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;
}
Aggregations