- com
- softwareag
- um
- modules
- storage
- StorageProperties
Contains the properties used to construct a Storage object Note: If the Percent Free is non zero, then the store will automatically run Storage.performMaintenance() when the stores free space versus used space reaches this value. More...
Public Member Functions | |
int | getBufferSize () |
int | getCapacity () |
See setCapacity for a full description of this attribute. More... | |
EventFactory | getEventFactory () |
int | getEventsBeforeSync () |
int | getEventsPerSpindle () |
If specified then the factory will create a Mixed File across multiple files. More... | |
long | getMinFileSizeBeforeAutoMaintenance () |
int | getPercentFree () |
String | getStoreName () |
StorageSyncListener | getSyncListener () |
int | getTimeBetweenSync () |
long | getTTL () |
StorageType | getType () |
boolean | isBufferReads () |
boolean | isCacheDuringReload () |
boolean | isPerformAutoMaintenance () |
boolean | isSyncOnWrite () |
void | setBufferReads (boolean bufferReads) |
To optimise the reading from disks the store can be configured to read large buffers of the file into memory and process it directly, rather than individual reads from a file. More... | |
void | setBufferSize (int bufferSize) |
This sets the size of the buffer used to read ahead when reading from file, used by StorageType.Mixed and StorageType.Persistent. More... | |
void | setCacheDuringReload (boolean cacheDuringReload) |
If set then when the store is reloaded, events will be placed into a memory that otherwise would remain on disk. More... | |
void | setCacheEvents (boolean cacheEvents) |
If the CacheEvents is set to true, then when writing or reloading events the store will cache the event in memory on the chance that the event maybe required again. More... | |
void | setCapacity (int capacity) |
Sets the maximum number of events that the store will hold. More... | |
void | setEventFactory (EventFactory eventFactory) |
Sets the EventFactory to use for event serialisation. | |
void | setEventsBeforeSync (int eventsBeforeSync) |
Sets the maximum number of events before sync() is called on the file system. | |
void | setEventsPerSpindle (int eventsPerSpindle) |
If specified then the factory will create a Mixed File across multiple files. More... | |
void | setPercentFree (int percentFree) |
Set the percent free threshold. | |
void | setStoreName (String storeName) |
Sets the name of the store. More... | |
void | setSyncListener (StorageSyncListener listener) |
Set a sync listener to be called whenever the stores lower levels calls the file descriptors sync() function. | |
void | setSyncOnWrite (boolean syncOnWrite) |
If syncOnWrite set, then for every write to the store the underlying file system is synced to ensure all data is flushed through the OS cache. More... | |
void | setTimeBetweenSync (int timeBetweenSync) |
Sets the maximum time between when an event is written and sync is called. More... | |
void | setTTL (long ttl) |
Sets the Time To Live for the store in milliseconds. More... | |
void | setType (StorageType type) |
Sets the StorageType to use for the store. | |
StorageProperties (StorageType type, String storeName, EventFactory factory) | |
Constructor for StorageProperties. More... | |
Static Public Member Functions | |
static long | getMaxTimeForScheduler () |
Returns the currently configured maximum time for the stores management run to wait between runs This is a static value across ALL stores. | |
static long | getMinTimeForScheduler () |
Returns the currently configured time for the stores management run to wait between runs This is a static value across ALL stores. | |
static void | setMaxTimeForScheduler (long time) |
This value specifies the longest amount of time, in milliseconds, that the stores management tasks will wait between runs This is a static value across ALL stores. | |
static void | setMinFileSizeBeforeAutoMaintenance (long size) |
This sets the size of a store before an auto maintenance task is run. More... | |
static void | setMinTimeForScheduler (long time) |
This value specifies the smallest amount of time, in milliseconds, that the stores management tasks will wait between runs This is a static value across ALL stores. | |
Contains the properties used to construct a Storage object Note: If the Percent Free is non zero, then the store will automatically run Storage.performMaintenance() when the stores free space versus used space reaches this value.
For example, if you specify 80, then once the free space reaches or exceeds 80% of the file, then the scheduled task will reclaim the unused space. This is only applicable to StoreType.Mixed StoreType.Persistent, the other types do not require any action to reclaim unused space.
com.softwareag.um.modules.storage.StorageProperties.StorageProperties | ( | StorageType | type, |
String | storeName, | ||
EventFactory | factory | ||
) |
Constructor for StorageProperties.
type | The StorageType that will be constructed |
storeName | The name of the store, if file based, the file name will have ".mem" appended to it |
factory | The EventFactory required to deserialise the event from a store |
int com.softwareag.um.modules.storage.StorageProperties.getBufferSize | ( | ) |
int com.softwareag.um.modules.storage.StorageProperties.getCapacity | ( | ) |
See setCapacity for a full description of this attribute.
EventFactory com.softwareag.um.modules.storage.StorageProperties.getEventFactory | ( | ) |
int com.softwareag.um.modules.storage.StorageProperties.getEventsBeforeSync | ( | ) |
int com.softwareag.um.modules.storage.StorageProperties.getEventsPerSpindle | ( | ) |
If specified then the factory will create a Mixed File across multiple files.
long com.softwareag.um.modules.storage.StorageProperties.getMinFileSizeBeforeAutoMaintenance | ( | ) |
int com.softwareag.um.modules.storage.StorageProperties.getPercentFree | ( | ) |
String com.softwareag.um.modules.storage.StorageProperties.getStoreName | ( | ) |
StorageSyncListener com.softwareag.um.modules.storage.StorageProperties.getSyncListener | ( | ) |
int com.softwareag.um.modules.storage.StorageProperties.getTimeBetweenSync | ( | ) |
long com.softwareag.um.modules.storage.StorageProperties.getTTL | ( | ) |
StorageType com.softwareag.um.modules.storage.StorageProperties.getType | ( | ) |
boolean com.softwareag.um.modules.storage.StorageProperties.isBufferReads | ( | ) |
boolean com.softwareag.um.modules.storage.StorageProperties.isCacheDuringReload | ( | ) |
boolean com.softwareag.um.modules.storage.StorageProperties.isPerformAutoMaintenance | ( | ) |
boolean com.softwareag.um.modules.storage.StorageProperties.isSyncOnWrite | ( | ) |
void com.softwareag.um.modules.storage.StorageProperties.setBufferReads | ( | boolean | bufferReads | ) |
To optimise the reading from disks the store can be configured to read large buffers of the file into memory and process it directly, rather than individual reads from a file.
This allows the store to read ahead of the event
void com.softwareag.um.modules.storage.StorageProperties.setBufferSize | ( | int | bufferSize | ) |
This sets the size of the buffer used to read ahead when reading from file, used by StorageType.Mixed and StorageType.Persistent.
When used in conjunction with StorageType.Paged it specifies the size of the pages to allocate
void com.softwareag.um.modules.storage.StorageProperties.setCacheDuringReload | ( | boolean | cacheDuringReload | ) |
If set then when the store is reloaded, events will be placed into a memory that otherwise would remain on disk.
This is useful if the application needs a "fast" start to access the events. If the events are not required at application start then by setting this to false the events are not loaded reducing memory usage at load time
void com.softwareag.um.modules.storage.StorageProperties.setCacheEvents | ( | boolean | cacheEvents | ) |
If the CacheEvents is set to true, then when writing or reloading events the store will cache the event in memory on the chance that the event maybe required again.
This cache is routinely cleared after a certain time period
void com.softwareag.um.modules.storage.StorageProperties.setCapacity | ( | int | capacity | ) |
Sets the maximum number of events that the store will hold.
If 0 then no limit is implied and it is up to the application to manage the size of the store. Once the store exceeds this number then the lowest event ( based on the Event Key ) is removed.
void com.softwareag.um.modules.storage.StorageProperties.setEventsPerSpindle | ( | int | eventsPerSpindle | ) |
If specified then the factory will create a Mixed File across multiple files.
eventsPerSpindle | the number of events that will be stored in each file |
|
static |
This sets the size of a store before an auto maintenance task is run.
If the file is small it results in undesired cycles of maintenance running This is a static value across all stores
void com.softwareag.um.modules.storage.StorageProperties.setStoreName | ( | String | storeName | ) |
Sets the name of the store.
Any directory paths required will be created during the Storage creation
void com.softwareag.um.modules.storage.StorageProperties.setSyncOnWrite | ( | boolean | syncOnWrite | ) |
If syncOnWrite set, then for every write to the store the underlying file system is synced to ensure all data is flushed through the OS cache.
This has dramatic impact on performance and should be used only if absolutely required.
void com.softwareag.um.modules.storage.StorageProperties.setTimeBetweenSync | ( | int | timeBetweenSync | ) |
Sets the maximum time between when an event is written and sync is called.
Please note, times of less then 10ms are rounded to 10ms
void com.softwareag.um.modules.storage.StorageProperties.setTTL | ( | long | ttl | ) |
Sets the Time To Live for the store in milliseconds.
Once the event exceeds this time the store will automatically remove it.