incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From monte...@apache.org
Subject svn commit: r903366 - in /incubator/kato/trunk/org.apache.kato: kato.common/src/main/java/org/apache/kato/common/ kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/ kato.hprof.reader/src/test/java/test/apache/kato/common/
Date Tue, 26 Jan 2010 18:58:03 GMT
Author: monteith
Date: Tue Jan 26 18:58:03 2010
New Revision: 903366

URL: http://svn.apache.org/viewvc?rev=903366&view=rev
Log:
JIRA KATO-12  Commit Lukasz changes, but add properties to change defaults.

Modified:
    incubator/kato/trunk/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/IDataProvider.java
    incubator/kato/trunk/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/SubsetDataProvider.java
    incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/CachedRandomAccesDataProvider.java
    incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/HProfFile.java
    incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/RandomAccesDataProvider.java
    incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/common/TestSubsetDataProvider.java

Modified: incubator/kato/trunk/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/IDataProvider.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/IDataProvider.java?rev=903366&r1=903365&r2=903366&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/IDataProvider.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/IDataProvider.java
Tue Jan 26 18:58:03 2010
@@ -38,7 +38,7 @@
 
 	byte[] readBytes(int left) throws IOException;
 
-	void moveBy(int left) throws IOException;
+	void moveBy(long left) throws IOException;
 
 	short readU2() throws IOException;
 	

Modified: incubator/kato/trunk/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/SubsetDataProvider.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/SubsetDataProvider.java?rev=903366&r1=903365&r2=903366&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/SubsetDataProvider.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.common/src/main/java/org/apache/kato/common/SubsetDataProvider.java
Tue Jan 26 18:58:03 2010
@@ -46,7 +46,7 @@
 		return scope;
 	}
 
-	public void moveBy(int left) throws IOException {
+	public void moveBy(long left) throws IOException {
 		current+=left;
 		moved=true;
 		if(current>scope) throw new IOException("moving "+left+" is out of range "+scope);

Modified: incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/CachedRandomAccesDataProvider.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/CachedRandomAccesDataProvider.java?rev=903366&r1=903365&r2=903366&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/CachedRandomAccesDataProvider.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/CachedRandomAccesDataProvider.java
Tue Jan 26 18:58:03 2010
@@ -338,7 +338,7 @@
 	}
 
 	@Override
-	public void moveBy(int move) throws IOException {
+	public void moveBy(long move) throws IOException {
 		current+=move;
 		moved=true;	
 	}

Modified: incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/HProfFile.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/HProfFile.java?rev=903366&r1=903365&r2=903366&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/HProfFile.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/HProfFile.java
Tue Jan 26 18:58:03 2010
@@ -29,6 +29,10 @@
  
 public class HProfFile {
 
+	private static final int HPROF_MAPARRAYSIZE_DEFAULT = 10000;
+
+	private static final String HPROF_MAPARRAYSIZE_PROPERTY = "org.apache.kato.hprof.maparraysize";
+
 	class ControlSettingsHProfRecord extends HProfRecord implements
 			IControlSettingsHProfRecord {
 
@@ -113,6 +117,10 @@
 	class HeapDumpHProfRecord extends HProfRecord implements
 			IHeapDumpHProfRecord {
 
+		private static final int HEAP_MAPARRAYSIZE_DEFAULT = 100000;
+
+		private static final String HEAP_MAPARRAYSIZE_PROPERTY = "org.apache.kato.hprof.heap.maparraysize";
+		
 		private BitMaskMappingArray subRecordArray = null;
 		private int subRecordCount = -1;
 		private long size = 0;
@@ -123,7 +131,7 @@
 			super(tag, null);
 			size = dataProvider.getDataLength();
 			myP = dataProvider;
-			subRecordArray = new BitMaskMappingArray(1000, 25,
+			subRecordArray = new BitMaskMappingArray(Integer.getInteger(HEAP_MAPARRAYSIZE_PROPERTY,HEAP_MAPARRAYSIZE_DEFAULT).intValue(),
25,
 					new HProfDumpRecordArrayProvider(dataProvider));
 		}
 
@@ -484,9 +492,10 @@
 					return new EndThreadHProfRecord(tag, data);
 
 				case 0x0c:
+                                        long l = recordProvider.dataRemaining();
 					IHeapDumpHProfRecord rec = new HeapDumpHProfRecord(tag,
-							new SubsetDataProvider(recordProvider, left));
-					recordProvider.moveBy(left);
+							new SubsetDataProvider(recordProvider, l));
+					recordProvider.moveBy(l);
 					return rec;
 				default:
 					// don't know what the thing is - return an unknown
@@ -744,7 +753,7 @@
 		long maxOffsetLength = mainProvider.getDataLength() - recordsOffset;
 		SubsetDataProvider subset = new SubsetDataProvider(mainProvider,
 				maxOffsetLength);
-		array = new BitMaskMappingArray(1000, 25, new HPROFRecordProvider(
+		array = new BitMaskMappingArray(Integer.getInteger(HPROF_MAPARRAYSIZE_PROPERTY, HPROF_MAPARRAYSIZE_DEFAULT).intValue(),
25, new HPROFRecordProvider(
 				subset));
 
 	}

Modified: incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/RandomAccesDataProvider.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/RandomAccesDataProvider.java?rev=903366&r1=903365&r2=903366&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/RandomAccesDataProvider.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/main/java/org/apache/kato/hprof/datalayer/RandomAccesDataProvider.java
Tue Jan 26 18:58:03 2010
@@ -119,7 +119,7 @@
 	}
 
 	@Override
-	public void moveBy(int move) throws IOException {
+	public void moveBy(long move) throws IOException {
 		current+=move;
 		moved=true;
 		

Modified: incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/common/TestSubsetDataProvider.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/common/TestSubsetDataProvider.java?rev=903366&r1=903365&r2=903366&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/common/TestSubsetDataProvider.java
(original)
+++ incubator/kato/trunk/org.apache.kato/kato.hprof.reader/src/test/java/test/apache/kato/common/TestSubsetDataProvider.java
Tue Jan 26 18:58:03 2010
@@ -102,7 +102,7 @@
 		}
 
 		@Override
-		public void moveBy(int left) throws IOException {
+		public void moveBy(long left) throws IOException {
 			// TODO Auto-generated method stub
 			
 		}



Mime
View raw message