From: <tho...@us...> - 2012-03-12 13:03:59
|
Revision: 6107 http://bigdata.svn.sourceforge.net/bigdata/?rev=6107&view=rev Author: thompsonbry Date: 2012-03-12 13:03:53 +0000 (Mon, 12 Mar 2012) Log Message: ----------- The UnisolatedReadWriteIndex was using an hard coded effective value of 1000 rather than the configured value of 100 for the DEFAULT_CAPACITY. I modified the constructor to save the specified value on a defaultCapacity field, rangeIterator(...) to use that configured value, and the DEFAULT_CAPACITY to be 1000, which was the effective value for both 1.0.0x and 1.1.x. @see https://sourceforge.net/apps/trac/bigdata/ticket/506 (Load, closure and query performance in 1.1.x versus 1.0.x) Modified Paths: -------------- branches/BIGDATA_RELEASE_1_0_0/bigdata/src/java/com/bigdata/btree/UnisolatedReadWriteIndex.java branches/BIGDATA_RELEASE_1_1_0/bigdata/src/java/com/bigdata/btree/UnisolatedReadWriteIndex.java Modified: branches/BIGDATA_RELEASE_1_0_0/bigdata/src/java/com/bigdata/btree/UnisolatedReadWriteIndex.java =================================================================== --- branches/BIGDATA_RELEASE_1_0_0/bigdata/src/java/com/bigdata/btree/UnisolatedReadWriteIndex.java 2012-03-11 00:32:39 UTC (rev 6106) +++ branches/BIGDATA_RELEASE_1_0_0/bigdata/src/java/com/bigdata/btree/UnisolatedReadWriteIndex.java 2012-03-12 13:03:53 UTC (rev 6107) @@ -280,9 +280,16 @@ * main purpose of the capacity is to reduce the contention for the * {@link ReadWriteLock}. */ - final static protected int DEFAULT_CAPACITY = 100;//10000; + final static private int DEFAULT_CAPACITY = 1000;//10000; /** + * The default capacity for iterator reads against the underlying index. The + * main purpose of the capacity is to reduce the contention for the + * {@link ReadWriteLock}. + */ + final private int defaultCapacity; + + /** * Creates a view of an unisolated index that will enforce the concurrency * constraints of the {@link BTree} class, but only among other instances of * this class for the same underlying index. @@ -306,7 +313,7 @@ * * @param ndx * The underlying unisolated index. - * @param capacity + * @param defaultCapacity * The capacity for iterator reads against the underlying index. * The main purpose of the capacity is to reduce the contention * for the {@link ReadWriteLock}. Relatively small values should @@ -329,15 +336,17 @@ * the computed solutions onto the relations. It is likely that a * read-write lock will do well for this situation. */ - public UnisolatedReadWriteIndex(final BTree ndx, final int capacity) { + public UnisolatedReadWriteIndex(final BTree ndx, final int defaultCapacity) { if (ndx == null) throw new IllegalArgumentException(); - if (capacity <= 0) + if (defaultCapacity <= 0) throw new IllegalArgumentException(); this.ndx = ndx; + + this.defaultCapacity = defaultCapacity; this.readWriteLock = getReadWriteLock(ndx); @@ -631,11 +640,11 @@ if (capacity == 0) { /* - * When the buffer capacity is not specified a relatively small - * capacity is choosen. + * When the buffer capacity is not specified, use the default from + * the constructor. */ - capacity = 1000; + capacity = defaultCapacity; } Modified: branches/BIGDATA_RELEASE_1_1_0/bigdata/src/java/com/bigdata/btree/UnisolatedReadWriteIndex.java =================================================================== --- branches/BIGDATA_RELEASE_1_1_0/bigdata/src/java/com/bigdata/btree/UnisolatedReadWriteIndex.java 2012-03-11 00:32:39 UTC (rev 6106) +++ branches/BIGDATA_RELEASE_1_1_0/bigdata/src/java/com/bigdata/btree/UnisolatedReadWriteIndex.java 2012-03-12 13:03:53 UTC (rev 6107) @@ -281,7 +281,14 @@ * main purpose of the capacity is to reduce the contention for the * {@link ReadWriteLock}. */ - final static protected int DEFAULT_CAPACITY = 100;//10000; + final static private int DEFAULT_CAPACITY = 1000;// 10000; + + /** + * The default capacity for iterator reads against the underlying index. The + * main purpose of the capacity is to reduce the contention for the + * {@link ReadWriteLock}. + */ + final private int defaultCapacity; /** * Creates a view of an unisolated index that will enforce the concurrency @@ -307,7 +314,7 @@ * * @param ndx * The underlying unisolated index. - * @param capacity + * @param defaultCapacity * The capacity for iterator reads against the underlying index. * The main purpose of the capacity is to reduce the contention * for the {@link ReadWriteLock}. Relatively small values should @@ -330,18 +337,20 @@ * the computed solutions onto the relations. It is likely that a * read-write lock will do well for this situation. */ - public UnisolatedReadWriteIndex(final BTree ndx, final int capacity) { + public UnisolatedReadWriteIndex(final BTree ndx, final int defaultCapacity) { if (ndx == null) throw new IllegalArgumentException(); - if (capacity <= 0) + if (defaultCapacity <= 0) throw new IllegalArgumentException(); this.ndx = ndx; + this.defaultCapacity = defaultCapacity; + this.readWriteLock = getReadWriteLock(ndx); - + } /** @@ -633,11 +642,11 @@ if (capacity == 0) { /* - * When the buffer capacity is not specified a relatively small - * capacity is choosen. + * When the buffer capacity is not specified, use the default from + * the constructor. */ - capacity = 1000; + capacity = defaultCapacity; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |