Package com.tangosol.persistence
Class DirectorySnapshotArchiver
- java.lang.Object
-
- com.tangosol.persistence.AbstractSnapshotArchiver
-
- com.tangosol.persistence.DirectorySnapshotArchiver
-
- All Implemented Interfaces:
SnapshotArchiver
public class DirectorySnapshotArchiver extends AbstractSnapshotArchiver
An implementation of aSnapshotArchiverthat uses a shared directory to store archived snapshots.- Since:
- 12.2.1
- Author:
- tam 2014.08.19
-
-
Field Summary
-
Fields inherited from class com.tangosol.persistence.AbstractSnapshotArchiver
f_sClusterName, f_sServiceName, m_cMillisLastStart, m_cMillisMax, m_cMillisMin, m_cMillisTotal
-
-
Constructor Summary
Constructors Constructor Description DirectorySnapshotArchiver(String sClusterName, String sServiceName, File fileDirectory)Constructs a new DirectorySnapshotArchiver which uses a shared directory available from all members to store archived snapshots.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidarchiveInternal(Snapshot snapshot, com.oracle.coherence.persistence.PersistenceManager<ReadBuffer> mgr)Internal implementation to Archive the specified snapshot.protected PropertiesgetMetadata(String sSnapshot)Internal implementation to retrieve the metadata stored for the archived snapshot.FilegetSharedDirectoryPath()The shared directory to write archives to.protected String[]listInternal()Internal implementation to return the identifiers of the archived snapshots known to this archiver.protected String[]listStoresInternal(String sSnapshot)List the stores for a given snapshot.protected booleanremoveInternal(String sSnapshot)Internal implementation to remove the specified archived snapshot.protected voidretrieveInternal(Snapshot snapshot, com.oracle.coherence.persistence.PersistenceManager<ReadBuffer> mgr)Internal implementation to retrieve the specified snapshot.StringtoString()-
Methods inherited from class com.tangosol.persistence.AbstractSnapshotArchiver
archive, createTempEnvironment, displayStatistics, get, getPersistenceTools, hasArchivedSnapshot, hasLocalSnapshot, instantiatePersistenceTools, list, recordEndTime, recordStartTime, remove, resetStatistics, retrieve, writeMetadata
-
-
-
-
Constructor Detail
-
DirectorySnapshotArchiver
public DirectorySnapshotArchiver(String sClusterName, String sServiceName, File fileDirectory) throws IOException
Constructs a new DirectorySnapshotArchiver which uses a shared directory available from all members to store archived snapshots.- Parameters:
sClusterName- the name of the clustersServiceName- the service namefileDirectory- a shared directory available from all members- Throws:
IOException- if errors creating directories
-
-
Method Detail
-
listInternal
protected String[] listInternal()
Description copied from class:AbstractSnapshotArchiverInternal implementation to return the identifiers of the archived snapshots known to this archiver.- Specified by:
listInternalin classAbstractSnapshotArchiver- Returns:
- a list of the known archived snapshot identifiers
-
archiveInternal
protected void archiveInternal(Snapshot snapshot, com.oracle.coherence.persistence.PersistenceManager<ReadBuffer> mgr)
Description copied from class:AbstractSnapshotArchiverInternal implementation to Archive the specified snapshot.- Specified by:
archiveInternalin classAbstractSnapshotArchiver- Parameters:
snapshot- the snapshot to archivemgr- the PersistenceManager used to read the stores from
-
retrieveInternal
protected void retrieveInternal(Snapshot snapshot, com.oracle.coherence.persistence.PersistenceManager<ReadBuffer> mgr)
Description copied from class:AbstractSnapshotArchiverInternal implementation to retrieve the specified snapshot.- Specified by:
retrieveInternalin classAbstractSnapshotArchiver- Parameters:
snapshot- the snapshot to retrievemgr- the PersistenceManager used to write the stores to
-
removeInternal
protected boolean removeInternal(String sSnapshot)
Description copied from class:AbstractSnapshotArchiverInternal implementation to remove the specified archived snapshot. (Called by JMX operation removeArchivedSnapshot)- Specified by:
removeInternalin classAbstractSnapshotArchiver- Parameters:
sSnapshot- the snapshot name to remove- Returns:
- true if the snapshot was removed
-
listStoresInternal
protected String[] listStoresInternal(String sSnapshot)
Description copied from class:AbstractSnapshotArchiverList the stores for a given snapshot.- Specified by:
listStoresInternalin classAbstractSnapshotArchiver- Parameters:
sSnapshot- the snapshot name to list stores for- Returns:
- a
String[] of store names
-
getMetadata
protected Properties getMetadata(String sSnapshot) throws IOException
Description copied from class:AbstractSnapshotArchiverInternal implementation to retrieve the metadata stored for the archived snapshot.- Specified by:
getMetadatain classAbstractSnapshotArchiver- Parameters:
sSnapshot- the snapshot name to retrieve metadata- Returns:
- the metadata for the archived snapshot
- Throws:
IOException- if any I/O related problems
-
toString
public String toString()
Description copied from class:AbstractSnapshotArchiver- Overrides:
toStringin classAbstractSnapshotArchiver
-
getSharedDirectoryPath
public File getSharedDirectoryPath()
The shared directory to write archives to.- Returns:
- shared directory to write archives to.
-
-