|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.root.RootObject
com.neeve.ods.OdsObject
com.neeve.ods.StoreDescriptor
public final class StoreDescriptor
Describes a data store.
This class contains information used to describe a data store. It is intended for use by a user when establishing store bindings.
Field Summary | |
---|---|
static String |
PROPNAME_ADDRESS
|
static String |
PROPNAME_PROVIDER_NAME
|
Method Summary | |
---|---|
static StoreDescriptor |
create(String name)
Create a default store descriptor. |
void |
delete()
Delete a store descriptor from the default configuration repository. |
void |
delete(IConfigRepository repo)
Delete a store descriptor from the configuration repository. |
static boolean |
exists(IConfigRepository repo,
String name)
Checks if a store is configured in a configuration repository |
static boolean |
exists(String name)
Checks if a store is configured in the default configuration repository |
IStoreCheckpointingController.Type |
getCheckpointingType()
Indicates the type of checkpointing strategy being used. |
long |
getCheckpointMaxInterval()
Gets the max time interval (in millis) that can occur before triggering a new checkpoint |
int |
getCheckpointThreshold()
Gets the number of store operations that can occur before triggering a new checkpoint based on getCheckpointingType() |
boolean |
getFailOnMultiplePrimaries()
Get if a store will fail if it detects multiple primaries. |
int |
getInterClusterReplicationQuorum()
Get a store's inter-cluster replication quorum. |
String |
getInterClusterReplicator()
Get the name of a store's inter-cluster replicator (ICR). |
int |
getMaxInterClusterReplicationSyncBacklog()
Get a store's max inter-cluster replication sync backlog. |
int |
getMaxPersistSyncBacklog()
Get a store's max persist sync backlog. |
String |
getName()
Get the name of the store that this descriptor describes. |
int |
getPersistenceQuorum()
Get a store's persistence quorum. |
String |
getPersister()
Get the name of a store's persister. |
Properties |
getProviderConfig()
Get the provider configuration property table |
static StoreDescriptor |
load(IConfigRepository repo,
String name)
Create a store descriptor from a configuration respository. |
Properties |
load(Properties props)
Load a store descriptor's properties from a property table. |
static StoreDescriptor |
load(String name)
Create a store descriptor from the default configuration respository. |
static Set<StoreDescriptor> |
loadAll()
Create store descriptors for all stores configured in the default configuration repository. |
static Set<StoreDescriptor> |
loadAll(IConfigRepository repo)
Create store descriptors for all stores in a configuration repository. |
void |
save()
Save a store descriptor to the default configuration repository. |
void |
save(IConfigRepository repo)
Save a store descriptor to a configuration repository. |
Properties |
save(Properties props)
Save a store descriptor to a property table. |
void |
setCheckpointingType(IStoreCheckpointingController.Type val)
Indicates the checkpointing strategy/type to be used. |
void |
setCheckpointMaxInterval(long checkpointMaxInterval)
Sets the max time interval (in millis) that can occur before triggering a new checkpoint. |
void |
setCheckpointThreshold(int checkpointThreshold)
Sets the number of store operations that can occur before triggering a new checkpoint. |
StoreDescriptor |
setFailOnMultiplePrimaries(boolean val)
Set whether a store should fail on detecting multiple primaries. |
StoreDescriptor |
setInterClusterReplicationQuorum(int quorum)
Set a store's inter-cluster replication (IRCE) quorum. |
StoreDescriptor |
setInterClusterReplicator(String icrName)
Set the name of a store's inter-cluster replicator (ICR). |
StoreDescriptor |
setMaxInterClusterReplicationSyncBacklog(int backlog)
Set a store's max inter-cluster replication (ICR) sync backlog. |
StoreDescriptor |
setMaxPersistSyncBacklog(int backlog)
Set a store's max persist sync backlog. |
StoreDescriptor |
setPersistenceQuorum(int quorum)
Set a store's persistence quorum. |
StoreDescriptor |
setPersister(String persisterName)
Set the name of a store's persister. |
StoreDescriptor |
setProviderConfig(Properties props)
Set the configuration for the provider specific portion of the store binding that this descriptor describes. |
StoreDescriptor |
setProviderConfig(String descriptorStr)
Set a provider configuration from a descriptor string |
String |
toString()
Returns a string representation of this object |
Methods inherited from class com.neeve.root.RootObject |
---|
getChecked, getThreaded, getTracer, setChecked, setTracer |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String PROPNAME_PROVIDER_NAME
public static final String PROPNAME_ADDRESS
Method Detail |
---|
public final String getName()
public final StoreDescriptor setPersister(String persisterName)
persisterName
- The name of the persister. A persister of this
name should exist in the default repository at runtime from where the
ODS store using this descriptor will load the persister descriptor.public final String getPersister()
public final StoreDescriptor setPersistenceQuorum(int quorum)
quorum
- The quorum to set. Must be >= 1.
This method set's a store's persistence quorum. The persistence quorum is the minimum number of store members running in a cluster that determines whether persister commits are executed synchronously or not. If the number of members is greater or equal to the quorum, then persistence commits are always performed synchronously. Otherwise, they are persisted asynchronously.
The default persistence quorum is 2.
public final int getPersistenceQuorum()
public final StoreDescriptor setMaxPersistSyncBacklog(int backlog)
backlog
- The backlog in seconds.
The default max persist sync backlog is 0 (i.e force sync is off).
public final int getMaxPersistSyncBacklog()
public final StoreDescriptor setInterClusterReplicator(String icrName)
icrName
- The name of the replicator. An ICR of this name
should exist in the default repository at runtime from where the
ODS store using this descriptor will load the ICR's descriptor.public final String getInterClusterReplicator()
public final StoreDescriptor setInterClusterReplicationQuorum(int quorum)
quorum
- The quorum to set. Must be >= 1.
This method set's a store's ICR quorum. The ICR quorum is the minimum number of store members running in a cluster that determines whether ICR send commits are executed synchronously or not. If the number of members is greater or equal to the quorum, then ICR commits are always performed synchronously. Otherwise, they are performed asynchronously.
The default ICR quorum is 2.
public final int getInterClusterReplicationQuorum()
public final StoreDescriptor setMaxInterClusterReplicationSyncBacklog(int backlog)
backlog
- The backlog in seconds.
The default max ICR sync backlog is 0 (i.e force sync is off).
public final int getMaxInterClusterReplicationSyncBacklog()
public final StoreDescriptor setFailOnMultiplePrimaries(boolean val)
val
- The value to set.
The default policy is to not not fail on detecting multiple primaries. This means that, if multiple primaries are detected, the primaries will not join the same cluster.
Note: This feature is not currently available. As of now, a primary store member will fail if it detects another primary in its environment trying to join its cluster.
public final boolean getFailOnMultiplePrimaries()
public final void setCheckpointingType(IStoreCheckpointingController.Type val)
Note: This feature is currently under development and is meant only for use with state replication
val
- the type of checkpointing strategy to usepublic final IStoreCheckpointingController.Type getCheckpointingType()
Note: This feature is currently under development and is meant only for use with state replication
IStoreCheckpointingController.Type
the type of checkpointing strategy being used.public int getCheckpointThreshold()
getCheckpointingType()
public void setCheckpointThreshold(int checkpointThreshold)
setCheckpointingType(com.neeve.ods.IStoreCheckpointingController.Type)
checkpointThreshold
- The number of store operations that can occur before
a checkpoint is triggered.public long getCheckpointMaxInterval()
public void setCheckpointMaxInterval(long checkpointMaxInterval)
checkpointMaxInterval
- The the max time interval (in millis) that can occur before
triggering a new checkpoint.public final StoreDescriptor setProviderConfig(Properties props)
props
- The properties table that describes the provider configuration.
This parameter cannot be null.
This method sets the configuration for the provider specific portion of a store binding using a property table.
public final StoreDescriptor setProviderConfig(String descriptorStr)
descriptorStr
- The descriptor string
IllegalArgumentException
- Thrown if the descriptor string is null
or has invalid format.
Note: Using this method to set provider configuration will clear exsiting
provider config properties set by an earlier call to this method or by directly
setting the properties in the provider config property table returned by
getProviderConfig()
public final Properties getProviderConfig()
public final Properties save(Properties props)
props
- The property table.
IllegalArgumentException
- If the properties are null
public final Properties load(Properties props)
props
- The property table.
IllegalArgumentException
- If the properties are null
public final void save(IConfigRepository repo) throws OdsException
repo
- The root directory of the configuration respository.
OdsException
- Thrown in case an error in encountered during
the saving of the descriptor.This method saves a store descriptor to a configuration repository. The descriptor is saved in a format suitable for loading subsequently using any of the load methods offered by this class.
public final void save() throws OdsException
OdsException
This method saves a store descriptor to the default configuration respository. The descriptor is saved in a format suitable for loading subsequently using any of the load methods offered in this class.
public final void delete(IConfigRepository repo) throws OdsException
repo
- The configuration respository to delete the descriptor from.
OdsException
- Thrown in case an error in encountered during the
deletion of the descriptor.This method deletes a store descriptor from a configuration repository.
public final void delete() throws OdsException
OdsException
- Thrown in case an error in encountered during the
deletion of the descriptor.This method permanently deletes a store descriptor from the default configuration repository.
public static StoreDescriptor create(String name)
name
- The name of the store whose descriptor is to be prepared.public static boolean exists(IConfigRepository repo, String name)
repo
- The configuration respository to check in.name
- The name of the store to check for.public static boolean exists(String name)
name
- The name of the store to check for.public static StoreDescriptor load(IConfigRepository repo, String name) throws OdsException
repo
- The configuration repository from where to load the descriptor.name
- The name of the store whose descriptor is to be prepared.
OdsException
public static StoreDescriptor load(String name) throws OdsException
name
- The name of the store whose descriptor is to be prepared.
OdsException
public static Set<StoreDescriptor> loadAll(IConfigRepository repo) throws OdsException
repo
- The configuration respository from where to create the stores.
This method creates and initializes store descriptors for each of the stores configured in a configuration repository.
OdsException
public static Set<StoreDescriptor> loadAll() throws OdsException
This method creates and initializes stores descriptors for all the stores configured in the default configuration repository.
OdsException
public final String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |