Package com.gengoai.kv
Interface KeyValueStore<K,V>
-
- Type Parameters:
K
- the type parameterV
- the type parameter
- All Superinterfaces:
AutoCloseable
,Map<K,V>
- All Known Subinterfaces:
NavigableKeyValueStore<K,V>
- All Known Implementing Classes:
AbstractKeyValueStore
,AbstractNavigableKeyValueStore
,InMemoryKeyValueStore
public interface KeyValueStore<K,V> extends Map<K,V>, AutoCloseable
A Key-Value store is a database in which data is associated with a unique key providing quick retrieval via the key. Key-Value Stores are created usingconnect(String)
where the specification is defined as follows:kv::[type]::[namespace]::[path];compressed=[true,false];readOnly=[true,false]
- Author:
- David B. Bracewell
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
commit()
Commits changes to the key-value store to be persistedstatic <K,V,T extends KeyValueStore<K,V>>
Tconnect(@NonNull String connectionString)
String
getNameSpace()
Gets the namespace of the key-value storeboolean
isReadOnly()
Is this key-value store read-only?long
sizeAsLong()
Gets the number of keys in the store as a long-
Methods inherited from interface java.lang.AutoCloseable
close
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
connect
static <K,V,T extends KeyValueStore<K,V>> T connect(@NonNull @NonNull String connectionString)
-
commit
void commit()
Commits changes to the key-value store to be persisted
-
getNameSpace
String getNameSpace()
Gets the namespace of the key-value store- Returns:
- the name space
-
sizeAsLong
long sizeAsLong()
Gets the number of keys in the store as a long- Returns:
- the number of keys in the store
-
isReadOnly
boolean isReadOnly()
Is this key-value store read-only?- Returns:
- True - read only, False - writeable
-
-