Class BulkImport
- java.lang.Object
-
- org.apache.accumulo.core.clientImpl.bulk.BulkImport
-
- All Implemented Interfaces:
TableOperations.ImportDestinationArguments,TableOperations.ImportMappingOptions,TableOperations.ImportOptions
public class BulkImport extends Object implements TableOperations.ImportDestinationArguments, TableOperations.ImportMappingOptions
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBulkImport.KeyExtentCache
-
Field Summary
-
Fields inherited from interface org.apache.accumulo.core.client.admin.TableOperations.ImportMappingOptions
BULK_LOAD_THREADS_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description BulkImport(String directory, ClientContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SortedMap<KeyExtent,Bulk.Files>computeFileToTabletMappings(org.apache.hadoop.fs.FileSystem fs, TableId 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.ImportMappingOptionsexecutor(Executor service)Files are examined to determine where to load them.static List<org.apache.hadoop.fs.FileStatus>filterInvalid(org.apache.hadoop.fs.FileStatus[] files)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)voidload()Loads the files into the table.TableOperations.ImportMappingOptionsplan(LoadPlan plan)Load files in the directory to the row ranges specified in the plan.TableOperations.ImportMappingOptionstableTime(boolean value)Use table's next timestamp to override all timestamps in imported files.TableOperations.ImportMappingOptionsthreads(int numThreads)Files are examined to determine where to load them.TableOperations.ImportMappingOptionsto(String tableName)
-
-
-
Constructor Detail
-
BulkImport
public BulkImport(String directory, ClientContext context)
-
-
Method Detail
-
tableTime
public TableOperations.ImportMappingOptions tableTime(boolean value)
Description copied from interface:TableOperations.ImportOptionsUse table's next timestamp to override all timestamps in imported files. The type of timestamp used depends on how the table was created.- Specified by:
tableTimein interfaceTableOperations.ImportOptions- Parameters:
value- override the time values in the input files, and use the current time for all mutations- See Also:
NewTableConfiguration.setTimeType(TimeType)
-
load
public void load() throws TableNotFoundException, IOException, AccumuloException, AccumuloSecurityExceptionDescription copied from interface:TableOperations.ImportOptionsLoads the files into the table.- Specified by:
loadin interfaceTableOperations.ImportOptions- Throws:
TableNotFoundExceptionIOExceptionAccumuloExceptionAccumuloSecurityException
-
executor
public TableOperations.ImportMappingOptions executor(Executor service)
Description copied from interface:TableOperations.ImportMappingOptionsFiles are examined to determine where to load them. This examination is done in the current process using multiple threads. If this method is not called, then the client propertybulk.threadsis used to create a thread pool. This property defaults to "8C".- Specified by:
executorin interfaceTableOperations.ImportMappingOptions- Parameters:
service- Use this executor to run file examination task
-
threads
public TableOperations.ImportMappingOptions threads(int numThreads)
Description copied from interface:TableOperations.ImportMappingOptionsFiles are examined to determine where to load them. This examination is done in the current process using multiple threads. If this method is not called, then the client propertybulk.threadsis used to create a thread pool. This property defaults to "8C".- Specified by:
threadsin interfaceTableOperations.ImportMappingOptions- Parameters:
numThreads- Create a thread pool with this many thread to run file examination task.
-
plan
public TableOperations.ImportMappingOptions plan(LoadPlan plan)
Description copied from interface:TableOperations.ImportMappingOptionsLoad files in the directory to the row ranges specified in the plan. The plan should contain at least one entry for every file in the directory. When this option is specified, the files are never examined so it is possible to send files to the wrong tablet.- Specified by:
planin interfaceTableOperations.ImportMappingOptions
-
to
public TableOperations.ImportMappingOptions to(String tableName)
- Specified by:
toin interfaceTableOperations.ImportDestinationArguments- Parameters:
tableName- Import files to this tableName
-
estimateSizes
public 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
- Throws:
IOException
-
findOverlappingTablets
public static List<KeyExtent> findOverlappingTablets(BulkImport.KeyExtentCache extentCache, FileSKVIterator reader) throws IOException, AccumuloException, AccumuloSecurityException, TableNotFoundException
-
findOverlappingTablets
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
-
filterInvalid
public static List<org.apache.hadoop.fs.FileStatus> filterInvalid(org.apache.hadoop.fs.FileStatus[] files)
-
computeFileToTabletMappings
public static SortedMap<KeyExtent,Bulk.Files> computeFileToTabletMappings(org.apache.hadoop.fs.FileSystem fs, TableId tableId, org.apache.hadoop.fs.Path dirPath, Executor executor, ClientContext context) throws IOException
- Throws:
IOException
-
-