Class BondedS3AStatisticsContext

java.lang.Object
org.apache.hadoop.fs.s3a.statistics.impl.BondedS3AStatisticsContext
All Implemented Interfaces:
CountersAndGauges, S3AStatisticsContext, org.apache.hadoop.fs.statistics.DurationTrackerFactory

public class BondedS3AStatisticsContext extends Object implements S3AStatisticsContext
An S3A statistics context which is bonded to a S3AInstrumentation instance -inevitably that of an S3AFileSystem instance.

An interface is used to bind to the relevant fields, rather than have them passed in the constructor because some production code, specifically, DelegateToFileSystem, patches the protected field after initialization.

All operations are passed through directly to that class.

If an instance of FileSystem.Statistics is passed in, it will be used whenever input stream statistics are created - However, Internally always increments the statistics in the current thread.

As a result, cross-thread IO will under-report.

This is addressed through the stream statistics classes only updating the stats in the close() call. Provided they are closed in the worker thread, all stats collected in helper threads will be included.