Package io.permazen.kv.array
Class ArrayKVImplementation
java.lang.Object
io.permazen.kv.array.ArrayKVImplementation
- All Implemented Interfaces:
KVImplementation<File>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOptions(joptsimple.OptionParser parser) Add implementation-specific command line options.buildConfig(joptsimple.OptionSet options) Build a configuration from implementation-specific command line options, if any were given.createAtomicKVStore(File directory) Create anAtomicKVStoreusing the specified configuration.createKVDatabase(File directory, KVDatabase kvdb, AtomicKVStore kvstore) Create anKVDatabaseusing the specified configuration.getDescription(File directory) Generate a short, human-readable description of theKVDatabaseinstance configured as given.booleanprovidesAtomicKVStore(File config) Determine whether thisKVImplementationincludes an implementation of theAtomicKVStoreinterface.booleanprovidesKVDatabase(File config) Determine whether thisKVImplementationincludes an implementation of theKVDatabaseinterface.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.permazen.kv.KVImplementation
getConfigType, requiresAtomicKVStore, requiresKVDatabase
-
Constructor Details
-
ArrayKVImplementation
public ArrayKVImplementation()
-
-
Method Details
-
addOptions
public void addOptions(joptsimple.OptionParser parser) Description copied from interface:KVImplementationAdd implementation-specific command line options.All of the added options must be optional, because multiple key/value implementations will be available when the command line is parsed, and the presence of implementation-specific options determines which one(s) are chosen.
- Specified by:
addOptionsin interfaceKVImplementation<File>- Parameters:
parser- command line flag parser
-
buildConfig
Description copied from interface:KVImplementationBuild a configuration from implementation-specific command line options, if any were given.If none of this implementation's options were provided, then this method must return null.
- Specified by:
buildConfigin interfaceKVImplementation<File>- Parameters:
options- parsed command line options- Returns:
- corresponding configuration, or null if this implementation was not configured
-
providesKVDatabase
Description copied from interface:KVImplementationDetermine whether thisKVImplementationincludes an implementation of theKVDatabaseinterface.The implementation in
KVImplementationreturn false.- Specified by:
providesKVDatabasein interfaceKVImplementation<File>- Parameters:
config- implementation configuration returned bybuildConfig()- Returns:
- true if this instance can create an
KVDatabase
-
providesAtomicKVStore
Description copied from interface:KVImplementationDetermine whether thisKVImplementationincludes an implementation of theAtomicKVStoreinterface.The implementation in
KVImplementationreturn false.- Specified by:
providesAtomicKVStorein interfaceKVImplementation<File>- Parameters:
config- implementation configuration returned bybuildConfig()- Returns:
- true if this instance can create an
AtomicKVStore
-
createKVDatabase
Description copied from interface:KVImplementationCreate anKVDatabaseusing the specified configuration.The implementation in
KVImplementationalways throwsUnsupportedOperationException.- Specified by:
createKVDatabasein interfaceKVImplementation<File>- Parameters:
directory- implementation configuration returned bybuildConfig()kvdb- requiredKVDatabase; will be null unlessKVImplementation.requiresKVDatabase(C)returned truekvstore- requiredAtomicKVStore; will be null unlessKVImplementation.requiresAtomicKVStore(C)returned true- Returns:
- new
KVDatabaseinstance
-
createAtomicKVStore
Description copied from interface:KVImplementationCreate anAtomicKVStoreusing the specified configuration.The implementation in
KVImplementationinvokescreateKVDatabase()and constructs anAtomicKVDatabasefrom the result. Implementations that natively support theAtomicKVDatabaseinterface should override this method.- Specified by:
createAtomicKVStorein interfaceKVImplementation<File>- Parameters:
directory- implementation configuration returned bybuildConfig()- Returns:
- new
AtomicKVStoreinstance
-
getDescription
Description copied from interface:KVImplementationGenerate a short, human-readable description of theKVDatabaseinstance configured as given.- Specified by:
getDescriptionin interfaceKVImplementation<File>- Parameters:
directory- implementation configuration returned bybuildConfig()- Returns:
- human-readable description
-