public class FsSnapshotStorage extends Object implements SnapshotStorage
| Modifier and Type | Field and Description |
|---|---|
protected FsSnapshotStorageConfiguration |
cfg |
static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
FsSnapshotStorage(FsSnapshotStorageConfiguration cfg) |
| Modifier and Type | Method and Description |
|---|---|
FsSnapshotWriter |
createSnapshot(String name,
long logPosition)
Returns a writer to create a new snapshot.
|
FsTemporarySnapshotWriter |
createTemporarySnapshot(String name,
long logPosition)
Returns a writer to create a temporary snapshot.
|
FsReadableSnapshot |
getLastSnapshot(String name)
Returns the last snapshot for the given name.
|
List<SnapshotMetadata> |
listSnapshots()
Returns a list of available snapshots; for each snapshot item, it returns the latest file.
|
protected long |
position(File file,
String snapshotName) |
boolean |
purgeSnapshot(String name)
Deletes all existing snapshot and checksum files.
|
boolean |
snapshotExists(String name,
long logPosition)
Returns whether or not there already exists a snapshot for the given name + position.
|
public static final org.slf4j.Logger LOG
protected final FsSnapshotStorageConfiguration cfg
public FsSnapshotStorage(FsSnapshotStorageConfiguration cfg)
public FsReadableSnapshot getLastSnapshot(String name)
SnapshotStoragegetLastSnapshot in interface SnapshotStoragename - the name of the snapshotnull if none existspublic boolean purgeSnapshot(String name)
SnapshotStoragepurgeSnapshot in interface SnapshotStoragename - the name of the snapshotpublic FsSnapshotWriter createSnapshot(String name, long logPosition) throws Exception
SnapshotStoragecreateSnapshot in interface SnapshotStoragename - the name of the snapshotlogPosition - the log position at which the snapshot is takenException - if fails to create the snapshotpublic List<SnapshotMetadata> listSnapshots()
SnapshotStoragelistSnapshots in interface SnapshotStoragepublic FsTemporarySnapshotWriter createTemporarySnapshot(String name, long logPosition) throws Exception
SnapshotStoragecreateTemporarySnapshot in interface SnapshotStoragename - the snapshot namelogPosition - the logPositionException - if it fails to prepare the necessary resources for the temporary snapshotpublic boolean snapshotExists(String name, long logPosition)
SnapshotStoragesnapshotExists in interface SnapshotStorageCopyright © 2017–2018 camunda services GmbH. All rights reserved.