public abstract class ClassDescriptorStorage extends Object
OptiObjectInputStream
and OptiObjectOutputStream
.
The store should be accessible to retrieve the class descriptors and also update it in case the
OptiObjectOutputStream encounters a new class.Constructor and Description |
---|
ClassDescriptorStorage()
Creates a Class Descriptor Storage.
|
Modifier and Type | Method and Description |
---|---|
int |
getCleanupAgeDays()
Getter for cleanupAgeDays.
|
abstract ClassDescriptors |
getMasterClassDescriptors(boolean refreshFromStore)
Gets the class descriptors from the store.
|
long |
getUseTimeUpdateInterval()
Getter for useTimeUpdateInterval.
|
void |
setCleanupAgeDays(int pcleanupAgeDays)
Setter for cleanupAgeDays.
|
void |
setUseTimeUpdateInterval(long puseTimeUpdateInterval)
Setter for useTimeUpdateInterval.
|
abstract boolean |
updateClassDescriptors(ClassDescriptors updatedDescriptors)
Updates the class descriptors based on optimistic locking (Dirty write check) similar to WATCH-MULTI-EXEC or
in redis or CAS in memcached.
|
boolean |
updateTimingsAndCleanup(long updateInterval,
long lastUseTimeForCleanup)
Updates the last use times of the descriptors and removes old descriptors not used since the passed
lastUseTimeForCleanup.
|
public ClassDescriptorStorage()
public abstract ClassDescriptors getMasterClassDescriptors(boolean refreshFromStore) throws IOException
refreshFromStore
- Whether to fetch the Class Descriptors from store even if a local copy is availableIOException
- In case of error fetching the ClassDescriptorspublic abstract boolean updateClassDescriptors(ClassDescriptors updatedDescriptors) throws IOException
updatedDescriptors
- Updated Class DescriptorsIOException
- In case there is an error updating the ClassDescriptorspublic boolean updateTimingsAndCleanup(long updateInterval, long lastUseTimeForCleanup) throws IOException
updateInterval
- Specifies the time interval required between the current lastUseTime and lastUseTime when
the descriptors were fetched from the store so that the descriptors are updated to update lastUseTimelastUseTimeForCleanup
- Last Use Time in milliseconds time. Descriptors not used since this time are removed
from the store by setting the corresponding entry in the array to nullIOException
public long getUseTimeUpdateInterval()
public void setUseTimeUpdateInterval(long puseTimeUpdateInterval)
puseTimeUpdateInterval
- the useTimeUpdateInterval to setpublic int getCleanupAgeDays()
public void setCleanupAgeDays(int pcleanupAgeDays)
pcleanupAgeDays
- the cleanupAgeDays to setCopyright © 2013- Suresh Mahalingam. All Rights Reserved.