public class BulkImport extends Object implements TableOperations.ImportDestinationArguments, TableOperations.ImportMappingOptions
Modifier and Type | Class and Description |
---|---|
static interface |
BulkImport.KeyExtentCache |
BULK_LOAD_THREADS_DEFAULT
Constructor and Description |
---|
BulkImport(String directory,
ClientContext context) |
Modifier and Type | Method and Description |
---|---|
static SortedMap<KeyExtent,Bulk.Files> |
computeFileToTabletMappings(org.apache.hadoop.fs.FileSystem fs,
Table.ID tableId,
org.apache.hadoop.fs.Path dirPath,
Executor executor,
ClientContext context) |
static Map<KeyExtent,Long> |
estimateSizes(AccumuloConfiguration acuConf,
org.apache.hadoop.fs.Path mapFile,
long fileSize,
Collection<KeyExtent> extents,
org.apache.hadoop.fs.FileSystem ns,
com.google.common.cache.Cache<String,Long> fileLenCache,
CryptoService cs) |
TableOperations.ImportMappingOptions |
executor(Executor service)
Files are examined to determine where to load them.
|
static List<KeyExtent> |
findOverlappingTablets(BulkImport.KeyExtentCache extentCache,
FileSKVIterator reader) |
static List<KeyExtent> |
findOverlappingTablets(ClientContext context,
BulkImport.KeyExtentCache extentCache,
org.apache.hadoop.fs.Path file,
org.apache.hadoop.fs.FileSystem fs,
com.google.common.cache.Cache<String,Long> fileLenCache,
CryptoService cs) |
void |
load()
Loads the files into the table.
|
TableOperations.ImportMappingOptions |
plan(LoadPlan plan)
Load files in the directory to the row ranges specified in the plan.
|
TableOperations.ImportMappingOptions |
tableTime(boolean value)
Use table's next timestamp to override all timestamps in imported files.
|
TableOperations.ImportMappingOptions |
threads(int numThreads)
Files are examined to determine where to load them.
|
TableOperations.ImportMappingOptions |
to(String tableName) |
public BulkImport(String directory, ClientContext context)
public TableOperations.ImportMappingOptions tableTime(boolean value)
TableOperations.ImportOptions
tableTime
in interface TableOperations.ImportOptions
value
- override the time values in the input files, and use the current time for all
mutationsNewTableConfiguration.setTimeType(TimeType)
public void load() throws TableNotFoundException, IOException, AccumuloException, AccumuloSecurityException
TableOperations.ImportOptions
load
in interface TableOperations.ImportOptions
TableNotFoundException
IOException
AccumuloException
AccumuloSecurityException
public TableOperations.ImportMappingOptions executor(Executor service)
TableOperations.ImportMappingOptions
bulk.threads
is used to create a thread pool. This property defaults to
.executor
in interface TableOperations.ImportMappingOptions
service
- Use this executor to run file examination taskpublic TableOperations.ImportMappingOptions threads(int numThreads)
TableOperations.ImportMappingOptions
bulk.threads
is used to create a thread pool. This property defaults to
.threads
in interface TableOperations.ImportMappingOptions
numThreads
- Create a thread pool with this many thread to run file examination task.public TableOperations.ImportMappingOptions plan(LoadPlan plan)
TableOperations.ImportMappingOptions
plan
in interface TableOperations.ImportMappingOptions
public TableOperations.ImportMappingOptions to(String tableName)
to
in interface TableOperations.ImportDestinationArguments
tableName
- Import files to this tableNamepublic static Map<KeyExtent,Long> estimateSizes(AccumuloConfiguration acuConf, org.apache.hadoop.fs.Path mapFile, long fileSize, Collection<KeyExtent> extents, org.apache.hadoop.fs.FileSystem ns, com.google.common.cache.Cache<String,Long> fileLenCache, CryptoService cs) throws IOException
IOException
public static List<KeyExtent> findOverlappingTablets(BulkImport.KeyExtentCache extentCache, FileSKVIterator reader) throws IOException, AccumuloException, AccumuloSecurityException, TableNotFoundException
public static List<KeyExtent> findOverlappingTablets(ClientContext context, BulkImport.KeyExtentCache extentCache, org.apache.hadoop.fs.Path file, org.apache.hadoop.fs.FileSystem fs, com.google.common.cache.Cache<String,Long> fileLenCache, CryptoService cs) throws IOException, AccumuloException, AccumuloSecurityException, TableNotFoundException
public static SortedMap<KeyExtent,Bulk.Files> computeFileToTabletMappings(org.apache.hadoop.fs.FileSystem fs, Table.ID tableId, org.apache.hadoop.fs.Path dirPath, Executor executor, ClientContext context) throws IOException
IOException
Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.