public class LocalSnapshotStorage extends Object implements SnapshotStorage
2018-Mar-13 2:11:30 PM
| Constructor and Description |
|---|
LocalSnapshotStorage(String path,
String tempPath,
RaftOptions raftOptions) |
| Modifier and Type | Method and Description |
|---|---|
SnapshotReader |
copyFrom(String uri,
SnapshotCopierOptions opts)
Copy data from remote uri.
|
SnapshotWriter |
create()
Create a snapshot writer.
|
SnapshotWriter |
create(boolean fromEmpty) |
long |
getLastSnapshotIndex() |
boolean |
hasServerAddr() |
boolean |
init(Void v)
Initialize the service.
|
SnapshotReader |
open()
Open a snapshot reader.
|
boolean |
setFilterBeforeCopyRemote()
Set filterBeforeCopyRemote to be true.When true,
it will filter the data before copy to remote.
|
void |
setServerAddr(Endpoint addr) |
void |
setSnapshotThrottle(SnapshotThrottle snapshotThrottle)
Configure a SnapshotThrottle.
|
void |
shutdown()
Dispose the resources for service.
|
SnapshotCopier |
startToCopyFrom(String uri,
SnapshotCopierOptions opts)
Starts a copy job to copy data from remote uri.
|
public LocalSnapshotStorage(String path, String tempPath, RaftOptions raftOptions)
public void setSnapshotThrottle(SnapshotThrottle snapshotThrottle)
SnapshotStoragesetSnapshotThrottle in interface SnapshotStoragesnapshotThrottle - throttle of snapshotpublic boolean hasServerAddr()
public void setServerAddr(Endpoint addr)
public long getLastSnapshotIndex()
public boolean init(Void v)
Lifecyclepublic void shutdown()
Lifecyclepublic boolean setFilterBeforeCopyRemote()
SnapshotStoragesetFilterBeforeCopyRemote in interface SnapshotStoragepublic SnapshotWriter create()
SnapshotStoragecreate in interface SnapshotStoragepublic SnapshotWriter create(boolean fromEmpty)
public SnapshotReader open()
SnapshotStorageopen in interface SnapshotStoragepublic SnapshotReader copyFrom(String uri, SnapshotCopierOptions opts)
SnapshotStoragecopyFrom in interface SnapshotStorageuri - remote uriopts - copy optionspublic SnapshotCopier startToCopyFrom(String uri, SnapshotCopierOptions opts)
SnapshotStoragestartToCopyFrom in interface SnapshotStorageuri - remote uriopts - copy optionsCopyright © 2024. All rights reserved.