storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [1/3] storm git commit: STORM-2277: Support given for storm-druid connector shaded jar and added debug logs to DruidBolt
Date Tue, 10 Jan 2017 00:49:44 GMT
Repository: storm
Updated Branches:
  refs/heads/1.x-branch e4df16aa5 -> ad5f52000


STORM-2277: Support given for storm-druid connector shaded jar and added debug logs to DruidBolt


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/be50b098
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/be50b098
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/be50b098

Branch: refs/heads/1.x-branch
Commit: be50b09825954b516c60ed90d17f7c09e486fe9c
Parents: e4df16a
Author: Manikumar Reddy O <manikumar.reddy@gmail.com>
Authored: Thu Jan 5 17:26:44 2017 +0530
Committer: Manikumar Reddy O <manikumar.reddy@gmail.com>
Committed: Mon Jan 9 12:52:21 2017 +0530

----------------------------------------------------------------------
 external/storm-druid/README.md                  |  4 ++
 external/storm-druid/pom.xml                    | 60 ++++++++++++++++++--
 .../apache/storm/druid/bolt/DruidBeamBolt.java  | 10 +++-
 3 files changed, 67 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/be50b098/external/storm-druid/README.md
----------------------------------------------------------------------
diff --git a/external/storm-druid/README.md b/external/storm-druid/README.md
index 75434f7..de7f44c 100644
--- a/external/storm-druid/README.md
+++ b/external/storm-druid/README.md
@@ -118,6 +118,10 @@ public class SampleDruidBeamFactoryImpl implements DruidBeamFactory<Map<String,
 
 Example code is available [here.](https://github.com/apache/storm/tree/master/external/storm-druid/src/test/java/org/apache/storm/druid)
 
+This version is built to work with Druid 0.8.x. This connector uses the Tranquility module
built for Scala 2.11.
+This provides a shaded jar with all Tranquility dependencies. You should include Scala 2.11
dependency in your
+application.
+
 ## License
 
 Licensed to the Apache Software Foundation (ASF) under one

http://git-wip-us.apache.org/repos/asf/storm/blob/be50b098/external/storm-druid/pom.xml
----------------------------------------------------------------------
diff --git a/external/storm-druid/pom.xml b/external/storm-druid/pom.xml
index 0872c2f..ba20283 100644
--- a/external/storm-druid/pom.xml
+++ b/external/storm-druid/pom.xml
@@ -40,16 +40,26 @@
             <groupId>io.druid</groupId>
             <artifactId>tranquility-core_2.11</artifactId>
             <version>0.8.2</version>
-        </dependency>
-        <dependency>
-            <groupId>io.druid</groupId>
-            <artifactId>druid-server</artifactId>
-            <version>0.9.1</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.sun.jersey</groupId>
+                    <artifactId>jersey-server</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.sun.jersey</groupId>
+                    <artifactId>jersey-core</artifactId>
+                </exclusion>
+                <exclusion>
+                  <groupId>mysql</groupId>
+                  <artifactId>mysql-connector-java</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.scala-lang</groupId>
             <artifactId>scala-library</artifactId>
             <version>2.11.8</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>com.twitter</groupId>
@@ -80,4 +90,44 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <filters>
+                                <filter>
+                                    <artifact>*:*</artifact>
+                                    <excludes>
+                                        <exclude>META-INF/*.SF</exclude>
+                                        <exclude>META-INF/*.DSA</exclude>
+                                        <exclude>META-INF/*.RSA</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                            <relocations>
+                                <relocation>
+                                    <pattern>com.fasterxml.jackson</pattern>
+                                    <shadedPattern>org.apache.storm.druid.bolt.com.fasterxml.jackson</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.jboss.netty</pattern>
+                                    <shadedPattern>org.apache.storm.druid.bolt.org.jboss.netty</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <createDependencyReducedPom>true</createDependencyReducedPom>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/storm/blob/be50b098/external/storm-druid/src/main/java/org/apache/storm/druid/bolt/DruidBeamBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-druid/src/main/java/org/apache/storm/druid/bolt/DruidBeamBolt.java
b/external/storm-druid/src/main/java/org/apache/storm/druid/bolt/DruidBeamBolt.java
index 822b92c..cd87aff 100644
--- a/external/storm-druid/src/main/java/org/apache/storm/druid/bolt/DruidBeamBolt.java
+++ b/external/storm-druid/src/main/java/org/apache/storm/druid/bolt/DruidBeamBolt.java
@@ -48,6 +48,7 @@ import java.util.Map;
  *
  */
 public class DruidBeamBolt<E> extends BaseRichBolt {
+    private static final Logger LOG = LoggerFactory.getLogger(DruidBeamBolt.class);
 
     private volatile  OutputCollector collector;
     private DruidBeamFactory<E> beamFactory = null;
@@ -76,22 +77,27 @@ public class DruidBeamBolt<E> extends BaseRichBolt {
     @Override
     public void execute(final Tuple tuple) {
       Future future = tranquilizer.send((druidEventMapper.getEvent(tuple)));
-      future.addEventListener(new FutureEventListener() {
+        LOG.debug("Sent tuple : [{}]" , tuple);
+
+        future.addEventListener(new FutureEventListener() {
           @Override
           public void onFailure(Throwable cause) {
               if (cause instanceof MessageDroppedException) {
                   collector.ack(tuple);
+                  LOG.debug("Tuple Dropped due to MessageDroppedException : [{}]" , tuple);
                   if (druidConfig.getDiscardStreamId() != null)
                       collector.emit(druidConfig.getDiscardStreamId(), new Values(tuple,
System.currentTimeMillis()));
               }
               else {
                   collector.fail(tuple);
+                  LOG.debug("Tuple Processing Failed : [{}]" , tuple);
               }
           }
 
           @Override
           public void onSuccess(Object value) {
-                  collector.ack(tuple);
+              collector.ack(tuple);
+              LOG.debug("Tuple Processing Success : [{}]" , tuple);
           }
       });
 


Mime
View raw message