public final class StorePersisterDescriptor extends OdsObject
This class contains information used to describe a store persister. It is intended for use by a user when creating store persisters.
| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_DETACHED
Property used to indicate whether to persist in 'detached' mode
This property is used to indicate whether the persister should operate
in "detached" mode.
|
static String |
PROP_DETACHED_QUEUE_DEPTH
Property used to specify the depth of the detached thread feeder queue
This property is only applicable if the persister is configured for
detached mode of operation.
|
static String |
PROP_DETACHED_QUEUE_DRAINER_CPU_AFFINITIZATION_MASK
Property used to specify the affinity mask of the detached thread.
|
static String |
PROP_DETACHED_QUEUE_OFFER_STRATEGY
Property used to specify the offer strategy of the detached thread
feeder queue
This property is only applicable if the persister is configured for
detached mode of operation.
|
static String |
PROP_DETACHED_QUEUE_WAIT_STRATEGY
Property used to specify the wait strategy of the detached thread
feeder queue
This property is only applicable if the persister is configured for
detached mode of operation.
|
static String |
PROP_FLUSH_ON_COMMIT
Property used to indicate whether a flush should be performed on commit.
|
static String |
PROP_RECORD_LEG_LATENCIES
Property used to indicate whether to record leg latencies
|
static String |
PROP_SHARED
Property used to indicate whether this a shared persister or not.
|
| Modifier and Type | Method and Description |
|---|---|
static StorePersisterDescriptor |
create(String name)
Create a default persister descriptor.
|
static StorePersisterDescriptor |
create(String name,
String className)
Create a persister descriptor.
|
void |
delete()
Delete a persister descriptor from the default configuration repository.
|
void |
delete(IConfigRepository repo)
Delete a persister descriptor from the configuration repository.
|
static boolean |
exists(IConfigRepository repo,
String name)
Checks if a persister is configured in a configuration repository
|
static boolean |
exists(String name)
Checks if a persister is configured in the default configuration repository
|
String |
getClassName()
Get the name of the main class of the persister that this descriptor describes.
|
String |
getName()
Get the name of the persister that this descriptor describes.
|
Properties |
getProperties()
Get the app properties
|
String |
getProperty(String name)
Get a persister property.
|
static StorePersisterDescriptor |
load(IConfigRepository repo,
String name)
Create a persister descriptor from a configuration respository.
|
static StorePersisterDescriptor |
load(String name)
Create a persister descriptor from the default configuration respository.
|
static Set<StorePersisterDescriptor> |
loadAll()
Create persister descriptors for all persisters configured in the default configuration
repository.
|
static Set<StorePersisterDescriptor> |
loadAll(IConfigRepository repo)
Create persister descriptors for all persisters in a configuration repository.
|
void |
save()
Save a persister descriptor to the default configuration repository.
|
void |
save(IConfigRepository repo)
Save a persister descriptor to a configuration repository.
|
Properties |
save(Properties props)
Save a persister descriptor to a property table.
|
StorePersisterDescriptor |
setProperties(Properties props)
Set a set of persister properties.
|
StorePersisterDescriptor |
setProperty(String name,
String value)
Set a persister property.
|
String |
toString()
Returns a string representation of this object
|
getChecked, getThreaded, getTracerpublic static final String PROP_DETACHED
This property is used to indicate whether the persister should operate in "detached" mode. In detached mode of operation, a separate thread is spun up that does the actual write.
public static final String PROP_DETACHED_QUEUE_DEPTH
This property is only applicable if the persister is configured for detached mode of operation. In such a case, this property configures the size of the queue that feeds the detached thread.
Default value of this parameter is 1024
public static final String PROP_DETACHED_QUEUE_OFFER_STRATEGY
This property is only applicable if the persister is configured for detached mode of operation. In such a case, this property configures the strategy for offering messages/objects for persistence to the queue that feeds the detached thread
public static final String PROP_DETACHED_QUEUE_WAIT_STRATEGY
This property is only applicable if the persister is configured for detached mode of operation. In such a case, this property configures the strategy for waiting for messages/objects to arrive in the queue that feeds the detached thread
public static final String PROP_DETACHED_QUEUE_DRAINER_CPU_AFFINITIZATION_MASK
This property is only applicable if the persister is configured for detached mode of operation. In such a case, this property configures the CPU affinitization mask for the detached thread.
public static final String PROP_SHARED
A shared persister is one that shares the underlying storage resource between the primary and backup members of a cluster
public static final String PROP_FLUSH_ON_COMMIT
public static final String PROP_RECORD_LEG_LATENCIES
public final String getName()
public final String getClassName()
public final StorePersisterDescriptor setProperty(String name, String value)
name - The property namevalue - The property value. A vaue of null clears the property.public final String getProperty(String name)
public final StorePersisterDescriptor setProperties(Properties props)
public final Properties getProperties()
public final Properties save(Properties props)
props - The property table.IllegalArgumentException - If the properties are nullpublic 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 persister 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
OdsExceptionThis method saves a persister descriptor to the default confiiguration 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 persister 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 persister descriptor from the default configuration repository.
public static StorePersisterDescriptor create(String name, String className)
name - The name of the persister whose descriptor is to be prepared.className - The name of the persister's main classpublic static StorePersisterDescriptor create(String name)
name - The name of the persister 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 persister to check for.public static boolean exists(String name)
name - The name of the persister to check for.public static StorePersisterDescriptor load(IConfigRepository repo, String name) throws OdsException
repo - The configuration repository from where to load the descriptor.name - The name of the persister whose descriptor is to be prepared.OdsExceptionpublic static StorePersisterDescriptor load(String name) throws OdsException
name - The name of the persister whose descriptor is to be prepared.OdsExceptionpublic static Set<StorePersisterDescriptor> loadAll(IConfigRepository repo) throws OdsException
repo - The configuration respository from where to create the persisters.This method creates and initializes persister descriptors for each of the persisters configured in a configuration repository.
OdsExceptionpublic static Set<StorePersisterDescriptor> loadAll() throws OdsException
This method creates and initializes persisters descriptors for all the persisters configured in the default configuration repository.
OdsExceptionCopyright © 2019 N5 Technologies, Inc. All Rights Reserved.