public interface BLOB
Modifier and Type | Interface and Description |
---|---|
static interface |
BLOB.Reducer |
static interface |
BLOB.Rewriter |
Modifier and Type | Method and Description |
---|---|
void |
clear()
clears the content of the database
|
void |
close(boolean writeIDX)
close the BLOB table
|
boolean |
containsKey(byte[] key)
check if a specific key is in the database
|
void |
delete(byte[] key)
remove a BLOB
|
byte[] |
get(byte[] key)
retrieve the whole BLOB from the table
|
byte[] |
get(java.lang.Object key) |
void |
insert(byte[] key,
byte[] b)
write a whole byte array as BLOB to the table
|
boolean |
isEmpty()
ask if the BLOB is empty
|
int |
keylength()
ask for the length of the primary key
|
CloneableIterator<byte[]> |
keys(boolean up,
boolean rotating)
iterator over all keys
|
CloneableIterator<byte[]> |
keys(boolean up,
byte[] firstKey)
iterate over all keys
|
long |
length()
retrieve the size of the database
|
long |
length(byte[] key)
retrieve the size of the BLOB
|
long |
mem()
calculate the memory in RAM that the BLOB occupies
|
java.lang.String |
name()
return a name of the BLOB; can be the file name
|
void |
optimize()
trim the index of the database: this releases memory not currently used
|
ByteOrder |
ordering()
return the underlying odering
|
int |
reduce(byte[] key,
BLOB.Reducer reducer)
a reduce method is the same as the replace.
|
int |
replace(byte[] key,
BLOB.Rewriter rewriter)
replace an existing entry in the BLOB with a new entry
this method is similar to put, but it is necessary that a blob entry existed before
and contains an entry of same size or bigger than the new entry.
|
int |
size()
ask for the number of entries
|
java.lang.String name()
int keylength()
ByteOrder ordering()
void clear() throws java.io.IOException
java.io.IOException
void optimize()
java.io.IOException
long mem()
int size()
boolean isEmpty()
CloneableIterator<byte[]> keys(boolean up, boolean rotating) throws java.io.IOException
up
- rotating
- java.io.IOException
CloneableIterator<byte[]> keys(boolean up, byte[] firstKey) throws java.io.IOException
up
- firstKey
- java.io.IOException
boolean containsKey(byte[] key)
key
- the primary keyjava.io.IOException
byte[] get(byte[] key) throws java.io.IOException, SpaceExceededException
key
- the primary keyjava.io.IOException
SpaceExceededException
byte[] get(java.lang.Object key)
long length() throws java.io.IOException
- java.io.IOException
long length(byte[] key) throws java.io.IOException
key
- java.io.IOException
void insert(byte[] key, byte[] b) throws java.io.IOException
key
- the primary keyb
- java.io.IOException
SpaceExceededException
int replace(byte[] key, BLOB.Rewriter rewriter) throws java.io.IOException, SpaceExceededException
key
- the primary keyrewriter
- java.io.IOException
SpaceExceededException
int reduce(byte[] key, BLOB.Reducer reducer) throws java.io.IOException, SpaceExceededException
key
- the primary keyreducer
- java.io.IOException
SpaceExceededException
void delete(byte[] key) throws java.io.IOException
key
- the primary keyjava.io.IOException
void close(boolean writeIDX)