@InterfaceAudience.Public public class TableSnapshotInputFormat extends Object implements org.apache.hadoop.mapred.InputFormat<ImmutableBytesWritable,Result>
TableSnapshotInputFormat
.TableSnapshotInputFormat
Modifier and Type | Class and Description |
---|---|
(package private) static class |
TableSnapshotInputFormat.TableSnapshotRecordReader |
static class |
TableSnapshotInputFormat.TableSnapshotRegionSplit |
Constructor and Description |
---|
TableSnapshotInputFormat() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,Result> |
getRecordReader(org.apache.hadoop.mapred.InputSplit split,
org.apache.hadoop.mapred.JobConf job,
org.apache.hadoop.mapred.Reporter reporter) |
org.apache.hadoop.mapred.InputSplit[] |
getSplits(org.apache.hadoop.mapred.JobConf job,
int numSplits) |
static void |
setInput(org.apache.hadoop.mapred.JobConf job,
String snapshotName,
org.apache.hadoop.fs.Path restoreDir)
Configures the job to use TableSnapshotInputFormat to read from a snapshot.
|
static void |
setInput(org.apache.hadoop.mapred.JobConf job,
String snapshotName,
org.apache.hadoop.fs.Path restoreDir,
RegionSplitter.SplitAlgorithm splitAlgo,
int numSplitsPerRegion)
Configures the job to use TableSnapshotInputFormat to read from a snapshot.
|
public TableSnapshotInputFormat()
public org.apache.hadoop.mapred.InputSplit[] getSplits(org.apache.hadoop.mapred.JobConf job, int numSplits) throws IOException
getSplits
in interface org.apache.hadoop.mapred.InputFormat<ImmutableBytesWritable,Result>
IOException
public org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,Result> getRecordReader(org.apache.hadoop.mapred.InputSplit split, org.apache.hadoop.mapred.JobConf job, org.apache.hadoop.mapred.Reporter reporter) throws IOException
getRecordReader
in interface org.apache.hadoop.mapred.InputFormat<ImmutableBytesWritable,Result>
IOException
public static void setInput(org.apache.hadoop.mapred.JobConf job, String snapshotName, org.apache.hadoop.fs.Path restoreDir) throws IOException
job
- the job to configuresnapshotName
- the name of the snapshot to read fromrestoreDir
- a temporary directory to restore the snapshot into. Current user should
have write permissions to this directory, and this should not be a subdirectory of rootdir.
After the job is finished, restoreDir can be deleted.IOException
- if an error occurspublic static void setInput(org.apache.hadoop.mapred.JobConf job, String snapshotName, org.apache.hadoop.fs.Path restoreDir, RegionSplitter.SplitAlgorithm splitAlgo, int numSplitsPerRegion) throws IOException
job
- the job to configuresnapshotName
- the name of the snapshot to read fromrestoreDir
- a temporary directory to restore the snapshot into. Current user should
have write permissions to this directory, and this should not be a subdirectory of rootdir.
After the job is finished, restoreDir can be deleted.splitAlgo
- split algorithm to generate splits from regionnumSplitsPerRegion
- how many input splits to generate per one regionIOException
- if an error occursCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.