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 protected static class
FileOperations.FileAccessOperation<SubclassType extends FileOperations.FileAccessOperation<SubclassType>>
Options common to all FileOperations.protected static interface
FileOperations.FileAccessOperationBuilder<SubbuilderType>
Builder interface parallel toFileOperations.FileAccessOperation
.protected static class
FileOperations.FileIOOperation<SubclassType extends FileOperations.FileIOOperation<SubclassType>>
Options common to allFileOperation
s which perform reading or writing.protected static interface
FileOperations.FileIOOperationBuilder<SubbuilderType>
Builder interface parallel toFileOperations.FileIOOperation
.protected static class
FileOperations.FileReaderOperation<SubclassType extends FileOperations.FileReaderOperation<SubclassType>>
Options common to allFileOperations
which perform reads.protected static interface
FileOperations.FileReaderOperationBuilder<SubbuilderType>
Builder interface parallel toFileOperations.FileReaderOperation
.protected class
FileOperations.GetFileSizeOperation
Operation object for performinggetFileSize()
operations.static interface
FileOperations.GetFileSizeOperationBuilder
Builder interface forFileOperations.GetFileSizeOperation
, allowing execution ofgetFileSize()
operations.static interface
FileOperations.NeedsFile<ReturnType>
Type wrapper to ensure thatforFile(...)
is called before other methods.static interface
FileOperations.NeedsFileOrOuputStream<ReturnType>
static interface
FileOperations.NeedsFileSystem<ReturnType>
Type wrapper to ensure thatinFileSystem(...)
is called before other methods.static interface
FileOperations.NeedsRange<ReturnType>
Type wrapper to ensure thatoverRange(...)
is called before other methods.static interface
FileOperations.NeedsTableConfiguration<ReturnType>
Type wrapper to ensure thatwithTableConfiguration(...)
is called before other methods.protected class
FileOperations.OpenIndexOperation
Operation object for opening an index.static interface
FileOperations.OpenIndexOperationBuilder
Builder interface parallel toFileOperations.OpenIndexOperation
.protected class
FileOperations.OpenReaderOperation
Operation object for opening a full reader.static interface
FileOperations.OpenReaderOperationBuilder
Builder parallel toFileOperations.OpenReaderOperation
.protected class
FileOperations.OpenScanReaderOperation
Operation object for opening a scan reader.static interface
FileOperations.OpenScanReaderOperationBuilder
Builder interface parallel toFileOperations.OpenScanReaderOperation
.protected class
FileOperations.OpenWriterOperation
Operation object for constructing a writer.static interface
FileOperations.OpenWriterOperationBuilder
Builder interface parallel toFileOperations.OpenWriterOperation
.
-
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.GetFileSizeOperation options) throws IOException
- Throws:
IOException
-
openWriter
protected abstract FileSKVWriter openWriter(FileOperations.OpenWriterOperation options) throws IOException
- Throws:
IOException
-
openIndex
protected abstract FileSKVIterator openIndex(FileOperations.OpenIndexOperation options) throws IOException
- Throws:
IOException
-
openScanReader
protected abstract FileSKVIterator openScanReader(FileOperations.OpenScanReaderOperation options) throws IOException
- Throws:
IOException
-
openReader
protected abstract FileSKVIterator openReader(FileOperations.OpenReaderOperation options) throws IOException
- Throws:
IOException
-
getFileSize
public FileOperations.NeedsFile<FileOperations.GetFileSizeOperationBuilder> getFileSize()
Construct an operation object allowing one to query the size of a file.
Syntax:long size = fileOperations.getFileSize().forFile(filename, fileSystem, fsConfiguration) .withTableConfiguration(tableConf).execute();
-
newWriterBuilder
public FileOperations.NeedsFileOrOuputStream<FileOperations.OpenWriterOperationBuilder> 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.NeedsFile<FileOperations.OpenIndexOperationBuilder> 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.NeedsFile<FileOperations.NeedsRange<FileOperations.OpenScanReaderOperationBuilder>> 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.NeedsFile<FileOperations.OpenReaderOperationBuilder> 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();
-
-