Package io.permazen.kv.mvstore
Class MVStoreKVImplementation
java.lang.Object
io.permazen.kv.mvstore.MVStoreKVImplementation
- All Implemented Interfaces:
KVImplementation<MVStoreKVImplementation.Config>
public class MVStoreKVImplementation
extends Object
implements KVImplementation<MVStoreKVImplementation.Config>
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default MVStore map name to use ("Permazen"). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOptions
(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.Create anAtomicKVStore
using the specified configuration.createKVDatabase
(MVStoreKVImplementation.Config config, KVDatabase ignored1, AtomicKVStore ignored2) Create anKVDatabase
using the specified configuration.Generate a short, human-readable description of theKVDatabase
instance configured as given.boolean
Determine whether thisKVImplementation
includes an implementation of theAtomicKVStore
interface.boolean
Determine whether thisKVImplementation
includes an implementation of theKVDatabase
interface.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.permazen.kv.KVImplementation
getConfigType, requiresAtomicKVStore, requiresKVDatabase
-
Field Details
-
DEFAULT_MAP_NAME
Default MVStore map name to use ("Permazen").- See Also:
-
-
Constructor Details
-
MVStoreKVImplementation
public MVStoreKVImplementation()
-
-
Method Details
-
addOptions
public void addOptions(joptsimple.OptionParser parser) Description copied from interface:KVImplementation
Add 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:
addOptions
in interfaceKVImplementation<MVStoreKVImplementation.Config>
- Parameters:
parser
- command line flag parser
-
buildConfig
Description copied from interface:KVImplementation
Build 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:
buildConfig
in interfaceKVImplementation<MVStoreKVImplementation.Config>
- Parameters:
options
- parsed command line options- Returns:
- corresponding configuration, or null if this implementation was not configured
-
providesKVDatabase
Description copied from interface:KVImplementation
Determine whether thisKVImplementation
includes an implementation of theKVDatabase
interface.The implementation in
KVImplementation
return false.- Specified by:
providesKVDatabase
in interfaceKVImplementation<MVStoreKVImplementation.Config>
- Parameters:
config
- implementation configuration returned bybuildConfig()
- Returns:
- true if this instance can create an
KVDatabase
-
providesAtomicKVStore
Description copied from interface:KVImplementation
Determine whether thisKVImplementation
includes an implementation of theAtomicKVStore
interface.The implementation in
KVImplementation
return false.- Specified by:
providesAtomicKVStore
in interfaceKVImplementation<MVStoreKVImplementation.Config>
- Parameters:
config
- implementation configuration returned bybuildConfig()
- Returns:
- true if this instance can create an
AtomicKVStore
-
createKVDatabase
public MVStoreKVDatabase createKVDatabase(MVStoreKVImplementation.Config config, KVDatabase ignored1, AtomicKVStore ignored2) Description copied from interface:KVImplementation
Create anKVDatabase
using the specified configuration.The implementation in
KVImplementation
always throwsUnsupportedOperationException
.- Specified by:
createKVDatabase
in interfaceKVImplementation<MVStoreKVImplementation.Config>
- Parameters:
config
- implementation configuration returned bybuildConfig()
ignored1
- requiredKVDatabase
; will be null unlessKVImplementation.requiresKVDatabase(C)
returned trueignored2
- requiredAtomicKVStore
; will be null unlessKVImplementation.requiresAtomicKVStore(C)
returned true- Returns:
- new
KVDatabase
instance
-
createAtomicKVStore
Description copied from interface:KVImplementation
Create anAtomicKVStore
using the specified configuration.The implementation in
KVImplementation
invokescreateKVDatabase()
and constructs anAtomicKVDatabase
from the result. Implementations that natively support theAtomicKVDatabase
interface should override this method.- Specified by:
createAtomicKVStore
in interfaceKVImplementation<MVStoreKVImplementation.Config>
- Parameters:
config
- implementation configuration returned bybuildConfig()
- Returns:
- new
AtomicKVStore
instance
-
getDescription
Description copied from interface:KVImplementation
Generate a short, human-readable description of theKVDatabase
instance configured as given.- Specified by:
getDescription
in interfaceKVImplementation<MVStoreKVImplementation.Config>
- Parameters:
config
- implementation configuration returned bybuildConfig()
- Returns:
- human-readable description
-