From c15f18c34358154e58e1a5931958a3d94ed2e379 Mon Sep 17 00:00:00 2001 From: Dhruv Parthasarathy Date: Thu, 27 Jun 2013 19:03:25 -0700 Subject: [PATCH] removed NoopRunnable --- .../com/metamx/druid/guava/Runnables.java | 6 ++++ .../examples/webStream/NoopRunnable.java | 28 ------------------- .../webStream/WebFirehoseFactory.java | 3 +- 3 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 examples/src/main/java/druid/examples/webStream/NoopRunnable.java diff --git a/common/src/main/java/com/metamx/druid/guava/Runnables.java b/common/src/main/java/com/metamx/druid/guava/Runnables.java index 8c41886d349..118d4938a9d 100644 --- a/common/src/main/java/com/metamx/druid/guava/Runnables.java +++ b/common/src/main/java/com/metamx/druid/guava/Runnables.java @@ -34,4 +34,10 @@ public class Runnables } }; } + + public static Runnable getNoopRunnable(){ + return new Runnable(){ + public void run(){} + }; + } } diff --git a/examples/src/main/java/druid/examples/webStream/NoopRunnable.java b/examples/src/main/java/druid/examples/webStream/NoopRunnable.java deleted file mode 100644 index 6ccd4ba1584..00000000000 --- a/examples/src/main/java/druid/examples/webStream/NoopRunnable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Druid - a distributed column store. - * Copyright (C) 2012 Metamarkets Group Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package druid.examples.webStream; - -public class NoopRunnable implements Runnable -{ - @Override - public void run() - { - } -} diff --git a/examples/src/main/java/druid/examples/webStream/WebFirehoseFactory.java b/examples/src/main/java/druid/examples/webStream/WebFirehoseFactory.java index 949e948176d..8cad52403b5 100644 --- a/examples/src/main/java/druid/examples/webStream/WebFirehoseFactory.java +++ b/examples/src/main/java/druid/examples/webStream/WebFirehoseFactory.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.google.common.base.Throwables; import com.google.common.collect.Maps; import com.metamx.common.parsers.TimestampParser; +import com.metamx.druid.guava.Runnables; import com.metamx.druid.input.InputRow; import com.metamx.druid.input.MapBasedInputRow; import com.metamx.druid.jackson.DefaultObjectMapper; @@ -77,7 +78,7 @@ public class WebFirehoseFactory implements FirehoseFactory return new Firehose() { - private final Runnable doNothingRunnable = new NoopRunnable(); + private final Runnable doNothingRunnable = Runnables.getNoopRunnable(); @Override public boolean hasMore()