/** * Return a SnapshotManifest instance, used for writing a snapshot. * * There are two usage pattern: * - The Master will create a manifest, add the descriptor, offline regions * and consolidate the snapshot by writing all the pending stuff on-disk. * manifest = SnapshotManifest.create(...) * manifest.addRegion(tableDir, hri) * manifest.consolidate() * - The RegionServer will create a single region manifest * manifest = SnapshotManifest.create(...) * manifest.addRegion(region) */ public static SnapshotManifest create(final Configuration conf, final FileSystem fs, final Path workingDir, final SnapshotDescription desc, final ForeignExceptionSnare monitor) throws IOException { return new SnapshotManifest(conf, fs, workingDir, desc, monitor); }
/** * Return a SnapshotManifest instance with the information already loaded in-memory. * SnapshotManifest manifest = SnapshotManifest.open(...) * TableDescriptor htd = manifest.getTableDescriptor() * for (SnapshotRegionManifest regionManifest: manifest.getRegionManifests()) * hri = regionManifest.getRegionInfo() * for (regionManifest.getFamilyFiles()) * ... */ public static SnapshotManifest open(final Configuration conf, final FileSystem fs, final Path workingDir, final SnapshotDescription desc) throws IOException { SnapshotManifest manifest = new SnapshotManifest(conf, fs, workingDir, desc, null); manifest.load(); return manifest; }
/** * Return a SnapshotManifest instance, used for writing a snapshot. * * There are two usage pattern: * - The Master will create a manifest, add the descriptor, offline regions * and consolidate the snapshot by writing all the pending stuff on-disk. * manifest = SnapshotManifest.create(...) * manifest.addRegion(tableDir, hri) * manifest.consolidate() * - The RegionServer will create a single region manifest * manifest = SnapshotManifest.create(...) * manifest.addRegion(region) */ public static SnapshotManifest create(final Configuration conf, final FileSystem fs, final Path workingDir, final SnapshotDescription desc, final ForeignExceptionSnare monitor) { return new SnapshotManifest(conf, fs, workingDir, desc, monitor); }
/** * Return a SnapshotManifest instance with the information already loaded in-memory. * SnapshotManifest manifest = SnapshotManifest.open(...) * HTableDescriptor htd = manifest.getTableDescriptor() * for (SnapshotRegionManifest regionManifest: manifest.getRegionManifests()) * hri = regionManifest.getRegionInfo() * for (regionManifest.getFamilyFiles()) * ... */ public static SnapshotManifest open(final Configuration conf, final FileSystem fs, final Path workingDir, final SnapshotDescription desc) throws IOException { SnapshotManifest manifest = new SnapshotManifest(conf, fs, workingDir, desc, null); manifest.load(); return manifest; }