private static class ExportSnapshot.ExportMapper extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.NullWritable>
Modifier and Type | Field and Description |
---|---|
(package private) static int |
BUFFER_SIZE |
private int |
bufferSize |
private String |
filesGroup |
private short |
filesMode |
private String |
filesUser |
private org.apache.hadoop.fs.Path |
inputArchive |
private org.apache.hadoop.fs.FileSystem |
inputFs |
private org.apache.hadoop.fs.Path |
inputRoot |
private static org.slf4j.Logger |
LOG |
private org.apache.hadoop.fs.Path |
outputArchive |
private org.apache.hadoop.fs.FileSystem |
outputFs |
private org.apache.hadoop.fs.Path |
outputRoot |
(package private) static int |
REPORT_SIZE |
private static ExportSnapshot.Testing |
testing |
private boolean |
verifyChecksum |
Modifier | Constructor and Description |
---|---|
private |
ExportMapper() |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanup(org.apache.hadoop.mapreduce.Mapper.Context context) |
private void |
copyData(org.apache.hadoop.mapreduce.Mapper.Context context,
org.apache.hadoop.fs.Path inputPath,
InputStream in,
org.apache.hadoop.fs.Path outputPath,
org.apache.hadoop.fs.FSDataOutputStream out,
long inputFileSize) |
private void |
copyFile(org.apache.hadoop.mapreduce.Mapper.Context context,
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotFileInfo inputInfo,
org.apache.hadoop.fs.Path outputPath) |
private void |
createOutputPath(org.apache.hadoop.fs.Path path)
Create the output folder and optionally set ownership.
|
private org.apache.hadoop.fs.FileChecksum |
getFileChecksum(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path) |
private FileLink |
getFileLink(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf) |
private org.apache.hadoop.fs.Path |
getOutputPath(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotFileInfo inputInfo)
Returns the location where the inputPath will be copied.
|
private org.apache.hadoop.fs.FileStatus |
getSourceFileStatus(org.apache.hadoop.mapreduce.Mapper.Context context,
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotFileInfo fileInfo) |
private void |
injectTestFailure(org.apache.hadoop.mapreduce.Mapper.Context context,
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotFileInfo inputInfo) |
void |
map(org.apache.hadoop.io.BytesWritable key,
org.apache.hadoop.io.NullWritable value,
org.apache.hadoop.mapreduce.Mapper.Context context) |
private org.apache.hadoop.fs.FSDataInputStream |
openSourceFile(org.apache.hadoop.mapreduce.Mapper.Context context,
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotFileInfo fileInfo)
Try to open the "source" file.
|
private boolean |
preserveAttributes(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.FileStatus refStat)
Try to Preserve the files attribute selected by the user copying them from the source file
This is only required when you are exporting as a different user than "hbase" or on a system
that doesn't have the "hbase" user.
|
private boolean |
sameFile(org.apache.hadoop.fs.FileStatus inputStat,
org.apache.hadoop.fs.FileStatus outputStat)
Check if the two files are equal by looking at the file length, and at the checksum (if user
has specified the verifyChecksum flag).
|
void |
setup(org.apache.hadoop.mapreduce.Mapper.Context context) |
private boolean |
stringIsNotEmpty(String str) |
private static final org.slf4j.Logger LOG
static final int REPORT_SIZE
static final int BUFFER_SIZE
private boolean verifyChecksum
private String filesGroup
private short filesMode
private int bufferSize
private org.apache.hadoop.fs.FileSystem outputFs
private org.apache.hadoop.fs.Path outputArchive
private org.apache.hadoop.fs.Path outputRoot
private org.apache.hadoop.fs.FileSystem inputFs
private org.apache.hadoop.fs.Path inputArchive
private org.apache.hadoop.fs.Path inputRoot
private static ExportSnapshot.Testing testing
private ExportMapper()
public void setup(org.apache.hadoop.mapreduce.Mapper.Context context) throws IOException
setup
in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.NullWritable>
IOException
protected void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)
cleanup
in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.NullWritable>
public void map(org.apache.hadoop.io.BytesWritable key, org.apache.hadoop.io.NullWritable value, org.apache.hadoop.mapreduce.Mapper.Context context) throws InterruptedException, IOException
map
in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.NullWritable>
InterruptedException
IOException
private org.apache.hadoop.fs.Path getOutputPath(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotFileInfo inputInfo) throws IOException
IOException
private void injectTestFailure(org.apache.hadoop.mapreduce.Mapper.Context context, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotFileInfo inputInfo) throws IOException
IOException
private void copyFile(org.apache.hadoop.mapreduce.Mapper.Context context, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotFileInfo inputInfo, org.apache.hadoop.fs.Path outputPath) throws IOException
IOException
private void createOutputPath(org.apache.hadoop.fs.Path path) throws IOException
IOException
private boolean preserveAttributes(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.FileStatus refStat)
private boolean stringIsNotEmpty(String str)
private void copyData(org.apache.hadoop.mapreduce.Mapper.Context context, org.apache.hadoop.fs.Path inputPath, InputStream in, org.apache.hadoop.fs.Path outputPath, org.apache.hadoop.fs.FSDataOutputStream out, long inputFileSize) throws IOException
IOException
private org.apache.hadoop.fs.FSDataInputStream openSourceFile(org.apache.hadoop.mapreduce.Mapper.Context context, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotFileInfo fileInfo) throws IOException
IOException
private org.apache.hadoop.fs.FileStatus getSourceFileStatus(org.apache.hadoop.mapreduce.Mapper.Context context, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotFileInfo fileInfo) throws IOException
IOException
private FileLink getFileLink(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
private org.apache.hadoop.fs.FileChecksum getFileChecksum(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path)
private boolean sameFile(org.apache.hadoop.fs.FileStatus inputStat, org.apache.hadoop.fs.FileStatus outputStat)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.