public interface StoreWriter
Users of this class should initialize it by using the
PalDB.createWriter()
method and then call the
put()
method to insert. Call the
close()
to liberate resources when done.
Note that duplicates aren't allowed.
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the store writer and append the data to the final destination.
|
Configuration |
getConfiguration()
Return the writer configuration.
|
void |
put(byte[] key,
byte[] value)
Put serialized key-value entry to the store.
|
void |
put(java.lang.Object key,
java.lang.Object value)
Put key-value to the store.
|
void |
putAll(java.lang.Object[] keys,
java.lang.Object[] values)
Put multiple key-values to the store.
|
void close()
Configuration getConfiguration()
open()
method.void put(java.lang.Object key, java.lang.Object value)
key
- a keyvalue
- a valuejava.lang.NullPointerException
- if key
or value
is
nullvoid putAll(java.lang.Object[] keys, java.lang.Object[] values)
keys
- a collection of keysvalues
- a collection of valuesvoid put(byte[] key, byte[] value)
Use only this method if you've already serialized the key and the value in their PalDB format.
key
- a serialized key as a byte arrayvalue
- a serialized value as a byte arrayjava.lang.NullPointerException
- if key
or value
is
null