Modifier and Type | Field and Description |
---|---|
private Index |
backend |
private RowSet |
buffer |
private int |
buffersize |
private Row.EntryComparator |
entryComparator |
Constructor and Description |
---|
BufferedObjectIndex(Index backend,
int buffersize) |
Modifier and Type | Method and Description |
---|---|
void |
addUnique(Row.Entry row) |
private void |
checkBuffer()
check size of buffer in such a way that a put into the buffer is possible
afterwards without exceeding the given maximal buffersize
|
void |
clear() |
void |
close() |
boolean |
delete(byte[] key) |
void |
deleteOnExit() |
java.lang.String |
filename() |
private void |
flushBuffer() |
Row.Entry |
get(byte[] key,
boolean forcecopy) |
java.util.Map<byte[],Row.Entry> |
get(java.util.Collection<byte[]> keys,
boolean forcecopy) |
boolean |
has(byte[] key) |
boolean |
isEmpty() |
boolean |
isOnDemand() |
java.util.Iterator<Row.Entry> |
iterator() |
CloneableIterator<byte[]> |
keys(boolean up,
byte[] firstKey) |
HandleSet |
keysFromBuffer(int load)
special iterator for BufferedObjectIndex:
iterates only objects from the buffer.
|
byte[] |
largestKey() |
long |
mem() |
void |
optimize() |
boolean |
put(Row.Entry row)
Adds the row to the index.
|
java.util.List<Row.Entry> |
random(int count) |
Row.Entry |
remove(byte[] key) |
java.util.List<RowCollection> |
removeDoubles() |
Row.Entry |
removeOne() |
Row.Entry |
replace(Row.Entry row) |
Row |
row() |
CloneableIterator<Row.Entry> |
rows() |
CloneableIterator<Row.Entry> |
rows(boolean up,
byte[] firstKey) |
int |
size() |
byte[] |
smallestKey() |
java.util.List<Row.Entry> |
top(int count) |
private final Index backend
private final RowSet buffer
private final int buffersize
private final Row.EntryComparator entryComparator
public BufferedObjectIndex(Index backend, int buffersize)
public boolean isOnDemand()
public byte[] smallestKey()
smallestKey
in interface Index
public byte[] largestKey()
largestKey
in interface Index
private final void flushBuffer() throws java.io.IOException, SpaceExceededException
java.io.IOException
SpaceExceededException
private final void checkBuffer() throws java.io.IOException, SpaceExceededException
SpaceExceededException
java.io.IOException
public void addUnique(Row.Entry row) throws SpaceExceededException, java.io.IOException
addUnique
in interface Index
SpaceExceededException
java.io.IOException
public void clear() throws java.io.IOException
public void deleteOnExit()
deleteOnExit
in interface Index
public Row.Entry get(byte[] key, boolean forcecopy) throws java.io.IOException
public java.util.Map<byte[],Row.Entry> get(java.util.Collection<byte[]> keys, boolean forcecopy) throws java.io.IOException, java.lang.InterruptedException
public boolean put(Row.Entry row) throws java.io.IOException, SpaceExceededException
put
in interface Index
row
- a index rowjava.io.IOException
SpaceExceededException
public Row.Entry remove(byte[] key) throws java.io.IOException
public boolean delete(byte[] key) throws java.io.IOException
public java.util.List<RowCollection> removeDoubles() throws java.io.IOException, SpaceExceededException
removeDoubles
in interface Index
java.io.IOException
SpaceExceededException
public java.util.List<Row.Entry> top(int count) throws java.io.IOException
public java.util.List<Row.Entry> random(int count) throws java.io.IOException
public Row.Entry removeOne() throws java.io.IOException
public Row.Entry replace(Row.Entry row) throws SpaceExceededException, java.io.IOException
replace
in interface Index
SpaceExceededException
java.io.IOException
public CloneableIterator<byte[]> keys(boolean up, byte[] firstKey) throws java.io.IOException
public java.util.Iterator<Row.Entry> iterator()
public CloneableIterator<Row.Entry> rows(boolean up, byte[] firstKey) throws java.io.IOException
public CloneableIterator<Row.Entry> rows() throws java.io.IOException
public HandleSet keysFromBuffer(int load) throws java.io.IOException
load
- number of records that shall be in the buffer when returning the buffer iteratorjava.io.IOException