use of com.alipay.sofa.jraft.rhea.errors.StorageException in project sofa-jraft by sofastack.
the class MemoryKVStoreSnapshotFile method doSnapshotLoad.
@Override
void doSnapshotLoad(final String snapshotPath, final LocalFileMeta meta, final Region region) throws Exception {
final File file = new File(snapshotPath);
if (!file.exists()) {
throw new StorageException("Snapshot file [" + snapshotPath + "] not exists");
}
final Region snapshotRegion = readMetadata(meta, Region.class);
if (!RegionHelper.isSameRange(region, snapshotRegion)) {
throw new StorageException("Invalid snapshot region: " + snapshotRegion + ", current region is: " + region);
}
this.kvStore.doSnapshotLoad(this, snapshotPath);
}
Aggregations