You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2012/01/06 19:52:58 UTC
svn commit: r1228342 - in /incubator/jena/Scratch/AFS/Dev/trunk: ./
src-dev/dev/ src-lib/test/java/structure/exthash/
src-lib/test/java/structure/skiplist/ src-lib/test/java/structure/tree/
src-lib/test/java/structure/ttree/ src/main/java/storage/varre...
Author: andy
Date: Fri Jan 6 18:52:57 2012
New Revision: 1228342
URL: http://svn.apache.org/viewvc?rev=1228342&view=rev
Log:
Removed migrated code.
Added:
incubator/jena/Scratch/AFS/Dev/trunk/src/main/java/storage/varrecord/VarInteger$.java
Removed:
incubator/jena/Scratch/AFS/Dev/trunk/src-lib/test/java/structure/exthash/
incubator/jena/Scratch/AFS/Dev/trunk/src-lib/test/java/structure/skiplist/
incubator/jena/Scratch/AFS/Dev/trunk/src-lib/test/java/structure/tree/
incubator/jena/Scratch/AFS/Dev/trunk/src-lib/test/java/structure/ttree/
Modified:
incubator/jena/Scratch/AFS/Dev/trunk/.project
incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/RunAFS.java
incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/SizeIndexes.java
incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/StringUTF8.java
incubator/jena/Scratch/AFS/Dev/trunk/src/main/java/storage/varrecord/VarRecordBuffer.java
Modified: incubator/jena/Scratch/AFS/Dev/trunk/.project
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Dev/trunk/.project?rev=1228342&r1=1228341&r2=1228342&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Dev/trunk/.project (original)
+++ incubator/jena/Scratch/AFS/Dev/trunk/.project Fri Jan 6 18:52:57 2012
@@ -1,5 +1,5 @@
<projectDescription>
- <name>AFS-Dev</name>
+ <name>AFS-Dev-ASF</name>
<comment>AFS workspace</comment>
<projects>
<project>ARQ</project>
Modified: incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/RunAFS.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/RunAFS.java?rev=1228342&r1=1228341&r2=1228342&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/RunAFS.java (original)
+++ incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/RunAFS.java Fri Jan 6 18:52:57 2012
@@ -18,21 +18,14 @@
package dev;
-import static structure.radix.RLib.str ;
-
-import java.nio.ByteBuffer ;
import java.util.Iterator ;
import org.openjena.atlas.logging.Log ;
-import storage.varrecord.VarRecordBuffer ;
-import structure.radix.RadixRun ;
-import structure.radix.RadixTree ;
import com.hp.hpl.jena.iri.IRI ;
import com.hp.hpl.jena.iri.IRIFactory ;
import com.hp.hpl.jena.iri.Violation ;
import com.hp.hpl.jena.iri.ViolationCodes ;
-import com.hp.hpl.jena.tdb.base.record.Record ;
public class RunAFS
{
@@ -44,83 +37,7 @@ public class RunAFS
System.exit(code) ;
}
- static byte[] key1 = { 2 , 4 , 6 , 8 } ;
- static byte[] key2 = { 2 , 4 , 6 , 10 } ;
- static byte[] key3 = { 2 } ;
- static byte[] key4 = { 2 , 4 , 6, 8 , 10 } ;
- static byte[] key5 = { 2 , 4 , 3 , 1 } ;
- static byte[] key6 = { 0 , 1 , 2 , 3 , 4 } ;
-
- static void insert(RadixTree t, byte[] k)
- {
- System.out.println("Insert: "+str(k)) ;
- t.insert(k) ;
- t.print() ;
- t.check() ;
- }
-
- static void print( RadixTree t)
- {
- t.print() ;
- Iterator<ByteBuffer> iter = t.iterator() ;
- for ( ; iter.hasNext() ; )
- {
- ByteBuffer v = iter.next();
- System.out.println(" = "+str(v)) ;
- }
- System.out.println() ;
- }
-
- public static void main(String ... args) throws Exception
- {
- RadixRun.main(args) ; exit(0) ;
-
- // RadixTree TODO
- // Read through and check/optimize.
- // ByteBuffers throughout => var length.
-
-// {
-// RadixTree.logging = false ;
-// RadixTree t = new RadixTree() ;
-// insert(t, key1) ;
-// //print(t) ;
-//
-// insert(t, key2) ;
-// //print(t) ;
-//
-// insert(t, key3) ;
-// //print(t) ;
-//
-// exit(0) ;
-// }
- RadixTree.logging = false ;
- RadixTree.checking = true ;
-
- RadixTree t = new RadixTree() ;
- byte[][] keys = { key1, key2, key3, key4, key5, key6 } ;
- int i = 0 ;
- for ( byte[]k : keys )
- {
- insert(t, k) ;
- for ( int j = 0 ; j < i ; j++ )
- {
- if ( t.find(keys[j]) == null )
- System.out.println("**** Not found: "+str(keys[j])) ;
- }
- i++ ;
- }
-
- System.out.println() ;
- t.print() ;
-
- for ( Iterator<ByteBuffer> iter = t.iterator() ; iter.hasNext() ; )
- {
- ByteBuffer r = iter.next() ;
- System.out.println(str(r)) ;
- }
- }
-
- static IRIFactory iriFactory = new IRIFactory();
+ static IRIFactory iriFactory = new IRIFactory();
static {
// IRIFactory.iriImplementation() ...
iriFactory.useSpecificationIRI(true);
@@ -167,74 +84,7 @@ public class RunAFS
}
}
- private static void varBlock()
- {
- byte[] d1 = {1,2,3,4} ;
- byte[] d2 = {(byte)0xFF, (byte)0xFE} ;
-
- byte[] d3 = {5,4,5,4,3,2,3,2,1,1} ;
- byte[] d4 = {(byte)0xFF, (byte)0xFE, (byte)0xFD, (byte)0xFC, (byte)0xFB} ;
-
- {
- VarRecordBuffer vrb = new VarRecordBuffer(50) ;
- vrb.dump();
- vrb.put(d1,d2) ;
- vrb.dump();
- vrb.put(d3,d4) ;
- vrb.dump();
- System.out.println(vrb) ;
- Record r = vrb.get(0) ;
-
- System.out.println(r) ;
- System.exit(0) ;
- }
-
- VarRecordBuffer vrb = new VarRecordBuffer(40) ;
- byte[] k1 = new byte[]{1,2} ;
- byte[] v1 = new byte[]{(byte)0xA9, (byte)0xA8, (byte)0xA7 }; //, (byte)0xA6} ;
-
- byte[] k2 = new byte[]{3,4} ;
- byte[] v2 = new byte[]{(byte)0xFF, (byte)0xFE, (byte)0xFD, (byte)0xFC} ;
-
- byte[] k3 = new byte[]{5,6} ;
- byte[] v3 = new byte[]{(byte)0xBF, (byte)0xBE} ;//, (byte)0xBD, (byte)0xBC} ;
-
- //byte[] v3 = new byte[100] ;
-
- divider() ;
-
- boolean PRINT = false ;
-
- if ( PRINT ) System.out.println("k="+str(k1)+", v="+str(v1)) ;
- vrb.put(0, k1, v1) ;
- if ( PRINT ) vrb.dump();
- if ( PRINT ) System.out.println(vrb) ;
-
- if ( PRINT )divider() ;
-
- // Push up.
- if ( PRINT ) System.out.println("k="+str(k2)+", v="+str(v2)) ;
- vrb.put(0, k2, v2) ;
- if ( PRINT ) vrb.dump();
- if ( PRINT ) System.out.println(vrb) ;
-
- if ( PRINT ) divider() ;
-
- if ( PRINT ) System.out.println("k="+str(k3)+", v="+str(v3)) ;
- vrb.put(2, k3, v3) ;
- if ( PRINT ) vrb.dump();
- if ( PRINT ) System.out.println(vrb) ;
-
- PRINT = false ;
- if ( PRINT ) divider() ;
- if ( PRINT ) vrb.dump();
- if ( PRINT ) System.out.println(vrb) ;
- vrb.delete(1) ;
- if ( PRINT ) vrb.dump();
- System.out.println(vrb) ;
- }
-
- // ---- Helpers
+ // ---- Helpers
private static final String NL = "\n" ;
Modified: incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/SizeIndexes.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/SizeIndexes.java?rev=1228342&r1=1228341&r2=1228342&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/SizeIndexes.java (original)
+++ incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/SizeIndexes.java Fri Jan 6 18:52:57 2012
@@ -19,13 +19,10 @@
package dev;
import java.io.InputStream ;
-import java.util.Iterator ;
import org.openjena.atlas.io.IO ;
import org.openjena.atlas.lib.ColumnMap ;
import org.openjena.atlas.logging.Log ;
-import structure.radix.RadixIndex ;
-import structure.radix.RadixTree ;
import com.hp.hpl.jena.tdb.base.record.Record ;
import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
@@ -44,7 +41,6 @@ public class SizeIndexes
public static void main(String ... args) throws Exception
{
Log.setLog4j() ;
- Log.enable(RadixTree.class) ;
// create index
long count = 0 ;
@@ -56,10 +52,10 @@ public class SizeIndexes
boolean useRadix = true ;
RangeIndex index ;
- if ( ! useRadix )
+ //if ( ! useRadix )
index = BPlusTree.makeMem(200, 200, 24, 0) ;
- else
- index = new RadixIndex(rf) ;
+// else
+// index = new RadixIndex(rf) ;
for ( ; stream.hasNext() ; )
{
@@ -68,16 +64,16 @@ public class SizeIndexes
if ( useRadix )
System.out.println("Add: "+r) ;
index.add(r) ;
- if ( useRadix )
- {
- System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>");
- ((RadixIndex)index).radix.print() ;
- System.out.println("Records");
- Iterator<Record> iter = index.iterator() ;
- for ( ; iter.hasNext() ; )
- System.out.println(iter.next()) ;
- System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<");
- }
+// if ( useRadix )
+// {
+// System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>");
+// ((RadixIndex)index).radix.print() ;
+// System.out.println("Records");
+// Iterator<Record> iter = index.iterator() ;
+// for ( ; iter.hasNext() ; )
+// System.out.println(iter.next()) ;
+// System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<");
+// }
}
// Release. reload. Recording memory.
Modified: incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/StringUTF8.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/StringUTF8.java?rev=1228342&r1=1228341&r2=1228342&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/StringUTF8.java (original)
+++ incubator/jena/Scratch/AFS/Dev/trunk/src-dev/dev/StringUTF8.java Fri Jan 6 18:52:57 2012
@@ -20,8 +20,6 @@ package dev;
import java.nio.ByteBuffer ;
-import migrate.lib.VarInteger ;
-import org.openjena.atlas.lib.Pair ;
import org.openjena.atlas.lib.StrUtils ;
public class StringUTF8
@@ -67,14 +65,15 @@ public class StringUTF8
// V1 - object allocation.
- private VarInteger length ;
+ private int length ;
private ByteBuffer bytes ;
private StringUTF8(String string)
{
// A copy ...
byte[] rawbytes = StrUtils.asUTF8bytes(string) ;
bytes = ByteBuffer.wrap(rawbytes) ;
- length = VarInteger.valueOf(rawbytes.length) ;
+ //length = VarInteger.valueOf(rawbytes.length) ;
+ length = rawbytes.length ;
}
public String asString() {return StrUtils.fromUTF8bytes(bytes.array()) ; }
@@ -85,16 +84,16 @@ public class StringUTF8
static ByteBuffer space1 = ByteBuffer.allocate(1000*1000) ;
- private static Pair<VarInteger, VarInteger> allocSpace(String string)
- {
- return null ;
- }
-
- private static ByteBuffer allocSpace(VarInteger allocSpaceId, VarInteger allocId)
- {
- if ( allocSpaceId.value() != 0 )
- throw new IllegalArgumentException() ;
- return space1 ;
- }
+// private static Pair<VarInteger, VarInteger> allocSpace(String string)
+// {
+// return null ;
+// }
+//
+// private static ByteBuffer allocSpace(VarInteger allocSpaceId, VarInteger allocId)
+// {
+// if ( allocSpaceId.value() != 0 )
+// throw new IllegalArgumentException() ;
+// return space1 ;
+// }
}
Added: incubator/jena/Scratch/AFS/Dev/trunk/src/main/java/storage/varrecord/VarInteger$.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Dev/trunk/src/main/java/storage/varrecord/VarInteger%24.java?rev=1228342&view=auto
==============================================================================
--- incubator/jena/Scratch/AFS/Dev/trunk/src/main/java/storage/varrecord/VarInteger$.java (added)
+++ incubator/jena/Scratch/AFS/Dev/trunk/src/main/java/storage/varrecord/VarInteger$.java Fri Jan 6 18:52:57 2012
@@ -0,0 +1,278 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package storage.varrecord ;
+
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+
+// Thisis not the master version
+
+/** Variable length integers for tight packing into byte arrays and ByteBuffers.
+ * Packing is 7bits per byte and is the same format as vints in Lucene.
+ */
+final class VarInteger$
+{
+ public static void main(String ... argv) { varint() ; }
+ private static void varint()
+ {
+ long[] testValues = {0, 1, 127, 128, 129, (1L<<63)-1} ; // { 0 , 5 , 127, 128 , 0x1000} ;
+ for ( long x : testValues )
+ {
+ VarInteger$ vint = new VarInteger$(x) ;
+ System.out.printf("0x%04X => %s\n", x , vint) ;
+ long z = vint.value() ;
+ System.out.printf("0x%04X => %s ==> 0x%04X\n", x , vint, z) ;
+ }
+ }
+
+ /* See:
+ http://lucene.apache.org/java/docs/fileformats.html#VInt
+ FYI: src/java/org/apache/lucene/store/IndexInput.java, IndexOutput.java
+ but this code is for ByteBuffers.
+ */
+
+ /* Encoding
+ * Low to high, 7 bits (low end) per byte.
+ * High bit is 1 for "more" and 0 for last byte.
+ */
+
+ // Either 1: ByteSink etc.
+ // or 2: ByteBuffer + wrappers (what about OutputStreams?)
+
+ static final long maxValue = (1L<<63) - 1 ;
+
+ // The core encoder and decoder could take a ByteSink/ByteSource - that
+ // would be a well-structured way to do it but of extra objects for each
+ // number might become non-trivial.
+ // Currently, works specifically on ByteBuffers.
+
+ public static byte[] encode(long value)
+ {
+ // Max length is ceiling(63/7) = (63+6)/7 = 9
+ // Unlikely.
+ if ( value > maxValue )
+ throw new IllegalArgumentException("Too large: "+value) ;
+ int len = calcLength(value) ;
+ byte[] bytes = new byte[len] ;
+ encode(ByteBuffer.wrap(bytes), 0, value) ;
+ return bytes ;
+ }
+
+ // Relative vs absolute put/get.
+
+ public static int encode(ByteBuffer bytes, long value) { return encode(bytes, bytes.position(), value) ; }
+
+ public static int encode(ByteBuffer bytes, int startIdx, long value)
+ {
+ long N = value ;
+ int idx = startIdx ;
+ byte b = 0 ;
+ while (true)
+ {
+ b = (byte)(N&0x7FL) ;
+ N = ( N >>> 7 ) ;
+ if ( N == 0 )
+ break ;
+ bytes.put(idx, (byte) (b | 0x80)) ;
+ idx ++ ;
+ }
+ bytes.put(idx, b) ;
+ return (idx+1)-startIdx ;
+ }
+
+ public static long decode(byte[] bytes, int idx)
+ { return decode(ByteBuffer.wrap(bytes), idx) ; }
+
+ public static long decode(ByteBuffer bytes)
+ { return decode(bytes, 0) ; }
+
+ public static long decode(ByteBuffer bytes, int idx)
+ {
+ // Low to high
+ long value = 0 ;
+ int shift = 0 ;
+
+ while (true)
+ {
+ byte b = bytes.get(idx) ;
+ value |= (b & 0x7FL) << shift ;
+ if ( (b & 0x80) == 0 )
+ return value ;
+ shift += 7 ;
+ idx++ ;
+ }
+ }
+
+ /** Make a VarInteger from the bytes found start from idx */
+ public static VarInteger$ make(ByteBuffer bb, int idx)
+ {
+ int start = idx ;
+ while (true)
+ {
+ byte b = bb.get(idx) ;
+ if ( (b & 0x80) == 0 )
+ break ;
+ idx++ ;
+ }
+ // points idx at he last bytes
+ int len = idx-start+1 ;
+ byte[] bytes = new byte[len] ;
+ for ( int i = 0 ; i < len ; i++ )
+ bytes[i] = bb.get(start+i) ;
+ return make(bytes) ;
+ }
+
+ /** Make a VarInteger from the bytes found start from idx */
+ public static VarInteger$ make(byte[] bytes)
+ {
+ return new VarInteger$(bytes) ;
+ }
+
+ private static String toString(byte[] bytes) { return toString(bytes, 0) ; }
+ private static String toString(byte[] bytes, int idx)
+ {
+ StringBuilder buff = new StringBuilder() ;
+ buff.append("[") ;
+
+ String sep = null ;
+ while(true)
+ {
+ byte b = bytes[idx] ;
+ if ( sep != null )
+ buff.append(sep) ;
+ else
+ sep = ", " ;
+ buff.append(String.format("%02X", b)) ;
+ if ( b >= 0 )
+ break ;
+ idx++ ;
+ }
+ buff.append("]") ;
+ return buff.toString() ;
+ }
+
+ public static boolean equals(long value, byte[] bytes) { return equals(value, ByteBuffer.wrap(bytes)) ; }
+
+ public static boolean equals(long value, ByteBuffer bytes) { return equals(value, bytes, 0) ; }
+
+ public static boolean equals(long value, ByteBuffer bytes, int idx)
+ {
+ long x = decode(bytes, idx) ;
+ return x == value ;
+ }
+
+ // ---- Factory
+
+ // -- Some constants
+ public static VarInteger$ varint_0 = new VarInteger$(0) ;
+ public static VarInteger$ varint_1 = new VarInteger$(1) ;
+ public static VarInteger$ varint_2 = new VarInteger$(2) ;
+
+ /** Return a VarInteger that encodes the value */
+ public static VarInteger$ valueOf(long value)
+ {
+ if ( value == 0 ) return varint_0 ;
+ if ( value == 1 ) return varint_1 ;
+ if ( value == 2 ) return varint_2 ;
+ return new VarInteger$(value) ;
+ }
+
+ public static int lengthOf(long value)
+ {
+ return calcLengthTable(value) ;
+ }
+
+ // ---- The object
+
+ byte[] bytes ;
+ long value = -1 ;
+
+ private VarInteger$(long value)
+ {
+ Integer.valueOf(0) ;
+ if ( value < 0 )
+ throw new IllegalArgumentException("Positive integers only") ;
+ bytes = encode(value) ;
+ }
+
+ private VarInteger$(byte[] bytes)
+ {
+ if ( bytes.length == 0 )
+ throw new IllegalArgumentException("Zero length byte[]") ;
+ this.bytes = bytes ;
+ }
+
+ public int length() { return bytes.length ; }
+ public byte[] bytes() { return bytes ; }
+
+ public long value()
+ {
+ if ( value == -1 )
+ value = decode(bytes, 0) ;
+ return value ;
+ }
+
+ @Override
+ public int hashCode()
+ { return Arrays.hashCode(bytes) ; }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ if ( ! ( other instanceof VarInteger$ ) ) return false ;
+ VarInteger$ vint = (VarInteger$)other ;
+ return Arrays.equals(bytes, vint.bytes) ;
+ }
+
+ @Override
+ public String toString() { return toString(bytes) ; }
+
+ // Next is the impossible (it's the sign bit) 1L<<63
+ static final long VarIntLengths[] = { 1L<<7 , 1L<<14 , 1L<<21 , 1L<<28 , 1L<<35, 1L<<42, 1L<<49, 1L<<56 } ;
+
+ // By semi-lookup.
+ static int calcLengthTable(long value)
+ {
+ int len = -1 ;
+ for ( int i = 0 ; i < VarIntLengths.length ; i++ )
+ {
+ if ( value < VarIntLengths[i] )
+ return i+1 ;
+ }
+ //throw new IllegalArgumentException("Value too long: "+value) ;
+ return VarIntLengths.length+1 ;
+ }
+
+ // By calculation.
+ static int calcLength(long value)
+ {
+ int len = 1 ; // The byte with high bit zero.
+ long N = value ;
+ byte b = 0 ;
+ while (true)
+ {
+ N >>>= 7 ;
+ if ( N == 0 )
+ break ;
+ len ++ ;
+ }
+ return len ;
+ }
+
+}
Modified: incubator/jena/Scratch/AFS/Dev/trunk/src/main/java/storage/varrecord/VarRecordBuffer.java
URL: http://svn.apache.org/viewvc/incubator/jena/Scratch/AFS/Dev/trunk/src/main/java/storage/varrecord/VarRecordBuffer.java?rev=1228342&r1=1228341&r2=1228342&view=diff
==============================================================================
--- incubator/jena/Scratch/AFS/Dev/trunk/src/main/java/storage/varrecord/VarRecordBuffer.java (original)
+++ incubator/jena/Scratch/AFS/Dev/trunk/src/main/java/storage/varrecord/VarRecordBuffer.java Fri Jan 6 18:52:57 2012
@@ -22,7 +22,6 @@ import java.io.PrintStream ;
import java.nio.ByteBuffer ;
import java.util.Arrays ;
-import migrate.lib.VarInteger ;
import org.openjena.atlas.lib.ByteBufferLib ;
import org.openjena.atlas.lib.InternalErrorException ;
@@ -228,8 +227,8 @@ public final class VarRecordBuffer
throw new IllegalArgumentException("VarRecordBuffer.check failure") ;
//System.out.printf("Put: %d (%d,%d)\n", idx, key.length, value.length) ;
- VarInteger keyLen = VarInteger.valueOf(key.length) ;
- VarInteger valLen = VarInteger.valueOf(value.length) ;
+ VarInteger$ keyLen = VarInteger$.valueOf(key.length) ;
+ VarInteger$ valLen = VarInteger$.valueOf(value.length) ;
// Var bytes + change in fixed area
int lengthNeeded = bytesNeeded(key, value)+LenIdxSlot ;
@@ -306,10 +305,10 @@ public final class VarRecordBuffer
// ---- Lengths and setup
// Assumes bytes for keys or values are not shared.
int k = keyStartIdx(idx) ;
- VarInteger kLen = VarInteger.make(bb,k) ;
+ VarInteger$ kLen = VarInteger$.make(bb,k) ;
int v = valueStartIdx(idx) ;
- VarInteger vLen = VarInteger.make(bb,v) ;
+ VarInteger$ vLen = VarInteger$.make(bb,v) ;
//System.out.printf("delete: idx=%d (%d,%d)\n", idx, kLen.length()+kLen.value(), vLen.length()+vLen.value());
// So we have from k to v + length of VarInt + length - k bytes
@@ -402,7 +401,7 @@ public final class VarRecordBuffer
private static int bytesNeeded(byte[] bytes)
{
- return VarInteger.lengthOf(bytes.length) + bytes.length ;
+ return VarInteger$.lengthOf(bytes.length) + bytes.length ;
}
/** Perform consistence checking */
@@ -437,7 +436,7 @@ public final class VarRecordBuffer
{
if ( x < startVarArea || x >= bb.limit() )
error("Variable area is corrupt") ;
- VarInteger varInt = VarInteger.make(bb, x) ;
+ VarInteger$ varInt = VarInteger$.make(bb, x) ;
int len = varInt.length()+(int)varInt.value() ;
x = x+len ;
}
@@ -499,7 +498,7 @@ public final class VarRecordBuffer
private byte[] getBytes(int byteIdx)
{
//System.out.println("Get: @"+byteIdx) ;
- VarInteger vInt = getVInt(byteIdx) ; // Length of variable length object
+ VarInteger$ vInt = getVInt(byteIdx) ; // Length of variable length object
int v = (int)vInt.value() ;
int bytesStart = byteIdx+vInt.length() ;
byte[] b = new byte[v] ;
@@ -509,9 +508,9 @@ public final class VarRecordBuffer
return b ;
}
- private VarInteger getVInt(int byteIdx)
+ private VarInteger$ getVInt(int byteIdx)
{
- return VarInteger.make(bb, byteIdx) ;
+ return VarInteger$.make(bb, byteIdx) ;
}
// ---- Development