Search in sources :

Example 1 with SnapshotCopier

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

the class LocalSnapshotStorage method copyFrom.

@Override
public SnapshotReader copyFrom(final String uri, final SnapshotCopierOptions opts) {
    final SnapshotCopier copier = startToCopyFrom(uri, opts);
    if (copier == null) {
        return null;
    }
    try {
        copier.join();
    } catch (final InterruptedException e) {
        Thread.currentThread().interrupt();
        LOG.error("Join on snapshot copier was interrupted.");
        return null;
    }
    final SnapshotReader reader = copier.getReader();
    Utils.closeQuietly(copier);
    return reader;
}
Also used : SnapshotReader(io.dingodb.raft.storage.snapshot.SnapshotReader) SnapshotCopier(io.dingodb.raft.storage.snapshot.SnapshotCopier)

Aggregations

SnapshotCopier (io.dingodb.raft.storage.snapshot.SnapshotCopier)1 SnapshotReader (io.dingodb.raft.storage.snapshot.SnapshotReader)1