@InterfaceAudience.LimitedPrivate(value="HBase") @InterfaceStability.Evolving public class MultiTableSnapshotInputFormatImpl extends Object
.MultiTableSnapshotInputFormat
and mapred
(MultiTableSnapshotInputFormat
implementations.Modifier and Type | Field and Description |
---|---|
private static org.apache.commons.logging.Log |
LOG |
static String |
RESTORE_DIRS_KEY |
static String |
SNAPSHOT_TO_SCANS_KEY |
Constructor and Description |
---|
MultiTableSnapshotInputFormatImpl() |
Modifier and Type | Method and Description |
---|---|
private Map<String,org.apache.hadoop.fs.Path> |
generateSnapshotToRestoreDirMapping(Collection<String> snapshots,
org.apache.hadoop.fs.Path baseRestoreDir)
Generate a random path underneath baseRestoreDir for each snapshot in snapshots and
return a map from the snapshot to the restore directory.
|
Map<String,org.apache.hadoop.fs.Path> |
getSnapshotDirs(org.apache.hadoop.conf.Configuration conf)
Retrieve the directories into which snapshots have been restored from
(
RESTORE_DIRS_KEY ) |
Map<String,Collection<Scan>> |
getSnapshotsToScans(org.apache.hadoop.conf.Configuration conf)
Retrieve the snapshot name -> list<scan> mapping pushed to configuration by
setSnapshotToScans(org.apache.hadoop.conf.Configuration, java.util.Map) |
List<TableSnapshotInputFormatImpl.InputSplit> |
getSplits(org.apache.hadoop.conf.Configuration conf)
Return the list of splits extracted from the scans/snapshots pushed to conf by
setInput(org.apache.hadoop.conf.Configuration, java.util.Map, org.apache.hadoop.fs.Path) |
(package private) void |
restoreSnapshot(org.apache.hadoop.conf.Configuration conf,
String snapshotName,
org.apache.hadoop.fs.Path rootDir,
org.apache.hadoop.fs.Path restoreDir,
org.apache.hadoop.fs.FileSystem fs) |
void |
restoreSnapshots(org.apache.hadoop.conf.Configuration conf,
Map<String,org.apache.hadoop.fs.Path> snapshotToDir,
org.apache.hadoop.fs.FileSystem fs)
Restore each (snapshot name, restore directory) pair in snapshotToDir
|
void |
setInput(org.apache.hadoop.conf.Configuration conf,
Map<String,Collection<Scan>> snapshotScans,
org.apache.hadoop.fs.Path restoreDir)
Configure conf to read from snapshotScans, with snapshots restored to a subdirectory of
restoreDir.
|
void |
setSnapshotDirs(org.apache.hadoop.conf.Configuration conf,
Map<String,org.apache.hadoop.fs.Path> snapshotDirs) |
void |
setSnapshotToScans(org.apache.hadoop.conf.Configuration conf,
Map<String,Collection<Scan>> snapshotScans)
Push snapshotScans to conf (under the key
SNAPSHOT_TO_SCANS_KEY ) |
private static final org.apache.commons.logging.Log LOG
public static final String RESTORE_DIRS_KEY
public static final String SNAPSHOT_TO_SCANS_KEY
public void setInput(org.apache.hadoop.conf.Configuration conf, Map<String,Collection<Scan>> snapshotScans, org.apache.hadoop.fs.Path restoreDir) throws IOException
RESTORE_DIRS_KEY
, SNAPSHOT_TO_SCANS_KEY
conf
- snapshotScans
- restoreDir
- IOException
public List<TableSnapshotInputFormatImpl.InputSplit> getSplits(org.apache.hadoop.conf.Configuration conf) throws IOException
setInput(org.apache.hadoop.conf.Configuration, java.util.Map, org.apache.hadoop.fs.Path)
conf
- Configuration to determine splits fromIOException
public Map<String,Collection<Scan>> getSnapshotsToScans(org.apache.hadoop.conf.Configuration conf) throws IOException
setSnapshotToScans(org.apache.hadoop.conf.Configuration, java.util.Map)
conf
- Configuration to extract name -> list<scan> mappings from.IOException
public void setSnapshotToScans(org.apache.hadoop.conf.Configuration conf, Map<String,Collection<Scan>> snapshotScans) throws IOException
SNAPSHOT_TO_SCANS_KEY
)conf
- snapshotScans
- IOException
public Map<String,org.apache.hadoop.fs.Path> getSnapshotDirs(org.apache.hadoop.conf.Configuration conf) throws IOException
RESTORE_DIRS_KEY
)conf
- Configuration to extract restore directories fromIOException
public void setSnapshotDirs(org.apache.hadoop.conf.Configuration conf, Map<String,org.apache.hadoop.fs.Path> snapshotDirs)
private Map<String,org.apache.hadoop.fs.Path> generateSnapshotToRestoreDirMapping(Collection<String> snapshots, org.apache.hadoop.fs.Path baseRestoreDir)
snapshots
- collection of snapshot names to restorebaseRestoreDir
- base directory under which all snapshots in snapshots will be restoredpublic void restoreSnapshots(org.apache.hadoop.conf.Configuration conf, Map<String,org.apache.hadoop.fs.Path> snapshotToDir, org.apache.hadoop.fs.FileSystem fs) throws IOException
conf
- configuration to restore withsnapshotToDir
- mapping from snapshot names to restore directoriesfs
- filesystem to do snapshot restoration onIOException
void restoreSnapshot(org.apache.hadoop.conf.Configuration conf, String snapshotName, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.Path restoreDir, org.apache.hadoop.fs.FileSystem fs) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.