Modifier and Type | Class and Description |
---|---|
private static class |
RowHandleMap.entry |
static class |
RowHandleMap.initDataConsumer |
Modifier and Type | Field and Description |
---|---|
private RAMIndexCluster |
index |
protected static RowHandleMap.entry |
poisonEntry |
private Row |
rowdef |
Constructor and Description |
---|
RowHandleMap(int keylength,
ByteOrder objectOrder,
int idxbytes,
java.io.File file)
initialize a HandleMap with the content of a dumped index
|
RowHandleMap(int keylength,
ByteOrder objectOrder,
int idxbytes,
int expectedspace,
java.lang.String name)
initialize a HandleMap
This may store a key and a long value for each key.
|
Modifier and Type | Method and Description |
---|---|
long |
add(byte[] key,
long a) |
static RowHandleMap.initDataConsumer |
asynchronusInitializer(java.lang.String name,
int keylength,
ByteOrder objectOrder,
int idxbytes,
int expectedspace)
this method creates a concurrent thread that can take entries that are used to initialize the map
it should be used when a HandleMap is initialized when a file is read.
|
void |
clear() |
void |
close() |
long |
dec(byte[] key) |
int |
dump(java.io.File file)
write a dump of the index to a file.
|
private static int |
eq(byte[] a,
byte[] b)
check length of equal leading bytes
|
long |
get(byte[] key) |
boolean |
has(byte[] key) |
long |
inc(byte[] key) |
boolean |
isEmpty() |
java.util.Iterator<java.util.Map.Entry<byte[],java.lang.Long>> |
iterator() |
CloneableIterator<byte[]> |
keys(boolean up,
byte[] firstKey) |
byte[] |
largestKey() |
long |
mem() |
void |
optimize() |
long |
put(byte[] key,
long l)
Adds the key-value pair to the index.
|
void |
putUnique(byte[] key,
long l) |
long |
remove(byte[] key) |
java.util.ArrayList<long[]> |
removeDoubles() |
long |
removeone() |
Row |
row() |
CloneableIterator<Row.Entry> |
rows(boolean up,
byte[] firstKey) |
int[] |
saturation()
Caclulate a statistic about the possible saving in the data structure when the data structure would be compressed.
|
int |
size() |
byte[] |
smallestKey() |
private static int |
spread(int expectedspace) |
java.util.ArrayList<byte[]> |
top(int count) |
private final Row rowdef
private RAMIndexCluster index
protected static final RowHandleMap.entry poisonEntry
public RowHandleMap(int keylength, ByteOrder objectOrder, int idxbytes, int expectedspace, java.lang.String name)
keylength
- objectOrder
- space
- public RowHandleMap(int keylength, ByteOrder objectOrder, int idxbytes, java.io.File file) throws java.io.IOException, SpaceExceededException
keylength
- objectOrder
- file
- java.io.IOException
SpaceExceededException
private static final int spread(int expectedspace)
public final int[] saturation()
private static final int eq(byte[] a, byte[] b)
a
- b
- public final int dump(java.io.File file) throws java.io.IOException
public final Row row()
public final byte[] smallestKey()
smallestKey
in interface HandleMap
public final byte[] largestKey()
largestKey
in interface HandleMap
public final long put(byte[] key, long l) throws SpaceExceededException
put
in interface HandleMap
key
- the index keyl
- the valuejava.io.IOException
SpaceExceededException
public final void putUnique(byte[] key, long l) throws SpaceExceededException
putUnique
in interface HandleMap
SpaceExceededException
public final long add(byte[] key, long a) throws SpaceExceededException
add
in interface HandleMap
SpaceExceededException
public final long inc(byte[] key) throws SpaceExceededException
inc
in interface HandleMap
SpaceExceededException
public final long dec(byte[] key) throws SpaceExceededException
dec
in interface HandleMap
SpaceExceededException
public final java.util.ArrayList<long[]> removeDoubles() throws SpaceExceededException
removeDoubles
in interface HandleMap
SpaceExceededException
public final java.util.ArrayList<byte[]> top(int count)
public final CloneableIterator<byte[]> keys(boolean up, byte[] firstKey)
public final CloneableIterator<Row.Entry> rows(boolean up, byte[] firstKey)
public static final RowHandleMap.initDataConsumer asynchronusInitializer(java.lang.String name, int keylength, ByteOrder objectOrder, int idxbytes, int expectedspace)
keylength
- objectOrder
- space
- bufferSize
- public java.util.Iterator<java.util.Map.Entry<byte[],java.lang.Long>> iterator()
iterator
in interface java.lang.Iterable<java.util.Map.Entry<byte[],java.lang.Long>>