public class BufferedMap
extends java.lang.Object
Session
and we call methods there using ColumnFamilyHandle.Constructor and Description |
---|
BufferedMap(Session session)
Encapsulates a RockSack session.
|
BufferedMap(Session session,
java.lang.String derivedClassName)
Encapsulates a RockSack session.
|
Modifier and Type | Method and Description |
---|---|
void |
Close()
Close the database
|
boolean |
contains(java.lang.Comparable o)
Does the database contain the key
|
boolean |
containsKey(java.lang.Comparable tkey)
Returns true if the collection contains the given key.
|
boolean |
containsValue(java.lang.Object o)
Session containsValue |
void |
dropColumn()
Drop the column encapsulated by the session for this BufferedMap
|
java.util.Iterator<?> |
entrySet()
Obtain iterator over the entrySet.
|
java.util.stream.Stream<?> |
entrySetStream()
Stream of all elements as Map.Entry
Session |
java.lang.Object |
first()
Return the first element.
|
java.lang.Comparable |
firstKey()
Get the first key
|
java.lang.Object |
get(java.lang.Comparable tkey)
call a get from
Session |
java.lang.String |
getDBName() |
org.rocksdb.RocksDB |
getKVStore()
Return the RocksDB instance.
|
java.lang.Object |
getMutexObject() |
Session |
getSession()
Get the
Session associated wit this database |
java.lang.Object |
getValue(java.lang.Object tkey)
Get a value from backing store.
|
java.lang.Object |
getViaBytes(byte[] tkey)
Get a value from backing store.
|
java.util.Iterator<?> |
headMap(java.lang.Comparable tkey) |
java.util.Iterator<?> |
headMapKV(java.lang.Comparable tkey) |
java.util.stream.Stream<?> |
headMapKVStream(java.lang.Comparable tkey) |
java.util.stream.Stream<?> |
headMapStream(java.lang.Comparable tkey)
Stream of strictly less than 'to' elements.
|
java.util.Iterator<?> |
headSet(java.lang.Comparable tkey)
Not a real subset, returns Iterator
|
java.util.Iterator<?> |
headSetKV(java.lang.Comparable tkey)
Not a real subset, returns Iterator
|
java.util.stream.Stream<?> |
headSetKVStream(java.lang.Comparable tkey)
Get a stream of head set
|
java.util.stream.Stream<?> |
headSetStream(java.lang.Comparable tkey)
Get a stream of headset
|
boolean |
isEmpty()
Return boolean value indicating whether the map for the columnFamilyHandle encapsulated by this
Session is empty |
java.util.Iterator<?> |
iterator()
Session equivalent of keySet fulfills SetInterface |
java.util.Iterator<?> |
keySet()
Get a keySet iterator.
|
java.util.stream.Stream<?> |
keySetStream()
Get a stream over keys
Session |
java.lang.Object |
last()
Return the last element.
|
java.lang.Comparable |
lastKey()
Get the last key in the KVStore
|
java.lang.Object |
nearest(java.lang.Comparable key)
Find the entry nearest to given key
|
void |
Open()
Open the files associated with the BTree for the instances of class
|
boolean |
put(java.lang.Comparable tkey,
java.lang.Object tvalue)
Put a key/value pair to underlying store.
|
boolean |
putViaBytes(byte[] tkey,
java.lang.Object tvalue)
Put a key/value pair to underlying store.
|
java.lang.Object |
remove(java.lang.Comparable tkey)
Remove object from cache and backing store.
|
long |
size()
Return the number of elements in the backing store.
|
java.util.Iterator<?> |
subMap(java.lang.Comparable fkey,
java.lang.Comparable tkey) |
java.util.Iterator<?> |
subMapKV(java.lang.Comparable fkey,
java.lang.Comparable tkey) |
java.util.stream.Stream<?> |
subMapKVStream(java.lang.Comparable fkey,
java.lang.Comparable tkey) |
java.util.stream.Stream<?> |
subMapStream(java.lang.Comparable fkey,
java.lang.Comparable tkey) |
java.util.Iterator<?> |
subSet(java.lang.Comparable fkey,
java.lang.Comparable tkey)
Not a real subset, returns iterator vs set.
|
java.util.Iterator<?> |
subSetKV(java.lang.Comparable fkey,
java.lang.Comparable tkey)
Not a real subset, returns iterator vs set.
|
java.util.stream.Stream<?> |
subSetKVStream(java.lang.Comparable fkey,
java.lang.Comparable tkey)
Return a Streamof key/value pairs that delivers the subset of fkey to tkey
|
java.util.stream.Stream<?> |
subSetStream(java.lang.Comparable fkey,
java.lang.Comparable tkey)
Return a Stream that delivers the subset of fkey to tkey
|
java.util.Iterator<?> |
tailMap(java.lang.Comparable fkey) |
java.util.Iterator<?> |
tailMapKV(java.lang.Comparable fkey) |
java.util.stream.Stream<?> |
tailMapKVStream(java.lang.Comparable fkey) |
java.util.stream.Stream<?> |
tailMapStream(java.lang.Comparable fkey) |
java.util.Iterator<?> |
tailSet(java.lang.Comparable fkey)
Not a real subset, returns Iterator
|
java.util.Iterator<?> |
tailSetKV(java.lang.Comparable fkey)
Not a real subset, returns Iterator
|
java.util.stream.Stream<?> |
tailSetKVStream(java.lang.Comparable fkey)
Return a tail set key/value stream
|
java.util.stream.Stream<?> |
tailSetStream(java.lang.Comparable fkey)
Return a tail set stream
|
java.lang.String |
toString() |
public BufferedMap(Session session, java.lang.String derivedClassName) throws java.lang.IllegalAccessException, java.io.IOException, org.rocksdb.RocksDBException
session
- the Session
instancederivedClassName
- the derived class for the ColumnFamily denoting subclasses stored in this databasejava.io.IOException
- if global IO problemjava.lang.IllegalAccessException
- if the database has been put offlineorg.rocksdb.RocksDBException
public BufferedMap(Session session) throws java.lang.IllegalAccessException, java.io.IOException, org.rocksdb.RocksDBException
session
- the Session
instancejava.io.IOException
- if global IO problemjava.lang.IllegalAccessException
- if the database has been put offlineorg.rocksdb.RocksDBException
public Session getSession() throws java.io.IOException
SetInterface
Session
associated wit this databaseSession
instance after ensuring the database is open and ready for processing.java.io.IOException
public boolean put(java.lang.Comparable tkey, java.lang.Object tvalue) throws java.io.IOException
Session
tkey
- The key for the pairtvalue
- The value for the pairjava.io.IOException
- if put to backing store failspublic boolean putViaBytes(byte[] tkey, java.lang.Object tvalue) throws java.io.IOException
Session
tkey
- The key for the pair, raw bytes unserialized before storagetvalue
- The value for the pairjava.io.IOException
- if put to backing store failspublic java.lang.Object get(java.lang.Comparable tkey) throws java.io.IOException
Session
tkey
- The key for the valueKeyValue
java.io.IOException
- if get from backing store failspublic java.lang.Object getViaBytes(byte[] tkey) throws java.io.IOException
Session
tkey
- The key for the valuejava.io.IOException
- if get from backing store failspublic java.lang.Object getValue(java.lang.Object tkey) throws java.io.IOException
Session
tkey
- The key for the valueEntry
implemented from Map.Entryjava.io.IOException
- if get from backing store failspublic long size() throws java.io.IOException
Session
java.io.IOException
- If backing store retrieval failurepublic java.util.Iterator<?> entrySet() throws java.io.IOException
Session
java.io.IOException
- if get from backing store failspublic java.util.stream.Stream<?> entrySetStream() throws java.io.IOException
Session
java.io.IOException
public java.util.Iterator<?> keySet() throws java.io.IOException
Session
java.io.IOException
- if get from backing store failspublic java.util.stream.Stream<?> keySetStream() throws java.io.IOException
Session
java.io.IOException
public boolean containsKey(java.lang.Comparable tkey) throws java.io.IOException
Session
tkey
- The key to matchjava.io.IOException
- If backing store failspublic java.lang.Object remove(java.lang.Comparable tkey) throws java.io.IOException
Session
tkey
- The key to matchjava.io.IOException
- If backing store failspublic java.lang.Comparable firstKey() throws java.io.IOException
Session
java.io.IOException
- If backing store retrieval failurepublic java.lang.Comparable lastKey() throws java.io.IOException
Session
java.io.IOException
- If backing store retrieval failurepublic java.lang.Object last() throws java.io.IOException
Session
java.io.IOException
- If backing store retrieval failurepublic java.lang.Object first() throws java.io.IOException
Session
java.io.IOException
- If backing store retrieval failurepublic java.lang.Object nearest(java.lang.Comparable key) throws java.io.IOException
key
- java.io.IOException
public java.util.Iterator<?> headMap(java.lang.Comparable tkey) throws java.io.IOException
tkey
- Strictly less than 'to' this element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.stream.Stream<?> headMapStream(java.lang.Comparable tkey) throws java.io.IOException
Session
tkey
- java.io.IOException
public java.util.Iterator<?> headMapKV(java.lang.Comparable tkey) throws java.io.IOException
tkey
- Strictly less than 'to' this element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.stream.Stream<?> headMapKVStream(java.lang.Comparable tkey) throws java.io.IOException
tkey
- Strictly less than 'to' this element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.Iterator<?> tailMap(java.lang.Comparable fkey) throws java.io.IOException
fkey
- Greater or equal to 'from' element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.stream.Stream<?> tailMapStream(java.lang.Comparable fkey) throws java.io.IOException
fkey
- Greater or equal to 'from' element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.Iterator<?> tailMapKV(java.lang.Comparable fkey) throws java.io.IOException
fkey
- Greater or equal to 'from' element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.stream.Stream<?> tailMapKVStream(java.lang.Comparable fkey) throws java.io.IOException
fkey
- Greater or equal to 'from' element, Session
java.io.IOException
- If backing store retrieval failurepublic java.util.Iterator<?> subMap(java.lang.Comparable fkey, java.lang.Comparable tkey) throws java.io.IOException
fkey
- 'from' element inclusive. Session
tkey
- 'to' element exclusivejava.io.IOException
- If backing store retrieval failurepublic java.util.stream.Stream<?> subMapStream(java.lang.Comparable fkey, java.lang.Comparable tkey) throws java.io.IOException
fkey
- 'from' element inclusive. Session
tkey
- 'to' element exclusivejava.io.IOException
- If backing store retrieval failurepublic java.util.Iterator<?> subMapKV(java.lang.Comparable fkey, java.lang.Comparable tkey) throws java.io.IOException
fkey
- 'from' element inclusive. Session
tkey
- 'to' element exclusivejava.io.IOException
- If backing store retrieval failurepublic java.util.stream.Stream<?> subMapKVStream(java.lang.Comparable fkey, java.lang.Comparable tkey) throws java.io.IOException
fkey
- 'from' element inclusive. Session
tkey
- 'to' element exclusivejava.io.IOException
- If backing store retrieval failurepublic boolean isEmpty() throws java.io.IOException
Session
is emptyjava.io.IOException
- If backing store retrieval failurepublic java.lang.String getDBName()
public java.lang.Object getMutexObject()
public java.util.Iterator<?> iterator() throws java.io.IOException
Session
equivalent of keySet fulfills SetInterface
Session
java.io.IOException
- if backing store failspublic boolean contains(java.lang.Comparable o) throws java.io.IOException
SetInterface
o
- the key to locatejava.io.IOException
- if backing store failspublic void Open() throws java.io.IOException
SetInterface
java.io.IOException
public void Close() throws java.io.IOException
SetInterface
java.io.IOException
public org.rocksdb.RocksDB getKVStore()
public boolean containsValue(java.lang.Object o) throws java.io.IOException
Session
containsValuejava.io.IOException
public java.util.Iterator<?> subSet(java.lang.Comparable fkey, java.lang.Comparable tkey) throws java.io.IOException
fkey
- 'from' element inclusive. Session
tkey
- 'to' element exclusivejava.io.IOException
- If backing store retrieval failurepublic java.util.stream.Stream<?> subSetStream(java.lang.Comparable fkey, java.lang.Comparable tkey) throws java.io.IOException
fkey
- 'from' element inclusive. Session
tkey
- 'to' element exclusivejava.io.IOException
- If backing store retrieval failurepublic java.util.Iterator<?> headSet(java.lang.Comparable tkey) throws java.io.IOException
tkey
- Strictly less than 'to' this element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.stream.Stream<?> headSetStream(java.lang.Comparable tkey) throws java.io.IOException
tkey
- Strictly less than 'to' this element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.Iterator<?> tailSet(java.lang.Comparable fkey) throws java.io.IOException
fkey
- Greater or equal to 'from' element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.stream.Stream<?> tailSetStream(java.lang.Comparable fkey) throws java.io.IOException
fkey
- Greater or equal to 'from' element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.Iterator<?> subSetKV(java.lang.Comparable fkey, java.lang.Comparable tkey) throws java.io.IOException
fkey
- 'from' element inclusive. Session
tkey
- 'to' element exclusivejava.io.IOException
- If backing store retrieval failurepublic java.util.stream.Stream<?> subSetKVStream(java.lang.Comparable fkey, java.lang.Comparable tkey) throws java.io.IOException
fkey
- 'from' element inclusive. Session
tkey
- 'to' element exclusivejava.io.IOException
- If backing store retrieval failurepublic java.util.Iterator<?> headSetKV(java.lang.Comparable tkey) throws java.io.IOException
tkey
- Strictly less than 'to' this element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.stream.Stream<?> headSetKVStream(java.lang.Comparable tkey) throws java.io.IOException
tkey
- Strictly less than 'to' this element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.Iterator<?> tailSetKV(java.lang.Comparable fkey) throws java.io.IOException
fkey
- Greater or equal to 'from' element. Session
java.io.IOException
- If backing store retrieval failurepublic java.util.stream.Stream<?> tailSetKVStream(java.lang.Comparable fkey) throws java.io.IOException
fkey
- Greater or equal to 'from' element. Session
java.io.IOException
- If backing store retrieval failurepublic void dropColumn() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object