public interface Database extends DatabaseProxy<String,byte[]>, net.kuujo.copycat.resource.Resource<Database>
| Modifier and Type | Method and Description |
|---|---|
static Database |
create(String name)
Creates a new database with the default cluster configuration.
|
static Database |
create(String name,
net.kuujo.copycat.cluster.ClusterConfig cluster)
Creates a new database.
|
static Database |
create(String name,
net.kuujo.copycat.cluster.ClusterConfig cluster,
DatabaseConfig config)
Creates a new database.
|
default boolean |
hasChangeNotificationSupport()
Tells whether the database supports change notifications.
|
void |
registerConsumer(Consumer<StateMachineUpdate> consumer)
Registers a new consumer of StateMachineUpdates.
|
void |
unregisterConsumer(Consumer<StateMachineUpdate> consumer)
Unregisters a consumer of StateMachineUpdates.
|
commit, counterAddAndGet, counterCompareAndSet, counterGet, counterGetAndAdd, counters, counterSet, mapClear, mapContainsKey, mapContainsValue, mapEntrySet, mapGet, mapIsEmpty, mapKeySet, maps, mapSize, mapUpdate, mapValues, prepare, prepareAndCommit, queuePeek, queuePop, queuePush, queueSize, rollbackstatic Database create(String name)
The database will be constructed with the default cluster configuration. The default cluster configuration
searches for two resources on the classpath - cluster and {cluster-defaults} - in that order. Configuration
options specified in cluster.conf will override those in {cluster-defaults.conf}.
Additionally, the database will be constructed with an database configuration that searches the classpath for
three configuration files - name, database, database-defaults, resource, and
resource-defaults - in that order. The first resource is a configuration resource with the same name
as the map resource. If the resource is namespaced - e.g. `databases.my-database.conf` - then resource
configurations will be loaded according to namespaces as well; for example, `databases.conf`.
name - The database name.static Database create(String name, net.kuujo.copycat.cluster.ClusterConfig cluster)
The database will be constructed with an database configuration that searches the classpath for
three configuration files - name, database, database-defaults, resource, and
resource-defaults - in that order. The first resource is a configuration resource with the same name
as the database resource. If the resource is namespaced - e.g. `databases.my-database.conf` - then resource
configurations will be loaded according to namespaces as well; for example, `databases.conf`.
name - The database name.cluster - The cluster configuration.static Database create(String name, net.kuujo.copycat.cluster.ClusterConfig cluster, DatabaseConfig config)
name - The database name.cluster - The cluster configuration.config - The database configuration.default boolean hasChangeNotificationSupport()
void registerConsumer(Consumer<StateMachineUpdate> consumer)
consumer - consumer to registervoid unregisterConsumer(Consumer<StateMachineUpdate> consumer)
consumer - consumer to unregisterCopyright © 2015. All rights reserved.