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 aSnapshotArchiver
that 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 void
archiveInternal(Snapshot snapshot, com.oracle.coherence.persistence.PersistenceManager<ReadBuffer> mgr)
Internal implementation to Archive the specified snapshot.protected Properties
getMetadata(String sSnapshot)
Internal implementation to retrieve the metadata stored for the archived snapshot.File
getSharedDirectoryPath()
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 boolean
removeInternal(String sSnapshot)
Internal implementation to remove the specified archived snapshot.protected void
retrieveInternal(Snapshot snapshot, com.oracle.coherence.persistence.PersistenceManager<ReadBuffer> mgr)
Internal implementation to retrieve the specified snapshot.String
toString()
-
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:AbstractSnapshotArchiver
Internal implementation to return the identifiers of the archived snapshots known to this archiver.- Specified by:
listInternal
in 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:AbstractSnapshotArchiver
Internal implementation to Archive the specified snapshot.- Specified by:
archiveInternal
in 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:AbstractSnapshotArchiver
Internal implementation to retrieve the specified snapshot.- Specified by:
retrieveInternal
in 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:AbstractSnapshotArchiver
Internal implementation to remove the specified archived snapshot. (Called by JMX operation removeArchivedSnapshot)- Specified by:
removeInternal
in 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:AbstractSnapshotArchiver
List the stores for a given snapshot.- Specified by:
listStoresInternal
in 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:AbstractSnapshotArchiver
Internal implementation to retrieve the metadata stored for the archived snapshot.- Specified by:
getMetadata
in 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:
toString
in classAbstractSnapshotArchiver
-
getSharedDirectoryPath
public File getSharedDirectoryPath()
The shared directory to write archives to.- Returns:
- shared directory to write archives to.
-
-