[teiid-commits] teiid SVN: r3852 - in branches/7.7.x: engine/src/main/java/org/teiid/common/buffer/impl and 1 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Tue Feb 7 10:30:31 EST 2012


Author: shawkins
Date: 2012-02-07 10:30:30 -0500 (Tue, 07 Feb 2012)
New Revision: 3852

Modified:
   branches/7.7.x/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml
   branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java
   branches/7.7.x/engine/src/test/java/org/teiid/common/buffer/impl/TestBufferFrontedFileStoreCache.java
Log:
TEIID-1931 correcting buffer initialization to account for max storage size in max blocks

Modified: branches/7.7.x/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml
===================================================================
--- branches/7.7.x/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml	2012-02-07 02:26:11 UTC (rev 3851)
+++ branches/7.7.x/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml	2012-02-07 15:30:30 UTC (rev 3852)
@@ -69,7 +69,7 @@
 			Teiid has a non-negligible amount of overhead per batch/table page on the order of 100-200 bytes.  Depending on the data types involved each
 			full batch/table page will represent a variable number of rows (a power of two multiple above or below the processor batch size).  If you are dealing with datasets with billions of rows and you run into OutOfMemory issues, consider increasing the processor
 			batch size in the &jboss-beans; file to force the allocation of larger batches and table pages.  If the processor batch size is increased and/or you are dealing with extremely wide result sets (several hundred columns),
-			then the default setting of 8MB for the maxStorageObjectSize in the &jboss-beans; file may be too low.  The sizing for maxStorageObjectSize is terms of serialized size, which will be much
+			then the default setting of 8MB for the maxStorageObjectSize in the &jboss-beans; file may be too low.  The sizing for maxStorageObjectSize is in terms of serialized size, which will be much
 			closer to the raw data size then the Java memory footprint estimation used for maxReservedKB.  
 			maxStorageObjectSize should not be set too large relative to memoryBufferSpace since it will reduce the performance of the memory buffer.  The memory buffer supports only 1 concurrent writer for each maxStorageObjectSize of the memoryBufferSpace.
 			</para>

Modified: branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java	2012-02-07 02:26:11 UTC (rev 3851)
+++ branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java	2012-02-07 15:30:30 UTC (rev 3852)
@@ -506,6 +506,7 @@
 		this.inodeByteBuffer = new BlockByteBuffer(30, blocks+1, LOG_INODE_SIZE, direct);
 		memoryWritePermits = new Semaphore(blocks);
 		maxMemoryBlocks = Math.min(MAX_DOUBLE_INDIRECT, blocks);
+		maxMemoryBlocks = Math.min(maxMemoryBlocks, maxStorageObjectSize>>LOG_BLOCK_SIZE + ((maxStorageObjectSize&BufferFrontedFileStoreCache.BLOCK_MASK)>0?1:0));
 		//try to maintain enough freespace so that writers don't block in cleaning
 		cleaningThreshold = Math.min(maxMemoryBlocks<<4, blocks>>1);
 		criticalCleaningThreshold = Math.min(maxMemoryBlocks<<2, blocks>>2);
@@ -1076,5 +1077,9 @@
 	public void setMinDefrag(long minDefrag) {
 		this.minDefrag = minDefrag;
 	}
+	
+	public int getMaxMemoryBlocks() {
+		return maxMemoryBlocks;
+	}
 
 }
\ No newline at end of file

Modified: branches/7.7.x/engine/src/test/java/org/teiid/common/buffer/impl/TestBufferFrontedFileStoreCache.java
===================================================================
--- branches/7.7.x/engine/src/test/java/org/teiid/common/buffer/impl/TestBufferFrontedFileStoreCache.java	2012-02-07 02:26:11 UTC (rev 3851)
+++ branches/7.7.x/engine/src/test/java/org/teiid/common/buffer/impl/TestBufferFrontedFileStoreCache.java	2012-02-07 15:30:30 UTC (rev 3852)
@@ -148,6 +148,7 @@
 	
 	@Test public void testEviction() throws Exception {
 		BufferFrontedFileStoreCache cache = createLayeredCache(1<<15, 1<<15);
+		assertEquals(3, cache.getMaxMemoryBlocks());
 		
 		CacheEntry ce = new CacheEntry(2l);
 		Serializer<Integer> s = new SimpleSerializer();



More information about the teiid-commits mailing list