public class OpenFileSupport extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
OpenFileSupport.OpenFileInformation
The information on a file needed to open it.
|
Modifier and Type | Field and Description |
---|---|
static org.apache.hadoop.fs.store.LogExactlyOnce |
LOG_NO_SQL_SELECT |
Constructor and Description |
---|
OpenFileSupport(ChangeDetectionPolicy changePolicy,
long defaultReadAhead,
String username,
int defaultBufferSize,
long defaultAsyncDrainThreshold,
S3AInputPolicy defaultInputPolicy)
Instantiate with the default options from the filesystem.
|
Modifier and Type | Method and Description |
---|---|
S3AReadOpContext |
applyDefaultOptions(S3AReadOpContext roc)
Propagate the default options to the operation context
being built up.
|
ChangeDetectionPolicy |
getChangePolicy() |
long |
getDefaultAsyncDrainThreshold() |
int |
getDefaultBufferSize() |
long |
getDefaultReadAhead() |
OpenFileSupport.OpenFileInformation |
openSimpleFile(int bufferSize)
Open a simple file, using all the default
options.
|
OpenFileSupport.OpenFileInformation |
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.
|
String |
toString() |
public static final org.apache.hadoop.fs.store.LogExactlyOnce LOG_NO_SQL_SELECT
public OpenFileSupport(ChangeDetectionPolicy changePolicy, long defaultReadAhead, String username, int defaultBufferSize, long defaultAsyncDrainThreshold, S3AInputPolicy defaultInputPolicy)
changePolicy
- change detection policydefaultReadAhead
- read ahead rangeusername
- usernamedefaultBufferSize
- buffer sizedefaultAsyncDrainThreshold
- drain thresholddefaultInputPolicy
- input policypublic ChangeDetectionPolicy getChangePolicy()
public long getDefaultReadAhead()
public int getDefaultBufferSize()
public long getDefaultAsyncDrainThreshold()
public S3AReadOpContext applyDefaultOptions(S3AReadOpContext roc)
roc
- contextpublic OpenFileSupport.OpenFileInformation prepareToOpenFile(org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.impl.OpenFileParameters parameters, long blockSize) throws IOException
path
- path to the fileparameters
- open file parameters from the builder.blockSize
- for fileStatusIOException
- failure to resolve the link.IllegalArgumentException
- unknown mandatory keyUnsupportedOperationException
- for S3 Select options.public OpenFileSupport.OpenFileInformation openSimpleFile(int bufferSize)
bufferSize
- buffer sizeopen(path, bufferSize)
.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.