Search in sources :

Example 1 with SnapshotExecutorImpl

use of io.dingodb.raft.storage.snapshot.SnapshotExecutorImpl in project dingo by dingodb.

the class NodeImpl method initSnapshotStorage.

private boolean initSnapshotStorage() {
    if (StringUtils.isEmpty(this.options.getSnapshotUri())) {
        LOG.warn("Do not set snapshot uri, ignore initSnapshotStorage.");
        return true;
    }
    this.snapshotExecutor = new SnapshotExecutorImpl();
    final SnapshotExecutorOptions opts = new SnapshotExecutorOptions();
    opts.setUri(this.options.getSnapshotUri());
    opts.setFsmCaller(this.fsmCaller);
    opts.setNode(this);
    opts.setLogManager(this.logManager);
    opts.setAddr(this.serverId != null ? this.serverId.getEndpoint() : null);
    opts.setInitTerm(this.currTerm);
    opts.setFilterBeforeCopyRemote(this.options.isFilterBeforeCopyRemote());
    // get snapshot throttle
    opts.setSnapshotThrottle(this.options.getSnapshotThrottle());
    return this.snapshotExecutor.init(opts);
}
Also used : SnapshotExecutorImpl(io.dingodb.raft.storage.snapshot.SnapshotExecutorImpl) SnapshotExecutorOptions(io.dingodb.raft.option.SnapshotExecutorOptions)

Aggregations

SnapshotExecutorOptions (io.dingodb.raft.option.SnapshotExecutorOptions)1 SnapshotExecutorImpl (io.dingodb.raft.storage.snapshot.SnapshotExecutorImpl)1