@InterfaceAudience.Public @InterfaceStability.Stable public class LoadIncrementalHFiles extends org.apache.hadoop.conf.Configured implements org.apache.hadoop.util.Tool
usage()
Modifier and Type | Class and Description |
---|---|
private static interface |
LoadIncrementalHFiles.BulkHFileVisitor<TFamily> |
static class |
LoadIncrementalHFiles.LoadQueueItem
Represents an HFile waiting to be loaded.
|
Modifier and Type | Field and Description |
---|---|
private static String |
ASSIGN_SEQ_IDS |
private boolean |
assignSeqIds |
private String |
bulkToken |
static String |
CREATE_TABLE_CONF_KEY |
private org.apache.hadoop.fs.FileSystem |
fs |
private FsDelegationToken |
fsDelegationToken |
private Admin |
hbAdmin |
private static org.apache.commons.logging.Log |
LOG |
static String |
MAX_FILES_PER_REGION_PER_FAMILY |
private int |
maxFilesPerRegionPerFamily |
static String |
NAME |
(package private) static String |
TMP_DIR |
private UserProvider |
userProvider |
Modifier | Constructor and Description |
---|---|
private |
LoadIncrementalHFiles() |
|
LoadIncrementalHFiles(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
protected void |
bulkLoadPhase(Table table,
Connection conn,
ExecutorService pool,
Deque<LoadIncrementalHFiles.LoadQueueItem> queue,
com.google.common.collect.Multimap<ByteBuffer,LoadIncrementalHFiles.LoadQueueItem> regionGroups)
This takes the LQI's grouped by likely regions and attempts to bulk load
them.
|
private boolean |
checkHFilesCountPerRegionPerFamily(com.google.common.collect.Multimap<ByteBuffer,LoadIncrementalHFiles.LoadQueueItem> regionGroups) |
private static void |
copyHFileHalf(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path inFile,
org.apache.hadoop.fs.Path outFile,
Reference reference,
HColumnDescriptor familyDescriptor)
Copy half of an HFile into a new HFile.
|
private void |
createTable(TableName tableName,
String dirPath) |
private void |
discoverLoadQueue(Deque<LoadIncrementalHFiles.LoadQueueItem> ret,
org.apache.hadoop.fs.Path hfofDir,
boolean validateHFile)
Walk the given directory for all HFiles, and return a Queue
containing all such files.
|
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,
HTable table)
Deprecated.
since hbase-1.3.0, hbase-1.2.2, and hbase-1.1.6; replaced
by
doBulkLoad(Path, Admin, Table, RegionLocator) . |
private boolean |
doesTableExist(TableName tableName) |
private String |
getUniqueName() |
protected List<LoadIncrementalHFiles.LoadQueueItem> |
groupOrSplit(com.google.common.collect.Multimap<ByteBuffer,LoadIncrementalHFiles.LoadQueueItem> regionGroups,
LoadIncrementalHFiles.LoadQueueItem item,
Table table,
Pair<byte[][],byte[][]> startEndKeys)
Attempt to assign the given load queue item into its target region group.
|
private com.google.common.collect.Multimap<ByteBuffer,LoadIncrementalHFiles.LoadQueueItem> |
groupOrSplitPhase(Table table,
ExecutorService pool,
Deque<LoadIncrementalHFiles.LoadQueueItem> queue,
Pair<byte[][],byte[][]> startEndKeys) |
static byte[][] |
inferBoundaries(TreeMap<byte[],Integer> bdryMap) |
private void |
initialize() |
private boolean |
isSecureBulkLoadEndpointAvailable() |
static void |
main(String[] args) |
int |
run(String[] args) |
private static boolean |
shouldCopyHFileMetaKey(byte[] key) |
(package private) static void |
splitStoreFile(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path inFile,
HColumnDescriptor familyDesc,
byte[] splitKey,
org.apache.hadoop.fs.Path bottomOut,
org.apache.hadoop.fs.Path topOut)
Split a storefile into a top and bottom half, maintaining
the metadata, recreating bloom filters, etc.
|
protected List<LoadIncrementalHFiles.LoadQueueItem> |
splitStoreFile(LoadIncrementalHFiles.LoadQueueItem item,
Table table,
byte[] startKey,
byte[] splitKey) |
protected List<LoadIncrementalHFiles.LoadQueueItem> |
tryAtomicRegionLoad(Connection conn,
TableName tableName,
byte[] first,
Collection<LoadIncrementalHFiles.LoadQueueItem> lqis)
Attempts to do an atomic load of many hfiles into a region.
|
protected List<LoadIncrementalHFiles.LoadQueueItem> |
tryAtomicRegionLoad(HConnection conn,
byte[] tableName,
byte[] first,
Collection<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) . |
private void |
usage() |
private static <TFamily> void |
visitBulkHFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path bulkDir,
LoadIncrementalHFiles.BulkHFileVisitor<TFamily> visitor)
Iterate over the bulkDir hfiles.
|
private static <TFamily> void |
visitBulkHFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path bulkDir,
LoadIncrementalHFiles.BulkHFileVisitor<TFamily> visitor,
boolean validateHFile)
Iterate over the bulkDir hfiles.
|
private static final org.apache.commons.logging.Log LOG
private Admin hbAdmin
public static final String NAME
public static final String MAX_FILES_PER_REGION_PER_FAMILY
private static final String ASSIGN_SEQ_IDS
public static final String CREATE_TABLE_CONF_KEY
static final String TMP_DIR
private int maxFilesPerRegionPerFamily
private boolean assignSeqIds
private org.apache.hadoop.fs.FileSystem fs
private FsDelegationToken fsDelegationToken
private String bulkToken
private UserProvider userProvider
private void usage()
private static <TFamily> void visitBulkHFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path bulkDir, LoadIncrementalHFiles.BulkHFileVisitor<TFamily> visitor) throws IOException
IOException
private static <TFamily> void visitBulkHFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path bulkDir, LoadIncrementalHFiles.BulkHFileVisitor<TFamily> visitor, boolean validateHFile) throws IOException
IOException
private void discoverLoadQueue(Deque<LoadIncrementalHFiles.LoadQueueItem> ret, org.apache.hadoop.fs.Path hfofDir, boolean validateHFile) throws IOException
IOException
@Deprecated public void doBulkLoad(org.apache.hadoop.fs.Path hfofDir, 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
protected void bulkLoadPhase(Table table, Connection conn, ExecutorService pool, Deque<LoadIncrementalHFiles.LoadQueueItem> queue, com.google.common.collect.Multimap<ByteBuffer,LoadIncrementalHFiles.LoadQueueItem> regionGroups) throws IOException
IOException
private boolean checkHFilesCountPerRegionPerFamily(com.google.common.collect.Multimap<ByteBuffer,LoadIncrementalHFiles.LoadQueueItem> regionGroups)
private com.google.common.collect.Multimap<ByteBuffer,LoadIncrementalHFiles.LoadQueueItem> groupOrSplitPhase(Table table, ExecutorService pool, Deque<LoadIncrementalHFiles.LoadQueueItem> queue, Pair<byte[][],byte[][]> startEndKeys) throws IOException
IOException
private String getUniqueName()
protected List<LoadIncrementalHFiles.LoadQueueItem> splitStoreFile(LoadIncrementalHFiles.LoadQueueItem item, Table table, byte[] startKey, byte[] splitKey) throws IOException
IOException
protected List<LoadIncrementalHFiles.LoadQueueItem> groupOrSplit(com.google.common.collect.Multimap<ByteBuffer,LoadIncrementalHFiles.LoadQueueItem> regionGroups, LoadIncrementalHFiles.LoadQueueItem item, Table table, Pair<byte[][],byte[][]> startEndKeys) throws IOException
IOException
@Deprecated protected List<LoadIncrementalHFiles.LoadQueueItem> tryAtomicRegionLoad(HConnection conn, byte[] tableName, byte[] first, Collection<LoadIncrementalHFiles.LoadQueueItem> lqis) throws IOException
tryAtomicRegionLoad(Connection, TableName, byte[], Collection)
.IOException
protected List<LoadIncrementalHFiles.LoadQueueItem> tryAtomicRegionLoad(Connection conn, TableName tableName, byte[] first, Collection<LoadIncrementalHFiles.LoadQueueItem> lqis) throws IOException
IOException
private boolean isSecureBulkLoadEndpointAvailable()
static void splitStoreFile(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path inFile, HColumnDescriptor familyDesc, byte[] splitKey, org.apache.hadoop.fs.Path bottomOut, org.apache.hadoop.fs.Path topOut) throws IOException
IOException
private static void copyHFileHalf(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path inFile, org.apache.hadoop.fs.Path outFile, Reference reference, HColumnDescriptor familyDescriptor) throws IOException
IOException
private static boolean shouldCopyHFileMetaKey(byte[] key)
private boolean doesTableExist(TableName tableName) throws Exception
Exception
private void createTable(TableName tableName, String dirPath) throws Exception
Exception
public int run(String[] args) throws Exception
run
in interface org.apache.hadoop.util.Tool
Exception
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.