gianm closed pull request #6391: Move wikipedia irc firehose and dependencies 
to examples
URL: https://github.com/apache/incubator-druid/pull/6391
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 @@
             <artifactId>commons-validator</artifactId>
             <version>1.4.0</version>
         </dependency>
+        <dependency>
+            <groupId>com.ircclouds.irc</groupId>
+            <artifactId>irc-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.maxmind.geoip2</groupId>
+            <artifactId>geoip2</artifactId>
+        </dependency>
 
         <!-- For tests! -->
         <dependency>
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.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 @@
     return Collections.<Module>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 InputRow nextRow()
       @Override
       public Runnable commit()
       {
-        return new Runnable()
-        {
-          @Override
-          public void run()
-          {
-            // nothing to see here
-          }
+        return () -> {
+          // 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 @@
             <groupId>org.eclipse.jetty</groupId>
             <artifactId>jetty-servlets</artifactId>
         </dependency>
-        <dependency>
-            <groupId>com.ircclouds.irc</groupId>
-            <artifactId>irc-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.maxmind.geoip2</groupId>
-            <artifactId>geoip2</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derby</artifactId>
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.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 void configure(Binder binder)
             .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<? extends Module> getJacksonModules()
-  {
-    return Collections.<Module>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.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 static Injector makeInjectorWithModules(final 
Injector baseInjector, Iter
         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.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 void run()
                 new FirehoseModule(),
                 new IndexingHadoopModule(),
                 new IndexingServiceFirehoseModule(),
-                new LocalDataStorageDruidModule(),
-                new ParsersModule()
+                new LocalDataStorageDruidModule()
             )
         )
     );


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to