aboutsummaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-04-23 14:35:44 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2019-04-23 14:35:44 +0200
commit8bdf825e164469f4a3f22a2d6e92e799c02b9f6e (patch)
treefe8a036cbb8a6e8f355e814297d791d3d2401448 /vespaclient-container-plugin
parentfc7f77270eaca41d85d7d2499b5ff10f6afaa68e (diff)
Move the NullFeedMetric too where it is used.
Diffstat (limited to 'vespaclient-container-plugin')
-rw-r--r--vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/FeedTesterV3.java1
-rw-r--r--vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/NullFeedMetric.java35
2 files changed, 35 insertions, 1 deletions
diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/FeedTesterV3.java b/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/FeedTesterV3.java
index 3c758114ecf..fd9655fb838 100644
--- a/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/FeedTesterV3.java
+++ b/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/FeedTesterV3.java
@@ -11,7 +11,6 @@ import com.yahoo.document.DocumentTypeManager;
import com.yahoo.document.config.DocumentmanagerConfig;
import com.yahoo.documentapi.messagebus.protocol.PutDocumentMessage;
import com.yahoo.documentapi.metrics.DocumentApiMetrics;
-import com.yahoo.feedhandler.NullFeedMetric;
import com.yahoo.jdisc.ReferencedResource;
import com.yahoo.messagebus.SourceSessionParams;
import com.yahoo.messagebus.shared.SharedSourceSession;
diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/NullFeedMetric.java b/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/NullFeedMetric.java
new file mode 100644
index 00000000000..4777c6c7b99
--- /dev/null
+++ b/vespaclient-container-plugin/src/test/java/com/yahoo/feedhandler/v3/NullFeedMetric.java
@@ -0,0 +1,35 @@
+// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.feedhandler.v3;
+
+import com.yahoo.jdisc.Metric;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
+ * @since 5.1.20
+ */
+public final class NullFeedMetric implements Metric {
+
+ public NullFeedMetric(boolean flag) {
+ if (!flag) {
+ throw new IllegalArgumentException("must set flag allowing to throw away metrics");
+ }
+ }
+
+ @Override
+ public void set(String key, Number val, Context ctx) {
+ }
+
+ @Override
+ public void add(String key, Number val, Context ctx) {
+ }
+
+ @Override
+ public Context createContext(Map<String, ?> properties) {
+ return NullFeedContext.INSTANCE;
+ }
+
+ private static class NullFeedContext implements Context {
+ private static final NullFeedContext INSTANCE = new NullFeedContext();
+ }
+}