com.neeve.ods
Class StoreDescriptor

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.ods.OdsObject
          extended by com.neeve.ods.StoreDescriptor

public final class StoreDescriptor
extends OdsObject

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.

Threading:
This class is not thread safe.

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

PROPNAME_PROVIDER_NAME

public static final String PROPNAME_PROVIDER_NAME
See Also:
Constant Field Values

PROPNAME_ADDRESS

public static final String PROPNAME_ADDRESS
See Also:
Constant Field Values

PROPNAME_DISCOVERY_DESCRIPTOR

public static final String PROPNAME_DISCOVERY_DESCRIPTOR
The property name used to set the discovery descriptor.

See Also:
Constant Field Values
Method Detail

getName

public final String getName()
Get the name of the store that this descriptor describes.


setReplicator

public final StoreDescriptor setReplicator(String replicatorName)
Set the name of a store's replicator.

Parameters:
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.

getReplicator

public final String getReplicator()
Get the name of a store's replicator.


setPersister

public final StoreDescriptor setPersister(String persisterName)
Set the name of a store's persister.

Parameters:
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.

getPersister

public final String getPersister()
Get the name of a store's persister.


setPersistenceQuorum

public final StoreDescriptor setPersistenceQuorum(int quorum)
Set a store's persistence quorum.

Parameters:
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.


getPersistenceQuorum

public final int getPersistenceQuorum()
Get a store's persistence quorum.


setMaxPersistSyncBacklog

public final StoreDescriptor setMaxPersistSyncBacklog(int backlog)
Set a store's max persist sync backlog.

Parameters:
backlog - The backlog in seconds.

The default max persist sync backlog is 0 (i.e force sync is off).


getMaxPersistSyncBacklog

public final int getMaxPersistSyncBacklog()
Get a store's max persist sync backlog.


setInterClusterReplicator

public final StoreDescriptor setInterClusterReplicator(String icrName)
Set the name of a store's inter-cluster replicator (ICR).

Parameters:
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.

getInterClusterReplicator

public final String getInterClusterReplicator()
Get the name of a store's inter-cluster replicator (ICR).


setInterClusterReplicationQuorum

public final StoreDescriptor setInterClusterReplicationQuorum(int quorum)
Set a store's inter-cluster replication (IRCE) quorum.

Parameters:
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.


getInterClusterReplicationQuorum

public final int getInterClusterReplicationQuorum()
Get a store's inter-cluster replication quorum.


setIcrQuorum

public final StoreDescriptor setIcrQuorum(int quorum)
This method is equivalent to calling setInterClusterReplicationQuorum(int).

Parameters:
quorum - The ICR quorum to set.
Returns:
Get the descriptor for invocation chaining.

getIcrQuorum

public final int getIcrQuorum()
This method is equivalent to calling getInterClusterReplicationQuorum().

Returns:
Get a store's inter-cluster replication quorum.

setMaxInterClusterReplicationSyncBacklog

public final StoreDescriptor setMaxInterClusterReplicationSyncBacklog(int backlog)
Set a store's max inter-cluster replication (ICR) sync backlog.

Parameters:
backlog - The backlog in seconds.

The default max ICR sync backlog is 0 (i.e force sync is off).


getMaxInterClusterReplicationSyncBacklog

public final int getMaxInterClusterReplicationSyncBacklog()
Get a store's max inter-cluster replication sync backlog.


setMaxIcrSyncBacklog

public final StoreDescriptor setMaxIcrSyncBacklog(int backlog)
This method is equivalent to call setMaxInterClusterReplicationSyncBacklog(int)


getMaxIcrSyncBacklog

public final int getMaxIcrSyncBacklog()
This method is equivalent to call getMaxInterClusterReplicationSyncBacklog()


setCheckpointingType

public final void setCheckpointingType(IStoreCheckpointingController.Type val)
Indicates the checkpointing strategy/type to be used.

Parameters:
val - the type of checkpointing strategy to use

getCheckpointingType

public final IStoreCheckpointingController.Type getCheckpointingType()
Indicates the type of checkpointing strategy being used.

Note: This feature is currently under development and is meant only for use with state replication

Returns:
IStoreCheckpointingController.Type the type of checkpointing strategy being used.

getCheckpointThreshold

public int getCheckpointThreshold()
Gets the number of store operations that can occur before triggering a new checkpoint based on getCheckpointingType()

Returns:
The number of store operations that can occur before a checkpoint is triggered.

setCheckpointThreshold

public void setCheckpointThreshold(int checkpointThreshold)
Sets the number of store operations that can occur before triggering a new checkpoint. The type of store operations to be counted are determined by the checkpointingType set for the store using setCheckpointingType(com.neeve.ods.IStoreCheckpointingController.Type)

Parameters:
checkpointThreshold - The number of store operations that can occur before a checkpoint is triggered.

getCheckpointMaxInterval

public long getCheckpointMaxInterval()
Gets the max time interval (in millis) that can occur before triggering a new checkpoint

Returns:
The max time interval that can pass before a checkpoint is triggered.

setCheckpointMaxInterval

public void setCheckpointMaxInterval(long checkpointMaxInterval)
Sets the max time interval (in millis) that can occur before triggering a new checkpoint.

Parameters:
checkpointMaxInterval - The the max time interval (in millis) that can occur before triggering a new checkpoint.

isQueryable

public boolean isQueryable()
Gets whether a store is queryable

Returns:
Whether the store is queryable or not

setQueryable

public void setQueryable(boolean queryable)
Sets whether a store is queryable or not

Parameters:
queryable - The queryability value

getDiscoveryDescriptor

@Deprecated
public 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

Gets the 'custom' discovery for this store or null, if none is configured.

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().

Returns:
The custom discovery discovery descriptor for this store.
See Also:
setDiscoveryDescriptor(String)

setDiscoveryDescriptor

@Deprecated
public 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

Sets the custom discovery descriptor for the store.

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:

where in the above the 'discovery' portion of the property name are stripped when appending to the discovery descriptor. Unless: For Example:

native://mcast://224.0.1.200:4060&discoveryInitWaitTime=5&localIfAddress=myserverhost
would 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.

Parameters:
discoveryDescriptor - The discovery descriptor.

save

public final Properties save(Properties props)
Save a store descriptor to a property table.

Parameters:
props - The property table.
Throws:
IllegalArgumentException - If the properties are null
Threading:
This method is notsafe for concurrent access by multiple threads.

load

public final Properties load(Properties props)
Load a store descriptor's properties from a property table.

Parameters:
props - The property table.
Throws:
IllegalArgumentException - If the properties are null
Threading:
This method is notsafe for concurrent access by multiple threads.

save

public final void save(IConfigRepository repo)
                throws OdsException
Save a store descriptor to a configuration repository.

Parameters:
repo - The root directory of the configuration respository.
Throws:
OdsException - Thrown in case an error in encountered during the saving of the descriptor.
Threading:
This method is notsafe for concurrent access by multiple threads.

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.


save

public final void save()
                throws OdsException
Save a store descriptor to the default configuration repository.

Throws:
OdsException
Threading:
This method is notsafe for concurrent access by multiple threads.

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.


delete

public final void delete(IConfigRepository repo)
                  throws OdsException
Delete a store descriptor from the configuration repository.

Parameters:
repo - The configuration respository to delete the descriptor from.
Throws:
OdsException - Thrown in case an error in encountered during the deletion of the descriptor.
Threading:
This method is notsafe for concurrent access by multiple threads.

This method deletes a store descriptor from a configuration repository.


delete

public final void delete()
                  throws OdsException
Delete a store descriptor from the default configuration repository.

Throws:
OdsException - Thrown in case an error in encountered during the deletion of the descriptor.
Threading:
This method is notsafe for concurrent access by multiple threads.

This method permanently deletes a store descriptor from the default configuration repository.


create

public static StoreDescriptor create(String name)
Create a default store descriptor.

Parameters:
name - The name of the store whose descriptor is to be prepared.
Threading:
This method is safe for concurrent access by multiple threads.

exists

public static boolean exists(IConfigRepository repo,
                             String name)
Checks if a store is configured in a configuration repository

Parameters:
repo - The configuration respository to check in.
name - The name of the store to check for.
Threading:
This method is safe for concurrent access by multiple threads.

exists

public static boolean exists(String name)
Checks if a store is configured in the default configuration repository

Parameters:
name - The name of the store to check for.
Threading:
This method is safe for concurrent access by multiple threads.

load

public static StoreDescriptor load(IConfigRepository repo,
                                   String name)
                            throws OdsException
Create a store descriptor from a configuration respository.

Parameters:
repo - The configuration repository from where to load the descriptor.
name - The name of the store whose descriptor is to be prepared.
Throws:
OdsException
Threading:
This method is safe for concurrent access by multiple threads.

load

public static StoreDescriptor load(String name)
                            throws OdsException
Create a store descriptor from the default configuration respository.

Parameters:
name - The name of the store whose descriptor is to be prepared.
Throws:
OdsException
Threading:
This method is safe for concurrent access by multiple threads.

loadAll

public static Set<StoreDescriptor> loadAll(IConfigRepository repo)
                                    throws OdsException
Create store descriptors for all stores in a configuration repository.

Parameters:
repo - The configuration respository from where to create the stores.
Returns:
Returns the set of store descriptors.

This method creates and initializes store descriptors for each of the stores configured in a configuration repository.

Throws:
OdsException
Threading:
This method is safe for concurrent access by multiple threads.

loadAll

public static Set<StoreDescriptor> loadAll()
                                    throws OdsException
Create store descriptors for all stores configured in the default configuration repository.

Returns:
Returns the set of store descriptors.

This method creates and initializes stores descriptors for all the stores configured in the default configuration repository.

Throws:
OdsException
Threading:
This method is safe for concurrent access by multiple threads.

toString

public final String toString()
Returns a string representation of this object

Overrides:
toString in class Object


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.