|
|||||||||
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 an ODS store.
This class contains information used to describe an ODS store. It is intended for use by a user when establishing store bindings.
Field Summary | |
---|---|
static String |
PROPNAME_ADDRESS
|
static String |
PROPNAME_DISCOVERY_DESCRIPTOR
The property name used to set the discovery descriptor. |
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() |
String |
getDiscoveryDescriptor()
Deprecated. Discovery descriptor configuration has been moved to the store replicator configuration. Use setReplicator(java.lang.String) to enable and set clustering/replication configuration including setting
the cluster discovery descriptor |
int |
getIcrQuorum()
This method is equivalent to calling getInterClusterReplicationQuorum() . |
int |
getInterClusterReplicationQuorum()
Get a store's inter-cluster replication quorum. |
String |
getInterClusterReplicator()
Get the name of a store's inter-cluster replicator (ICR). |
int |
getMaxIcrSyncBacklog()
This method is equivalent to call getMaxInterClusterReplicationSyncBacklog() |
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. |
String |
getReplicator()
Get the name of a store's replicator. |
boolean |
isQueryable()
Gets whether a store is queryable |
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. |
void |
setDiscoveryDescriptor(String discoveryDescriptor)
Deprecated. Discovery descriptor configuration has been moved to the store replicator configuration. Use setReplicator(java.lang.String) to enable and set clustering/replication configuration including setting
the cluster discovery descriptor |
StoreDescriptor |
setIcrQuorum(int quorum)
This method is equivalent to calling setInterClusterReplicationQuorum(int) . |
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 |
setMaxIcrSyncBacklog(int backlog)
This method is equivalent to call setMaxInterClusterReplicationSyncBacklog(int) |
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. |
void |
setQueryable(boolean queryable)
Sets whether a store is queryable or not |
StoreDescriptor |
setReplicator(String replicatorName)
Set the name of a store's replicator. |
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
public static final String PROPNAME_DISCOVERY_DESCRIPTOR
Method Detail |
---|
public final String getName()
public final StoreDescriptor setReplicator(String replicatorName)
replicatorName
- The name of the replicator. A replicator of this
name should exist in the default repository at runtime from where the
ODS store using this descriptor will load the replicator descriptor.public final String getReplicator()
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 asynchronously. Otherwise, they are persisted synchronously.
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 asynchronously. Otherwise, they are performed synchronously.
The default ICR quorum is 2.
public final int getInterClusterReplicationQuorum()
public final StoreDescriptor setIcrQuorum(int quorum)
setInterClusterReplicationQuorum(int)
.
quorum
- The ICR quorum to set.
public final int getIcrQuorum()
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 setMaxIcrSyncBacklog(int backlog)
setMaxInterClusterReplicationSyncBacklog(int)
public final int getMaxIcrSyncBacklog()
getMaxInterClusterReplicationSyncBacklog()
public final void setCheckpointingType(IStoreCheckpointingController.Type val)
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 boolean isQueryable()
public void setQueryable(boolean queryable)
queryable
- The queryability value@Deprecated public String getDiscoveryDescriptor()
setReplicator(java.lang.String)
to enable and set clustering/replication configuration including setting
the cluster discovery descriptor
If no custom discovery descriptor is returned and no discovery provider information
is encoded in the address portion of this descriptor, the store binding should
use the default discovery descriptor returned by DiscoveryCacheFactory.getDefaultCache()
.
setDiscoveryDescriptor(String)
@Deprecated public void setDiscoveryDescriptor(String discoveryDescriptor)
setReplicator(java.lang.String)
to enable and set clustering/replication configuration including setting
the cluster discovery descriptor
When set, this descriptor is used to load the discovery provider for the store (providing the store implementation uses discovery). Store implementations such as the default (native) store implementation use the discovery provider to broadcast their presence and connection information and presence to cluster peers.
In most cases, an application will simply want to use the default discovery
configured for the server JVM in which they are running. In such cases, The
store descriptor of 'native://.' should be used, and this value need not be
set. The store will simply use the default discovery provider returned by
DiscoveryCacheFactory.getDefaultCache()
.
However, in some cases where discovery within the same JVM must be partitioned, it can be useful to specify a separate discovery provider for the store, and this property facilitates that.
NOTE on native store binding discovery configuration: When the discovery descriptor is not set by this value in the descriptor, the default (native) store binding implementation will fall back to computing the discovery descriptor from the address of this store descriptor by appending the following:
StoreDescriptor
StoreDescriptor
StoreDescriptor
StoreDescriptor
StoreDescriptor
DiscoveryCacheFactory.getDefaultCache()
will be used.
native://mcast://224.0.1.200:4060&discoveryInitWaitTime=5&localIfAddress=myserverhostwould yield a discovery descriptor of:
mcast://224.0.1.200:4060&initWaitTime=5
For discovery descriptors that need more provider configuration parameters than those listed above, this method should be used to set the discovery descriptor.
discoveryDescriptor
- The discovery descriptor.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 |