Package org.apache.hadoop.fs.s3a.impl
Class OpenFileSupport
java.lang.Object
org.apache.hadoop.fs.s3a.impl.OpenFileSupport
Helper class for openFile() logic, especially processing file status
args and length/etag/versionID.
This got complex enough it merited removal from S3AFileSystem -which also permits unit testing.
The default values are those from the FileSystem configuration. in openFile(), they can all be changed by specific options; in FileSystem.open(path, buffersize) only the buffer size is set.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe information on a file needed to open it. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.hadoop.fs.store.LogExactlyOnce -
Constructor Summary
ConstructorsConstructorDescriptionOpenFileSupport(ChangeDetectionPolicy changePolicy, long defaultReadAhead, String username, int defaultBufferSize, long defaultAsyncDrainThreshold, S3AInputPolicy defaultInputPolicy) Instantiate with the default options from the filesystem. -
Method Summary
Modifier and TypeMethodDescriptionPropagate the default options to the operation context being built up.longintlongopenSimpleFile(int bufferSize) Open a simple file, using all the default options.prepareToOpenFile(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.impl.OpenFileParameters parameters, long blockSize) Prepare to open a file from the openFile parameters.toString()
-
Field Details
-
LOG_NO_SQL_SELECT
public static final org.apache.hadoop.fs.store.LogExactlyOnce LOG_NO_SQL_SELECT
-
-
Constructor Details
-
OpenFileSupport
public OpenFileSupport(ChangeDetectionPolicy changePolicy, long defaultReadAhead, String username, int defaultBufferSize, long defaultAsyncDrainThreshold, S3AInputPolicy defaultInputPolicy) Instantiate with the default options from the filesystem.- Parameters:
changePolicy- change detection policydefaultReadAhead- read ahead rangeusername- usernamedefaultBufferSize- buffer sizedefaultAsyncDrainThreshold- drain thresholddefaultInputPolicy- input policy
-
-
Method Details
-
getChangePolicy
-
getDefaultReadAhead
public long getDefaultReadAhead() -
getDefaultBufferSize
public int getDefaultBufferSize() -
getDefaultAsyncDrainThreshold
public long getDefaultAsyncDrainThreshold() -
applyDefaultOptions
Propagate the default options to the operation context being built up.- Parameters:
roc- context- Returns:
- the context
-
prepareToOpenFile
public OpenFileSupport.OpenFileInformation prepareToOpenFile(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.impl.OpenFileParameters parameters, long blockSize) throws IOException Prepare to open a file from the openFile parameters. S3Select SQL is rejected if a mandatory opt, ignored if optional.- Parameters:
path- path to the fileparameters- open file parameters from the builder.blockSize- for fileStatus- Returns:
- open file options
- Throws:
IOException- failure to resolve the link.IllegalArgumentException- unknown mandatory keyUnsupportedOperationException- for S3 Select options.
-
openSimpleFile
Open a simple file, using all the default options.- Parameters:
bufferSize- buffer size- Returns:
- the parameters needed to open a file through
open(path, bufferSize).
-
toString
-