public class LocalSnapshotStorage extends Object implements SnapshotStorage
| 构造器和说明 |
|---|
LocalSnapshotStorage(String path,
RaftOptions raftOptions) |
| 限定符和类型 | 方法和说明 |
|---|---|
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, RaftOptions raftOptions)
public void setSnapshotThrottle(SnapshotThrottle snapshotThrottle)
SnapshotStoragesetSnapshotThrottle 在接口中 SnapshotStoragesnapshotThrottle - throttle of snapshotpublic boolean hasServerAddr()
public void setServerAddr(Endpoint addr)
public long getLastSnapshotIndex()
public void shutdown()
Lifecyclepublic boolean setFilterBeforeCopyRemote()
SnapshotStoragesetFilterBeforeCopyRemote 在接口中 SnapshotStoragepublic SnapshotWriter create()
SnapshotStoragecreate 在接口中 SnapshotStoragepublic SnapshotWriter create(boolean fromEmpty)
public SnapshotReader open()
SnapshotStorageopen 在接口中 SnapshotStoragepublic SnapshotReader copyFrom(String uri, SnapshotCopierOptions opts)
SnapshotStoragecopyFrom 在接口中 SnapshotStorageuri - remote uriopts - copy optionspublic SnapshotCopier startToCopyFrom(String uri, SnapshotCopierOptions opts)
SnapshotStoragestartToCopyFrom 在接口中 SnapshotStorageuri - remote uriopts - copy optionsCopyright © 2021. All rights reserved.