Class AwsStatisticsCollector

java.lang.Object
org.apache.hadoop.fs.s3a.statistics.impl.AwsStatisticsCollector
All Implemented Interfaces:
AutoCloseable, software.amazon.awssdk.metrics.MetricPublisher, software.amazon.awssdk.utils.SdkAutoCloseable

public class AwsStatisticsCollector extends Object implements software.amazon.awssdk.metrics.MetricPublisher
Collect statistics from the AWS SDK and forward to an instance of StatisticsFromAwsSdk and thence into the S3A statistics.

See com.facebook.presto.hive.s3.PrestoS3FileSystemMetricCollector for the inspiration for this.

See software.amazon.awssdk.core.metrics.CoreMetric for metric names.

  • Constructor Details

    • AwsStatisticsCollector

      public AwsStatisticsCollector(StatisticsFromAwsSdk collector)
      Instantiate.
      Parameters:
      collector - final destination of updates
  • Method Details

    • publish

      public void publish(software.amazon.awssdk.metrics.MetricCollection metricCollection)
      This is the callback from the AWS SDK where metrics can be collected.
      Specified by:
      publish in interface software.amazon.awssdk.metrics.MetricPublisher
      Parameters:
      metricCollection - metrics collection
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface software.amazon.awssdk.metrics.MetricPublisher
      Specified by:
      close in interface software.amazon.awssdk.utils.SdkAutoCloseable