com.amazonaws.metrics
Class MetricFilterInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by com.amazonaws.internal.SdkFilterInputStream
              extended by com.amazonaws.metrics.MetricFilterInputStream
All Implemented Interfaces:
com.amazonaws.internal.MetricAware, Closeable

public class MetricFilterInputStream
extends com.amazonaws.internal.SdkFilterInputStream

Used to capture the input stream throughput metrics, but excluding the SdkFilterInputStream.read() API.

Note this class is only relevant when metric is enabled. Otherwise it should not even be involved in the call stack to minimize runtime overhead.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
MetricFilterInputStream(ThroughputMetricType type, InputStream in)
           
 
Method Summary
 void close()
           
 boolean isMetricActivated()
           
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class com.amazonaws.internal.SdkFilterInputStream
abort, abortIfNeeded, available, mark, markSupported, read, reset, skip
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetricFilterInputStream

public MetricFilterInputStream(ThroughputMetricType type,
                               InputStream in)
Method Detail

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class com.amazonaws.internal.SdkFilterInputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class com.amazonaws.internal.SdkFilterInputStream
Throws:
IOException

isMetricActivated

public final boolean isMetricActivated()
Specified by:
isMetricActivated in interface com.amazonaws.internal.MetricAware
Overrides:
isMetricActivated in class com.amazonaws.internal.SdkFilterInputStream


Copyright © 2016. All rights reserved.