Class BulkLoadCollectorJob
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.hbase.backup.mapreduce.BulkLoadCollectorJob
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable,org.apache.hadoop.util.Tool
@Private
public class BulkLoadCollectorJob
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool
MapReduce job that scans WAL backups and extracts referenced bulk-load store-file paths.
This job is intended to be used when you want a list of HFiles / store-files referenced by WAL
bulk-load descriptors. It emits a de-duplicated list of full paths (one per line) by default
using the BulkLoadCollectorJob.DedupReducer.
Usage (CLI):
BulkLoadCollector <WAL inputdir> <bulk-files-output-dir> [<tables> [<tableMappings>]]
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classMapper that extracts relative bulk-load paths from a WAL entry (viaBulkLoadProcessor), resolves them to full paths (viaBackupFileSystemManager#resolveBulkLoadFullPath(Path, Path)), and emits each full path as the map key (Text).static classReducer that deduplicates full-path keys emitted by the mappers. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.mapreduce.JobcreateSubmittableJob(String[] args) Create and configure a Job instance for bulk-file collection.private static org.apache.hadoop.mapreduce.JobcreateSubmittableJob(org.apache.hadoop.conf.Configuration conf, String inputDirs, String bulkFilesOut) Low-level job wiring.static voidCLI entry point.intprivate voidParse a time option.private voidPrint usage/help for the BulkLoadCollectorJob CLI/driver.Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
-
Field Details
-
LOG
-
NAME
- See Also:
-
DEFAULT_REDUCERS
- See Also:
-
-
Constructor Details
-
BulkLoadCollectorJob
public BulkLoadCollectorJob() -
BulkLoadCollectorJob
-
-
Method Details
-
createSubmittableJob
Create and configure a Job instance for bulk-file collection.- Parameters:
args- CLI args expected to be: inputDirs bulkFilesOut [tables] [tableMap]- Throws:
IOException- on misconfiguration
-
createSubmittableJob
private static org.apache.hadoop.mapreduce.Job createSubmittableJob(org.apache.hadoop.conf.Configuration conf, String inputDirs, String bulkFilesOut) throws IOException Low-level job wiring. Creates the Job instance and sets input, mapper, reducer and output.- Parameters:
conf- configuration used for the jobinputDirs- WAL input directories (comma-separated)bulkFilesOut- output directory to write discovered full-paths- Throws:
IOException- on invalid args
-
setupTime
Parse a time option. Supports the user-friendly ISO-like formatyyyy-MM-dd'T'HH:mm:ss.SSor milliseconds since epoch. If the option is not present, this method is a no-op.- Parameters:
conf- configuration containing optionoption- key to read (e.g. WALInputFormat.START_TIME_KEY)- Throws:
IOException- on parse failure
-
main
CLI entry point.- Parameters:
args- job arguments (seeusage(String))- Throws:
Exception- on job failure
-
run
- Specified by:
runin interfaceorg.apache.hadoop.util.Tool- Throws:
Exception
-
usage
Print usage/help for the BulkLoadCollectorJob CLI/driver.args layout: args[0] = input directory (required) args[1] = output directory (required) args[2] = tables (comma-separated) (optional) args[3] = tableMappings (comma-separated) (optional; must match tables length)
-