@InterfaceAudience.Public
@InterfaceStability.Stable
public class LoadIncrementalHFiles
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool
usage()
Modifier and Type | Field and Description |
---|---|
static String |
CREATE_TABLE_CONF_KEY |
static String |
MAX_FILES_PER_REGION_PER_FAMILY |
static String |
NAME |
Constructor and Description |
---|
LoadIncrementalHFiles(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
protected void |
bulkLoadPhase(Table table,
Connection conn,
ExecutorService pool,
Deque<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> queue,
com.google.common.collect.Multimap<ByteBuffer,org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> regionGroups)
This takes the LQI's grouped by likely regions and attempts to bulk load
them.
|
void |
doBulkLoad(org.apache.hadoop.fs.Path hfofDir,
Admin admin,
Table table,
RegionLocator regionLocator)
Perform a bulk load of the given directory into the given
pre-existing table.
|
void |
doBulkLoad(org.apache.hadoop.fs.Path hfofDir,
org.apache.hadoop.hbase.client.HTable table)
Deprecated.
since hbase-1.3.0, hbase-1.2.2, and hbase-1.1.6; replaced
by
doBulkLoad(Path, Admin, Table, RegionLocator) . |
protected List<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> |
groupOrSplit(com.google.common.collect.Multimap<ByteBuffer,org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> regionGroups,
org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem item,
Table table,
Pair<byte[][],byte[][]> startEndKeys)
Attempt to assign the given load queue item into its target region group.
|
static byte[][] |
inferBoundaries(TreeMap<byte[],Integer> bdryMap) |
void |
loadHFileQueue(Table table,
Connection conn,
Deque<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> queue,
Pair<byte[][],byte[][]> startEndKeys)
Used by the replication sink to load the hfiles from the source cluster.
|
static void |
main(String[] args) |
void |
prepareHFileQueue(org.apache.hadoop.fs.Path hfilesDir,
Table table,
Deque<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> queue,
boolean validateHFile)
Prepare a collection of
LoadIncrementalHFiles.LoadQueueItem from list of source hfiles contained in the
passed directory and validates whether the prepared queue has all the valid table column
families in it. |
int |
run(String[] args) |
void |
setBulkToken(String stagingDir)
Called from replication sink, where it manages bulkToken(staging directory) by itself.
|
void |
setClusterIds(List<String> clusterIds) |
void |
setDepth(int depth) |
protected List<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> |
splitStoreFile(org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem item,
Table table,
byte[] startKey,
byte[] splitKey) |
protected List<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> |
tryAtomicRegionLoad(Connection conn,
TableName tableName,
byte[] first,
Collection<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> lqis)
Attempts to do an atomic load of many hfiles into a region.
|
protected List<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> |
tryAtomicRegionLoad(HConnection conn,
byte[] tableName,
byte[] first,
Collection<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> lqis)
Deprecated.
As of release 0.96
(HBASE-9508).
This will be removed in HBase 2.0.0.
Use
tryAtomicRegionLoad(Connection, TableName, byte[], Collection) . |
public static final String NAME
public static final String MAX_FILES_PER_REGION_PER_FAMILY
public static final String CREATE_TABLE_CONF_KEY
public void setDepth(int depth)
@Deprecated public void doBulkLoad(org.apache.hadoop.fs.Path hfofDir, org.apache.hadoop.hbase.client.HTable table) throws TableNotFoundException, IOException
doBulkLoad(Path, Admin, Table, RegionLocator)
.hfofDir
- the directory that was provided as the output path
of a job using HFileOutputFormattable
- the table to load intoTableNotFoundException
- if table does not yet existIOException
HBASE-15876
public void doBulkLoad(org.apache.hadoop.fs.Path hfofDir, Admin admin, Table table, RegionLocator regionLocator) throws TableNotFoundException, IOException
hfofDir
- the directory that was provided as the output path
of a job using HFileOutputFormattable
- the table to load intoTableNotFoundException
- if table does not yet existIOException
public void prepareHFileQueue(org.apache.hadoop.fs.Path hfilesDir, Table table, Deque<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> queue, boolean validateHFile) throws IOException
LoadIncrementalHFiles.LoadQueueItem
from list of source hfiles contained in the
passed directory and validates whether the prepared queue has all the valid table column
families in it.hfilesDir
- directory containing list of hfiles to be loaded into the tabletable
- table to which hfiles should be loadedqueue
- queue which needs to be loaded into the tablevalidateHFile
- if true hfiles will be validated for its formatIOException
- If any I/O or network error occurredpublic void loadHFileQueue(Table table, Connection conn, Deque<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> queue, Pair<byte[][],byte[][]> startEndKeys) throws IOException
groupOrSplitPhase(Table, ExecutorService, Deque, Pair)
2.
bulkLoadPhase(Table, Connection, ExecutorService, Deque, Multimap)
table
- Table to which these hfiles should be loaded toconn
- Connection to usequeue
- LoadIncrementalHFiles.LoadQueueItem
has hfiles yet to be loadedstartEndKeys
- starting and ending row keys of the regionIOException
protected void bulkLoadPhase(Table table, Connection conn, ExecutorService pool, Deque<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> queue, com.google.common.collect.Multimap<ByteBuffer,org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> regionGroups) throws IOException
IOException
protected List<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> splitStoreFile(org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem item, Table table, byte[] startKey, byte[] splitKey) throws IOException
IOException
protected List<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> groupOrSplit(com.google.common.collect.Multimap<ByteBuffer,org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> regionGroups, org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem item, Table table, Pair<byte[][],byte[][]> startEndKeys) throws IOException
IOException
@Deprecated protected List<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> tryAtomicRegionLoad(HConnection conn, byte[] tableName, byte[] first, Collection<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> lqis) throws IOException
tryAtomicRegionLoad(Connection, TableName, byte[], Collection)
.IOException
protected List<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> tryAtomicRegionLoad(Connection conn, TableName tableName, byte[] first, Collection<org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.LoadQueueItem> lqis) throws IOException
IOException
public int run(String[] args) throws Exception
run
in interface org.apache.hadoop.util.Tool
Exception
public void setBulkToken(String stagingDir)
SecureBulkLoadEndpoint
is configured in hbase.coprocessor.region.classes
property. This directory is used as a temporary directory where all files are initially
copied/moved from user given directory, set all the required file permissions and then from
their it is finally loaded into a table. This should be set only when, one would like to manage
the staging directory by itself. Otherwise this tool will handle this by itself.stagingDir
- staging directory pathCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.