@InterfaceAudience.Private public class HFileReplicator extends Object implements Closeable
LoadIncrementalHFiles
to prepare a collection of
LoadIncrementalHFiles.LoadQueueItem
which will finally be loaded(replicated) into the table of this cluster.
Call close()
when done.Modifier and Type | Class and Description |
---|---|
private class |
HFileReplicator.Copier
This class will copy the given hfiles from the given source file system to the given local file
system staging directory.
|
Modifier and Type | Field and Description |
---|---|
private Map<String,List<Pair<byte[],List<String>>>> |
bulkLoadHFileMap |
private org.apache.hadoop.conf.Configuration |
conf |
private Connection |
connection |
private int |
copiesPerThread |
private ThreadPoolExecutor |
exec |
private FsDelegationToken |
fsDelegationToken |
private org.apache.hadoop.fs.Path |
hbaseStagingDir |
private static org.slf4j.Logger |
LOG |
private int |
maxCopyThreads |
private static org.apache.hadoop.fs.permission.FsPermission |
PERM_ALL_ACCESS |
static int |
REPLICATION_BULKLOAD_COPY_HFILES_PERTHREAD_DEFAULT |
static String |
REPLICATION_BULKLOAD_COPY_HFILES_PERTHREAD_KEY
Number of hfiles to copy per thread during replication
|
static int |
REPLICATION_BULKLOAD_COPY_MAXTHREADS_DEFAULT |
static String |
REPLICATION_BULKLOAD_COPY_MAXTHREADS_KEY
Maximum number of threads to allow in pool to copy hfiles during replication
|
private org.apache.hadoop.fs.FileSystem |
sinkFs |
private String |
sourceBaseNamespaceDirPath |
private org.apache.hadoop.conf.Configuration |
sourceClusterConf |
private List<String> |
sourceClusterIds |
private String |
sourceHFileArchiveDirPath |
private static String |
UNDERSCORE |
private UserProvider |
userProvider |
Constructor and Description |
---|
HFileReplicator(org.apache.hadoop.conf.Configuration sourceClusterConf,
String sourceBaseNamespaceDirPath,
String sourceHFileArchiveDirPath,
Map<String,List<Pair<byte[],List<String>>>> tableQueueMap,
org.apache.hadoop.conf.Configuration conf,
Connection connection,
List<String> sourceClusterIds) |
Modifier and Type | Method and Description |
---|---|
private void |
cleanup(String stagingDir,
Table table) |
void |
close() |
private Map<String,org.apache.hadoop.fs.Path> |
copyHFilesToStagingDir() |
private org.apache.hadoop.fs.Path |
createStagingDir(org.apache.hadoop.fs.Path baseDir,
User user,
String randomDir) |
private org.apache.hadoop.fs.Path |
createStagingDir(org.apache.hadoop.fs.Path baseDir,
User user,
TableName tableName) |
private void |
doBulkLoad(LoadIncrementalHFiles loadHFiles,
Table table,
Deque<LoadIncrementalHFiles.LoadQueueItem> queue,
RegionLocator locator,
int maxRetries) |
Void |
replicate() |
public static final String REPLICATION_BULKLOAD_COPY_MAXTHREADS_KEY
public static final int REPLICATION_BULKLOAD_COPY_MAXTHREADS_DEFAULT
public static final String REPLICATION_BULKLOAD_COPY_HFILES_PERTHREAD_KEY
public static final int REPLICATION_BULKLOAD_COPY_HFILES_PERTHREAD_DEFAULT
private static final org.slf4j.Logger LOG
private static final String UNDERSCORE
private static final org.apache.hadoop.fs.permission.FsPermission PERM_ALL_ACCESS
private org.apache.hadoop.conf.Configuration sourceClusterConf
private String sourceBaseNamespaceDirPath
private String sourceHFileArchiveDirPath
private org.apache.hadoop.fs.FileSystem sinkFs
private FsDelegationToken fsDelegationToken
private UserProvider userProvider
private org.apache.hadoop.conf.Configuration conf
private Connection connection
private org.apache.hadoop.fs.Path hbaseStagingDir
private ThreadPoolExecutor exec
private int maxCopyThreads
private int copiesPerThread
private List<String> sourceClusterIds
public HFileReplicator(org.apache.hadoop.conf.Configuration sourceClusterConf, String sourceBaseNamespaceDirPath, String sourceHFileArchiveDirPath, Map<String,List<Pair<byte[],List<String>>>> tableQueueMap, org.apache.hadoop.conf.Configuration conf, Connection connection, List<String> sourceClusterIds) throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public Void replicate() throws IOException
IOException
private void doBulkLoad(LoadIncrementalHFiles loadHFiles, Table table, Deque<LoadIncrementalHFiles.LoadQueueItem> queue, RegionLocator locator, int maxRetries) throws IOException
IOException
private Map<String,org.apache.hadoop.fs.Path> copyHFilesToStagingDir() throws IOException
IOException
private org.apache.hadoop.fs.Path createStagingDir(org.apache.hadoop.fs.Path baseDir, User user, TableName tableName) throws IOException
IOException
private org.apache.hadoop.fs.Path createStagingDir(org.apache.hadoop.fs.Path baseDir, User user, String randomDir) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.