Package org.apache.hadoop.fs.s3a
Class S3AReadOpContext
java.lang.Object
org.apache.hadoop.fs.s3a.impl.ActiveOperationContext
org.apache.hadoop.fs.s3a.S3AOpContext
org.apache.hadoop.fs.s3a.S3AReadOpContext
Read-specific operation context structure.
-
Field Summary
Fields inherited from class org.apache.hadoop.fs.s3a.S3AOpContext
dstFileStatus -
Constructor Summary
ConstructorsConstructorDescriptionS3AReadOpContext(org.apache.hadoop.fs.Path path, Invoker invoker, org.apache.hadoop.fs.FileSystem.Statistics stats, S3AStatisticsContext instrumentation, org.apache.hadoop.fs.FileStatus dstFileStatus, VectoredIOContext vectoredIOContext, org.apache.hadoop.fs.statistics.IOStatisticsAggregator ioStatisticsAggregator, org.apache.hadoop.fs.impl.prefetch.ExecutorServiceFuturePool futurePool) Instantiate. -
Method Summary
Modifier and TypeMethodDescriptionbuild()validate the context.longorg.apache.hadoop.fs.store.audit.AuditSpanGet the audit which was active when the file was opened.org.apache.hadoop.fs.impl.prefetch.ExecutorServiceFuturePoolGets theExecutorServiceFuturePoolused for asynchronous prefetches.Get the IO policy.org.apache.hadoop.fs.statistics.IOStatisticsAggregatorReturn the IOStatistics aggregator.org.apache.hadoop.fs.PathgetPath()Get the path of this read.longGet the readahead for this operation.Get invoker to use for read operations.Get Vectored IO context for this this read op.toString()withAsyncDrainThreshold(long value) Set builder value.withAuditSpan(org.apache.hadoop.fs.store.audit.AuditSpan value) Set builder value.Set builder value.withInputPolicy(S3AInputPolicy value) Set builder value.withReadahead(long value) Set builder value.Methods inherited from class org.apache.hadoop.fs.s3a.S3AOpContext
getDstFileStatus, getInvoker, getStatsMethods inherited from class org.apache.hadoop.fs.s3a.impl.ActiveOperationContext
getOperationId, getS3AStatisticsContext, newOperationId
-
Constructor Details
-
S3AReadOpContext
public S3AReadOpContext(org.apache.hadoop.fs.Path path, Invoker invoker, @Nullable org.apache.hadoop.fs.FileSystem.Statistics stats, S3AStatisticsContext instrumentation, org.apache.hadoop.fs.FileStatus dstFileStatus, VectoredIOContext vectoredIOContext, org.apache.hadoop.fs.statistics.IOStatisticsAggregator ioStatisticsAggregator, org.apache.hadoop.fs.impl.prefetch.ExecutorServiceFuturePool futurePool) Instantiate.- Parameters:
path- path of readinvoker- invoker for normal retries.stats- Filesystem statistics (may be null)instrumentation- statistics contextdstFileStatus- target file statusvectoredIOContext- context for vectored read operation.ioStatisticsAggregator- IOStatistics aggregator for each thread.futurePool- Pool for any future IO
-
-
Method Details
-
build
validate the context.- Returns:
- a read operation context ready for use.
-
getReadInvoker
Get invoker to use for read operations.- Returns:
- invoker to use for read codepaths
-
getPath
public org.apache.hadoop.fs.Path getPath()Get the path of this read.- Returns:
- path.
-
getInputPolicy
Get the IO policy.- Returns:
- the initial input policy.
-
getChangeDetectionPolicy
-
getReadahead
public long getReadahead()Get the readahead for this operation.- Returns:
- a value >= 0
-
getAuditSpan
public org.apache.hadoop.fs.store.audit.AuditSpan getAuditSpan()Get the audit which was active when the file was opened.- Returns:
- active span
-
withInputPolicy
Set builder value.- Parameters:
value- new value- Returns:
- the builder
-
withChangeDetectionPolicy
Set builder value.- Parameters:
value- new value- Returns:
- the builder
-
withReadahead
Set builder value.- Parameters:
value- new value- Returns:
- the builder
-
withAuditSpan
Set builder value.- Parameters:
value- new value- Returns:
- the builder
-
withAsyncDrainThreshold
Set builder value.- Parameters:
value- new value- Returns:
- the builder
-
getAsyncDrainThreshold
public long getAsyncDrainThreshold() -
getVectoredIOContext
Get Vectored IO context for this this read op.- Returns:
- vectored IO context.
-
getIOStatisticsAggregator
public org.apache.hadoop.fs.statistics.IOStatisticsAggregator getIOStatisticsAggregator()Return the IOStatistics aggregator.- Returns:
- instance of IOStatisticsAggregator.
-
getFuturePool
public org.apache.hadoop.fs.impl.prefetch.ExecutorServiceFuturePool getFuturePool()Gets theExecutorServiceFuturePoolused for asynchronous prefetches.- Returns:
- the
ExecutorServiceFuturePoolused for asynchronous prefetches.
-
toString
- Overrides:
toStringin classActiveOperationContext
-