From fc1d5795c12a33e6228bfe3cdcefb8388a9a6d3e Mon Sep 17 00:00:00 2001 From: Clint Wylie Date: Wed, 26 Sep 2018 21:46:37 -0700 Subject: [PATCH] remove wikipedia irc firehose and dependencies from core server module to examples (#6391) --- examples/pom.xml | 8 +++ .../druid/examples/ExamplesDruidModule.java | 6 ++- .../druid/examples/wikipedia}/IrcDecoder.java | 2 +- .../wikipedia}/IrcFirehoseFactory.java | 11 ++-- .../wikipedia}/IrcInputRowParser.java | 2 +- .../wikipedia}/WikipediaIrcDecoder.java | 2 +- server/pom.xml | 8 --- .../apache/druid/guice/FirehoseModule.java | 2 - .../org/apache/druid/guice/ParsersModule.java | 51 ------------------- .../druid/initialization/Initialization.java | 2 - .../cli/validate/DruidJsonValidator.java | 4 +- 11 files changed, 20 insertions(+), 78 deletions(-) rename {server/src/main/java/org/apache/druid/segment/realtime/firehose => examples/src/main/java/org/apache/druid/examples/wikipedia}/IrcDecoder.java (96%) rename {server/src/main/java/org/apache/druid/segment/realtime/firehose => examples/src/main/java/org/apache/druid/examples/wikipedia}/IrcFirehoseFactory.java (97%) rename {server/src/main/java/org/apache/druid/segment/realtime/firehose => examples/src/main/java/org/apache/druid/examples/wikipedia}/IrcInputRowParser.java (98%) rename {server/src/main/java/org/apache/druid/segment/realtime/firehose => examples/src/main/java/org/apache/druid/examples/wikipedia}/WikipediaIrcDecoder.java (99%) delete mode 100644 server/src/main/java/org/apache/druid/guice/ParsersModule.java diff --git a/examples/pom.xml b/examples/pom.xml index 0f4e915dd45..d85db499144 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -66,6 +66,14 @@ commons-validator 1.4.0 + + com.ircclouds.irc + irc-api + + + com.maxmind.geoip2 + geoip2 + diff --git a/examples/src/main/java/org/apache/druid/examples/ExamplesDruidModule.java b/examples/src/main/java/org/apache/druid/examples/ExamplesDruidModule.java index c9321b86b90..8bf13d0cf9c 100644 --- a/examples/src/main/java/org/apache/druid/examples/ExamplesDruidModule.java +++ b/examples/src/main/java/org/apache/druid/examples/ExamplesDruidModule.java @@ -24,6 +24,8 @@ import com.fasterxml.jackson.databind.jsontype.NamedType; import com.fasterxml.jackson.databind.module.SimpleModule; import com.google.inject.Binder; import org.apache.druid.examples.twitter.TwitterSpritzerFirehoseFactory; +import org.apache.druid.examples.wikipedia.IrcFirehoseFactory; +import org.apache.druid.examples.wikipedia.IrcInputRowParser; import org.apache.druid.initialization.DruidModule; import java.util.Collections; @@ -39,7 +41,9 @@ public class ExamplesDruidModule implements DruidModule return Collections.singletonList( new SimpleModule("ExamplesModule") .registerSubtypes( - new NamedType(TwitterSpritzerFirehoseFactory.class, "twitzer") + new NamedType(TwitterSpritzerFirehoseFactory.class, "twitzer"), + new NamedType(IrcFirehoseFactory.class, "irc"), + new NamedType(IrcInputRowParser.class, "irc") ) ); } diff --git a/server/src/main/java/org/apache/druid/segment/realtime/firehose/IrcDecoder.java b/examples/src/main/java/org/apache/druid/examples/wikipedia/IrcDecoder.java similarity index 96% rename from server/src/main/java/org/apache/druid/segment/realtime/firehose/IrcDecoder.java rename to examples/src/main/java/org/apache/druid/examples/wikipedia/IrcDecoder.java index 59a8ddea058..e4adb1c1f42 100644 --- a/server/src/main/java/org/apache/druid/segment/realtime/firehose/IrcDecoder.java +++ b/examples/src/main/java/org/apache/druid/examples/wikipedia/IrcDecoder.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.druid.segment.realtime.firehose; +package org.apache.druid.examples.wikipedia; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/server/src/main/java/org/apache/druid/segment/realtime/firehose/IrcFirehoseFactory.java b/examples/src/main/java/org/apache/druid/examples/wikipedia/IrcFirehoseFactory.java similarity index 97% rename from server/src/main/java/org/apache/druid/segment/realtime/firehose/IrcFirehoseFactory.java rename to examples/src/main/java/org/apache/druid/examples/wikipedia/IrcFirehoseFactory.java index 87211b6fff4..ab3f8069a46 100644 --- a/server/src/main/java/org/apache/druid/segment/realtime/firehose/IrcFirehoseFactory.java +++ b/examples/src/main/java/org/apache/druid/examples/wikipedia/IrcFirehoseFactory.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.druid.segment.realtime.firehose; +package org.apache.druid.examples.wikipedia; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -234,13 +234,8 @@ public class IrcFirehoseFactory implements FirehoseFactory { + // nothing to see here }; } diff --git a/server/src/main/java/org/apache/druid/segment/realtime/firehose/IrcInputRowParser.java b/examples/src/main/java/org/apache/druid/examples/wikipedia/IrcInputRowParser.java similarity index 98% rename from server/src/main/java/org/apache/druid/segment/realtime/firehose/IrcInputRowParser.java rename to examples/src/main/java/org/apache/druid/examples/wikipedia/IrcInputRowParser.java index c8490197d70..b4a9fbbdd1d 100644 --- a/server/src/main/java/org/apache/druid/segment/realtime/firehose/IrcInputRowParser.java +++ b/examples/src/main/java/org/apache/druid/examples/wikipedia/IrcInputRowParser.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.druid.segment.realtime.firehose; +package org.apache.druid.examples.wikipedia; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/server/src/main/java/org/apache/druid/segment/realtime/firehose/WikipediaIrcDecoder.java b/examples/src/main/java/org/apache/druid/examples/wikipedia/WikipediaIrcDecoder.java similarity index 99% rename from server/src/main/java/org/apache/druid/segment/realtime/firehose/WikipediaIrcDecoder.java rename to examples/src/main/java/org/apache/druid/examples/wikipedia/WikipediaIrcDecoder.java index 983a17ec8f2..af792c7058b 100644 --- a/server/src/main/java/org/apache/druid/segment/realtime/firehose/WikipediaIrcDecoder.java +++ b/examples/src/main/java/org/apache/druid/examples/wikipedia/WikipediaIrcDecoder.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.druid.segment.realtime.firehose; +package org.apache.druid.examples.wikipedia; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/server/pom.xml b/server/pom.xml index 7935ed8ff02..54be740704e 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -159,14 +159,6 @@ org.eclipse.jetty jetty-servlets - - com.ircclouds.irc - irc-api - - - com.maxmind.geoip2 - geoip2 - org.apache.derby derby diff --git a/server/src/main/java/org/apache/druid/guice/FirehoseModule.java b/server/src/main/java/org/apache/druid/guice/FirehoseModule.java index 91698d3fe26..171594908bb 100644 --- a/server/src/main/java/org/apache/druid/guice/FirehoseModule.java +++ b/server/src/main/java/org/apache/druid/guice/FirehoseModule.java @@ -29,7 +29,6 @@ import org.apache.druid.segment.realtime.firehose.CombiningFirehoseFactory; import org.apache.druid.segment.realtime.firehose.EventReceiverFirehoseFactory; import org.apache.druid.segment.realtime.firehose.FixedCountFirehoseFactory; import org.apache.druid.segment.realtime.firehose.HttpFirehoseFactory; -import org.apache.druid.segment.realtime.firehose.IrcFirehoseFactory; import org.apache.druid.segment.realtime.firehose.LocalFirehoseFactory; import org.apache.druid.segment.realtime.firehose.SqlFirehoseFactory; import org.apache.druid.segment.realtime.firehose.TimedShutoffFirehoseFactory; @@ -54,7 +53,6 @@ public class FirehoseModule implements DruidModule .registerSubtypes( new NamedType(ClippedFirehoseFactory.class, "clipped"), new NamedType(TimedShutoffFirehoseFactory.class, "timed"), - new NamedType(IrcFirehoseFactory.class, "irc"), new NamedType(LocalFirehoseFactory.class, "local"), new NamedType(HttpFirehoseFactory.class, "http"), new NamedType(EventReceiverFirehoseFactory.class, "receiver"), diff --git a/server/src/main/java/org/apache/druid/guice/ParsersModule.java b/server/src/main/java/org/apache/druid/guice/ParsersModule.java deleted file mode 100644 index 421a9a13368..00000000000 --- a/server/src/main/java/org/apache/druid/guice/ParsersModule.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.guice; - -import com.fasterxml.jackson.databind.Module; -import com.fasterxml.jackson.databind.jsontype.NamedType; -import com.fasterxml.jackson.databind.module.SimpleModule; -import com.google.inject.Binder; -import org.apache.druid.initialization.DruidModule; -import org.apache.druid.segment.realtime.firehose.IrcInputRowParser; - -import java.util.Collections; -import java.util.List; - -/** - */ -public class ParsersModule implements DruidModule -{ - @Override - public void configure(Binder binder) - { - } - - @Override - public List getJacksonModules() - { - return Collections.singletonList( - new SimpleModule("ParsersModule") - .registerSubtypes( - new NamedType(IrcInputRowParser.class, "irc") - ) - ); - } -} diff --git a/server/src/main/java/org/apache/druid/initialization/Initialization.java b/server/src/main/java/org/apache/druid/initialization/Initialization.java index e8f025c1812..5ab04ea1bf0 100644 --- a/server/src/main/java/org/apache/druid/initialization/Initialization.java +++ b/server/src/main/java/org/apache/druid/initialization/Initialization.java @@ -47,7 +47,6 @@ import org.apache.druid.guice.LifecycleModule; import org.apache.druid.guice.LocalDataStorageDruidModule; import org.apache.druid.guice.MetadataConfigModule; import org.apache.druid.guice.ModulesConfig; -import org.apache.druid.guice.ParsersModule; import org.apache.druid.guice.ServerModule; import org.apache.druid.guice.ServerViewModule; import org.apache.druid.guice.StartupLoggingModule; @@ -394,7 +393,6 @@ public class Initialization new CoordinatorDiscoveryModule(), new LocalDataStorageDruidModule(), new FirehoseModule(), - new ParsersModule(), new JavaScriptModule(), new AuthenticatorModule(), new AuthenticatorMapperModule(), diff --git a/services/src/main/java/org/apache/druid/cli/validate/DruidJsonValidator.java b/services/src/main/java/org/apache/druid/cli/validate/DruidJsonValidator.java index dac7a711f5e..8101b33cdfa 100644 --- a/services/src/main/java/org/apache/druid/cli/validate/DruidJsonValidator.java +++ b/services/src/main/java/org/apache/druid/cli/validate/DruidJsonValidator.java @@ -41,7 +41,6 @@ import org.apache.druid.guice.ExtensionsConfig; import org.apache.druid.guice.FirehoseModule; import org.apache.druid.guice.IndexingServiceFirehoseModule; import org.apache.druid.guice.LocalDataStorageDruidModule; -import org.apache.druid.guice.ParsersModule; import org.apache.druid.guice.QueryRunnerFactoryModule; import org.apache.druid.guice.QueryableModule; import org.apache.druid.indexer.HadoopDruidIndexerConfig; @@ -130,8 +129,7 @@ public class DruidJsonValidator extends GuiceRunnable new FirehoseModule(), new IndexingHadoopModule(), new IndexingServiceFirehoseModule(), - new LocalDataStorageDruidModule(), - new ParsersModule() + new LocalDataStorageDruidModule() ) ) );