use of org.apache.geode.admin.RegionNotFoundException in project geode by apache.
the class CacheSnapshotServiceImpl method load.
@Override
public void load(File[] snapshots, SnapshotFormat format, SnapshotOptions<Object, Object> options) throws IOException, ClassNotFoundException {
for (File f : snapshots) {
GFSnapshotImporter in = new GFSnapshotImporter(f);
try {
byte version = in.getVersion();
if (version == GFSnapshot.SNAP_VER_1) {
throw new IOException(LocalizedStrings.Snapshot_UNSUPPORTED_SNAPSHOT_VERSION_0.toLocalizedString(version));
}
String regionName = in.getRegionName();
Region<Object, Object> region = cache.getRegion(regionName);
if (region == null) {
throw new RegionNotFoundException(LocalizedStrings.Snapshot_COULD_NOT_FIND_REGION_0_1.toLocalizedString(regionName, f));
}
RegionSnapshotService<Object, Object> rs = region.getSnapshotService();
rs.load(f, format, options);
} finally {
in.close();
}
}
}
Aggregations