From 12e00539329b6c43bd86a3ebf24debbfee4ac5ad Mon Sep 17 00:00:00 2001 From: Rajat Khandelwal Date: Thu, 9 May 2019 21:14:37 +0100 Subject: [PATCH] HADOOP-16278. With S3A Filesystem, Long Running services End up Doing lot of GC and eventually die. Contributed by Rajat Khandelwal (cherry picked from commit 591ca698230f25217c10c7549aff8097baa11f1e) --- .../org/apache/hadoop/fs/s3a/S3AInstrumentation.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInstrumentation.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInstrumentation.java index 44e9e88b2b1..9ab18406717 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInstrumentation.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInstrumentation.java @@ -120,7 +120,8 @@ public class S3AInstrumentation implements Closeable, MetricsSource { private final MutableCounterLong streamBytesReadInClose; private final MutableCounterLong streamBytesDiscardedInAbort; private final MutableCounterLong ignoredErrors; - + private final MutableQuantiles putLatencyQuantile; + private final MutableQuantiles throttleRateQuantile; private final MutableCounterLong numberOfFilesCreated; private final MutableCounterLong numberOfFilesCopied; private final MutableCounterLong bytesOfFilesCopied; @@ -236,9 +237,9 @@ public class S3AInstrumentation implements Closeable, MetricsSource { } //todo need a config for the quantiles interval? int interval = 1; - quantiles(S3GUARD_METADATASTORE_PUT_PATH_LATENCY, + putLatencyQuantile = quantiles(S3GUARD_METADATASTORE_PUT_PATH_LATENCY, "ops", "latency", interval); - quantiles(S3GUARD_METADATASTORE_THROTTLE_RATE, + throttleRateQuantile = quantiles(S3GUARD_METADATASTORE_THROTTLE_RATE, "events", "frequency (Hz)", interval); registerAsMetricsSource(name); @@ -603,6 +604,8 @@ public class S3AInstrumentation implements Closeable, MetricsSource { public void close() { synchronized (metricsSystemLock) { + putLatencyQuantile.stop(); + throttleRateQuantile.stop(); metricsSystem.unregisterSource(metricsSourceName); int activeSources = --metricsSourceActiveCounter; if (activeSources == 0) {