Package org.apache.accumulo.core.file
Class FileOperations
- java.lang.Object
-
- org.apache.accumulo.core.file.FileOperations
-
- Direct Known Subclasses:
MapFileOperations,RFileOperations
public abstract class FileOperations extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classFileOperations.FileHelperHelper class extended by both writers and readers.classFileOperations.FileOptionsclassFileOperations.IndexReaderBuilderOperation object for opening an index.static interfaceFileOperations.IndexReaderTableConfigurationclassFileOperations.ReaderBuilderOptions common to allFileOperationswhich perform reads.static interfaceFileOperations.ReaderTableConfigurationclassFileOperations.ScanReaderBuilderOperation object for opening a scan reader.static interfaceFileOperations.ScanReaderTableConfigurationclassFileOperations.WriterBuilderOperation object for constructing a writer.static interfaceFileOperations.WriterTableConfiguration
-
Constructor Summary
Constructors Constructor Description FileOperations()
-
Method Summary
-
-
-
Method Detail
-
getNewFileExtension
public static String getNewFileExtension(AccumuloConfiguration acuconf)
-
getInstance
public static FileOperations getInstance()
-
getFileSize
protected abstract long getFileSize(FileOperations.FileOptions options) throws IOException
- Throws:
IOException
-
openWriter
protected abstract FileSKVWriter openWriter(FileOperations.FileOptions options) throws IOException
- Throws:
IOException
-
openIndex
protected abstract FileSKVIterator openIndex(FileOperations.FileOptions options) throws IOException
- Throws:
IOException
-
openScanReader
protected abstract FileSKVIterator openScanReader(FileOperations.FileOptions options) throws IOException
- Throws:
IOException
-
openReader
protected abstract FileSKVIterator openReader(FileOperations.FileOptions options) throws IOException
- Throws:
IOException
-
newWriterBuilder
public FileOperations.WriterBuilder newWriterBuilder()
Construct an operation object allowing one to create a writer for a file.
Syntax:FileSKVWriter writer = fileOperations.newWriterBuilder() .forFile(...) .withTableConfiguration(...) .withRateLimiter(...) // optional .withCompression(...) // optional .build();
-
newIndexReaderBuilder
public FileOperations.IndexReaderBuilder newIndexReaderBuilder()
Construct an operation object allowing one to create an index iterator for a file.
Syntax:FileSKVIterator iterator = fileOperations.newIndexReaderBuilder() .forFile(...) .withTableConfiguration(...) .withRateLimiter(...) // optional .withBlockCache(...) // optional .build();
-
newScanReaderBuilder
public FileOperations.ScanReaderBuilder newScanReaderBuilder()
Construct an operation object allowing one to create a "scan" reader for a file. Scan readers do not have any optimizations for seeking beyond their initial position. This is useful for file operations that only need to scan data within a range and do not need to seek. Therefore file metadata such as indexes does not need to be kept in memory while the file is scanned. Also seek optimizations like bloom filters do not need to be loaded.
Syntax:FileSKVIterator scanner = fileOperations.newScanReaderBuilder() .forFile(...) .withTableConfiguration(...) .overRange(...) .withRateLimiter(...) // optional .withBlockCache(...) // optional .build();
-
newReaderBuilder
public FileOperations.ReaderBuilder newReaderBuilder()
Construct an operation object allowing one to create a reader for a file. A reader constructed in this manner fully supports seeking, and also enables any optimizations related to seeking (e.g. Bloom filters).
Syntax:FileSKVIterator scanner = fileOperations.newReaderBuilder() .forFile(...) .withTableConfiguration(...) .withRateLimiter(...) // optional .withBlockCache(...) // optional .seekToBeginning(...) // optional .build();
-
-