You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/08/18 21:42:04 UTC

[01/50] git commit: STORM-87 code change accorrding to comments 1. log level change to error 2. use exit instead of halt to terminate jvm

Repository: incubator-storm
Updated Branches:
  refs/heads/security a55d79220 -> 7a06ef722


STORM-87 code change accorrding to comments
1. log level change to error
2. use exit instead of halt to terminate jvm


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

Branch: refs/heads/security
Commit: cea872d4e9317601eed60f7fa0a9a831446f41be
Parents: b1ccc15
Author: Kang Xiao <kx...@gmail.com>
Authored: Sun Jul 20 00:40:15 2014 +0800
Committer: Kang Xiao <kx...@gmail.com>
Committed: Sun Jul 20 00:40:15 2014 +0800

----------------------------------------------------------------------
 storm-core/src/jvm/backtype/storm/task/ShellBolt.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/cea872d4/storm-core/src/jvm/backtype/storm/task/ShellBolt.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/task/ShellBolt.java b/storm-core/src/jvm/backtype/storm/task/ShellBolt.java
index f34d465..17938dc 100644
--- a/storm-core/src/jvm/backtype/storm/task/ShellBolt.java
+++ b/storm-core/src/jvm/backtype/storm/task/ShellBolt.java
@@ -241,8 +241,8 @@ public class ShellBolt implements IBolt {
 
     private void die(Throwable exception) {
         _exception = exception;
-        LOG.info("Halting process: ShellBolt died.", exception);
+        LOG.error("Halting process: ShellBolt died.", exception);
         _collector.reportError(exception);
-        Runtime.getRuntime().halt(11);
+        System.exit(11);
     }
 }


[11/50] git commit: Merge remote-tracking branch 'community/master' into STORM-417

Posted by bo...@apache.org.
Merge remote-tracking branch 'community/master' into STORM-417


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

Branch: refs/heads/security
Commit: 4ee369ca691436863d9afc83d0a9c21eee234e95
Parents: 9f53bdc a6bf4c3
Author: Kyle Nusbaum <kn...@yahoo-inc.com>
Authored: Fri Jul 25 21:50:26 2014 +0000
Committer: Kyle Nusbaum <kn...@yahoo-inc.com>
Committed: Fri Jul 25 21:50:26 2014 +0000

----------------------------------------------------------------------
 CHANGELOG.md                                    |   7 +
 README.markdown                                 |   4 +
 dev-tools/github/__init__.py                    | 109 +++++++++
 dev-tools/jira-github-join.py                   |  80 +++++++
 dev-tools/jira/__init__.py                      | 232 +++++++++++++++++++
 examples/storm-starter/README.markdown          |   3 +
 .../storm-starter/multilang/resources/storm.py  |   2 +-
 .../src/jvm/storm/kafka/KafkaConfig.java        |   2 +-
 .../src/clj/backtype/storm/daemon/executor.clj  |   4 +-
 .../clj/backtype/storm/daemon/supervisor.clj    |  26 ++-
 storm-core/src/clj/backtype/storm/util.clj      |   2 +
 .../storm/multilang/JsonSerializer.java         |   7 +-
 .../jvm/backtype/storm/multilang/ShellMsg.java  |  26 +++
 .../src/jvm/backtype/storm/spout/ISpout.java    |   2 +-
 .../jvm/backtype/storm/spout/ShellSpout.java    |  30 ++-
 .../src/jvm/backtype/storm/task/ShellBolt.java  |  32 ++-
 .../jvm/backtype/storm/utils/ShellProcess.java  |   2 +-
 storm-core/src/multilang/py/storm.py            |  19 +-
 storm-core/src/multilang/rb/storm.rb            |  24 +-
 .../test/clj/backtype/storm/cluster_test.clj    |   3 +-
 .../test/clj/backtype/storm/supervisor_test.clj |  65 +++++-
 21 files changed, 652 insertions(+), 29 deletions(-)
----------------------------------------------------------------------



[47/50] git commit: updated the pom.xml in storm-hdfs to be the correct version for STORM-451

Posted by bo...@apache.org.
updated the pom.xml in storm-hdfs to be the correct version for
STORM-451


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

Branch: refs/heads/security
Commit: 7071fba98caf453db5505b4287f3ebc343a56b54
Parents: 9968b8b
Author: Naresh Kosgi <Na...@gmail.com>
Authored: Tue Aug 12 13:46:54 2014 -0400
Committer: Naresh Kosgi <Na...@gmail.com>
Committed: Tue Aug 12 13:46:54 2014 -0400

----------------------------------------------------------------------
 external/storm-hdfs/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/7071fba9/external/storm-hdfs/pom.xml
----------------------------------------------------------------------
diff --git a/external/storm-hdfs/pom.xml b/external/storm-hdfs/pom.xml
index 6dcd1e8..2aadac0 100644
--- a/external/storm-hdfs/pom.xml
+++ b/external/storm-hdfs/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>storm</artifactId>
         <groupId>org.apache.storm</groupId>
-        <version>0.9.2-incubating-SNAPSHOT</version>
+        <version>0.9.3-incubating-SNAPSHOT</version>
         <relativePath>../../pom.xml</relativePath>
     </parent>
 


[32/50] git commit: Merge branch 'STORM-87' of https://github.com/xiaokang/incubator-storm into STORM-87

Posted by bo...@apache.org.
Merge branch 'STORM-87' of https://github.com/xiaokang/incubator-storm into STORM-87

STORM-87: fail fast on ShellBolt exception


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

Branch: refs/heads/security
Commit: aff8d651ee32bec8f39baf32f2ff15595e3e0106
Parents: b1c5e7e b60feb7
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Thu Aug 7 11:26:25 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Thu Aug 7 11:26:25 2014 -0500

----------------------------------------------------------------------
 storm-core/src/clj/backtype/storm/util.clj            | 2 +-
 storm-core/src/jvm/backtype/storm/task/ShellBolt.java | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



[39/50] git commit: update changelog for STORM-211

Posted by bo...@apache.org.
update changelog for STORM-211


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

Branch: refs/heads/security
Commit: 50c69fe1bda351b96f204b6705cabf590c4067a7
Parents: 581a528
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Fri Aug 8 15:15:11 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri Aug 8 15:15:11 2014 -0400

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/50c69fe1/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e63e8c2..4a942a7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## 0.9.3-incubating
+ * STORM-211: Add module for HDFS integration
  * STORM-337: Expose managed spout ids publicly
  * STORM-320: Support STORM_CONF_DIR environment variable to support
  * STORM-360: Add node details for Error Topology and Component pages


[03/50] git commit: STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.

Posted by bo...@apache.org.
STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.


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

Branch: refs/heads/security
Commit: a26329c238f2bdcd1fd8fe41ac511a394f47c440
Parents: a277c88
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Wed Jul 16 10:58:29 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Tue Jul 22 11:14:05 2014 -0700

----------------------------------------------------------------------
 .../src/jvm/storm/kafka/bolt/KafkaBolt.java     | 23 ++++++----
 ...ameBasedTupleToKafkaKeyAndMessageMapper.java | 37 ++++++++++++++++
 .../mapper/TupleToKafkaKeyAndMessageMapper.java | 32 ++++++++++++++
 ...ameBasedTupleToKafkaKeyAndMessageMapper.java | 44 ++++++++++++++++++++
 .../TridentTupleToKafkaKeyAndMessageMapper.java | 28 +++++++++++++
 5 files changed, 157 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/a26329c2/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
index b9ea948..a397977 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
@@ -27,6 +27,8 @@ import kafka.producer.KeyedMessage;
 import kafka.producer.ProducerConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import storm.kafka.bolt.mapper.FieldNameBasedTupleToKafkaKeyAndMessageMapper;
+import storm.kafka.bolt.mapper.TupleToKafkaKeyAndMessageMapper;
 
 import java.util.Map;
 import java.util.Properties;
@@ -48,15 +50,23 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
     public static final String TOPIC = "topic";
     public static final String KAFKA_BROKER_PROPERTIES = "kafka.broker.properties";
 
-    public static final String BOLT_KEY = "key";
-    public static final String BOLT_MESSAGE = "message";
-
     private Producer<K, V> producer;
     private OutputCollector collector;
     private String topic;
+    private TupleToKafkaKeyAndMessageMapper<K,V> mapper;
+
+    public KafkaBolt<K,V> withTupleToKafkaKeyAndMessageMapper(TupleToKafkaKeyAndMessageMapper<K,V> mapper) {
+        this.mapper = mapper;
+        return this;
+    }
 
     @Override
     public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
+        //for backward compatibility.
+        if(mapper == null) {
+            this.mapper = new FieldNameBasedTupleToKafkaKeyAndMessageMapper<K,V>();
+        }
+
         Map configMap = (Map) stormConf.get(KAFKA_BROKER_PROPERTIES);
         Properties properties = new Properties();
         properties.putAll(configMap);
@@ -69,11 +79,10 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
     @Override
     public void execute(Tuple input) {
         K key = null;
-        if (input.contains(BOLT_KEY)) {
-            key = (K) input.getValueByField(BOLT_KEY);
-        }
-        V message = (V) input.getValueByField(BOLT_MESSAGE);
+        V message = null;
         try {
+            key = mapper.getKeyFromTuple(input);
+            message = mapper.getMessageFromTuple(input);
             producer.send(new KeyedMessage<K, V>(topic, key, message));
         } catch (Exception ex) {
             LOG.error("Could not send message with key '" + key + "' and value '" + message + "'", ex);

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/a26329c2/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java
new file mode 100644
index 0000000..76db3f7
--- /dev/null
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java
@@ -0,0 +1,37 @@
+/**
+ * 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 storm.kafka.bolt.mapper;
+
+import backtype.storm.tuple.Tuple;
+
+public class FieldNameBasedTupleToKafkaKeyAndMessageMapper<K,V> implements TupleToKafkaKeyAndMessageMapper {
+
+    public static final String BOLT_KEY = "key";
+    public static final String BOLT_MESSAGE = "message";
+
+    @Override
+    public K getKeyFromTuple(Tuple tuple) {
+        //for backward compatibility, we return null when key is not present.
+        return tuple.contains(BOLT_KEY) ? (K) tuple.getValueByField(BOLT_KEY) : null;
+    }
+
+    @Override
+    public V getMessageFromTuple(Tuple tuple) {
+        return (V) tuple.getValueByField(BOLT_MESSAGE);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/a26329c2/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/TupleToKafkaKeyAndMessageMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/TupleToKafkaKeyAndMessageMapper.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/TupleToKafkaKeyAndMessageMapper.java
new file mode 100644
index 0000000..2601051
--- /dev/null
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/TupleToKafkaKeyAndMessageMapper.java
@@ -0,0 +1,32 @@
+/**
+ * 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 storm.kafka.bolt.mapper;
+
+import backtype.storm.tuple.Tuple;
+
+import java.io.Serializable;
+
+/**
+ * as the really verbose name suggests this interface mapps a storm tuple to kafka key and message.
+ * @param <K> type of key.
+ * @param <V> type of value.
+ */
+public interface TupleToKafkaKeyAndMessageMapper<K,V> extends Serializable {
+    K getKeyFromTuple(Tuple tuple);
+    V getMessageFromTuple(Tuple tuple);
+}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/a26329c2/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java b/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java
new file mode 100644
index 0000000..09b3618
--- /dev/null
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java
@@ -0,0 +1,44 @@
+/**
+ * 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 storm.kafka.trident.mapper;
+
+import backtype.storm.tuple.Tuple;
+import storm.trident.tuple.TridentTuple;
+
+import java.io.Serializable;
+
+public class FieldNameBasedTupleToKafkaKeyAndMessageMapper<K, V> implements TridentTupleToKafkaKeyAndMessageMapper {
+
+    public final String keyFieldName;
+    public final String msgFieldName;
+
+    public FieldNameBasedTupleToKafkaKeyAndMessageMapper(String keyFieldName, String msgFieldName) {
+        this.keyFieldName = keyFieldName;
+        this.msgFieldName = msgFieldName;
+    }
+
+    @Override
+    public K getKeyFromTuple(TridentTuple tuple) {
+        return (K) tuple.getValueByField(keyFieldName);
+    }
+
+    @Override
+    public V getMessageFromTuple(TridentTuple tuple) {
+        return (V) tuple.getValueByField(msgFieldName);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/a26329c2/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/TridentTupleToKafkaKeyAndMessageMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/TridentTupleToKafkaKeyAndMessageMapper.java b/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/TridentTupleToKafkaKeyAndMessageMapper.java
new file mode 100644
index 0000000..ad10839
--- /dev/null
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/TridentTupleToKafkaKeyAndMessageMapper.java
@@ -0,0 +1,28 @@
+/**
+ * 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 storm.kafka.trident.mapper;
+
+import backtype.storm.tuple.Tuple;
+import storm.trident.tuple.TridentTuple;
+
+import java.io.Serializable;
+
+public interface TridentTupleToKafkaKeyAndMessageMapper<K,V>  extends Serializable {
+    K getKeyFromTuple(TridentTuple tuple);
+    V getMessageFromTuple(TridentTuple tuple);
+}


[31/50] git commit: use log-error instead of log-message in exit-process!

Posted by bo...@apache.org.
use log-error instead of log-message in exit-process!


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

Branch: refs/heads/security
Commit: b60feb7407b77b0a70f00340d13c287324c53480
Parents: 1e3a2b8
Author: Kang Xiao <kx...@gmail.com>
Authored: Fri Aug 8 00:12:29 2014 +0800
Committer: Kang Xiao <kx...@gmail.com>
Committed: Fri Aug 8 00:12:29 2014 +0800

----------------------------------------------------------------------
 storm-core/src/clj/backtype/storm/util.clj | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/b60feb74/storm-core/src/clj/backtype/storm/util.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/util.clj b/storm-core/src/clj/backtype/storm/util.clj
index 3df25b7..7bd4991 100644
--- a/storm-core/src/clj/backtype/storm/util.clj
+++ b/storm-core/src/clj/backtype/storm/util.clj
@@ -316,7 +316,7 @@
 
 (defn exit-process!
   [val & msg]
-  (log-message "Halting process: " msg)
+  (log-error (RuntimeException. msg) "Halting process: " msg)
   (.exit (Runtime/getRuntime) val))
 
 (defn sum


[37/50] git commit: Added STORM-396 to changelog

Posted by bo...@apache.org.
Added STORM-396 to changelog


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

Branch: refs/heads/security
Commit: 675edb486eb2f469aa66a4fa390ccf2447359385
Parents: 832600e
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Thu Aug 7 15:56:27 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Thu Aug 7 15:56:27 2014 -0500

----------------------------------------------------------------------
 CHANGELOG.md    | 1 +
 README.markdown | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/675edb48/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e8b325c..e63e8c2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -39,6 +39,7 @@
  * STORM-239: Allow supervisor to operate in paths with spaces in them
  * STORM-87: fail fast on ShellBolt exception
  * STORM-417: Storm UI lost table sort style when tablesorter was updated
+ * STORM-396: Replace NullPointerException with IllegalArgumentExeption
 
 ## 0.9.2-incubating
  * STORM-66: send taskid on initial handshake

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/675edb48/README.markdown
----------------------------------------------------------------------
diff --git a/README.markdown b/README.markdown
index 39f4530..105e503 100644
--- a/README.markdown
+++ b/README.markdown
@@ -160,6 +160,7 @@ under the License.
 * averykhoo ([@averykhoo](https://github.com/averykhoo))
 * Curtis Allen ([@curtisallen](https://github.com/curtisallen))
 * Boris Aksenov ([@miofthena](https://github.com/miofthena))
+* Itai Frenkel ([@itaifrenkel](https://github.com/itaifrenkel))
 
 ## Acknowledgements
 


[22/50] git commit: Merge branch 'STORM-369' of https://github.com/shell0dh/incubator-storm into STORM-369

Posted by bo...@apache.org.
Merge branch 'STORM-369' of https://github.com/shell0dh/incubator-storm into STORM-369

STORM-369: topology summary page displays wrong order.


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

Branch: refs/heads/security
Commit: c410404a2af2a01a948a626a0023d14d62159578
Parents: d65c913 c897127
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Wed Jul 30 19:08:32 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Wed Jul 30 19:08:32 2014 -0500

----------------------------------------------------------------------
 storm-core/src/ui/public/templates/index-page-template.html    | 2 +-
 storm-core/src/ui/public/templates/topology-page-template.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/c410404a/storm-core/src/ui/public/templates/topology-page-template.html
----------------------------------------------------------------------


[02/50] git commit: STORM-279. cluster.xml doesn't take in STORM_LOG_DIR values.

Posted by bo...@apache.org.
STORM-279. cluster.xml doesn't take in STORM_LOG_DIR values.


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

Branch: refs/heads/security
Commit: 6e6aeb9a770df6d119e0db3273981f1d12c3aac7
Parents: 85c9cd5
Author: Sriharsha Chintalapani <ma...@harsha.io>
Authored: Sun Jul 20 13:32:52 2014 -0700
Committer: Sriharsha Chintalapani <ma...@harsha.io>
Committed: Sun Jul 20 13:32:52 2014 -0700

----------------------------------------------------------------------
 bin/storm                                               |  6 +++++-
 logback/cluster.xml                                     | 12 ++++++------
 storm-core/src/clj/backtype/storm/daemon/supervisor.clj |  2 ++
 storm-core/test/clj/backtype/storm/supervisor_test.clj  |  2 +-
 4 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/6e6aeb9a/bin/storm
----------------------------------------------------------------------
diff --git a/bin/storm b/bin/storm
index a4aadb1..b8478bf 100755
--- a/bin/storm
+++ b/bin/storm
@@ -163,9 +163,13 @@ def parse_args(string):
 
 def exec_storm_class(klass, jvmtype="-server", jvmopts=[], extrajars=[], args=[], fork=False):
     global CONFFILE
+    storm_log_dir = confvalue("storm.log.dir",[CLUSTER_CONF_DIR])
+    if(storm_log_dir == None or storm_log_dir == "nil"):
+        storm_log_dir = STORM_DIR+"/logs"
     all_args = [
         JAVA_CMD, jvmtype, get_config_opts(),
-        "-Dstorm.home=" + STORM_DIR, 
+        "-Dstorm.home=" + STORM_DIR,
+        "-Dstorm.log.dir=" + storm_log_dir, 
         "-Djava.library.path=" + confvalue("java.library.path", extrajars),
         "-Dstorm.conf.file=" + CONFFILE,
         "-cp", get_classpath(extrajars),

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/6e6aeb9a/logback/cluster.xml
----------------------------------------------------------------------
diff --git a/logback/cluster.xml b/logback/cluster.xml
index a761c12..c2def42 100644
--- a/logback/cluster.xml
+++ b/logback/cluster.xml
@@ -18,9 +18,9 @@
 
 <configuration scan="true" scanPeriod="60 seconds">
  <appender name="A1" class="ch.qos.logback.core.rolling.RollingFileAppender">
-    <file>${storm.home}/logs/${logfile.name}</file>
+    <file>${storm.log.dir}/${logfile.name}</file>
     <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
-      <fileNamePattern>${storm.home}/logs/${logfile.name}.%i</fileNamePattern>
+      <fileNamePattern>${storm.log.dir}/${logfile.name}.%i</fileNamePattern>
       <minIndex>1</minIndex>
       <maxIndex>9</maxIndex>
     </rollingPolicy>
@@ -35,9 +35,9 @@
  </appender>
 
  <appender name="ACCESS" class="ch.qos.logback.core.rolling.RollingFileAppender">
-    <file>${storm.home}/logs/access.log</file>
+    <file>${storm.log.dir}/access.log</file>
     <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
-      <fileNamePattern>${storm.home}/logs/access.log.%i</fileNamePattern>
+      <fileNamePattern>${storm.log.dir}/access.log.%i</fileNamePattern>
       <minIndex>1</minIndex>
       <maxIndex>9</maxIndex>
     </rollingPolicy>
@@ -52,9 +52,9 @@
   </appender>
 
   <appender name="METRICS" class="ch.qos.logback.core.rolling.RollingFileAppender">
-    <file>${storm.home}/logs/metrics.log</file>
+    <file>${storm.log.dir}/metrics.log</file>
     <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
-      <fileNamePattern>${storm.home}/logs/metrics.log.%i</fileNamePattern>
+      <fileNamePattern>${storm.log.dir}/logs/metrics.log.%i</fileNamePattern>
       <minIndex>1</minIndex>
       <maxIndex>9</maxIndex>
     </rollingPolicy>

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/6e6aeb9a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
index 7ba1c69..8adadf0 100644
--- a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
@@ -480,6 +480,7 @@
     :distributed [supervisor storm-id port worker-id]
     (let [conf (:conf supervisor)
           storm-home (System/getProperty "storm.home")
+          storm-log-dir (or (System/getProperty "storm.log.dir") (str storm-home "/logs"))
           stormroot (supervisor-stormdist-root conf storm-id)
           jlp (jlp stormroot conf)
           stormjar (supervisor-stormjar-path stormroot)
@@ -505,6 +506,7 @@
                     [(str "-Djava.library.path=" jlp)
                      (str "-Dlogfile.name=" logfilename)
                      (str "-Dstorm.home=" storm-home)
+                     (str "-Dstorm.log.dir=" storm-log-dir)
                      (str "-Dlogback.configurationFile=" storm-home "/logback/cluster.xml")
                      (str "-Dstorm.id=" storm-id)
                      (str "-Dworker.id=" worker-id)

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/6e6aeb9a/storm-core/test/clj/backtype/storm/supervisor_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/supervisor_test.clj b/storm-core/test/clj/backtype/storm/supervisor_test.clj
index eb69f11..b1b023d 100644
--- a/storm-core/test/clj/backtype/storm/supervisor_test.clj
+++ b/storm-core/test/clj/backtype/storm/supervisor_test.clj
@@ -254,6 +254,7 @@
                                ["-Djava.library.path="
                                 (str "-Dlogfile.name=worker-" mock-port ".log")
                                 "-Dstorm.home="
+                                "-Dstorm.log.dir=/logs"
                                 "-Dlogback.configurationFile=/logback/cluster.xml"
                                 (str "-Dstorm.id=" mock-storm-id)
                                 (str "-Dworker.id=" mock-worker-id)
@@ -351,4 +352,3 @@
 (deftest cleans-up-on-unassign
   ;; TODO just do reassign, and check that cleans up worker states after killing but doesn't get rid of downloaded code
   )
-


[05/50] git commit: STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages. Also added a topic selector interfac

Posted by bo...@apache.org.
STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.
Also added a topic selector interface so users can provide custom implmentation that can chose what topics a tuple should be forwarded to.


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

Branch: refs/heads/security
Commit: 6a38b52a51600c7cda561442f92a6195adce527e
Parents: 905969c
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Wed Jul 16 10:58:29 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Tue Jul 22 15:06:56 2014 -0700

----------------------------------------------------------------------
 external/storm-kafka/README.md | 99 +++++++++++++++++++++++++++++++++++++
 1 file changed, 99 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/6a38b52a/external/storm-kafka/README.md
----------------------------------------------------------------------
diff --git a/external/storm-kafka/README.md b/external/storm-kafka/README.md
index db0ccce..0db75d9 100644
--- a/external/storm-kafka/README.md
+++ b/external/storm-kafka/README.md
@@ -44,6 +44,105 @@ use Kafka 0.8.1.1 built against Scala 2.10, you would use the following dependen
 
 Note that the ZooKeeper and log4j dependencies are excluded to prevent version conflicts with Storm's dependencies.
 
+##Writing to Kafka as part of your topology
+You can create an instance of storm.kafka.bolt.KafkaBolt and attach it as a component to your topology or if you 
+are using trident you can use storm.kafka.trident.TridentState, storm.kafka.trident.TridentStateFactory and
+storm.kafka.trident.TridentKafkaUpdater.
+
+You need to provide implementation of following 2 interfaces
+
+###TupleToKafkaKeyAndMessageMapper and TridentTupleToKafkaKeyAndMessageMapper
+These interfaces have 2 methods defined:
+
+```java
+    K getKeyFromTuple(Tuple/TridentTuple tuple);
+    V getMessageFromTuple(Tuple/TridentTuple tuple);
+```
+
+as the name suggests these methods are called to map a tuple to kafka key and kafka message. If you just want one field
+as key and one field as value then you can use the provided FieldNameBasedTupleToKafkaKeyAndMessageMapper.java 
+implementation. In the KafkaBolt the implementation always looks for a field with field name "key" and "message" for 
+backward compatibility reasons. 
+In the TridentKafkaState you can specify what is the field name for key and message. These should be specified while
+constructing and instance of FieldNameBasedTupleToKafkaKeyAndMessageMapper.
+
+###KafkaTopicSelector and trident KafkaTopicSelector
+This interface has only one method
+```java
+public interface KafkaTopicSelector {
+    List<String> getTopics(Tuple/TridentTuple tuple);
+}
+```
+The implementation of this interface should return topics to which the tuple's key/message mapping needs to be published 
+You can return an empty list but null is not acceptable. If you have one static topic name then you can use 
+DefaultTopicSelector.java and set the name of the topic in the constructor.
+
+### Specifying kafka producer properties
+You can provide all the produce properties , see http://kafka.apache.org/07/configuration.html 
+section "Important configuration properties for the producer", in your storm topology config by setting the properties
+map with key kafka.broker.properties.
+
+###Putting it all together
+
+For the bolt :
+```java
+        TopologyBuilder builder = new TopologyBuilder();
+    
+        Fields fields = new Fields("key", "message");
+        FixedBatchSpout spout = new FixedBatchSpout(fields, 4,
+                    new Values("storm", "1"),
+                    new Values("trident", "1"),
+                    new Values("needs", "1"),
+                    new Values("javadoc", "1")
+        );
+        spout.setCycle(true);
+        builder.setSpout("spout", spout, 5);
+        KafkaBolt bolt = new KafkaBolt()
+                .withKafkaTopicSelector(new DefaultTopicSelector("test"))
+                .withTridentTupleToKafkaKeyAndMessageMapper(new FieldNameBasedTupleToKafkaKeyAndMessageMapper());
+        builder.setBolt("forwardToKafka", bolt, 8).shuffleGrouping("spout");
+        
+        Config conf = new Config();
+        //set producer properties.
+        Properties props = new Properties();
+        props.put("metadata.broker.list", "localhost:9092");
+        props.put("request.required.acks", "1");
+        props.put("serializer.class", "kafka.serializer.StringEncoder");
+        conf.put(TridentKafkaState.KAFKA_BROKER_PROPERTIES, props);
+        
+        StormSubmitter.submitTopology("kafkaboltTest", conf, builder.createTopology());
+```
+
+For Trident:
+
+```java
+        Fields fields = new Fields("word", "count");
+        FixedBatchSpout spout = new FixedBatchSpout(fields, 4,
+                new Values("storm", "1"),
+                new Values("trident", "1"),
+                new Values("needs", "1"),
+                new Values("javadoc", "1")
+        );
+        spout.setCycle(true);
+
+        TridentTopology topology = new TridentTopology();
+        Stream stream = topology.newStream("spout1", spout);
+
+        TridentKafkaStateFactory stateFactory = new TridentKafkaStateFactory()
+                .withKafkaTopicSelector(new DefaultTopicSelector("test"))
+                .withTridentTupleToKafkaKeyAndMessageMapper(new FieldNameBasedTupleToKafkaKeyAndMessageMapper("word", "count"));
+        stream.partitionPersist(stateFactory, fields, new TridentKafkaUpdater(), new Fields());
+
+        Config conf = new Config();
+        //set producer properties.
+        Properties props = new Properties();
+        props.put("metadata.broker.list", "localhost:9092");
+        props.put("request.required.acks", "1");
+        props.put("serializer.class", "kafka.serializer.StringEncoder");
+        conf.put(TridentKafkaState.KAFKA_BROKER_PROPERTIES, props);
+        StormSubmitter.submitTopology("kafkaTridentTest", conf, topology.build());
+```
+
 ## Committer Sponsors
 
  * P. Taylor Goetz ([ptgoetz@apache.org](mailto:ptgoetz@apache.org))


[21/50] git commit: STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages. Also added a topic selector interfac

Posted by bo...@apache.org.
STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.
Also added a topic selector interface so users can provide custom implmentation that can chose what topics a tuple should be forwarded to.


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

Branch: refs/heads/security
Commit: ec086ab31812fa9ec6f42dcbc61096c6935347f4
Parents: 188bdb8
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Wed Jul 16 10:58:29 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Wed Jul 30 13:53:00 2014 -0700

----------------------------------------------------------------------
 external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/ec086ab3/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
index 51cbfd0..b6c3de4 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
@@ -63,7 +63,7 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
     }
 
     public KafkaBolt<K,V> withTopicSelector(KafkaTopicSelector selector) {
-        this.topicSelector = topicSelector;
+        this.topicSelector = selector;
         return this;
     }
 


[10/50] git commit: Storm kafka spout: avoid doubly wrapped RuntimeException

Posted by bo...@apache.org.
Storm kafka spout: avoid doubly wrapped RuntimeException


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

Branch: refs/heads/security
Commit: e89413368caf86727228cfddf3e252ad8b411ddf
Parents: 974f0f3
Author: Stephen Elliott <st...@qubitdigital.com>
Authored: Fri Jul 25 12:04:53 2014 +0100
Committer: Stephen Elliott <st...@qubitdigital.com>
Committed: Fri Jul 25 12:04:53 2014 +0100

----------------------------------------------------------------------
 external/storm-kafka/src/jvm/storm/kafka/DynamicBrokersReader.java | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/e8941336/external/storm-kafka/src/jvm/storm/kafka/DynamicBrokersReader.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/DynamicBrokersReader.java b/external/storm-kafka/src/jvm/storm/kafka/DynamicBrokersReader.java
index 3fccdc7..247ce91 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/DynamicBrokersReader.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/DynamicBrokersReader.java
@@ -120,6 +120,8 @@ public class DynamicBrokersReader {
                 throw new RuntimeException("No leader found for partition " + partition);
             }
             return leader;
+        } catch (RuntimeException e) {
+            throw e;
         } catch (Exception e) {
             throw new RuntimeException(e);
         }


[14/50] git commit: Merge remote-tracking branch 'origin/master' into STORM-279-V2

Posted by bo...@apache.org.
Merge remote-tracking branch 'origin/master' into STORM-279-V2


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

Branch: refs/heads/security
Commit: 49c12f255fda2364d1d4d68dcbdd9f14dd718065
Parents: 6e6aeb9 b2a8a77
Author: Sriharsha Chintalapani <ma...@harsha.io>
Authored: Tue Jul 29 09:47:59 2014 -0700
Committer: Sriharsha Chintalapani <ma...@harsha.io>
Committed: Tue Jul 29 09:47:59 2014 -0700

----------------------------------------------------------------------
 CHANGELOG.md                                    |  13 ++
 LICENSE                                         |  28 +++
 README.markdown                                 |   7 +
 STORM-UI-REST-API.md                            |  23 +-
 conf/defaults.yaml                              |   3 +-
 dev-tools/github/__init__.py                    | 109 +++++++++
 dev-tools/jira-github-join.py                   |  80 +++++++
 dev-tools/jira/__init__.py                      | 232 +++++++++++++++++++
 examples/storm-starter/README.markdown          |   3 +
 .../storm-starter/multilang/resources/storm.py  |   2 +-
 .../src/jvm/storm/kafka/KafkaConfig.java        |   2 +-
 .../src/clj/backtype/storm/daemon/executor.clj  |   4 +-
 .../clj/backtype/storm/daemon/supervisor.clj    |  36 ++-
 storm-core/src/clj/backtype/storm/ui/core.clj   |   2 +-
 .../src/clj/backtype/storm/ui/helpers.clj       |   5 -
 storm-core/src/clj/backtype/storm/util.clj      |   2 +
 .../backtype/storm/messaging/netty/Client.java  |  13 +-
 .../storm/multilang/JsonSerializer.java         |   7 +-
 .../jvm/backtype/storm/multilang/ShellMsg.java  |  26 +++
 .../src/jvm/backtype/storm/spout/ISpout.java    |   2 +-
 .../jvm/backtype/storm/spout/ShellSpout.java    |  30 ++-
 .../src/jvm/backtype/storm/task/ShellBolt.java  |  32 ++-
 .../backtype/storm/task/TopologyContext.java    |   4 +
 .../jvm/backtype/storm/utils/ShellProcess.java  |   2 +-
 storm-core/src/multilang/py/storm.py            |  19 +-
 storm-core/src/multilang/rb/storm.rb            |  24 +-
 storm-core/src/ui/public/component.html         |   3 +-
 storm-core/src/ui/public/js/moment.min.js       |   6 +
 storm-core/src/ui/public/js/script.js           |   9 +
 .../test/clj/backtype/storm/cluster_test.clj    |   3 +-
 .../test/clj/backtype/storm/supervisor_test.clj |  86 +++++--
 31 files changed, 762 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/49c12f25/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/49c12f25/storm-core/test/clj/backtype/storm/supervisor_test.clj
----------------------------------------------------------------------


[29/50] git commit: STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages. Also added a topic selector interfac

Posted by bo...@apache.org.
STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.
Also added a topic selector interface so users can provide custom implmentation that can chose what topics a tuple should be forwarded to.


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

Branch: refs/heads/security
Commit: c361603d2bffea419cb989913099639b65004f22
Parents: ec086ab
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Wed Jul 16 10:58:29 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Wed Aug 6 10:08:02 2014 -0700

----------------------------------------------------------------------
 external/storm-kafka/README.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/c361603d/external/storm-kafka/README.md
----------------------------------------------------------------------
diff --git a/external/storm-kafka/README.md b/external/storm-kafka/README.md
index 85b2ec2..bdefecf 100644
--- a/external/storm-kafka/README.md
+++ b/external/storm-kafka/README.md
@@ -60,12 +60,12 @@ These interfaces have 2 methods defined:
 ```
 
 as the name suggests these methods are called to map a tuple to kafka key and kafka message. If you just want one field
-as key and one field as value then you can use the provided FieldNameBasedTupleToKafkaKeyAndMessageMapper.java 
+as key and one field as value then you can use the provided FieldNameBasedTupleToKafkaMapper.java 
 implementation. In the KafkaBolt, the implementation always looks for a field with field name "key" and "message" if you 
-use the default constructor to construct FieldNameBasedTupleToKafkaKeyAndMessageMapper for backward compatibility 
+use the default constructor to construct FieldNameBasedTupleToKafkaMapper for backward compatibility 
 reasons. Alternatively you could also specify a different key and message field by using the non default constructor.
 In the TridentKafkaState you must specify what is the field name for key and message as there is no default constructor.
-These should be specified while constructing and instance of FieldNameBasedTupleToKafkaKeyAndMessageMapper.
+These should be specified while constructing and instance of FieldNameBasedTupleToKafkaMapper.
 
 ###KafkaTopicSelector and trident KafkaTopicSelector
 This interface has only one method


[49/50] git commit: Merge branch 'master' into security-upemerge

Posted by bo...@apache.org.
Merge branch 'master' into security-upemerge

Conflicts:
	README.markdown
	storm-core/src/ui/public/templates/index-page-template.html
	storm-core/src/ui/public/templates/topology-page-template.html


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

Branch: refs/heads/security
Commit: d20c101fa73c413b8d9fe1065a0291125e18bc96
Parents: a55d792 7a58c2d
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Mon Aug 18 14:25:07 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Mon Aug 18 14:25:07 2014 -0500

----------------------------------------------------------------------
 CHANGELOG.md                                    |  12 +
 README.markdown                                 |   3 +
 bin/storm                                       |   6 +-
 external/storm-hdfs/README.md                   | 343 +++++++++++++++++++
 external/storm-hdfs/pom.xml                     |  68 ++++
 .../storm/hdfs/bolt/AbstractHdfsBolt.java       | 139 ++++++++
 .../org/apache/storm/hdfs/bolt/HdfsBolt.java    | 131 +++++++
 .../storm/hdfs/bolt/SequenceFileBolt.java       | 149 ++++++++
 .../hdfs/bolt/format/DefaultFileNameFormat.java |  86 +++++
 .../hdfs/bolt/format/DefaultSequenceFormat.java |  52 +++
 .../hdfs/bolt/format/DelimitedRecordFormat.java |  88 +++++
 .../storm/hdfs/bolt/format/FileNameFormat.java  |  42 +++
 .../storm/hdfs/bolt/format/RecordFormat.java    |  32 ++
 .../storm/hdfs/bolt/format/SequenceFormat.java  |  40 +++
 .../hdfs/bolt/rotation/FileRotationPolicy.java  |  51 +++
 .../bolt/rotation/FileSizeRotationPolicy.java   |  81 +++++
 .../hdfs/bolt/rotation/NoRotationPolicy.java    |  35 ++
 .../hdfs/bolt/rotation/TimedRotationPolicy.java |  55 +++
 .../storm/hdfs/bolt/sync/CountSyncPolicy.java   |  46 +++
 .../apache/storm/hdfs/bolt/sync/SyncPolicy.java |  46 +++
 .../hdfs/common/rotation/MoveFileAction.java    |  27 ++
 .../hdfs/common/rotation/RotationAction.java    |  12 +
 .../hdfs/common/security/HdfsSecurityUtil.java  |  48 +++
 .../apache/storm/hdfs/trident/HdfsState.java    | 317 +++++++++++++++++
 .../storm/hdfs/trident/HdfsStateFactory.java    |  29 ++
 .../apache/storm/hdfs/trident/HdfsUpdater.java  |  14 +
 .../trident/format/DefaultFileNameFormat.java   |  83 +++++
 .../trident/format/DefaultSequenceFormat.java   |  54 +++
 .../trident/format/DelimitedRecordFormat.java   |  83 +++++
 .../hdfs/trident/format/FileNameFormat.java     |  40 +++
 .../storm/hdfs/trident/format/RecordFormat.java |  32 ++
 .../hdfs/trident/format/SequenceFormat.java     |  40 +++
 .../trident/rotation/FileRotationPolicy.java    |  50 +++
 .../rotation/FileSizeRotationPolicy.java        |  81 +++++
 .../hdfs/trident/rotation/NoRotationPolicy.java |  35 ++
 .../trident/rotation/TimedRotationPolicy.java   |  54 +++
 .../hdfs/trident/sync/CountSyncPolicy.java      |  46 +++
 .../storm/hdfs/trident/sync/SyncPolicy.java     |  46 +++
 .../storm/hdfs/bolt/HdfsFileTopology.java       | 198 +++++++++++
 .../storm/hdfs/bolt/SequenceFileTopology.java   | 193 +++++++++++
 .../storm/hdfs/trident/FixedBatchSpout.java     |  80 +++++
 .../storm/hdfs/trident/TridentFileTopology.java |  73 ++++
 .../hdfs/trident/TridentSequenceTopology.java   |  71 ++++
 external/storm-kafka/README.md                  | 197 ++++++++++-
 .../jvm/storm/kafka/DynamicBrokersReader.java   |   5 +
 .../src/jvm/storm/kafka/bolt/KafkaBolt.java     |  49 ++-
 .../FieldNameBasedTupleToKafkaMapper.java       |  48 +++
 .../kafka/bolt/mapper/TupleToKafkaMapper.java   |  32 ++
 .../bolt/selector/DefaultTopicSelector.java     |  34 ++
 .../kafka/bolt/selector/KafkaTopicSelector.java |  26 ++
 .../storm/kafka/trident/TridentKafkaState.java  |  99 ++++++
 .../kafka/trident/TridentKafkaStateFactory.java |  57 +++
 .../kafka/trident/TridentKafkaUpdater.java      |  31 ++
 .../FieldNameBasedTupleToKafkaMapper.java       |  41 +++
 .../mapper/TridentTupleToKafkaMapper.java       |  28 ++
 .../trident/selector/DefaultTopicSelector.java  |  34 ++
 .../trident/selector/KafkaTopicSelector.java    |  26 ++
 .../src/test/storm/kafka/TestUtils.java         |  62 ++++
 .../src/test/storm/kafka/TridentKafkaTest.java  |  89 +++++
 .../test/storm/kafka/TridentKafkaTopology.java  | 100 ++++++
 logback/cluster.xml                             |  12 +-
 pom.xml                                         |   5 +-
 storm-core/pom.xml                              |   2 +-
 .../clj/backtype/storm/daemon/supervisor.clj    |   9 +-
 storm-core/src/clj/backtype/storm/disruptor.clj |  11 +-
 storm-core/src/clj/backtype/storm/util.clj      |   2 +-
 .../jvm/backtype/storm/multilang/ShellMsg.java  |  17 +
 .../jvm/backtype/storm/spout/ShellSpout.java    |   3 +
 .../src/jvm/backtype/storm/task/ShellBolt.java  |   6 +
 .../backtype/storm/utils/DisruptorQueue.java    |  56 ++-
 storm-core/src/ui/public/css/style.css          |  67 ++++
 .../public/templates/index-page-template.html   |   2 +-
 .../templates/topology-page-template.html       |   2 +-
 .../test/clj/backtype/storm/supervisor_test.clj |   1 +
 .../storm/utils/DisruptorQueueTest.java         |  25 +-
 storm-dist/binary/src/main/assembly/binary.xml  |  14 +
 76 files changed, 4327 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d20c101f/README.markdown
----------------------------------------------------------------------
diff --cc README.markdown
index 586f171,d5c3b23..27f897b
--- a/README.markdown
+++ b/README.markdown
@@@ -159,8 -159,11 +159,11 @@@ under the License
  * Jo Liss ([@joliss](https://github.com/joliss))
  * averykhoo ([@averykhoo](https://github.com/averykhoo))
  * Curtis Allen ([@curtisallen](https://github.com/curtisallen))
 +* Raghavendra Nandagopal ([@RaghavendraNandagopal](https://github.com/RaghavendraNandagopal)) 
+ * Boris Aksenov ([@miofthena](https://github.com/miofthena))
+ * Itai Frenkel ([@itaifrenkel](https://github.com/itaifrenkel))
+ * Naresh Kosgi ([@NareshKosgi](https://github.com/NareshKosgi))
  
 -
  ## Acknowledgements
  
  YourKit is kindly supporting open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products: [YourKit Java Profiler](http://www.yourkit.com/java/profiler/index.jsp) and [YourKit .NET Profiler](http://www.yourkit.com/.net/profiler/index.jsp).

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d20c101f/bin/storm
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d20c101f/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d20c101f/storm-core/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d20c101f/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
----------------------------------------------------------------------
diff --cc storm-core/src/clj/backtype/storm/daemon/supervisor.clj
index d8ff6b5,6473ed1..4d83497
--- a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
@@@ -14,9 -14,9 +14,10 @@@
  ;; See the License for the specific language governing permissions and
  ;; limitations under the License.
  (ns backtype.storm.daemon.supervisor
 +  (:import [java.io OutputStreamWriter BufferedWriter IOException])
    (:import [backtype.storm.scheduler ISupervisor]
-            [java.net JarURLConnection])
+            [java.net JarURLConnection]
+            [java.net URI])
    (:use [backtype.storm bootstrap])
    (:use [backtype.storm.daemon common])
    (:require [backtype.storm.daemon [worker :as worker]])
@@@ -606,8 -491,8 +607,9 @@@
  (defmethod launch-worker
      :distributed [supervisor storm-id port worker-id]
      (let [conf (:conf supervisor)
 +          run-worker-as-user (conf SUPERVISOR-RUN-WORKER-AS-USER)
            storm-home (System/getProperty "storm.home")
+           storm-log-dir (or (System/getProperty "storm.log.dir") (str storm-home "/logs"))
            stormroot (supervisor-stormdist-root conf storm-id)
            jlp (jlp stormroot conf)
            stormjar (supervisor-stormjar-path stormroot)

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d20c101f/storm-core/src/clj/backtype/storm/util.clj
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d20c101f/storm-core/src/ui/public/css/style.css
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d20c101f/storm-core/src/ui/public/templates/index-page-template.html
----------------------------------------------------------------------
diff --cc storm-core/src/ui/public/templates/index-page-template.html
index bd78c5c,45906e5..8f1c29b
--- a/storm-core/src/ui/public/templates/index-page-template.html
+++ b/storm-core/src/ui/public/templates/index-page-template.html
@@@ -48,13 -38,11 +48,13 @@@
  <tr>
    <td><a href="/topology.html?id={{id}}">{{name}}</a></td>
    <td>{{id}}</td>
 +  <td>{{owner}}</td>
    <td>{{status}}</td>
    <td>{{uptime}}</td>
-   <td>{{tasksTotal}}</td>
    <td>{{workersTotal}}</td>
    <td>{{executorsTotal}}</td>
 +  <td>{{schedulerInfo}}</td>
+   <td>{{tasksTotal}}</td>
  </tr>
  {{/topologies}}
  </tbody>

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d20c101f/storm-core/src/ui/public/templates/topology-page-template.html
----------------------------------------------------------------------
diff --cc storm-core/src/ui/public/templates/topology-page-template.html
index c249053,2b93ed6..ddf3c17
--- a/storm-core/src/ui/public/templates/topology-page-template.html
+++ b/storm-core/src/ui/public/templates/topology-page-template.html
@@@ -31,13 -21,11 +31,13 @@@
        <tr>
          <td>{{name}}</td>
          <td>{{id}}</td>
 +        <td>{{owner}}</td>
          <td>{{status}}</td>
          <td>{{uptime}}</td>
-         <td>{{tasksTotal}}</td>
          <td>{{workersTotal}}</td>
          <td>{{executorsTotal}}</td>
 +        <td>{{schedulerInfo}}</td>
+         <td>{{tasksTotal}}</td>
        </tr>
      </tbody>
    </table>

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d20c101f/storm-core/test/clj/backtype/storm/supervisor_test.clj
----------------------------------------------------------------------
diff --cc storm-core/test/clj/backtype/storm/supervisor_test.clj
index 6b40060,f6fc285..3eb5de6
--- a/storm-core/test/clj/backtype/storm/supervisor_test.clj
+++ b/storm-core/test/clj/backtype/storm/supervisor_test.clj
@@@ -259,8 -253,9 +259,9 @@@
                                 opts
                                 topo-opts
                                 ["-Djava.library.path="
 -                                (str "-Dlogfile.name=worker-" mock-port ".log")
 +                                (str "-Dlogfile.name=" mock-storm-id "-worker-" mock-port ".log")
                                  "-Dstorm.home="
+                                 "-Dstorm.log.dir=/logs"
                                  "-Dlogback.configurationFile=/logback/cluster.xml"
                                  (str "-Dstorm.id=" mock-storm-id)
                                  (str "-Dworker.id=" mock-worker-id)


[25/50] git commit: Added STORM-350 to Changelog and Readme

Posted by bo...@apache.org.
Added STORM-350 to Changelog and Readme


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

Branch: refs/heads/security
Commit: c8a6e716af4984a0b0515e18029693db2c68be78
Parents: 78c5e23
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Wed Jul 30 19:18:25 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Wed Jul 30 19:18:25 2014 -0500

----------------------------------------------------------------------
 CHANGELOG.md    | 1 +
 README.markdown | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/c8a6e716/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1cc642c..e8b90f3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -35,6 +35,7 @@
  * STORM-406: Fix for reconnect logic in netty client.
  * STORM-366: Add color span to most recent error and fix ui templates.
  * STORM-369: topology summary page displays wrong order.
+ * STORM-350: LMAX Disruptor 3.2.1
 
 ## 0.9.2-incubating
  * STORM-66: send taskid on initial handshake

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/c8a6e716/README.markdown
----------------------------------------------------------------------
diff --git a/README.markdown b/README.markdown
index cf67f64..39f4530 100644
--- a/README.markdown
+++ b/README.markdown
@@ -159,6 +159,7 @@ under the License.
 * Jo Liss ([@joliss](https://github.com/joliss))
 * averykhoo ([@averykhoo](https://github.com/averykhoo))
 * Curtis Allen ([@curtisallen](https://github.com/curtisallen))
+* Boris Aksenov ([@miofthena](https://github.com/miofthena))
 
 ## Acknowledgements
 


[48/50] git commit: update contributors list & change log for STORM-451

Posted by bo...@apache.org.
update contributors list & change log for STORM-451


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

Branch: refs/heads/security
Commit: 7a58c2d23214d818e6d6d974f1f2cc7a25e91d1a
Parents: 7071fba
Author: Derek Dagit <de...@yahoo-inc.com>
Authored: Sat Aug 16 15:18:08 2014 -0500
Committer: Derek Dagit <de...@yahoo-inc.com>
Committed: Sat Aug 16 15:18:08 2014 -0500

----------------------------------------------------------------------
 CHANGELOG.md    | 1 +
 README.markdown | 2 ++
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/7a58c2d2/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 37dfd1f..c256e31 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -45,6 +45,7 @@
  * STORM-87: fail fast on ShellBolt exception
  * STORM-417: Storm UI lost table sort style when tablesorter was updated
  * STORM-396: Replace NullPointerException with IllegalArgumentExeption
+ * STORM-451: Latest storm does not build due to a pom.xml error in storm-hdfs pom.xml
 
 ## 0.9.2-incubating
  * STORM-66: send taskid on initial handshake

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/7a58c2d2/README.markdown
----------------------------------------------------------------------
diff --git a/README.markdown b/README.markdown
index 105e503..d5c3b23 100644
--- a/README.markdown
+++ b/README.markdown
@@ -161,6 +161,8 @@ under the License.
 * Curtis Allen ([@curtisallen](https://github.com/curtisallen))
 * Boris Aksenov ([@miofthena](https://github.com/miofthena))
 * Itai Frenkel ([@itaifrenkel](https://github.com/itaifrenkel))
+* Naresh Kosgi ([@NareshKosgi](https://github.com/NareshKosgi))
+
 
 ## Acknowledgements
 


[13/50] git commit: STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages. Also added a topic selector interfac

Posted by bo...@apache.org.
STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.
Also added a topic selector interface so users can provide custom implmentation that can chose what topics a tuple should be forwarded to.


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

Branch: refs/heads/security
Commit: 185f1778ed6de45690210a208c3f5d9774d3e56f
Parents: 827e0ba
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Wed Jul 16 10:58:29 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Mon Jul 28 09:36:55 2014 -0700

----------------------------------------------------------------------
 external/storm-kafka/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/185f1778/external/storm-kafka/README.md
----------------------------------------------------------------------
diff --git a/external/storm-kafka/README.md b/external/storm-kafka/README.md
index 964051e..f181e34 100644
--- a/external/storm-kafka/README.md
+++ b/external/storm-kafka/README.md
@@ -78,7 +78,7 @@ You can return an empty list but null is not acceptable. If you have one static
 DefaultTopicSelector.java and set the name of the topic in the constructor.
 
 ### Specifying kafka producer properties
-You can provide all the produce properties , see http://kafka.apache.org/07/configuration.html 
+You can provide all the produce properties , see http://kafka.apache.org/documentation.html#producerconfigs 
 section "Important configuration properties for the producer", in your storm topology config by setting the properties
 map with key kafka.broker.properties.
 


[26/50] git commit: Merge branch 'STORM-239' of https://github.com/apetresc/incubator-storm into STORM-239

Posted by bo...@apache.org.
Merge branch 'STORM-239' of https://github.com/apetresc/incubator-storm into STORM-239

STORM-239: Allow supervisor to operate in paths with spaces in them


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

Branch: refs/heads/security
Commit: ee78097c0408e98df1951282ce72e7cfdc94cce8
Parents: c8a6e71 8c89d18
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Wed Jul 30 19:30:53 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Wed Jul 30 19:30:53 2014 -0500

----------------------------------------------------------------------
 storm-core/src/clj/backtype/storm/daemon/supervisor.clj | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/ee78097c/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
----------------------------------------------------------------------


[06/50] git commit: Fix for STORM-417

Posted by bo...@apache.org.
Fix for STORM-417


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

Branch: refs/heads/security
Commit: d89faea28405a0aaf82d46164d9cb88c3547d0ca
Parents: 7ac24b8
Author: Kyle Nusbaum <kn...@yahoo-inc.com>
Authored: Tue Jul 22 22:59:13 2014 +0000
Committer: Kyle Nusbaum <kn...@yahoo-inc.com>
Committed: Tue Jul 22 22:59:13 2014 +0000

----------------------------------------------------------------------
 storm-core/src/ui/public/css/style.css | 135 ++++++++++++++++++++++++++++
 1 file changed, 135 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/d89faea2/storm-core/src/ui/public/css/style.css
----------------------------------------------------------------------
diff --git a/storm-core/src/ui/public/css/style.css b/storm-core/src/ui/public/css/style.css
index 19821a5..a8ab66f 100644
--- a/storm-core/src/ui/public/css/style.css
+++ b/storm-core/src/ui/public/css/style.css
@@ -41,3 +41,138 @@ table th {
 .twipsy-inner {
   font-size: 13px;
 }
+
+/*
+ * Duplicate styles for table sorter
+ */
+
+/*
+table .tablesorter-headerAsc, table .tablesorter-headerDesc {
+  background-color: rgba(141, 192, 219, 0.25);
+  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
+}
+
+table .tablesorter-headerDesc:after, table .tablesorter-headerDesc:hover:after {
+  visibility: visible;
+  filter: alpha(opacity=60);
+  -khtml-opacity: 0.6;
+  -moz-opacity: 0.6;
+  opacity: 0.6;
+}
+table .tablesorter-headerAsc:after {
+  border-bottom: none;
+  border-left: 4px solid transparent;
+  border-right: 4px solid transparent;
+  border-top: 4px solid #000;
+  visibility: visible;
+  -webkit-box-shadow: none;
+  -moz-box-shadow: none;
+  box-shadow: none;
+  filter: alpha(opacity=60);
+  -khtml-opacity: 0.6;
+  -moz-opacity: 0.6;
+  opacity: 0.6;
+}
+
+table .tablesorter-headerAsc.blue, table .tablesorter-headerDesc.blue {
+  background-color: #ade6fe;
+}
+table .tablesorter-headerAsc.green, table .tablesorter-headerDesc.green {
+  background-color: #cdeacd;
+}
+table .tablesorter-headerAsc.red, table .tablesorter-headerDesc.red {
+  background-color: #f4c8c5;
+}
+table .tablesorter-headerAsc.yellow, table .tablesorter-headerDesc.yellow {
+  background-color: #fff6d9;
+}
+table .tablesorter-headerAsc.orange, table .tablesorter-headerDesc.orange {
+  background-color: #fee9cc;
+}
+table .tablesorter-headerAsc.purple, table .tablesorter-headerDesc.purple {
+  background-color: #e2d5f0;
+}
+
+tablesorter-header {
+  display: block;
+}
+
+table .tablesorter-header {
+  cursor: pointer;
+}
+table .tablesorter-header:after {
+  content: "";
+  float: right;
+  margin-top: 7px;
+  border-width: 0 4px 4px;
+  border-style: solid;
+  border-color: #000 transparent;
+  visibility: hidden;
+}
+table .tablesorter-header:hover:after {
+  visibility: visible;
+}
+*/
+
+tablesorter-header {
+  display: block;
+}
+
+table .tablesorter-header {
+  cursor: pointer;
+}
+table .tablesorter-header:after {
+  content: "";
+  float: right;
+  margin-top: 7px;
+  border-width: 0 4px 4px;
+  border-style: solid;
+  border-color: #000 transparent;
+  visibility: hidden;
+}
+table .tablesorter-headerAsc, table .tablesorter-headerDesc {
+  background-color: rgba(141, 192, 219, 0.25);
+  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
+}
+table .tablesorter-header:hover:after {
+  visibility: visible;
+}
+table .tablesorter-headerDesc:after, table .tablesorter-headerDesc:hover:after {
+  visibility: visible;
+  filter: alpha(opacity=60);
+  -khtml-opacity: 0.6;
+  -moz-opacity: 0.6;
+  opacity: 0.6;
+}
+table .tablesorter-headerAsc:after {
+  border-bottom: none;
+  border-left: 4px solid transparent;
+  border-right: 4px solid transparent;
+  border-top: 4px solid #000;
+  visibility: visible;
+  -webkit-box-shadow: none;
+  -moz-box-shadow: none;
+  box-shadow: none;
+  filter: alpha(opacity=60);
+  -khtml-opacity: 0.6;
+  -moz-opacity: 0.6;
+  opacity: 0.6;
+}
+table .tablesorter-headerAsc.blue, table .tablesorter-headerDesc.blue {
+  background-color: #ade6fe;
+}
+table .tablesorter-headerAsc.green, table .tablesorter-headerDesc.green {
+  background-color: #cdeacd;
+}
+table .tablesorter-headerAsc.red, table .tablesorter-headerDesc.red {
+  background-color: #f4c8c5;
+}
+table .tablesorter-headerAsc.yellow, table .tablesorter-headerDesc.yellow {
+  background-color: #fff6d9;
+}
+table .tablesorter-headerAsc.orange, table .tablesorter-headerDesc.orange {
+  background-color: #fee9cc;
+}
+table .tablesorter-headerAsc.purple, table .tablesorter-headerDesc.purple {
+  background-color: #e2d5f0;
+}


[36/50] git commit: Merge branch 'multilang-nullpointerexception-fix' of https://github.com/forter/incubator-storm into STORM-396

Posted by bo...@apache.org.
Merge branch 'multilang-nullpointerexception-fix' of https://github.com/forter/incubator-storm into STORM-396

Conflicts:
	storm-core/src/jvm/backtype/storm/multilang/ShellMsg.java

STORM-396: Replace NullPointerException with IllegalArgumentExeption


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

Branch: refs/heads/security
Commit: 832600e7bbe31f38cf5d8d58a8f138b7b9df5195
Parents: 1a49ca6 2ea2027
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Thu Aug 7 15:52:41 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Thu Aug 7 15:52:41 2014 -0500

----------------------------------------------------------------------
 .../src/jvm/backtype/storm/multilang/ShellMsg.java | 17 +++++++++++++++++
 .../src/jvm/backtype/storm/spout/ShellSpout.java   |  3 +++
 .../src/jvm/backtype/storm/task/ShellBolt.java     |  3 +++
 3 files changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/832600e7/storm-core/src/jvm/backtype/storm/multilang/ShellMsg.java
----------------------------------------------------------------------
diff --cc storm-core/src/jvm/backtype/storm/multilang/ShellMsg.java
index e035df0,fd8cd9a..9eafb1a
--- a/storm-core/src/jvm/backtype/storm/multilang/ShellMsg.java
+++ b/storm-core/src/jvm/backtype/storm/multilang/ShellMsg.java
@@@ -158,11 -140,19 +158,28 @@@ public class ShellMsg 
          return metricParams;
      }
  
 +    public ShellLogLevel getLogLevel() {
 +        return logLevel;
 +    }
 +
 +    public void setLogLevel(int logLevel) {
 +        this.logLevel = ShellLogLevel.fromInt(logLevel);
 +    }
++
+     @Override
+     public String toString() {
+         return "ShellMsg{" +
+                 "command='" + command + '\'' +
+                 ", id=" + id +
+                 ", anchors=" + anchors +
+                 ", stream='" + stream + '\'' +
+                 ", task=" + task +
+                 ", msg='" + msg + '\'' +
+                 ", tuple=" + tuple +
+                 ", needTaskIds=" + needTaskIds +
+                 ", metricName='" + metricName + '\'' +
+                 ", metricParams=" + metricParams +
++                ", logLevel=" + logLevel +
+                 '}';
+     }
  }

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/832600e7/storm-core/src/jvm/backtype/storm/spout/ShellSpout.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/832600e7/storm-core/src/jvm/backtype/storm/task/ShellBolt.java
----------------------------------------------------------------------


[50/50] git commit: Fixed tests after upmerge

Posted by bo...@apache.org.
Fixed tests after upmerge


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

Branch: refs/heads/security
Commit: 7a06ef722a7bbf5abae42a6c4b1f6762b2293773
Parents: d20c101
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Mon Aug 18 14:40:45 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Mon Aug 18 14:40:45 2014 -0500

----------------------------------------------------------------------
 storm-core/test/clj/backtype/storm/supervisor_test.clj | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/7a06ef72/storm-core/test/clj/backtype/storm/supervisor_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/supervisor_test.clj b/storm-core/test/clj/backtype/storm/supervisor_test.clj
index 3eb5de6..6f02688 100644
--- a/storm-core/test/clj/backtype/storm/supervisor_test.clj
+++ b/storm-core/test/clj/backtype/storm/supervisor_test.clj
@@ -379,6 +379,7 @@
                                 " '-Djava.library.path='"
                                 " '-Dlogfile.name=" mock-storm-id "-worker-" mock-port ".log'"
                                 " '-Dstorm.home='"
+                                " '-Dstorm.log.dir=/logs'"
                                 " '-Dlogback.configurationFile=/logback/cluster.xml'"
                                 " '-Dstorm.id=" mock-storm-id "'"
                                 " '-Dworker.id=" mock-worker-id "'"


[42/50] git commit: update changelog for STORM-435

Posted by bo...@apache.org.
update changelog for STORM-435


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

Branch: refs/heads/security
Commit: c565d562794af33612f3da9c3a670937154f8dc4
Parents: 6120555
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Fri Aug 8 15:27:05 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri Aug 8 15:27:05 2014 -0400

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/c565d562/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 622db41..e7bb508 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## 0.9.3-incubating
+ * STORM-435: Improve storm-kafka documentation
  * STORM-405: Add kafka trident state so messages can be sent to kafka topic
  * STORM-211: Add module for HDFS integration
  * STORM-337: Expose managed spout ids publicly


[15/50] git commit: Merge branch 'master' of ../storm-hdfs into storm-hdfs

Posted by bo...@apache.org.
Merge branch 'master' of ../storm-hdfs into storm-hdfs


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

Branch: refs/heads/security
Commit: f7fb65676dd80214760e058d366fb2d6dcb302c2
Parents: d339a56 be5eae3
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Tue Jul 29 14:39:57 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Tue Jul 29 14:39:57 2014 -0400

----------------------------------------------------------------------
 .../storm/hdfs/bolt/AbstractHdfsBolt.java       | 44 +++++++---
 .../org/apache/storm/hdfs/bolt/HdfsBolt.java    | 24 ++---
 .../storm/hdfs/bolt/SequenceFileBolt.java       | 22 +++--
 .../hdfs/bolt/rotation/TimedRotationPolicy.java | 55 ++++++++++++
 .../hdfs/common/security/HdfsSecurityUtil.java  |  4 +-
 .../apache/storm/hdfs/trident/HdfsState.java    | 92 ++++++++++++--------
 .../trident/rotation/TimedRotationPolicy.java   | 54 ++++++++++++
 .../storm/hdfs/bolt/HdfsFileTopology.java       |  7 +-
 8 files changed, 233 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/f7fb6567/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/AbstractHdfsBolt.java
----------------------------------------------------------------------
diff --cc external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/AbstractHdfsBolt.java
index dfe550d,0000000..f260598
mode 100644,000000..100644
--- a/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/AbstractHdfsBolt.java
+++ b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/AbstractHdfsBolt.java
@@@ -1,115 -1,0 +1,139 @@@
 +/**
 + * 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.storm.hdfs.bolt;
 +
 +import backtype.storm.task.OutputCollector;
 +import backtype.storm.task.TopologyContext;
 +import backtype.storm.topology.OutputFieldsDeclarer;
 +import backtype.storm.topology.base.BaseRichBolt;
 +import org.apache.hadoop.conf.Configuration;
 +import org.apache.hadoop.fs.FileSystem;
 +import org.apache.hadoop.fs.Path;
 +import org.apache.storm.hdfs.bolt.format.FileNameFormat;
 +import org.apache.storm.hdfs.bolt.rotation.FileRotationPolicy;
++import org.apache.storm.hdfs.bolt.rotation.TimedRotationPolicy;
 +import org.apache.storm.hdfs.bolt.sync.SyncPolicy;
 +import org.apache.storm.hdfs.common.rotation.RotationAction;
 +import org.apache.storm.hdfs.common.security.HdfsSecurityUtil;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +import java.io.IOException;
 +import java.util.ArrayList;
 +import java.util.Map;
++import java.util.Timer;
++import java.util.TimerTask;
 +
 +public abstract class AbstractHdfsBolt extends BaseRichBolt {
 +    private static final Logger LOG = LoggerFactory.getLogger(AbstractHdfsBolt.class);
 +
 +    protected ArrayList<RotationAction> rotationActions = new ArrayList<RotationAction>();
 +    private Path currentFile;
 +    protected OutputCollector collector;
-     protected FileSystem fs;
++    protected transient FileSystem fs;
 +    protected SyncPolicy syncPolicy;
 +    protected FileRotationPolicy rotationPolicy;
 +    protected FileNameFormat fileNameFormat;
 +    protected int rotation = 0;
 +    protected String fsUrl;
 +    protected String configKey;
++    protected transient Object writeLock;
++    protected transient Timer rotationTimer; // only used for TimedRotationPolicy
 +
-     protected Configuration hdfsConfig;
++    protected transient Configuration hdfsConfig;
 +
 +    protected void rotateOutputFile() throws IOException {
 +        LOG.info("Rotating output file...");
 +        long start = System.currentTimeMillis();
-         closeOutputFile();
-         this.rotation++;
- 
-         Path newFile = createOutputFile();
-         LOG.info("Performing {} file rotation actions.", this.rotationActions.size());
-         for(RotationAction action : this.rotationActions){
-             action.execute(this.fs, this.currentFile);
++        synchronized (this.writeLock) {
++            closeOutputFile();
++            this.rotation++;
++
++            Path newFile = createOutputFile();
++            LOG.info("Performing {} file rotation actions.", this.rotationActions.size());
++            for (RotationAction action : this.rotationActions) {
++                action.execute(this.fs, this.currentFile);
++            }
++            this.currentFile = newFile;
 +        }
-         this.currentFile = newFile;
 +        long time = System.currentTimeMillis() - start;
 +        LOG.info("File rotation took {} ms.", time);
 +    }
 +
 +    /**
 +     * Marked as final to prevent override. Subclasses should implement the doPrepare() method.
 +     * @param conf
 +     * @param topologyContext
 +     * @param collector
 +     */
 +    public final void prepare(Map conf, TopologyContext topologyContext, OutputCollector collector){
++        this.writeLock = new Object();
 +        if (this.syncPolicy == null) throw new IllegalStateException("SyncPolicy must be specified.");
 +        if (this.rotationPolicy == null) throw new IllegalStateException("RotationPolicy must be specified.");
 +        if (this.fsUrl == null) {
 +            throw new IllegalStateException("File system URL must be specified.");
 +        }
 +
 +        this.collector = collector;
 +        this.fileNameFormat.prepare(conf, topologyContext);
 +        this.hdfsConfig = new Configuration();
 +        Map<String, Object> map = (Map<String, Object>)conf.get(this.configKey);
 +        if(map != null){
 +            for(String key : map.keySet()){
 +                this.hdfsConfig.set(key, String.valueOf(map.get(key)));
 +            }
 +        }
 +
 +
 +        try{
 +            HdfsSecurityUtil.login(conf, hdfsConfig);
 +            doPrepare(conf, topologyContext, collector);
 +            this.currentFile = createOutputFile();
 +
 +        } catch (Exception e){
 +            throw new RuntimeException("Error preparing HdfsBolt: " + e.getMessage(), e);
 +        }
++
++        if(this.rotationPolicy instanceof TimedRotationPolicy){
++            long interval = ((TimedRotationPolicy)this.rotationPolicy).getInterval();
++            this.rotationTimer = new Timer(true);
++            TimerTask task = new TimerTask() {
++                @Override
++                public void run() {
++                    try {
++                        rotateOutputFile();
++                    } catch(IOException e){
++                        LOG.warn("IOException during scheduled file rotation.", e);
++                    }
++                }
++            };
++            this.rotationTimer.scheduleAtFixedRate(task, interval, interval);
++        }
 +    }
 +
 +    @Override
 +    public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
 +    }
 +
 +    abstract void closeOutputFile() throws IOException;
 +
 +    abstract Path createOutputFile() throws IOException;
 +
 +    abstract void doPrepare(Map conf, TopologyContext topologyContext, OutputCollector collector) throws IOException;
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/f7fb6567/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/HdfsBolt.java
----------------------------------------------------------------------
diff --cc external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/HdfsBolt.java
index 590f4e6,0000000..a416357
mode 100644,000000..100644
--- a/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/HdfsBolt.java
+++ b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/HdfsBolt.java
@@@ -1,129 -1,0 +1,131 @@@
 +/**
 + * 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.storm.hdfs.bolt;
 +
 +import backtype.storm.task.OutputCollector;
 +import backtype.storm.task.TopologyContext;
 +import backtype.storm.tuple.Tuple;
 +import org.apache.hadoop.fs.FSDataOutputStream;
 +import org.apache.hadoop.fs.FileSystem;
 +import org.apache.hadoop.fs.Path;
 +import org.apache.hadoop.hdfs.client.HdfsDataOutputStream;
 +import org.apache.hadoop.hdfs.client.HdfsDataOutputStream.SyncFlag;
 +import org.apache.storm.hdfs.bolt.format.FileNameFormat;
 +import org.apache.storm.hdfs.bolt.format.RecordFormat;
 +import org.apache.storm.hdfs.bolt.rotation.FileRotationPolicy;
 +import org.apache.storm.hdfs.bolt.sync.SyncPolicy;
 +import org.apache.storm.hdfs.common.rotation.RotationAction;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +import java.io.IOException;
 +import java.net.URI;
 +import java.util.EnumSet;
 +import java.util.Map;
 +
 +public class HdfsBolt extends AbstractHdfsBolt{
 +    private static final Logger LOG = LoggerFactory.getLogger(HdfsBolt.class);
 +
-     private FSDataOutputStream out;
++    private transient FSDataOutputStream out;
 +    private RecordFormat format;
 +    private long offset = 0;
 +
 +    public HdfsBolt withFsUrl(String fsUrl){
 +        this.fsUrl = fsUrl;
 +        return this;
 +    }
 +
 +    public HdfsBolt withConfigKey(String configKey){
 +        this.configKey = configKey;
 +        return this;
 +    }
 +
 +    public HdfsBolt withFileNameFormat(FileNameFormat fileNameFormat){
 +        this.fileNameFormat = fileNameFormat;
 +        return this;
 +    }
 +
 +    public HdfsBolt withRecordFormat(RecordFormat format){
 +        this.format = format;
 +        return this;
 +    }
 +
 +    public HdfsBolt withSyncPolicy(SyncPolicy syncPolicy){
 +        this.syncPolicy = syncPolicy;
 +        return this;
 +    }
 +
 +    public HdfsBolt withRotationPolicy(FileRotationPolicy rotationPolicy){
 +        this.rotationPolicy = rotationPolicy;
 +        return this;
 +    }
 +
 +    public HdfsBolt addRotationAction(RotationAction action){
 +        this.rotationActions.add(action);
 +        return this;
 +    }
 +
 +    @Override
 +    public void doPrepare(Map conf, TopologyContext topologyContext, OutputCollector collector) throws IOException {
 +        LOG.info("Preparing HDFS Bolt...");
 +        this.fs = FileSystem.get(URI.create(this.fsUrl), hdfsConfig);
 +    }
 +
 +    @Override
 +    public void execute(Tuple tuple) {
 +        try {
 +            byte[] bytes = this.format.format(tuple);
-             out.write(bytes);
-             this.offset += bytes.length;
- 
-             if(this.syncPolicy.mark(tuple, this.offset)){
-                 if(this.out instanceof HdfsDataOutputStream){
-                     ((HdfsDataOutputStream)this.out).hsync(EnumSet.of(SyncFlag.UPDATE_LENGTH));
-                 } else {
-                     this.out.hsync();
++            synchronized (this.writeLock) {
++                out.write(bytes);
++                this.offset += bytes.length;
++
++                if (this.syncPolicy.mark(tuple, this.offset)) {
++                    if (this.out instanceof HdfsDataOutputStream) {
++                        ((HdfsDataOutputStream) this.out).hsync(EnumSet.of(SyncFlag.UPDATE_LENGTH));
++                    } else {
++                        this.out.hsync();
++                    }
++                    this.syncPolicy.reset();
 +                }
-                 this.syncPolicy.reset();
 +            }
 +
 +            this.collector.ack(tuple);
 +
 +            if(this.rotationPolicy.mark(tuple, this.offset)){
-                 rotateOutputFile();
++                rotateOutputFile(); // synchronized
 +                this.offset = 0;
 +                this.rotationPolicy.reset();
 +            }
 +        } catch (IOException e) {
 +            LOG.warn("write/sync failed.", e);
 +            this.collector.fail(tuple);
 +        }
 +    }
 +
 +    @Override
 +    void closeOutputFile() throws IOException {
 +        this.out.close();
 +    }
 +
 +    @Override
 +    Path createOutputFile() throws IOException {
 +        Path path = new Path(this.fileNameFormat.getPath(), this.fileNameFormat.getName(this.rotation, System.currentTimeMillis()));
 +        this.out = this.fs.create(path);
 +        return path;
 +    }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/f7fb6567/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/SequenceFileBolt.java
----------------------------------------------------------------------
diff --cc external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/SequenceFileBolt.java
index dae94d9,0000000..fc9bb4f
mode 100644,000000..100644
--- a/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/SequenceFileBolt.java
+++ b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/SequenceFileBolt.java
@@@ -1,145 -1,0 +1,149 @@@
 +/**
 + * 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.storm.hdfs.bolt;
 +
 +import backtype.storm.task.OutputCollector;
 +import backtype.storm.task.TopologyContext;
 +import backtype.storm.tuple.Tuple;
 +import org.apache.hadoop.fs.FileSystem;
 +import org.apache.hadoop.fs.Path;
 +import org.apache.hadoop.io.SequenceFile;
 +import org.apache.hadoop.io.compress.CompressionCodecFactory;
 +import org.apache.storm.hdfs.bolt.format.FileNameFormat;
 +import org.apache.storm.hdfs.bolt.format.SequenceFormat;
 +import org.apache.storm.hdfs.bolt.rotation.FileRotationPolicy;
 +import org.apache.storm.hdfs.bolt.sync.SyncPolicy;
 +import org.apache.storm.hdfs.common.rotation.RotationAction;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +
 +import java.io.IOException;
 +import java.net.URI;
 +import java.util.Map;
 +
 +public class SequenceFileBolt extends AbstractHdfsBolt {
 +    private static final Logger LOG = LoggerFactory.getLogger(SequenceFileBolt.class);
 +
 +    private SequenceFormat format;
 +    private SequenceFile.CompressionType compressionType = SequenceFile.CompressionType.RECORD;
-     private SequenceFile.Writer writer;
++    private transient SequenceFile.Writer writer;
 +
 +    private String compressionCodec = "default";
 +    private transient CompressionCodecFactory codecFactory;
 +
 +    public SequenceFileBolt() {
 +    }
 +
 +    public SequenceFileBolt withCompressionCodec(String codec){
 +        this.compressionCodec = codec;
 +        return this;
 +    }
 +
 +    public SequenceFileBolt withFsUrl(String fsUrl) {
 +        this.fsUrl = fsUrl;
 +        return this;
 +    }
 +
 +    public SequenceFileBolt withConfigKey(String configKey){
 +        this.configKey = configKey;
 +        return this;
 +    }
 +
 +    public SequenceFileBolt withFileNameFormat(FileNameFormat fileNameFormat) {
 +        this.fileNameFormat = fileNameFormat;
 +        return this;
 +    }
 +
 +    public SequenceFileBolt withSequenceFormat(SequenceFormat format) {
 +        this.format = format;
 +        return this;
 +    }
 +
 +    public SequenceFileBolt withSyncPolicy(SyncPolicy syncPolicy) {
 +        this.syncPolicy = syncPolicy;
 +        return this;
 +    }
 +
 +    public SequenceFileBolt withRotationPolicy(FileRotationPolicy rotationPolicy) {
 +        this.rotationPolicy = rotationPolicy;
 +        return this;
 +    }
 +
 +    public SequenceFileBolt withCompressionType(SequenceFile.CompressionType compressionType){
 +        this.compressionType = compressionType;
 +        return this;
 +    }
 +
 +    public SequenceFileBolt addRotationAction(RotationAction action){
 +        this.rotationActions.add(action);
 +        return this;
 +    }
 +
 +    @Override
 +    public void doPrepare(Map conf, TopologyContext topologyContext, OutputCollector collector) throws IOException {
 +        LOG.info("Preparing Sequence File Bolt...");
 +        if (this.format == null) throw new IllegalStateException("SequenceFormat must be specified.");
 +
 +        this.fs = FileSystem.get(URI.create(this.fsUrl), hdfsConfig);
 +        this.codecFactory = new CompressionCodecFactory(hdfsConfig);
 +    }
 +
 +    @Override
 +    public void execute(Tuple tuple) {
 +        try {
-             this.writer.append(this.format.key(tuple), this.format.value(tuple));
-             long offset = this.writer.getLength();
-             this.collector.ack(tuple);
- 
-             if (this.syncPolicy.mark(tuple, offset)) {
-                 this.writer.hsync();
-                 this.syncPolicy.reset();
++            long offset;
++            synchronized (this.writeLock) {
++                this.writer.append(this.format.key(tuple), this.format.value(tuple));
++                offset = this.writer.getLength();
++
++                if (this.syncPolicy.mark(tuple, offset)) {
++                    this.writer.hsync();
++                    this.syncPolicy.reset();
++                }
 +            }
++
++            this.collector.ack(tuple);
 +            if (this.rotationPolicy.mark(tuple, offset)) {
-                 rotateOutputFile();
++                rotateOutputFile(); // synchronized
 +                this.rotationPolicy.reset();
 +            }
 +        } catch (IOException e) {
 +            LOG.warn("write/sync failed.", e);
 +            this.collector.fail(tuple);
 +        }
 +
 +    }
 +
 +    Path createOutputFile() throws IOException {
 +        Path p = new Path(this.fsUrl + this.fileNameFormat.getPath(), this.fileNameFormat.getName(this.rotation, System.currentTimeMillis()));
 +        this.writer = SequenceFile.createWriter(
 +                this.hdfsConfig,
 +                SequenceFile.Writer.file(p),
 +                SequenceFile.Writer.keyClass(this.format.keyClass()),
 +                SequenceFile.Writer.valueClass(this.format.valueClass()),
 +                SequenceFile.Writer.compression(this.compressionType, this.codecFactory.getCodecByName(this.compressionCodec))
 +        );
 +        return p;
 +    }
 +
 +    void closeOutputFile() throws IOException {
 +        this.writer.close();
 +    }
 +
 +
 +}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/f7fb6567/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/rotation/TimedRotationPolicy.java
----------------------------------------------------------------------
diff --cc external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/rotation/TimedRotationPolicy.java
index 0000000,0000000..6cf8f3d
new file mode 100644
--- /dev/null
+++ b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/bolt/rotation/TimedRotationPolicy.java
@@@ -1,0 -1,0 +1,55 @@@
++package org.apache.storm.hdfs.bolt.rotation;
++
++import backtype.storm.tuple.Tuple;
++
++public class TimedRotationPolicy implements FileRotationPolicy {
++
++    public static enum TimeUnit {
++
++        SECONDS((long)1000),
++        MINUTES((long)1000*60),
++        HOURS((long)1000*60*60),
++        DAYS((long)1000*60*60*24);
++
++        private long milliSeconds;
++
++        private TimeUnit(long milliSeconds){
++            this.milliSeconds = milliSeconds;
++        }
++
++        public long getMilliSeconds(){
++            return milliSeconds;
++        }
++    }
++
++    private long interval;
++
++    public TimedRotationPolicy(float count, TimeUnit units){
++        this.interval = (long)(count * units.getMilliSeconds());
++    }
++
++
++    /**
++     * Called for every tuple the HdfsBolt executes.
++     *
++     * @param tuple  The tuple executed.
++     * @param offset current offset of file being written
++     * @return true if a file rotation should be performed
++     */
++    @Override
++    public boolean mark(Tuple tuple, long offset) {
++        return false;
++    }
++
++    /**
++     * Called after the HdfsBolt rotates a file.
++     */
++    @Override
++    public void reset() {
++
++    }
++
++    public long getInterval(){
++        return this.interval;
++    }
++}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/f7fb6567/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java
----------------------------------------------------------------------
diff --cc external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java
index adfaaf5,0000000..9540564
mode 100644,000000..100644
--- a/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java
+++ b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java
@@@ -1,48 -1,0 +1,48 @@@
 +/**
 + * 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.storm.hdfs.common.security;
 +
 +import org.apache.hadoop.conf.Configuration;
 +import org.apache.hadoop.security.SecurityUtil;
 +import org.apache.hadoop.security.UserGroupInformation;
 +
 +import java.io.IOException;
 +import java.util.Map;
 +
 +/**
 + * This class provides util methods for storm-hdfs connector communicating
 + * with secured HDFS.
 + */
 +public class HdfsSecurityUtil {
-     public static final String STORM_KEYTAB_FILE_KEY = "storm.keytab.file";
-     public static final String STORM_USER_NAME_KEY = "storm.kerberos.principal";
++    public static final String STORM_KEYTAB_FILE_KEY = "hdfs.keytab.file";
++    public static final String STORM_USER_NAME_KEY = "hdfs.kerberos.principal";
 +
 +    public static void login(Map conf, Configuration hdfsConfig) throws IOException {
 +        if (UserGroupInformation.isSecurityEnabled()) {
 +            String keytab = (String) conf.get(STORM_KEYTAB_FILE_KEY);
 +            if (keytab != null) {
 +              hdfsConfig.set(STORM_KEYTAB_FILE_KEY, keytab);
 +            }
 +            String userName = (String) conf.get(STORM_USER_NAME_KEY);
 +            if (userName != null) {
 +              hdfsConfig.set(STORM_USER_NAME_KEY, userName);
 +            }
 +            SecurityUtil.login(hdfsConfig, STORM_KEYTAB_FILE_KEY, STORM_USER_NAME_KEY);
 +        }
 +    }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/f7fb6567/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/trident/HdfsState.java
----------------------------------------------------------------------
diff --cc external/storm-hdfs/src/main/java/org/apache/storm/hdfs/trident/HdfsState.java
index f711837,0000000..490e488
mode 100644,000000..100644
--- a/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/trident/HdfsState.java
+++ b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/trident/HdfsState.java
@@@ -1,293 -1,0 +1,317 @@@
 +package org.apache.storm.hdfs.trident;
 +
 +import backtype.storm.task.IMetricsContext;
 +import backtype.storm.topology.FailedException;
 +import org.apache.hadoop.conf.Configuration;
 +import org.apache.hadoop.fs.FSDataOutputStream;
 +import org.apache.hadoop.fs.FileSystem;
 +import org.apache.hadoop.fs.Path;
 +import org.apache.hadoop.hdfs.client.HdfsDataOutputStream;
 +import org.apache.hadoop.io.SequenceFile;
 +import org.apache.hadoop.io.compress.CompressionCodecFactory;
 +import org.apache.storm.hdfs.common.rotation.RotationAction;
 +import org.apache.storm.hdfs.common.security.HdfsSecurityUtil;
 +import org.apache.storm.hdfs.trident.format.FileNameFormat;
 +import org.apache.storm.hdfs.trident.format.RecordFormat;
 +import org.apache.storm.hdfs.trident.format.SequenceFormat;
 +import org.apache.storm.hdfs.trident.rotation.FileRotationPolicy;
 +
++import org.apache.storm.hdfs.trident.rotation.TimedRotationPolicy;
 +import org.slf4j.Logger;
 +import org.slf4j.LoggerFactory;
 +import storm.trident.operation.TridentCollector;
 +import storm.trident.state.State;
 +import storm.trident.tuple.TridentTuple;
 +
 +import java.io.IOException;
 +import java.io.Serializable;
 +import java.net.URI;
- import java.util.ArrayList;
- import java.util.EnumSet;
- import java.util.List;
- import java.util.Map;
++import java.util.*;
 +
 +public class HdfsState implements State {
 +
 +    public static abstract class Options implements Serializable {
 +
 +        protected String fsUrl;
 +        protected String configKey;
-         protected FileSystem fs;
++        protected transient FileSystem fs;
 +        private Path currentFile;
 +        protected FileRotationPolicy rotationPolicy;
 +        protected FileNameFormat fileNameFormat;
 +        protected int rotation = 0;
-         protected Configuration hdfsConfig;
++        protected transient Configuration hdfsConfig;
 +        protected ArrayList<RotationAction> rotationActions = new ArrayList<RotationAction>();
++        protected transient Object writeLock;
++        protected transient Timer rotationTimer;
 +
 +        abstract void closeOutputFile() throws IOException;
 +
 +        abstract Path createOutputFile() throws IOException;
 +
 +        abstract void execute(List<TridentTuple> tuples) throws IOException;
 +
 +        abstract void doPrepare(Map conf, int partitionIndex, int numPartitions) throws IOException;
 +
 +        protected void rotateOutputFile() throws IOException {
 +            LOG.info("Rotating output file...");
 +            long start = System.currentTimeMillis();
-             closeOutputFile();
-             this.rotation++;
- 
-             Path newFile = createOutputFile();
-             LOG.info("Performing {} file rotation actions.", this.rotationActions.size());
-             for(RotationAction action : this.rotationActions){
-                 action.execute(this.fs, this.currentFile);
++            synchronized (this.writeLock) {
++                closeOutputFile();
++                this.rotation++;
++
++                Path newFile = createOutputFile();
++                LOG.info("Performing {} file rotation actions.", this.rotationActions.size());
++                for (RotationAction action : this.rotationActions) {
++                    action.execute(this.fs, this.currentFile);
++                }
++                this.currentFile = newFile;
 +            }
-             this.currentFile = newFile;
 +            long time = System.currentTimeMillis() - start;
 +            LOG.info("File rotation took {} ms.", time);
 +
 +
 +        }
 +
 +        void prepare(Map conf, int partitionIndex, int numPartitions){
++            this.writeLock = new Object();
 +            if (this.rotationPolicy == null) throw new IllegalStateException("RotationPolicy must be specified.");
 +            if (this.fsUrl == null) {
 +                throw new IllegalStateException("File system URL must be specified.");
 +            }
 +            this.fileNameFormat.prepare(conf, partitionIndex, numPartitions);
 +            this.hdfsConfig = new Configuration();
 +            Map<String, Object> map = (Map<String, Object>)conf.get(this.configKey);
 +            if(map != null){
 +                for(String key : map.keySet()){
 +                    this.hdfsConfig.set(key, String.valueOf(map.get(key)));
 +                }
 +            }
 +            try{
 +                HdfsSecurityUtil.login(conf, hdfsConfig);
 +                doPrepare(conf, partitionIndex, numPartitions);
 +                this.currentFile = createOutputFile();
 +
 +            } catch (Exception e){
 +                throw new RuntimeException("Error preparing HdfsState: " + e.getMessage(), e);
 +            }
++
++            if(this.rotationPolicy instanceof TimedRotationPolicy){
++                long interval = ((TimedRotationPolicy)this.rotationPolicy).getInterval();
++                this.rotationTimer = new Timer(true);
++                TimerTask task = new TimerTask() {
++                    @Override
++                    public void run() {
++                        try {
++                            rotateOutputFile();
++                        } catch(IOException e){
++                            LOG.warn("IOException during scheduled file rotation.", e);
++                        }
++                    }
++                };
++                this.rotationTimer.scheduleAtFixedRate(task, interval, interval);
++            }
 +        }
 +
 +    }
 +
 +    public static class HdfsFileOptions extends Options {
 +
-         private FSDataOutputStream out;
++        private transient FSDataOutputStream out;
 +        protected RecordFormat format;
 +        private long offset = 0;
 +
 +        public HdfsFileOptions withFsUrl(String fsUrl){
 +            this.fsUrl = fsUrl;
 +            return this;
 +        }
 +
 +        public HdfsFileOptions withConfigKey(String configKey){
 +            this.configKey = configKey;
 +            return this;
 +        }
 +
 +        public HdfsFileOptions withFileNameFormat(FileNameFormat fileNameFormat){
 +            this.fileNameFormat = fileNameFormat;
 +            return this;
 +        }
 +
 +        public HdfsFileOptions withRecordFormat(RecordFormat format){
 +            this.format = format;
 +            return this;
 +        }
 +
 +        public HdfsFileOptions withRotationPolicy(FileRotationPolicy rotationPolicy){
 +            this.rotationPolicy = rotationPolicy;
 +            return this;
 +        }
 +
 +        public HdfsFileOptions addRotationAction(RotationAction action){
 +            this.rotationActions.add(action);
 +            return this;
 +        }
 +
 +        @Override
 +        void doPrepare(Map conf, int partitionIndex, int numPartitions) throws IOException {
 +            LOG.info("Preparing HDFS Bolt...");
 +            this.fs = FileSystem.get(URI.create(this.fsUrl), hdfsConfig);
 +        }
 +
 +        @Override
 +        void closeOutputFile() throws IOException {
 +            this.out.close();
 +        }
 +
 +        @Override
 +        Path createOutputFile() throws IOException {
 +            Path path = new Path(this.fileNameFormat.getPath(), this.fileNameFormat.getName(this.rotation, System.currentTimeMillis()));
 +            this.out = this.fs.create(path);
 +            return path;
 +        }
 +
 +        @Override
 +        public void execute(List<TridentTuple> tuples) throws IOException {
 +            boolean rotated = false;
-             for(TridentTuple tuple : tuples){
-                 byte[] bytes = this.format.format(tuple);
-                 out.write(bytes);
-                 this.offset += bytes.length;
- 
-                 if(this.rotationPolicy.mark(tuple, this.offset)){
-                     rotateOutputFile();
-                     this.offset = 0;
-                     this.rotationPolicy.reset();
-                     rotated = true;
++            synchronized (this.writeLock) {
++                for (TridentTuple tuple : tuples) {
++                    byte[] bytes = this.format.format(tuple);
++                    out.write(bytes);
++                    this.offset += bytes.length;
++
++                    if (this.rotationPolicy.mark(tuple, this.offset)) {
++                        rotateOutputFile();
++                        this.offset = 0;
++                        this.rotationPolicy.reset();
++                        rotated = true;
++                    }
 +                }
-             }
-             if(!rotated){
-                 if(this.out instanceof HdfsDataOutputStream){
-                     ((HdfsDataOutputStream)this.out).hsync(EnumSet.of(HdfsDataOutputStream.SyncFlag.UPDATE_LENGTH));
-                 } else {
-                     this.out.hsync();
++                if (!rotated) {
++                    if (this.out instanceof HdfsDataOutputStream) {
++                        ((HdfsDataOutputStream) this.out).hsync(EnumSet.of(HdfsDataOutputStream.SyncFlag.UPDATE_LENGTH));
++                    } else {
++                        this.out.hsync();
++                    }
 +                }
 +            }
 +        }
 +    }
 +
 +    public static class SequenceFileOptions extends Options {
 +        private SequenceFormat format;
 +        private SequenceFile.CompressionType compressionType = SequenceFile.CompressionType.RECORD;
-         private SequenceFile.Writer writer;
++        private transient SequenceFile.Writer writer;
 +        private String compressionCodec = "default";
 +        private transient CompressionCodecFactory codecFactory;
 +
 +        public SequenceFileOptions withCompressionCodec(String codec){
 +            this.compressionCodec = codec;
 +            return this;
 +        }
 +
 +        public SequenceFileOptions withFsUrl(String fsUrl) {
 +            this.fsUrl = fsUrl;
 +            return this;
 +        }
 +
 +        public SequenceFileOptions withConfigKey(String configKey){
 +            this.configKey = configKey;
 +            return this;
 +        }
 +
 +        public SequenceFileOptions withFileNameFormat(FileNameFormat fileNameFormat) {
 +            this.fileNameFormat = fileNameFormat;
 +            return this;
 +        }
 +
 +        public SequenceFileOptions withSequenceFormat(SequenceFormat format) {
 +            this.format = format;
 +            return this;
 +        }
 +
 +        public SequenceFileOptions withRotationPolicy(FileRotationPolicy rotationPolicy) {
 +            this.rotationPolicy = rotationPolicy;
 +            return this;
 +        }
 +
 +        public SequenceFileOptions withCompressionType(SequenceFile.CompressionType compressionType){
 +            this.compressionType = compressionType;
 +            return this;
 +        }
 +
 +        public SequenceFileOptions addRotationAction(RotationAction action){
 +            this.rotationActions.add(action);
 +            return this;
 +        }
 +
 +        @Override
 +        void doPrepare(Map conf, int partitionIndex, int numPartitions) throws IOException {
 +            LOG.info("Preparing Sequence File State...");
 +            if (this.format == null) throw new IllegalStateException("SequenceFormat must be specified.");
 +
 +            this.fs = FileSystem.get(URI.create(this.fsUrl), hdfsConfig);
 +            this.codecFactory = new CompressionCodecFactory(hdfsConfig);
 +        }
 +
 +        @Override
 +        Path createOutputFile() throws IOException {
 +            Path p = new Path(this.fsUrl + this.fileNameFormat.getPath(), this.fileNameFormat.getName(this.rotation, System.currentTimeMillis()));
 +            this.writer = SequenceFile.createWriter(
 +                    this.hdfsConfig,
 +                    SequenceFile.Writer.file(p),
 +                    SequenceFile.Writer.keyClass(this.format.keyClass()),
 +                    SequenceFile.Writer.valueClass(this.format.valueClass()),
 +                    SequenceFile.Writer.compression(this.compressionType, this.codecFactory.getCodecByName(this.compressionCodec))
 +            );
 +            return p;
 +        }
 +
 +        @Override
 +        void closeOutputFile() throws IOException {
 +            this.writer.close();
 +        }
 +
 +        @Override
 +        public void execute(List<TridentTuple> tuples) throws IOException {
++            long offset;
 +            for(TridentTuple tuple : tuples) {
-                 this.writer.append(this.format.key(tuple), this.format.value(tuple));
-                 long offset = this.writer.getLength();
++                synchronized (this.writeLock) {
++                    this.writer.append(this.format.key(tuple), this.format.value(tuple));
++                    offset = this.writer.getLength();
++                }
 +
 +                if (this.rotationPolicy.mark(tuple, offset)) {
 +                    rotateOutputFile();
 +                    this.rotationPolicy.reset();
 +                }
 +            }
 +        }
 +
 +    }
 +
 +    public static final Logger LOG = LoggerFactory.getLogger(HdfsState.class);
 +    private Options options;
 +
 +    HdfsState(Options options){
 +        this.options = options;
 +    }
 +
 +    void prepare(Map conf, IMetricsContext metrics, int partitionIndex, int numPartitions){
 +        this.options.prepare(conf, partitionIndex, numPartitions);
 +    }
 +
 +    @Override
 +    public void beginCommit(Long txId) {
 +    }
 +
 +    @Override
 +    public void commit(Long txId) {
 +    }
 +
 +    public void updateState(List<TridentTuple> tuples, TridentCollector tridentCollector){
 +        try{
 +            this.options.execute(tuples);
 +        } catch (IOException e){
 +            LOG.warn("Failing batch due to IOException.", e);
 +            throw new FailedException(e);
 +        }
 +    }
 +}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/f7fb6567/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/trident/rotation/TimedRotationPolicy.java
----------------------------------------------------------------------
diff --cc external/storm-hdfs/src/main/java/org/apache/storm/hdfs/trident/rotation/TimedRotationPolicy.java
index 0000000,0000000..b2f3e3a
new file mode 100644
--- /dev/null
+++ b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/trident/rotation/TimedRotationPolicy.java
@@@ -1,0 -1,0 +1,54 @@@
++package org.apache.storm.hdfs.trident.rotation;
++
++import storm.trident.tuple.TridentTuple;
++
++
++public class TimedRotationPolicy implements FileRotationPolicy {
++
++    public static enum TimeUnit {
++
++        SECONDS((long)1000),
++        MINUTES((long)1000*60),
++        HOURS((long)1000*60*60),
++        DAYS((long)1000*60*60*24);
++
++        private long milliSeconds;
++
++        private TimeUnit(long milliSeconds){
++            this.milliSeconds = milliSeconds;
++        }
++
++        public long getMilliSeconds(){
++            return milliSeconds;
++        }
++    }
++
++    private long interval;
++
++    public TimedRotationPolicy(float count, TimeUnit units){
++        this.interval = (long)(count * units.getMilliSeconds());
++    }
++    /**
++     * Called for every tuple the HdfsBolt executes.
++     *
++     * @param tuple  The tuple executed.
++     * @param offset current offset of file being written
++     * @return true if a file rotation should be performed
++     */
++    @Override
++    public boolean mark(TridentTuple tuple, long offset) {
++        return false;
++    }
++
++    /**
++     * Called after the HdfsBolt rotates a file.
++     */
++    @Override
++    public void reset() {
++
++    }
++
++    public long getInterval(){
++        return this.interval;
++    }
++}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/f7fb6567/external/storm-hdfs/src/test/java/org/apache/storm/hdfs/bolt/HdfsFileTopology.java
----------------------------------------------------------------------
diff --cc external/storm-hdfs/src/test/java/org/apache/storm/hdfs/bolt/HdfsFileTopology.java
index 492839f,0000000..4fc6fb3
mode 100644,000000..100644
--- a/external/storm-hdfs/src/test/java/org/apache/storm/hdfs/bolt/HdfsFileTopology.java
+++ b/external/storm-hdfs/src/test/java/org/apache/storm/hdfs/bolt/HdfsFileTopology.java
@@@ -1,197 -1,0 +1,198 @@@
 +/**
 + * 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.storm.hdfs.bolt;
 +
 +import backtype.storm.Config;
 +import backtype.storm.LocalCluster;
 +import backtype.storm.StormSubmitter;
 +import backtype.storm.spout.SpoutOutputCollector;
 +import backtype.storm.task.OutputCollector;
 +import backtype.storm.task.TopologyContext;
 +import backtype.storm.topology.OutputFieldsDeclarer;
 +import backtype.storm.topology.TopologyBuilder;
 +import backtype.storm.topology.base.BaseRichBolt;
 +import backtype.storm.topology.base.BaseRichSpout;
 +import backtype.storm.tuple.Fields;
 +import backtype.storm.tuple.Tuple;
 +import backtype.storm.tuple.Values;
 +import org.apache.storm.hdfs.bolt.format.DefaultFileNameFormat;
 +import org.apache.storm.hdfs.bolt.format.DelimitedRecordFormat;
 +import org.apache.storm.hdfs.bolt.format.FileNameFormat;
 +import org.apache.storm.hdfs.bolt.format.RecordFormat;
 +import org.apache.storm.hdfs.bolt.rotation.FileRotationPolicy;
 +import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy;
 +import org.apache.storm.hdfs.bolt.rotation.FileSizeRotationPolicy.Units;
++import org.apache.storm.hdfs.bolt.rotation.TimedRotationPolicy;
 +import org.apache.storm.hdfs.bolt.sync.CountSyncPolicy;
 +import org.apache.storm.hdfs.bolt.sync.SyncPolicy;
 +import org.apache.storm.hdfs.common.rotation.MoveFileAction;
 +import org.yaml.snakeyaml.Yaml;
 +
 +import java.io.FileInputStream;
 +import java.io.InputStream;
 +import java.util.HashMap;
 +import java.util.Map;
 +import java.util.UUID;
 +import java.util.concurrent.ConcurrentHashMap;
 +
 +public class HdfsFileTopology {
 +    static final String SENTENCE_SPOUT_ID = "sentence-spout";
 +    static final String BOLT_ID = "my-bolt";
 +    static final String TOPOLOGY_NAME = "test-topology";
 +
 +    public static void main(String[] args) throws Exception {
 +        Config config = new Config();
 +        config.setNumWorkers(1);
 +
 +        SentenceSpout spout = new SentenceSpout();
 +
 +        // sync the filesystem after every 1k tuples
 +        SyncPolicy syncPolicy = new CountSyncPolicy(1000);
 +
 +        // rotate files when they reach 5MB
-         FileRotationPolicy rotationPolicy = new FileSizeRotationPolicy(5.0f, Units.MB);
++        FileRotationPolicy rotationPolicy = new TimedRotationPolicy(1.0f, TimedRotationPolicy.TimeUnit.MINUTES);
 +
 +        FileNameFormat fileNameFormat = new DefaultFileNameFormat()
 +                .withPath("/foo/")
 +                .withExtension(".txt");
 +
 +
 +
 +        // use "|" instead of "," for field delimiter
 +        RecordFormat format = new DelimitedRecordFormat()
 +                .withFieldDelimiter("|");
 +
 +        Yaml yaml = new Yaml();
 +        InputStream in = new FileInputStream(args[1]);
 +        Map<String, Object> yamlConf = (Map<String, Object>) yaml.load(in);
 +        in.close();
 +        config.put("hdfs.config", yamlConf);
 +
 +        HdfsBolt bolt = new HdfsBolt()
 +                .withConfigKey("hdfs.config")
 +                .withFsUrl(args[0])
 +                .withFileNameFormat(fileNameFormat)
 +                .withRecordFormat(format)
 +                .withRotationPolicy(rotationPolicy)
 +                .withSyncPolicy(syncPolicy)
 +                .addRotationAction(new MoveFileAction().toDestination("/dest2/"));
 +
 +        TopologyBuilder builder = new TopologyBuilder();
 +
 +        builder.setSpout(SENTENCE_SPOUT_ID, spout, 1);
 +        // SentenceSpout --> MyBolt
 +        builder.setBolt(BOLT_ID, bolt, 4)
 +                .shuffleGrouping(SENTENCE_SPOUT_ID);
 +
-         if (args.length == 1) {
++        if (args.length == 2) {
 +            LocalCluster cluster = new LocalCluster();
 +
 +            cluster.submitTopology(TOPOLOGY_NAME, config, builder.createTopology());
 +            waitForSeconds(120);
 +            cluster.killTopology(TOPOLOGY_NAME);
 +            cluster.shutdown();
 +            System.exit(0);
-         } else if (args.length == 2) {
++        } else if (args.length == 3) {
 +            StormSubmitter.submitTopology(args[0], config, builder.createTopology());
 +        } else{
 +            System.out.println("Usage: HdfsFileTopology [topology name] <yaml config file>");
 +        }
 +    }
 +
 +    public static void waitForSeconds(int seconds) {
 +        try {
 +            Thread.sleep(seconds * 1000);
 +        } catch (InterruptedException e) {
 +        }
 +    }
 +
 +    public static class SentenceSpout extends BaseRichSpout {
 +        private ConcurrentHashMap<UUID, Values> pending;
 +        private SpoutOutputCollector collector;
 +        private String[] sentences = {
 +                "my dog has fleas",
 +                "i like cold beverages",
 +                "the dog ate my homework",
 +                "don't have a cow man",
 +                "i don't think i like fleas"
 +        };
 +        private int index = 0;
 +        private int count = 0;
 +        private long total = 0L;
 +
 +        public void declareOutputFields(OutputFieldsDeclarer declarer) {
 +            declarer.declare(new Fields("sentence", "timestamp"));
 +        }
 +
 +        public void open(Map config, TopologyContext context,
 +                         SpoutOutputCollector collector) {
 +            this.collector = collector;
 +            this.pending = new ConcurrentHashMap<UUID, Values>();
 +        }
 +
 +        public void nextTuple() {
 +            Values values = new Values(sentences[index], System.currentTimeMillis());
 +            UUID msgId = UUID.randomUUID();
 +            this.pending.put(msgId, values);
 +            this.collector.emit(values, msgId);
 +            index++;
 +            if (index >= sentences.length) {
 +                index = 0;
 +            }
 +            count++;
 +            total++;
 +            if(count > 20000){
 +                count = 0;
 +                System.out.println("Pending count: " + this.pending.size() + ", total: " + this.total);
 +            }
 +            Thread.yield();
 +        }
 +
 +        public void ack(Object msgId) {
 +            this.pending.remove(msgId);
 +        }
 +
 +        public void fail(Object msgId) {
 +            System.out.println("**** RESENDING FAILED TUPLE");
 +            this.collector.emit(this.pending.get(msgId), msgId);
 +        }
 +    }
 +
 +    public static class MyBolt extends BaseRichBolt {
 +
 +        private HashMap<String, Long> counts = null;
 +        private OutputCollector collector;
 +
 +        public void prepare(Map config, TopologyContext context, OutputCollector collector) {
 +            this.counts = new HashMap<String, Long>();
 +            this.collector = collector;
 +        }
 +
 +        public void execute(Tuple tuple) {
 +            collector.ack(tuple);
 +        }
 +
 +        public void declareOutputFields(OutputFieldsDeclarer declarer) {
 +            // this bolt does not emit anything
 +        }
 +
 +        @Override
 +        public void cleanup() {
 +        }
 +    }
 +}


[04/50] git commit: STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages. Also added a topic selector interfac

Posted by bo...@apache.org.
STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.
Also added a topic selector interface so users can provide custom implmentation that can chose what topics a tuple should be forwarded to.


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

Branch: refs/heads/security
Commit: 905969ca3a744d86a562d3d85805c25f9f9561cc
Parents: a26329c
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Wed Jul 16 10:58:29 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Tue Jul 22 14:19:24 2014 -0700

----------------------------------------------------------------------
 .../src/jvm/storm/kafka/bolt/KafkaBolt.java     | 19 +++++--
 .../bolt/selector/DefaultTopicSelector.java     | 37 ++++++++++++++
 .../kafka/bolt/selector/KafkaTopicSelector.java | 26 ++++++++++
 .../storm/kafka/trident/TridentKafkaState.java  | 54 +++++++++++++++-----
 .../kafka/trident/TridentKafkaStateFactory.java | 38 ++++++++++++--
 .../kafka/trident/TridentKafkaUpdater.java      | 17 ++++++
 .../trident/selector/DefaultTopicSelector.java  | 37 ++++++++++++++
 .../trident/selector/KafkaTopicSelector.java    | 27 ++++++++++
 .../src/test/storm/kafka/TridentKafkaTest.java  | 36 ++++++++++---
 .../test/storm/kafka/TridentKafkaTopology.java  | 27 ++++++++--
 10 files changed, 287 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/905969ca/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
index a397977..35994e2 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
@@ -29,6 +29,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import storm.kafka.bolt.mapper.FieldNameBasedTupleToKafkaKeyAndMessageMapper;
 import storm.kafka.bolt.mapper.TupleToKafkaKeyAndMessageMapper;
+import storm.kafka.bolt.selector.DefaultTopicSelector;
+import storm.kafka.bolt.selector.KafkaTopicSelector;
 
 import java.util.Map;
 import java.util.Properties;
@@ -52,14 +54,19 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
 
     private Producer<K, V> producer;
     private OutputCollector collector;
-    private String topic;
     private TupleToKafkaKeyAndMessageMapper<K,V> mapper;
+    private KafkaTopicSelector topicSelector;
 
     public KafkaBolt<K,V> withTupleToKafkaKeyAndMessageMapper(TupleToKafkaKeyAndMessageMapper<K,V> mapper) {
         this.mapper = mapper;
         return this;
     }
 
+    public KafkaBolt<K,V> withTopicSelector(KafkaTopicSelector selector) {
+        this.topicSelector = topicSelector;
+        return this;
+    }
+
     @Override
     public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
         //for backward compatibility.
@@ -67,12 +74,16 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
             this.mapper = new FieldNameBasedTupleToKafkaKeyAndMessageMapper<K,V>();
         }
 
+        //for backward compatibility.
+        if(topicSelector == null) {
+            this.topicSelector = new DefaultTopicSelector((String) stormConf.get(TOPIC));
+        }
+
         Map configMap = (Map) stormConf.get(KAFKA_BROKER_PROPERTIES);
         Properties properties = new Properties();
         properties.putAll(configMap);
         ProducerConfig config = new ProducerConfig(properties);
         producer = new Producer<K, V>(config);
-        this.topic = (String) stormConf.get(TOPIC);
         this.collector = collector;
     }
 
@@ -83,7 +94,9 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
         try {
             key = mapper.getKeyFromTuple(input);
             message = mapper.getMessageFromTuple(input);
-            producer.send(new KeyedMessage<K, V>(topic, key, message));
+            for(String topic : topicSelector.getTopics(input)) {
+                producer.send(new KeyedMessage<K, V>(topic, key, message));
+            }
         } catch (Exception ex) {
             LOG.error("Could not send message with key '" + key + "' and value '" + message + "'", ex);
         } finally {

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/905969ca/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/DefaultTopicSelector.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/DefaultTopicSelector.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/DefaultTopicSelector.java
new file mode 100644
index 0000000..8737dae
--- /dev/null
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/DefaultTopicSelector.java
@@ -0,0 +1,37 @@
+/**
+ * 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 storm.kafka.bolt.selector;
+
+import backtype.storm.tuple.Tuple;
+import com.google.common.collect.Lists;
+
+import java.util.List;
+
+public class DefaultTopicSelector implements KafkaTopicSelector {
+
+    private final String topicName;
+
+    public DefaultTopicSelector(final String topicName) {
+        this.topicName = topicName;
+    }
+
+    @Override
+    public List<String> getTopics(Tuple tuple) {
+        return Lists.newArrayList(topicName);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/905969ca/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java
new file mode 100644
index 0000000..8f2de90
--- /dev/null
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java
@@ -0,0 +1,26 @@
+/**
+ * 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 storm.kafka.bolt.selector;
+
+import backtype.storm.tuple.Tuple;
+
+import java.util.List;
+
+public interface KafkaTopicSelector {
+    List<String> getTopics(Tuple tuple);
+}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/905969ca/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
index d53a17b..7d3122b 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
@@ -1,6 +1,22 @@
+/**
+ * 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 storm.kafka.trident;
 
-
 import backtype.storm.task.OutputCollector;
 import backtype.storm.task.TopologyContext;
 import backtype.storm.topology.FailedException;
@@ -8,8 +24,12 @@ import com.google.common.collect.Lists;
 import kafka.javaapi.producer.Producer;
 import kafka.producer.KeyedMessage;
 import kafka.producer.ProducerConfig;
+import org.apache.commons.lang.Validate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import storm.kafka.trident.mapper.FieldNameBasedTupleToKafkaKeyAndMessageMapper;
+import storm.kafka.trident.mapper.TridentTupleToKafkaKeyAndMessageMapper;
+import storm.kafka.trident.selector.KafkaTopicSelector;
 import storm.trident.operation.TridentCollector;
 import storm.trident.state.State;
 import storm.trident.tuple.TridentTuple;
@@ -25,14 +45,21 @@ public class TridentKafkaState implements State {
     public static final String TOPIC = "topic";
     public static final String KAFKA_BROKER_PROPERTIES = "kafka.broker.properties";
 
-    public static final String KEY_FIELD = "keyFieldName";
-    public static final String MESSAGE_FIELD_NAME = "messageFieldName";
-
     private Producer producer;
     private OutputCollector collector;
-    private String topic;
-    private String keyField;
-    private String msgField;
+
+    private TridentTupleToKafkaKeyAndMessageMapper mapper;
+    private KafkaTopicSelector topicSelector;
+
+    public TridentKafkaState withTridentTupleToKafkaKeyAndMessageMapper(TridentTupleToKafkaKeyAndMessageMapper mapper) {
+        this.mapper = mapper;
+        return this;
+    }
+
+    public TridentKafkaState withKafkaTopicSelector(KafkaTopicSelector selector) {
+        this.topicSelector = selector;
+        return this;
+    }
 
     @Override
     public void beginCommit(Long txid) {
@@ -45,25 +72,24 @@ public class TridentKafkaState implements State {
     }
 
     public void prepare(Map stormConf) {
+        Validate.notNull(mapper, "mapper can not be null");
+        Validate.notNull(topicSelector, "topicSelector can not be null");
         Map configMap = (Map) stormConf.get(KAFKA_BROKER_PROPERTIES);
         Properties properties = new Properties();
         properties.putAll(configMap);
         ProducerConfig config = new ProducerConfig(properties);
         producer = new Producer(config);
-        this.topic = (String) stormConf.get(TOPIC);
-        this.keyField = (String) stormConf.get(KEY_FIELD);
-        this.msgField = (String) stormConf.get(MESSAGE_FIELD_NAME);
     }
 
     public void updateState(List<TridentTuple> tuples, TridentCollector collector) {
         for (TridentTuple tuple : tuples) {
             try {
-                if( tuple.getValueByField(keyField) != null) {
-                    producer.send(new KeyedMessage(topic, tuple.getValueByField(keyField),
-                            tuple.getValueByField(msgField)));
+                for(String topic : topicSelector.getTopics(tuple)) {
+                    producer.send(new KeyedMessage(topic, mapper.getKeyFromTuple(tuple),
+                            mapper.getMessageFromTuple(tuple)));
                 }
             } catch (Exception ex) {
-                String errorMsg = "Could not send message with key '" + tuple.getValueByField(keyField);
+                String errorMsg = "Could not send message with key '" + mapper.getKeyFromTuple(tuple);
                 LOG.warn(errorMsg, ex);
                 throw new FailedException(errorMsg, ex);
             }

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/905969ca/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaStateFactory.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaStateFactory.java b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaStateFactory.java
index 4962b12..97159a2 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaStateFactory.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaStateFactory.java
@@ -1,9 +1,27 @@
+/**
+ * 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 storm.kafka.trident;
 
-
 import backtype.storm.task.IMetricsContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import storm.kafka.trident.mapper.TridentTupleToKafkaKeyAndMessageMapper;
+import storm.kafka.trident.selector.KafkaTopicSelector;
 import storm.trident.state.State;
 import storm.trident.state.StateFactory;
 
@@ -13,12 +31,26 @@ public class TridentKafkaStateFactory implements StateFactory {
 
     private static final Logger LOG = LoggerFactory.getLogger(TridentKafkaStateFactory.class);
 
-    public TridentKafkaStateFactory(){}
+    private TridentTupleToKafkaKeyAndMessageMapper mapper;
+    private KafkaTopicSelector topicSelector;
+
+
+    public TridentKafkaStateFactory withTridentTupleToKafkaKeyAndMessageMapper(TridentTupleToKafkaKeyAndMessageMapper mapper) {
+        this.mapper = mapper;
+        return this;
+    }
+
+    public TridentKafkaStateFactory withKafkaTopicSelector(KafkaTopicSelector selector) {
+        this.topicSelector = selector;
+        return this;
+    }
 
     @Override
     public State makeState(Map conf, IMetricsContext metrics, int partitionIndex, int numPartitions) {
         LOG.info("makeState(partitonIndex={}, numpartitions={}", partitionIndex, numPartitions);
-        TridentKafkaState state = new TridentKafkaState();
+        TridentKafkaState state = new TridentKafkaState()
+                .withKafkaTopicSelector(this.topicSelector)
+                .withTridentTupleToKafkaKeyAndMessageMapper(this.mapper);
         state.prepare(conf);
         return state;
     }

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/905969ca/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaUpdater.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaUpdater.java b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaUpdater.java
index 7af2fad..6639b36 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaUpdater.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaUpdater.java
@@ -1,3 +1,20 @@
+/**
+ * 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 storm.kafka.trident;
 
 import storm.trident.operation.TridentCollector;

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/905969ca/external/storm-kafka/src/jvm/storm/kafka/trident/selector/DefaultTopicSelector.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/selector/DefaultTopicSelector.java b/external/storm-kafka/src/jvm/storm/kafka/trident/selector/DefaultTopicSelector.java
new file mode 100644
index 0000000..08a42be
--- /dev/null
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/selector/DefaultTopicSelector.java
@@ -0,0 +1,37 @@
+/**
+ * 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 storm.kafka.trident.selector;
+
+import com.google.common.collect.Lists;
+import storm.trident.tuple.TridentTuple;
+
+import java.util.List;
+
+public class DefaultTopicSelector implements KafkaTopicSelector {
+
+    private final String topicName;
+
+    public DefaultTopicSelector(final String topicName) {
+        this.topicName = topicName;
+    }
+
+    @Override
+    public List<String> getTopics(TridentTuple tuple) {
+        return Lists.newArrayList(topicName);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/905969ca/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java b/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java
new file mode 100644
index 0000000..ae0befe
--- /dev/null
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java
@@ -0,0 +1,27 @@
+/**
+ * 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 storm.kafka.trident.selector;
+
+import backtype.storm.tuple.Tuple;
+import storm.trident.tuple.TridentTuple;
+
+import java.util.List;
+
+public interface KafkaTopicSelector {
+    List<String> getTopics(TridentTuple tuple);
+}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/905969ca/external/storm-kafka/src/test/storm/kafka/TridentKafkaTest.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/test/storm/kafka/TridentKafkaTest.java b/external/storm-kafka/src/test/storm/kafka/TridentKafkaTest.java
index ba4e238..e657327 100644
--- a/external/storm-kafka/src/test/storm/kafka/TridentKafkaTest.java
+++ b/external/storm-kafka/src/test/storm/kafka/TridentKafkaTest.java
@@ -1,16 +1,33 @@
+/**
+ * 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 storm.kafka;
 
 import backtype.storm.Config;
-import backtype.storm.tuple.Values;
 import com.google.common.collect.Lists;
 import kafka.javaapi.consumer.SimpleConsumer;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
 import storm.kafka.trident.TridentKafkaState;
-import storm.trident.operation.TridentCollector;
+import storm.kafka.trident.mapper.FieldNameBasedTupleToKafkaKeyAndMessageMapper;
+import storm.kafka.trident.mapper.TridentTupleToKafkaKeyAndMessageMapper;
+import storm.kafka.trident.selector.DefaultTopicSelector;
+import storm.kafka.trident.selector.KafkaTopicSelector;
 import storm.trident.testing.MockTridentTuple;
 import storm.trident.tuple.TridentTuple;
 
@@ -23,16 +40,19 @@ public class TridentKafkaTest {
     private Config config;
     private KafkaConfig kafkaConfig;
     private SimpleConsumer simpleConsumer;
-
+    private TridentTupleToKafkaKeyAndMessageMapper mapper;
+    private KafkaTopicSelector topicSelector;
 
     @Before
     public void setup() {
         broker = new KafkaTestBroker();
         simpleConsumer = TestUtils.getKafkaConsumer(broker);
         config = TestUtils.getConfig(broker.getBrokerConnectionString());
-        config.put(TridentKafkaState.KEY_FIELD, "key");
-        config.put(TridentKafkaState.MESSAGE_FIELD_NAME, "message");
-        state = new TridentKafkaState();
+        mapper = new FieldNameBasedTupleToKafkaKeyAndMessageMapper("key", "message");
+        topicSelector = new DefaultTopicSelector(TestUtils.TOPIC);
+        state = new TridentKafkaState()
+                .withKafkaTopicSelector(topicSelector)
+                .withTridentTupleToKafkaKeyAndMessageMapper(mapper);
         state.prepare(config);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/905969ca/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java b/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java
index a24a67c..73ee6a7 100644
--- a/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java
+++ b/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java
@@ -1,3 +1,20 @@
+/**
+ * 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 storm.kafka;
 
 import backtype.storm.Config;
@@ -15,6 +32,8 @@ import storm.kafka.trident.GlobalPartitionInformation;
 import storm.kafka.trident.TridentKafkaState;
 import storm.kafka.trident.TridentKafkaStateFactory;
 import storm.kafka.trident.TridentKafkaUpdater;
+import storm.kafka.trident.mapper.FieldNameBasedTupleToKafkaKeyAndMessageMapper;
+import storm.kafka.trident.selector.DefaultTopicSelector;
 import storm.trident.Stream;
 import storm.trident.TridentTopology;
 import storm.trident.state.StateFactory;
@@ -39,7 +58,11 @@ public class TridentKafkaTopology {
 
         TridentTopology topology = new TridentTopology();
         Stream stream = topology.newStream("spout1", spout);
-        stream.partitionPersist(new TridentKafkaStateFactory(), fields, new TridentKafkaUpdater(), new Fields());
+
+        TridentKafkaStateFactory stateFactory = new TridentKafkaStateFactory()
+                .withKafkaTopicSelector(new DefaultTopicSelector("test"))
+                .withTridentTupleToKafkaKeyAndMessageMapper(new FieldNameBasedTupleToKafkaKeyAndMessageMapper("word", "count"));
+        stream.partitionPersist(stateFactory, fields, new TridentKafkaUpdater(), new Fields());
 
         return topology.build();
     }
@@ -80,8 +103,6 @@ public class TridentKafkaTopology {
         props.put("serializer.class", "kafka.serializer.StringEncoder");
         conf.put(TridentKafkaState.KAFKA_BROKER_PROPERTIES, props);
         conf.put(TridentKafkaState.TOPIC, "test");
-        conf.put(TridentKafkaState.KEY_FIELD, "word");
-        conf.put(TridentKafkaState.MESSAGE_FIELD_NAME, "count");
         return conf;
     }
 


[12/50] git commit: STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages. Also added a topic selector interfac

Posted by bo...@apache.org.
STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.
Also added a topic selector interface so users can provide custom implmentation that can chose what topics a tuple should be forwarded to.


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

Branch: refs/heads/security
Commit: 827e0ba9e88f5a719532f2cf55a3963ef0bfb6db
Parents: 425b756
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Wed Jul 16 10:58:29 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Mon Jul 28 09:34:59 2014 -0700

----------------------------------------------------------------------
 external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java | 7 +++++--
 .../jvm/storm/kafka/bolt/selector/DefaultTopicSelector.java  | 7 ++-----
 .../jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java    | 4 +---
 .../src/jvm/storm/kafka/trident/TridentKafkaState.java       | 8 ++++++--
 .../storm/kafka/trident/selector/DefaultTopicSelector.java   | 7 ++-----
 .../jvm/storm/kafka/trident/selector/KafkaTopicSelector.java | 5 +----
 6 files changed, 17 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/827e0ba9/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
index 6326e9d..6c9a7d1 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
@@ -91,14 +91,17 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
     public void execute(Tuple input) {
         K key = null;
         V message = null;
+        String topic = null;
         try {
             key = mapper.getKeyFromTuple(input);
             message = mapper.getMessageFromTuple(input);
-            for(String topic : topicSelector.getTopics(input)) {
+            topic = topicSelector.getTopic(input);
+            if(topic != null ) {
                 producer.send(new KeyedMessage<K, V>(topic, key, message));
             }
         } catch (Exception ex) {
-            LOG.error("Could not send message with key '" + key + "' and value '" + message + "'", ex);
+            LOG.error("Could not send message with key = " + key
+                    + " and value = " + message + " to topic = " + topic, ex);
         } finally {
             collector.ack(input);
         }

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/827e0ba9/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/DefaultTopicSelector.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/DefaultTopicSelector.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/DefaultTopicSelector.java
index 8737dae..9c87658 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/DefaultTopicSelector.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/DefaultTopicSelector.java
@@ -18,9 +18,6 @@
 package storm.kafka.bolt.selector;
 
 import backtype.storm.tuple.Tuple;
-import com.google.common.collect.Lists;
-
-import java.util.List;
 
 public class DefaultTopicSelector implements KafkaTopicSelector {
 
@@ -31,7 +28,7 @@ public class DefaultTopicSelector implements KafkaTopicSelector {
     }
 
     @Override
-    public List<String> getTopics(Tuple tuple) {
-        return Lists.newArrayList(topicName);
+    public String getTopic(Tuple tuple) {
+        return topicName;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/827e0ba9/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java
index 8f2de90..baf6c4a 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java
@@ -19,8 +19,6 @@ package storm.kafka.bolt.selector;
 
 import backtype.storm.tuple.Tuple;
 
-import java.util.List;
-
 public interface KafkaTopicSelector {
-    List<String> getTopics(Tuple tuple);
+    String getTopic(Tuple tuple);
 }

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/827e0ba9/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
index 7e1ef8d..c4ea38d 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
@@ -79,14 +79,18 @@ public class TridentKafkaState implements State {
     }
 
     public void updateState(List<TridentTuple> tuples, TridentCollector collector) {
+        String topic = null;
         for (TridentTuple tuple : tuples) {
             try {
-                for(String topic : topicSelector.getTopics(tuple)) {
+                topic = topicSelector.getTopic(tuple);
+
+                if(topic != null) {
                     producer.send(new KeyedMessage(topic, mapper.getKeyFromTuple(tuple),
                             mapper.getMessageFromTuple(tuple)));
                 }
             } catch (Exception ex) {
-                String errorMsg = "Could not send message with key '" + mapper.getKeyFromTuple(tuple);
+                String errorMsg = "Could not send message with key = " + mapper.getKeyFromTuple(tuple)
+                        + " to topic = " + topic;
                 LOG.warn(errorMsg, ex);
                 throw new FailedException(errorMsg, ex);
             }

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/827e0ba9/external/storm-kafka/src/jvm/storm/kafka/trident/selector/DefaultTopicSelector.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/selector/DefaultTopicSelector.java b/external/storm-kafka/src/jvm/storm/kafka/trident/selector/DefaultTopicSelector.java
index 08a42be..473a38d 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/trident/selector/DefaultTopicSelector.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/selector/DefaultTopicSelector.java
@@ -17,11 +17,8 @@
  */
 package storm.kafka.trident.selector;
 
-import com.google.common.collect.Lists;
 import storm.trident.tuple.TridentTuple;
 
-import java.util.List;
-
 public class DefaultTopicSelector implements KafkaTopicSelector {
 
     private final String topicName;
@@ -31,7 +28,7 @@ public class DefaultTopicSelector implements KafkaTopicSelector {
     }
 
     @Override
-    public List<String> getTopics(TridentTuple tuple) {
-        return Lists.newArrayList(topicName);
+    public String getTopic(TridentTuple tuple) {
+        return topicName;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/827e0ba9/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java b/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java
index ae0befe..837a40d 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java
@@ -17,11 +17,8 @@
  */
 package storm.kafka.trident.selector;
 
-import backtype.storm.tuple.Tuple;
 import storm.trident.tuple.TridentTuple;
 
-import java.util.List;
-
 public interface KafkaTopicSelector {
-    List<String> getTopics(TridentTuple tuple);
+    String getTopic(TridentTuple tuple);
 }


[27/50] git commit: Added STORM-239 to Changelog

Posted by bo...@apache.org.
Added STORM-239 to Changelog


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

Branch: refs/heads/security
Commit: b1c5e7eae5b647b13df5b82990eed5f3bbea9d81
Parents: ee78097
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Wed Jul 30 19:31:58 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Wed Jul 30 19:31:58 2014 -0500

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/b1c5e7ea/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e8b90f3..9599e25 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -36,6 +36,7 @@
  * STORM-366: Add color span to most recent error and fix ui templates.
  * STORM-369: topology summary page displays wrong order.
  * STORM-350: LMAX Disruptor 3.2.1
+ * STORM-239: Allow supervisor to operate in paths with spaces in them
 
 ## 0.9.2-incubating
  * STORM-66: send taskid on initial handshake


[34/50] git commit: Merge branch 'STORM-417' of https://github.com/knusbaum/incubator-storm into STORM-417

Posted by bo...@apache.org.
Merge branch 'STORM-417' of https://github.com/knusbaum/incubator-storm into STORM-417

STORM-417: Storm UI lost table sort style when tablesorter was updated


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

Branch: refs/heads/security
Commit: ba8975671e3449ff335704a5282ccf6bf12ca564
Parents: 2ebdbfa 4ee369c
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Thu Aug 7 15:38:07 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Thu Aug 7 15:38:07 2014 -0500

----------------------------------------------------------------------
 storm-core/src/ui/public/css/style.css | 67 +++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)
----------------------------------------------------------------------



[44/50] git commit: update changelog for STORM-380

Posted by bo...@apache.org.
update changelog for STORM-380


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

Branch: refs/heads/security
Commit: 1e3b8c100a61db6e1afc54a003e4eea31e6f18df
Parents: b0bf870
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Fri Aug 8 15:35:32 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri Aug 8 15:35:32 2014 -0400

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/1e3b8c10/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e7bb508..b2f2a27 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## 0.9.3-incubating
+ * STORM-380: Kafka spout: throw RuntimeException if a leader cannot be found for a partition
  * STORM-435: Improve storm-kafka documentation
  * STORM-405: Add kafka trident state so messages can be sent to kafka topic
  * STORM-211: Add module for HDFS integration


[09/50] git commit: Upmerging with master and fixing merge conflicts

Posted by bo...@apache.org.
Upmerging with master and fixing merge conflicts


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

Branch: refs/heads/security
Commit: 8c89d188a910a57a4e10bc956206c0f16e5d827d
Parents: dcd4bf7 7ac24b8
Author: Adrian Petrescu <ap...@gmail.com>
Authored: Thu Jul 24 16:53:59 2014 -0400
Committer: Adrian Petrescu <ap...@gmail.com>
Committed: Thu Jul 24 16:53:59 2014 -0400

----------------------------------------------------------------------
 CHANGELOG.md                                    |   9 +
 LICENSE                                         |  30 ++-
 README.markdown                                 |   6 +
 STORM-UI-REST-API.md                            |  23 +-
 bin/storm                                       |  20 +-
 storm-core/src/clj/backtype/storm/cluster.clj   |  29 +++
 .../src/clj/backtype/storm/command/monitor.clj  |  37 +++
 .../clj/backtype/storm/daemon/supervisor.clj    |  49 ++--
 .../src/clj/backtype/storm/daemon/worker.clj    |  16 +-
 storm-core/src/clj/backtype/storm/testing.clj   |  48 ++--
 storm-core/src/clj/backtype/storm/ui/core.clj   |   2 +-
 .../src/clj/backtype/storm/ui/helpers.clj       |   5 -
 storm-core/src/clj/backtype/storm/zookeeper.clj |  25 ++
 storm-core/src/jvm/backtype/storm/Config.java   | 121 +++++----
 .../jvm/backtype/storm/ConfigValidation.java    |  70 ++++++
 .../backtype/storm/task/TopologyContext.java    |   4 +
 .../src/jvm/backtype/storm/utils/Monitor.java   | 249 +++++++++++++++++++
 .../src/jvm/backtype/storm/utils/Utils.java     |  23 +-
 storm-core/src/ui/public/component.html         |   3 +-
 .../src/ui/public/js/jquery.tablesorter.min.js  |   9 +-
 storm-core/src/ui/public/js/moment.min.js       |   6 +
 storm-core/src/ui/public/js/script.js           |   9 +
 .../test/clj/backtype/storm/config_test.clj     |  41 ++-
 .../test/clj/backtype/storm/supervisor_test.clj |  20 +-
 24 files changed, 713 insertions(+), 141 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/8c89d188/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
----------------------------------------------------------------------
diff --cc storm-core/src/clj/backtype/storm/daemon/supervisor.clj
index d9ff3f3,573b3d7..2545283
--- a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
@@@ -14,8 -14,8 +14,9 @@@
  ;; See the License for the specific language governing permissions and
  ;; limitations under the License.
  (ns backtype.storm.daemon.supervisor
-   (:import [backtype.storm.scheduler ISupervisor])
-   (:import [java.net URI])
+   (:import [backtype.storm.scheduler ISupervisor]
 -           [java.net JarURLConnection])
++           [java.net JarURLConnection]
++           [java.net URI])
    (:use [backtype.storm bootstrap])
    (:use [backtype.storm.daemon common])
    (:require [backtype.storm.daemon [worker :as worker]])
@@@ -532,11 -545,14 +546,14 @@@
                (do
                  (log-message "Extracting resources from jar at " resources-jar " to " target-dir)
                  (extract-dir-from-jar resources-jar RESOURCES-SUBDIR stormroot))
-               uri
+               url
                (do
-                 (log-message "Copying resources at " (.getPath uri) " to " target-dir)
-                 (FileUtils/copyDirectory (File. (.getPath uri)) (File. target-dir))
-                 ))
 -                (log-message "Copying resources at " (str url) " to " target-dir)
++                (log-message "Copying resources at " (URI. (str url)) " to " target-dir)
+                 (if (= (.getProtocol url) "jar" )
+                     (extract-dir-from-jar (.getFile (.getJarFileURL (.openConnection url))) RESOURCES-SUBDIR stormroot)
 -                    (FileUtils/copyDirectory (File. (.getFile url)) (File. target-dir)))
++                    (FileUtils/copyDirectory (File. (.getPath (URI. (str url)))) (File. target-dir)))
+                 )
+               )
              )))
  
  (defmethod launch-worker


[20/50] git commit: STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages. Also added a topic selector interfac

Posted by bo...@apache.org.
STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.
Also added a topic selector interface so users can provide custom implmentation that can chose what topics a tuple should be forwarded to.


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

Branch: refs/heads/security
Commit: 188bdb83db816a7eae593f48f6981bedf859311c
Parents: c6ef84d
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Wed Jul 16 10:58:29 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Wed Jul 30 13:19:20 2014 -0700

----------------------------------------------------------------------
 .../src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java    | 4 +++-
 .../src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/188bdb83/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java
index baf6c4a..f77fc47 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/selector/KafkaTopicSelector.java
@@ -19,6 +19,8 @@ package storm.kafka.bolt.selector;
 
 import backtype.storm.tuple.Tuple;
 
-public interface KafkaTopicSelector {
+import java.io.Serializable;
+
+public interface KafkaTopicSelector extends Serializable {
     String getTopic(Tuple tuple);
 }

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/188bdb83/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java b/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java
index 837a40d..f6c5d82 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/selector/KafkaTopicSelector.java
@@ -19,6 +19,8 @@ package storm.kafka.trident.selector;
 
 import storm.trident.tuple.TridentTuple;
 
-public interface KafkaTopicSelector {
+import java.io.Serializable;
+
+public interface KafkaTopicSelector extends Serializable {
     String getTopic(TridentTuple tuple);
 }


[46/50] git commit: update changelog for STORM-279

Posted by bo...@apache.org.
update changelog for STORM-279


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

Branch: refs/heads/security
Commit: 9968b8b03b9b8eeb9e2f9293d58460cb01647fb1
Parents: 598acf9
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Fri Aug 8 15:42:00 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri Aug 8 15:42:00 2014 -0400

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/9968b8b0/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b2f2a27..37dfd1f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## 0.9.3-incubating
+ * STORM-279: cluster.xml doesn't take in STORM_LOG_DIR values.
  * STORM-380: Kafka spout: throw RuntimeException if a leader cannot be found for a partition
  * STORM-435: Improve storm-kafka documentation
  * STORM-405: Add kafka trident state so messages can be sent to kafka topic


[41/50] git commit: Merge branch 'STROM-435' of github.com:Parth-Brahmbhatt/incubator-storm

Posted by bo...@apache.org.
Merge branch 'STROM-435' of github.com:Parth-Brahmbhatt/incubator-storm


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

Branch: refs/heads/security
Commit: 61205557d9c5925a3661177fc2166b8a0413c082
Parents: 1011076 342d2e5
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Fri Aug 8 15:25:41 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri Aug 8 15:25:41 2014 -0400

----------------------------------------------------------------------
 external/storm-kafka/README.md | 97 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 95 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/61205557/external/storm-kafka/README.md
----------------------------------------------------------------------


[33/50] git commit: Added STORM-87 to Changelog

Posted by bo...@apache.org.
Added STORM-87 to Changelog


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

Branch: refs/heads/security
Commit: 2ebdbfa7c746e7c75f3aa34866e1c42d9c0fa340
Parents: aff8d65
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Thu Aug 7 11:27:10 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Thu Aug 7 11:27:10 2014 -0500

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/2ebdbfa7/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9599e25..f4c20f1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -37,6 +37,7 @@
  * STORM-369: topology summary page displays wrong order.
  * STORM-350: LMAX Disruptor 3.2.1
  * STORM-239: Allow supervisor to operate in paths with spaces in them
+ * STORM-87: fail fast on ShellBolt exception
 
 ## 0.9.2-incubating
  * STORM-66: send taskid on initial handshake


[28/50] git commit: Adding how to use kafka spouts and what are the different configuration options available to users.

Posted by bo...@apache.org.
Adding how to use kafka spouts and what are the different configuration options available to users.


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

Branch: refs/heads/security
Commit: 342d2e5f1442b26393dff55601d6412bec40ef0c
Parents: b1c5e7e
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Sun Aug 3 14:06:01 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Sun Aug 3 14:06:01 2014 -0700

----------------------------------------------------------------------
 external/storm-kafka/README.md | 97 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 95 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/342d2e5f/external/storm-kafka/README.md
----------------------------------------------------------------------
diff --git a/external/storm-kafka/README.md b/external/storm-kafka/README.md
index db0ccce..8239656 100644
--- a/external/storm-kafka/README.md
+++ b/external/storm-kafka/README.md
@@ -3,9 +3,103 @@ Storm Kafka
 
 Provides core storm and Trident spout implementations for consuming data from Apache Kafka 0.8.x.
 
+##Spouts
+We support both trident and core storm spouts. For both spout implementation we use a BrokerHost interface that
+tracks kafka broker host to partition mapping and kafkaConfig that controls some kafka related parameters.
+ 
+###BrokerHosts
+In order to initialize your kafka spout/emitter you need to construct and instance of the marker interface BrokerHosts. 
+Currently we support following two implementations:
 
-## Usage Example
+####ZkHosts
+ZkHosts is what you should use if you want to dynamically track kafka broker to partition mapping. This class uses 
+Kafka's zookeeper's entries to track brokerHost -> partition mapping. You can instantiate an object by calling
+```java
+    public ZkHosts(String brokerZkStr, String brokerZkPath) 
+    public ZkHosts(String brokerZkStr)
+```
+Where brokerZkStr is just ip:port e.g. localhost:9092. brokerZkPath is the root directory under which all the topics and
+partition information is stored. by Default this is /brokers which is what default kafka implementation uses.
+
+By default the broker-partition mapping is refreshed every 60 seconds from zookeeper. If you want to change it you
+should set host.refreshFreqSecs to your chosen value.
+
+####StaticHosts
+This is an alternative implementation where broker -> partition information is static. In order to construct an instance
+of this class you need to first construct an instance of GlobalPartitionInformation.
+
+```java
+    Broker brokerForPartition0 = new Broker("localhost");//localhost:9092
+    Broker brokerForPartition1 = new Broker("localhost", 9092);//localhost:9092 but we specified the port explicitly
+    Broker brokerForPartition2 = new Broker("localhost:9092");//localhost:9092 specified as one string.
+    GlobalPartitionInformation partitionInfo = new GlobalPartitionInformation();
+    partitionInfo.add(0, brokerForPartition0)//mapping form partition 0 to brokerForPartition0
+    partitionInfo.add(1, brokerForPartition1)//mapping form partition 1 to brokerForPartition1
+    partitionInfo.add(2, brokerForPartition2)//mapping form partition 2 to brokerForPartition2
+    StaticHosts hosts = new StaticHosts(partitionInfo);
+```
+
+###KafkaConfig
+The second thing needed for constructing a kafkaSpout is an instance of KafkaConfig. 
+```java
+    public KafkaConfig(BrokerHosts hosts, String topic)
+    public KafkaConfig(BrokerHosts hosts, String topic, String clientId)
+```
+
+The BorkerHosts can be any implementation of BrokerHosts interface as described above. the Topic is name of kafka topic.
+The optional ClientId is used as a part of the zookeeper path where the spout's current consumption offset is stored.
+
+There are 2 extensions of KafkaConfig currently in use.
+
+Spoutconfig is an extension of KafkaConfig that supports 2 additional fields, zkroot and id. The Zkroot will be used
+as root to store your consumer's offset. The id should uniquely identify your spout.
+```java
+public SpoutConfig(BrokerHosts hosts, String topic, String zkRoot, String id);
+```
+Core KafkaSpout only accepts an instance of SpoutConfig.
 
+TridentKafkaConfig is another extension of KafkaConfig.
+```java
+public SpoutConfig(BrokerHosts hosts, String topic, String id);
+```
+TridentKafkaEmitter only accepts TridentKafkaConfig.
+
+The KafkaConfig class also has bunch of public variables that controls your application's behavior. Here are defaults:
+```java
+    public int fetchSizeBytes = 1024 * 1024;
+    public int socketTimeoutMs = 10000;
+    public int fetchMaxWait = 10000;
+    public int bufferSizeBytes = 1024 * 1024;
+    public MultiScheme scheme = new RawMultiScheme();
+    public boolean forceFromStart = false;
+    public long startOffsetTime = kafka.api.OffsetRequest.EarliestTime();
+    public long maxOffsetBehind = Long.MAX_VALUE;
+    public boolean useStartOffsetTimeIfOffsetOutOfRange = true;
+    public int metricsTimeBucketSizeInSecs = 60;
+```
+
+Most of them are self explanatory except MultiScheme.
+###MultiScheme
+MultiScheme is an interface that dictates how the byte[] consumed from kafka gets transformed into a storm tuple. It
+also controls the naming of your output field.
+
+```java
+  public Iterable<List<Object>> deserialize(byte[] ser);
+  public Fields getOutputFields();
+```
+
+The default RawMultiScheme just takes the byte[] and returns a tuple with byte[] as is. The name of the outputField is
+"bytes". There are alternative implementation like SchemeAsMultiScheme and KeyValueSchemeAsMultiScheme which can convert
+the byte[] to String. 
+### Examples
+####Core Spout
+```java
+BrokerHosts hosts = new ZkHosts(zkConnString);
+SpoutConfig spoutConfig = new SpoutConfig(hosts, topicName, "/" + topicName, UUID.randomUUID().toString());
+spoutConf.scheme = new SchemeAsMultiScheme(new StringScheme());
+KafkaSpout kafkaSpout = new KafkaSpout(spoutConfig);
+```
+####Trident Spout
 ```java
 TridentTopology topology = new TridentTopology();
 BrokerHosts zk = new ZkHosts("localhost");
@@ -14,7 +108,6 @@ spoutConf.scheme = new SchemeAsMultiScheme(new StringScheme());
 OpaqueTridentKafkaSpout spout = new OpaqueTridentKafkaSpout(spoutConf);
 ```
 
-
 ## Using storm-kafka with different versions of Scala
 
 Storm-kafka's Kafka dependency is defined as `provided` scope in maven, meaning it will not be pulled in


[08/50] git commit: STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages. Also added a topic selector interfac

Posted by bo...@apache.org.
STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.
Also added a topic selector interface so users can provide custom implmentation that can chose what topics a tuple should be forwarded to.


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

Branch: refs/heads/security
Commit: 425b75609452f85f90e6945bf4171a2f7cd9e099
Parents: 6a38b52
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Wed Jul 16 10:58:29 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Wed Jul 23 14:45:27 2014 -0700

----------------------------------------------------------------------
 external/storm-kafka/README.md                  |  6 +--
 .../src/jvm/storm/kafka/bolt/KafkaBolt.java     | 10 ++---
 ...ameBasedTupleToKafkaKeyAndMessageMapper.java | 37 ----------------
 .../FieldNameBasedTupleToKafkaMapper.java       | 37 ++++++++++++++++
 .../mapper/TupleToKafkaKeyAndMessageMapper.java | 32 --------------
 .../kafka/bolt/mapper/TupleToKafkaMapper.java   | 32 ++++++++++++++
 .../storm/kafka/trident/TridentKafkaState.java  |  9 ++--
 .../kafka/trident/TridentKafkaStateFactory.java |  8 ++--
 ...ameBasedTupleToKafkaKeyAndMessageMapper.java | 44 --------------------
 .../FieldNameBasedTupleToKafkaMapper.java       | 41 ++++++++++++++++++
 .../TridentTupleToKafkaKeyAndMessageMapper.java | 28 -------------
 .../mapper/TridentTupleToKafkaMapper.java       | 28 +++++++++++++
 .../src/test/storm/kafka/TridentKafkaTest.java  | 10 ++---
 .../test/storm/kafka/TridentKafkaTopology.java  | 12 +-----
 14 files changed, 160 insertions(+), 174 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/README.md
----------------------------------------------------------------------
diff --git a/external/storm-kafka/README.md b/external/storm-kafka/README.md
index 0db75d9..964051e 100644
--- a/external/storm-kafka/README.md
+++ b/external/storm-kafka/README.md
@@ -51,7 +51,7 @@ storm.kafka.trident.TridentKafkaUpdater.
 
 You need to provide implementation of following 2 interfaces
 
-###TupleToKafkaKeyAndMessageMapper and TridentTupleToKafkaKeyAndMessageMapper
+###TupleToKafkaMapper and TridentTupleToKafkaMapper
 These interfaces have 2 methods defined:
 
 ```java
@@ -99,7 +99,7 @@ For the bolt :
         builder.setSpout("spout", spout, 5);
         KafkaBolt bolt = new KafkaBolt()
                 .withKafkaTopicSelector(new DefaultTopicSelector("test"))
-                .withTridentTupleToKafkaKeyAndMessageMapper(new FieldNameBasedTupleToKafkaKeyAndMessageMapper());
+                .withTridentTupleToKafkaMapper(new FieldNameBasedTupleToKafkaMapper());
         builder.setBolt("forwardToKafka", bolt, 8).shuffleGrouping("spout");
         
         Config conf = new Config();
@@ -130,7 +130,7 @@ For Trident:
 
         TridentKafkaStateFactory stateFactory = new TridentKafkaStateFactory()
                 .withKafkaTopicSelector(new DefaultTopicSelector("test"))
-                .withTridentTupleToKafkaKeyAndMessageMapper(new FieldNameBasedTupleToKafkaKeyAndMessageMapper("word", "count"));
+                .withTridentTupleToKafkaMapper(new FieldNameBasedTupleToKafkaMapper("word", "count"));
         stream.partitionPersist(stateFactory, fields, new TridentKafkaUpdater(), new Fields());
 
         Config conf = new Config();

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
index 35994e2..6326e9d 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
@@ -27,8 +27,8 @@ import kafka.producer.KeyedMessage;
 import kafka.producer.ProducerConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import storm.kafka.bolt.mapper.FieldNameBasedTupleToKafkaKeyAndMessageMapper;
-import storm.kafka.bolt.mapper.TupleToKafkaKeyAndMessageMapper;
+import storm.kafka.bolt.mapper.FieldNameBasedTupleToKafkaMapper;
+import storm.kafka.bolt.mapper.TupleToKafkaMapper;
 import storm.kafka.bolt.selector.DefaultTopicSelector;
 import storm.kafka.bolt.selector.KafkaTopicSelector;
 
@@ -54,10 +54,10 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
 
     private Producer<K, V> producer;
     private OutputCollector collector;
-    private TupleToKafkaKeyAndMessageMapper<K,V> mapper;
+    private TupleToKafkaMapper<K,V> mapper;
     private KafkaTopicSelector topicSelector;
 
-    public KafkaBolt<K,V> withTupleToKafkaKeyAndMessageMapper(TupleToKafkaKeyAndMessageMapper<K,V> mapper) {
+    public KafkaBolt<K,V> withTupleToKafkaMapper(TupleToKafkaMapper<K,V> mapper) {
         this.mapper = mapper;
         return this;
     }
@@ -71,7 +71,7 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
     public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
         //for backward compatibility.
         if(mapper == null) {
-            this.mapper = new FieldNameBasedTupleToKafkaKeyAndMessageMapper<K,V>();
+            this.mapper = new FieldNameBasedTupleToKafkaMapper<K,V>();
         }
 
         //for backward compatibility.

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java
deleted file mode 100644
index 76db3f7..0000000
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java
+++ /dev/null
@@ -1,37 +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 storm.kafka.bolt.mapper;
-
-import backtype.storm.tuple.Tuple;
-
-public class FieldNameBasedTupleToKafkaKeyAndMessageMapper<K,V> implements TupleToKafkaKeyAndMessageMapper {
-
-    public static final String BOLT_KEY = "key";
-    public static final String BOLT_MESSAGE = "message";
-
-    @Override
-    public K getKeyFromTuple(Tuple tuple) {
-        //for backward compatibility, we return null when key is not present.
-        return tuple.contains(BOLT_KEY) ? (K) tuple.getValueByField(BOLT_KEY) : null;
-    }
-
-    @Override
-    public V getMessageFromTuple(Tuple tuple) {
-        return (V) tuple.getValueByField(BOLT_MESSAGE);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaMapper.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaMapper.java
new file mode 100644
index 0000000..5a7984c
--- /dev/null
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaMapper.java
@@ -0,0 +1,37 @@
+/**
+ * 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 storm.kafka.bolt.mapper;
+
+import backtype.storm.tuple.Tuple;
+
+public class FieldNameBasedTupleToKafkaMapper<K,V> implements TupleToKafkaMapper {
+
+    public static final String BOLT_KEY = "key";
+    public static final String BOLT_MESSAGE = "message";
+
+    @Override
+    public K getKeyFromTuple(Tuple tuple) {
+        //for backward compatibility, we return null when key is not present.
+        return tuple.contains(BOLT_KEY) ? (K) tuple.getValueByField(BOLT_KEY) : null;
+    }
+
+    @Override
+    public V getMessageFromTuple(Tuple tuple) {
+        return (V) tuple.getValueByField(BOLT_MESSAGE);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/TupleToKafkaKeyAndMessageMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/TupleToKafkaKeyAndMessageMapper.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/TupleToKafkaKeyAndMessageMapper.java
deleted file mode 100644
index 2601051..0000000
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/TupleToKafkaKeyAndMessageMapper.java
+++ /dev/null
@@ -1,32 +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 storm.kafka.bolt.mapper;
-
-import backtype.storm.tuple.Tuple;
-
-import java.io.Serializable;
-
-/**
- * as the really verbose name suggests this interface mapps a storm tuple to kafka key and message.
- * @param <K> type of key.
- * @param <V> type of value.
- */
-public interface TupleToKafkaKeyAndMessageMapper<K,V> extends Serializable {
-    K getKeyFromTuple(Tuple tuple);
-    V getMessageFromTuple(Tuple tuple);
-}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/TupleToKafkaMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/TupleToKafkaMapper.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/TupleToKafkaMapper.java
new file mode 100644
index 0000000..d92de7b
--- /dev/null
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/TupleToKafkaMapper.java
@@ -0,0 +1,32 @@
+/**
+ * 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 storm.kafka.bolt.mapper;
+
+import backtype.storm.tuple.Tuple;
+
+import java.io.Serializable;
+
+/**
+ * as the really verbose name suggests this interface mapps a storm tuple to kafka key and message.
+ * @param <K> type of key.
+ * @param <V> type of value.
+ */
+public interface TupleToKafkaMapper<K,V> extends Serializable {
+    K getKeyFromTuple(Tuple tuple);
+    V getMessageFromTuple(Tuple tuple);
+}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
index 7d3122b..7e1ef8d 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
@@ -18,17 +18,14 @@
 package storm.kafka.trident;
 
 import backtype.storm.task.OutputCollector;
-import backtype.storm.task.TopologyContext;
 import backtype.storm.topology.FailedException;
-import com.google.common.collect.Lists;
 import kafka.javaapi.producer.Producer;
 import kafka.producer.KeyedMessage;
 import kafka.producer.ProducerConfig;
 import org.apache.commons.lang.Validate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import storm.kafka.trident.mapper.FieldNameBasedTupleToKafkaKeyAndMessageMapper;
-import storm.kafka.trident.mapper.TridentTupleToKafkaKeyAndMessageMapper;
+import storm.kafka.trident.mapper.TridentTupleToKafkaMapper;
 import storm.kafka.trident.selector.KafkaTopicSelector;
 import storm.trident.operation.TridentCollector;
 import storm.trident.state.State;
@@ -48,10 +45,10 @@ public class TridentKafkaState implements State {
     private Producer producer;
     private OutputCollector collector;
 
-    private TridentTupleToKafkaKeyAndMessageMapper mapper;
+    private TridentTupleToKafkaMapper mapper;
     private KafkaTopicSelector topicSelector;
 
-    public TridentKafkaState withTridentTupleToKafkaKeyAndMessageMapper(TridentTupleToKafkaKeyAndMessageMapper mapper) {
+    public TridentKafkaState withTridentTupleToKafkaMapper(TridentTupleToKafkaMapper mapper) {
         this.mapper = mapper;
         return this;
     }

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaStateFactory.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaStateFactory.java b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaStateFactory.java
index 97159a2..adca69e 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaStateFactory.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaStateFactory.java
@@ -20,7 +20,7 @@ package storm.kafka.trident;
 import backtype.storm.task.IMetricsContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import storm.kafka.trident.mapper.TridentTupleToKafkaKeyAndMessageMapper;
+import storm.kafka.trident.mapper.TridentTupleToKafkaMapper;
 import storm.kafka.trident.selector.KafkaTopicSelector;
 import storm.trident.state.State;
 import storm.trident.state.StateFactory;
@@ -31,11 +31,11 @@ public class TridentKafkaStateFactory implements StateFactory {
 
     private static final Logger LOG = LoggerFactory.getLogger(TridentKafkaStateFactory.class);
 
-    private TridentTupleToKafkaKeyAndMessageMapper mapper;
+    private TridentTupleToKafkaMapper mapper;
     private KafkaTopicSelector topicSelector;
 
 
-    public TridentKafkaStateFactory withTridentTupleToKafkaKeyAndMessageMapper(TridentTupleToKafkaKeyAndMessageMapper mapper) {
+    public TridentKafkaStateFactory withTridentTupleToKafkaMapper(TridentTupleToKafkaMapper mapper) {
         this.mapper = mapper;
         return this;
     }
@@ -50,7 +50,7 @@ public class TridentKafkaStateFactory implements StateFactory {
         LOG.info("makeState(partitonIndex={}, numpartitions={}", partitionIndex, numPartitions);
         TridentKafkaState state = new TridentKafkaState()
                 .withKafkaTopicSelector(this.topicSelector)
-                .withTridentTupleToKafkaKeyAndMessageMapper(this.mapper);
+                .withTridentTupleToKafkaMapper(this.mapper);
         state.prepare(conf);
         return state;
     }

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java b/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java
deleted file mode 100644
index 09b3618..0000000
--- a/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/FieldNameBasedTupleToKafkaKeyAndMessageMapper.java
+++ /dev/null
@@ -1,44 +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 storm.kafka.trident.mapper;
-
-import backtype.storm.tuple.Tuple;
-import storm.trident.tuple.TridentTuple;
-
-import java.io.Serializable;
-
-public class FieldNameBasedTupleToKafkaKeyAndMessageMapper<K, V> implements TridentTupleToKafkaKeyAndMessageMapper {
-
-    public final String keyFieldName;
-    public final String msgFieldName;
-
-    public FieldNameBasedTupleToKafkaKeyAndMessageMapper(String keyFieldName, String msgFieldName) {
-        this.keyFieldName = keyFieldName;
-        this.msgFieldName = msgFieldName;
-    }
-
-    @Override
-    public K getKeyFromTuple(TridentTuple tuple) {
-        return (K) tuple.getValueByField(keyFieldName);
-    }
-
-    @Override
-    public V getMessageFromTuple(TridentTuple tuple) {
-        return (V) tuple.getValueByField(msgFieldName);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/FieldNameBasedTupleToKafkaMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/FieldNameBasedTupleToKafkaMapper.java b/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/FieldNameBasedTupleToKafkaMapper.java
new file mode 100644
index 0000000..29a49d1
--- /dev/null
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/FieldNameBasedTupleToKafkaMapper.java
@@ -0,0 +1,41 @@
+/**
+ * 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 storm.kafka.trident.mapper;
+
+import storm.trident.tuple.TridentTuple;
+
+public class FieldNameBasedTupleToKafkaMapper<K, V> implements TridentTupleToKafkaMapper {
+
+    public final String keyFieldName;
+    public final String msgFieldName;
+
+    public FieldNameBasedTupleToKafkaMapper(String keyFieldName, String msgFieldName) {
+        this.keyFieldName = keyFieldName;
+        this.msgFieldName = msgFieldName;
+    }
+
+    @Override
+    public K getKeyFromTuple(TridentTuple tuple) {
+        return (K) tuple.getValueByField(keyFieldName);
+    }
+
+    @Override
+    public V getMessageFromTuple(TridentTuple tuple) {
+        return (V) tuple.getValueByField(msgFieldName);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/TridentTupleToKafkaKeyAndMessageMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/TridentTupleToKafkaKeyAndMessageMapper.java b/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/TridentTupleToKafkaKeyAndMessageMapper.java
deleted file mode 100644
index ad10839..0000000
--- a/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/TridentTupleToKafkaKeyAndMessageMapper.java
+++ /dev/null
@@ -1,28 +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 storm.kafka.trident.mapper;
-
-import backtype.storm.tuple.Tuple;
-import storm.trident.tuple.TridentTuple;
-
-import java.io.Serializable;
-
-public interface TridentTupleToKafkaKeyAndMessageMapper<K,V>  extends Serializable {
-    K getKeyFromTuple(TridentTuple tuple);
-    V getMessageFromTuple(TridentTuple tuple);
-}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/TridentTupleToKafkaMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/TridentTupleToKafkaMapper.java b/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/TridentTupleToKafkaMapper.java
new file mode 100644
index 0000000..9759ba3
--- /dev/null
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/mapper/TridentTupleToKafkaMapper.java
@@ -0,0 +1,28 @@
+/**
+ * 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 storm.kafka.trident.mapper;
+
+import backtype.storm.tuple.Tuple;
+import storm.trident.tuple.TridentTuple;
+
+import java.io.Serializable;
+
+public interface TridentTupleToKafkaMapper<K,V>  extends Serializable {
+    K getKeyFromTuple(TridentTuple tuple);
+    V getMessageFromTuple(TridentTuple tuple);
+}

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/test/storm/kafka/TridentKafkaTest.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/test/storm/kafka/TridentKafkaTest.java b/external/storm-kafka/src/test/storm/kafka/TridentKafkaTest.java
index e657327..064d598 100644
--- a/external/storm-kafka/src/test/storm/kafka/TridentKafkaTest.java
+++ b/external/storm-kafka/src/test/storm/kafka/TridentKafkaTest.java
@@ -24,8 +24,8 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import storm.kafka.trident.TridentKafkaState;
-import storm.kafka.trident.mapper.FieldNameBasedTupleToKafkaKeyAndMessageMapper;
-import storm.kafka.trident.mapper.TridentTupleToKafkaKeyAndMessageMapper;
+import storm.kafka.trident.mapper.FieldNameBasedTupleToKafkaMapper;
+import storm.kafka.trident.mapper.TridentTupleToKafkaMapper;
 import storm.kafka.trident.selector.DefaultTopicSelector;
 import storm.kafka.trident.selector.KafkaTopicSelector;
 import storm.trident.testing.MockTridentTuple;
@@ -40,7 +40,7 @@ public class TridentKafkaTest {
     private Config config;
     private KafkaConfig kafkaConfig;
     private SimpleConsumer simpleConsumer;
-    private TridentTupleToKafkaKeyAndMessageMapper mapper;
+    private TridentTupleToKafkaMapper mapper;
     private KafkaTopicSelector topicSelector;
 
     @Before
@@ -48,11 +48,11 @@ public class TridentKafkaTest {
         broker = new KafkaTestBroker();
         simpleConsumer = TestUtils.getKafkaConsumer(broker);
         config = TestUtils.getConfig(broker.getBrokerConnectionString());
-        mapper = new FieldNameBasedTupleToKafkaKeyAndMessageMapper("key", "message");
+        mapper = new FieldNameBasedTupleToKafkaMapper("key", "message");
         topicSelector = new DefaultTopicSelector(TestUtils.TOPIC);
         state = new TridentKafkaState()
                 .withKafkaTopicSelector(topicSelector)
-                .withTridentTupleToKafkaKeyAndMessageMapper(mapper);
+                .withTridentTupleToKafkaMapper(mapper);
         state.prepare(config);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/425b7560/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java b/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java
index 73ee6a7..b64e6ca 100644
--- a/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java
+++ b/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java
@@ -19,24 +19,16 @@ package storm.kafka;
 
 import backtype.storm.Config;
 import backtype.storm.LocalCluster;
-import backtype.storm.StormSubmitter;
 import backtype.storm.generated.StormTopology;
-import backtype.storm.topology.TopologyBuilder;
 import backtype.storm.tuple.Fields;
 import backtype.storm.tuple.Values;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import storm.kafka.bolt.KafkaBolt;
-import storm.kafka.trident.GlobalPartitionInformation;
 import storm.kafka.trident.TridentKafkaState;
 import storm.kafka.trident.TridentKafkaStateFactory;
 import storm.kafka.trident.TridentKafkaUpdater;
-import storm.kafka.trident.mapper.FieldNameBasedTupleToKafkaKeyAndMessageMapper;
+import storm.kafka.trident.mapper.FieldNameBasedTupleToKafkaMapper;
 import storm.kafka.trident.selector.DefaultTopicSelector;
 import storm.trident.Stream;
 import storm.trident.TridentTopology;
-import storm.trident.state.StateFactory;
 import storm.trident.testing.FixedBatchSpout;
 
 import java.util.HashMap;
@@ -61,7 +53,7 @@ public class TridentKafkaTopology {
 
         TridentKafkaStateFactory stateFactory = new TridentKafkaStateFactory()
                 .withKafkaTopicSelector(new DefaultTopicSelector("test"))
-                .withTridentTupleToKafkaKeyAndMessageMapper(new FieldNameBasedTupleToKafkaKeyAndMessageMapper("word", "count"));
+                .withTridentTupleToKafkaMapper(new FieldNameBasedTupleToKafkaMapper("word", "count"));
         stream.partitionPersist(stateFactory, fields, new TridentKafkaUpdater(), new Fields());
 
         return topology.build();


[07/50] git commit: Fix for STORM-417

Posted by bo...@apache.org.
Fix for STORM-417


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

Branch: refs/heads/security
Commit: 9f53bdc6a0d3345696a8310a1fc0a0583b095e89
Parents: d89faea
Author: Kyle Nusbaum <kn...@yahoo-inc.com>
Authored: Tue Jul 22 23:00:44 2014 +0000
Committer: Kyle Nusbaum <kn...@yahoo-inc.com>
Committed: Tue Jul 22 23:00:44 2014 +0000

----------------------------------------------------------------------
 storm-core/src/ui/public/css/style.css | 68 -----------------------------
 1 file changed, 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/9f53bdc6/storm-core/src/ui/public/css/style.css
----------------------------------------------------------------------
diff --git a/storm-core/src/ui/public/css/style.css b/storm-core/src/ui/public/css/style.css
index a8ab66f..5895075 100644
--- a/storm-core/src/ui/public/css/style.css
+++ b/storm-core/src/ui/public/css/style.css
@@ -46,74 +46,6 @@ table th {
  * Duplicate styles for table sorter
  */
 
-/*
-table .tablesorter-headerAsc, table .tablesorter-headerDesc {
-  background-color: rgba(141, 192, 219, 0.25);
-  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
-}
-
-table .tablesorter-headerDesc:after, table .tablesorter-headerDesc:hover:after {
-  visibility: visible;
-  filter: alpha(opacity=60);
-  -khtml-opacity: 0.6;
-  -moz-opacity: 0.6;
-  opacity: 0.6;
-}
-table .tablesorter-headerAsc:after {
-  border-bottom: none;
-  border-left: 4px solid transparent;
-  border-right: 4px solid transparent;
-  border-top: 4px solid #000;
-  visibility: visible;
-  -webkit-box-shadow: none;
-  -moz-box-shadow: none;
-  box-shadow: none;
-  filter: alpha(opacity=60);
-  -khtml-opacity: 0.6;
-  -moz-opacity: 0.6;
-  opacity: 0.6;
-}
-
-table .tablesorter-headerAsc.blue, table .tablesorter-headerDesc.blue {
-  background-color: #ade6fe;
-}
-table .tablesorter-headerAsc.green, table .tablesorter-headerDesc.green {
-  background-color: #cdeacd;
-}
-table .tablesorter-headerAsc.red, table .tablesorter-headerDesc.red {
-  background-color: #f4c8c5;
-}
-table .tablesorter-headerAsc.yellow, table .tablesorter-headerDesc.yellow {
-  background-color: #fff6d9;
-}
-table .tablesorter-headerAsc.orange, table .tablesorter-headerDesc.orange {
-  background-color: #fee9cc;
-}
-table .tablesorter-headerAsc.purple, table .tablesorter-headerDesc.purple {
-  background-color: #e2d5f0;
-}
-
-tablesorter-header {
-  display: block;
-}
-
-table .tablesorter-header {
-  cursor: pointer;
-}
-table .tablesorter-header:after {
-  content: "";
-  float: right;
-  margin-top: 7px;
-  border-width: 0 4px 4px;
-  border-style: solid;
-  border-color: #000 transparent;
-  visibility: hidden;
-}
-table .tablesorter-header:hover:after {
-  visibility: visible;
-}
-*/
-
 tablesorter-header {
   display: block;
 }


[18/50] git commit: STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages. Also added a topic selector interfac

Posted by bo...@apache.org.
STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.
Also added a topic selector interface so users can provide custom implmentation that can chose what topics a tuple should be forwarded to.


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

Branch: refs/heads/security
Commit: 813ed7fc55d70093bd6d9bfb176d28a39b99bd87
Parents: 179cc37
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Wed Jul 16 10:58:29 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Tue Jul 29 12:14:21 2014 -0700

----------------------------------------------------------------------
 external/storm-kafka/README.md                       |  9 +++++----
 .../mapper/FieldNameBasedTupleToKafkaMapper.java     | 15 +++++++++++++--
 2 files changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/813ed7fc/external/storm-kafka/README.md
----------------------------------------------------------------------
diff --git a/external/storm-kafka/README.md b/external/storm-kafka/README.md
index a044014..85b2ec2 100644
--- a/external/storm-kafka/README.md
+++ b/external/storm-kafka/README.md
@@ -61,10 +61,11 @@ These interfaces have 2 methods defined:
 
 as the name suggests these methods are called to map a tuple to kafka key and kafka message. If you just want one field
 as key and one field as value then you can use the provided FieldNameBasedTupleToKafkaKeyAndMessageMapper.java 
-implementation. In the KafkaBolt the implementation always looks for a field with field name "key" and "message" for 
-backward compatibility reasons. 
-In the TridentKafkaState you can specify what is the field name for key and message. These should be specified while
-constructing and instance of FieldNameBasedTupleToKafkaKeyAndMessageMapper.
+implementation. In the KafkaBolt, the implementation always looks for a field with field name "key" and "message" if you 
+use the default constructor to construct FieldNameBasedTupleToKafkaKeyAndMessageMapper for backward compatibility 
+reasons. Alternatively you could also specify a different key and message field by using the non default constructor.
+In the TridentKafkaState you must specify what is the field name for key and message as there is no default constructor.
+These should be specified while constructing and instance of FieldNameBasedTupleToKafkaKeyAndMessageMapper.
 
 ###KafkaTopicSelector and trident KafkaTopicSelector
 This interface has only one method

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/813ed7fc/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaMapper.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaMapper.java
index 5a7984c..6d9471f 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaMapper.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/mapper/FieldNameBasedTupleToKafkaMapper.java
@@ -23,15 +23,26 @@ public class FieldNameBasedTupleToKafkaMapper<K,V> implements TupleToKafkaMapper
 
     public static final String BOLT_KEY = "key";
     public static final String BOLT_MESSAGE = "message";
+    public String boltKeyField;
+    public String boltMessageField;
+
+    public FieldNameBasedTupleToKafkaMapper() {
+        this(BOLT_KEY, BOLT_MESSAGE);
+    }
+
+    public FieldNameBasedTupleToKafkaMapper(String boltKeyField, String boltMessageField) {
+        this.boltKeyField = boltKeyField;
+        this.boltMessageField = boltMessageField;
+    }
 
     @Override
     public K getKeyFromTuple(Tuple tuple) {
         //for backward compatibility, we return null when key is not present.
-        return tuple.contains(BOLT_KEY) ? (K) tuple.getValueByField(BOLT_KEY) : null;
+        return tuple.contains(boltKeyField) ? (K) tuple.getValueByField(boltKeyField) : null;
     }
 
     @Override
     public V getMessageFromTuple(Tuple tuple) {
-        return (V) tuple.getValueByField(BOLT_MESSAGE);
+        return (V) tuple.getValueByField(boltMessageField);
     }
 }


[23/50] git commit: Added STORM-369 to Changelog

Posted by bo...@apache.org.
Added STORM-369 to Changelog


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

Branch: refs/heads/security
Commit: 9ac011129dc90418b9e8210abf0ff8e9f60be656
Parents: c410404
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Wed Jul 30 19:13:43 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Wed Jul 30 19:13:43 2014 -0500

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/9ac01112/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 126c762..1cc642c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,6 +34,7 @@
  * STORM-419: Updated test so sort ordering is very explicit.
  * STORM-406: Fix for reconnect logic in netty client.
  * STORM-366: Add color span to most recent error and fix ui templates.
+ * STORM-369: topology summary page displays wrong order.
 
 ## 0.9.2-incubating
  * STORM-66: send taskid on initial handshake


[35/50] git commit: Added STORM-417 to changelog

Posted by bo...@apache.org.
Added STORM-417 to changelog


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

Branch: refs/heads/security
Commit: 1a49ca631751dabc840a330639ef79234ab01717
Parents: ba89756
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Thu Aug 7 15:38:32 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Thu Aug 7 15:38:32 2014 -0500

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/1a49ca63/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f4c20f1..e8b325c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -38,6 +38,7 @@
  * STORM-350: LMAX Disruptor 3.2.1
  * STORM-239: Allow supervisor to operate in paths with spaces in them
  * STORM-87: fail fast on ShellBolt exception
+ * STORM-417: Storm UI lost table sort style when tablesorter was updated
 
 ## 0.9.2-incubating
  * STORM-66: send taskid on initial handshake


[40/50] git commit: update changelog for STORM-405

Posted by bo...@apache.org.
update changelog for STORM-405


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

Branch: refs/heads/security
Commit: 10110763090b0fbeaa797aeec9c3a0f7773daba4
Parents: 50c69fe c361603
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Fri Aug 8 15:23:21 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri Aug 8 15:23:21 2014 -0400

----------------------------------------------------------------------
 CHANGELOG.md                                    |   1 +
 external/storm-kafka/README.md                  | 100 +++++++++++++++++++
 .../src/jvm/storm/kafka/bolt/KafkaBolt.java     |  49 +++++++--
 .../FieldNameBasedTupleToKafkaMapper.java       |  48 +++++++++
 .../kafka/bolt/mapper/TupleToKafkaMapper.java   |  32 ++++++
 .../bolt/selector/DefaultTopicSelector.java     |  34 +++++++
 .../kafka/bolt/selector/KafkaTopicSelector.java |  26 +++++
 .../storm/kafka/trident/TridentKafkaState.java  |  99 ++++++++++++++++++
 .../kafka/trident/TridentKafkaStateFactory.java |  57 +++++++++++
 .../kafka/trident/TridentKafkaUpdater.java      |  31 ++++++
 .../FieldNameBasedTupleToKafkaMapper.java       |  41 ++++++++
 .../mapper/TridentTupleToKafkaMapper.java       |  28 ++++++
 .../trident/selector/DefaultTopicSelector.java  |  34 +++++++
 .../trident/selector/KafkaTopicSelector.java    |  26 +++++
 .../src/test/storm/kafka/TestUtils.java         |  62 ++++++++++++
 .../src/test/storm/kafka/TridentKafkaTest.java  |  89 +++++++++++++++++
 .../test/storm/kafka/TridentKafkaTopology.java  | 100 +++++++++++++++++++
 17 files changed, 846 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/10110763/CHANGELOG.md
----------------------------------------------------------------------
diff --cc CHANGELOG.md
index 4a942a7,2817e5d..622db41
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -1,5 -1,4 +1,6 @@@
  ## 0.9.3-incubating
++ * STORM-405: Add kafka trident state so messages can be sent to kafka topic
 + * STORM-211: Add module for HDFS integration
   * STORM-337: Expose managed spout ids publicly
   * STORM-320: Support STORM_CONF_DIR environment variable to support
   * STORM-360: Add node details for Error Topology and Component pages


[17/50] git commit: STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages. Also added a topic selector interfac

Posted by bo...@apache.org.
STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.
Also added a topic selector interface so users can provide custom implmentation that can chose what topics a tuple should be forwarded to.


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

Branch: refs/heads/security
Commit: 179cc3760c629c7fe7ec3e0f09e17101707a010d
Parents: 185f177
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Wed Jul 16 10:58:29 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Tue Jul 29 12:05:58 2014 -0700

----------------------------------------------------------------------
 external/storm-kafka/README.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/179cc376/external/storm-kafka/README.md
----------------------------------------------------------------------
diff --git a/external/storm-kafka/README.md b/external/storm-kafka/README.md
index f181e34..a044014 100644
--- a/external/storm-kafka/README.md
+++ b/external/storm-kafka/README.md
@@ -70,11 +70,11 @@ constructing and instance of FieldNameBasedTupleToKafkaKeyAndMessageMapper.
 This interface has only one method
 ```java
 public interface KafkaTopicSelector {
-    List<String> getTopics(Tuple/TridentTuple tuple);
+    String getTopics(Tuple/TridentTuple tuple);
 }
 ```
-The implementation of this interface should return topics to which the tuple's key/message mapping needs to be published 
-You can return an empty list but null is not acceptable. If you have one static topic name then you can use 
+The implementation of this interface should return topic to which the tuple's key/message mapping needs to be published 
+You can return a null and the message will be ignored. If you have one static topic name then you can use 
 DefaultTopicSelector.java and set the name of the topic in the constructor.
 
 ### Specifying kafka producer properties


[16/50] git commit: add Bobby Evans as committer sponsor

Posted by bo...@apache.org.
add Bobby Evans as committer sponsor


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

Branch: refs/heads/security
Commit: fcc921596521befb597e07294e02eaeb877c0db2
Parents: f7fb656
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Tue Jul 29 14:57:41 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Tue Jul 29 14:57:41 2014 -0400

----------------------------------------------------------------------
 external/storm-hdfs/README.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/fcc92159/external/storm-hdfs/README.md
----------------------------------------------------------------------
diff --git a/external/storm-hdfs/README.md b/external/storm-hdfs/README.md
index cd08d93..be7b339 100644
--- a/external/storm-hdfs/README.md
+++ b/external/storm-hdfs/README.md
@@ -340,3 +340,4 @@ under the License.
 ## Committer Sponsors
 
  * P. Taylor Goetz ([ptgoetz@apache.org](mailto:ptgoetz@apache.org))
+ * Bobby Evans ([bobby@apache.org](mailto:bobby@apache.org))


[43/50] git commit: Merge branch 'kafka-no-leader' of github.com:spelliott/incubator-storm

Posted by bo...@apache.org.
Merge branch 'kafka-no-leader' of github.com:spelliott/incubator-storm


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

Branch: refs/heads/security
Commit: b0bf870af8d2d605d9ad4e95bf51960acb31c939
Parents: c565d56 e894133
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Fri Aug 8 15:34:25 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri Aug 8 15:34:25 2014 -0400

----------------------------------------------------------------------
 .../storm-kafka/src/jvm/storm/kafka/DynamicBrokersReader.java   | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------



[38/50] git commit: Merge branch 'storm-hdfs' of github.com:ptgoetz/incubator-storm

Posted by bo...@apache.org.
Merge branch 'storm-hdfs' of github.com:ptgoetz/incubator-storm


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

Branch: refs/heads/security
Commit: 581a528fbeab1c121c0511ece856eafd3dd674de
Parents: 675edb4 fcc9215
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Fri Aug 8 15:13:33 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri Aug 8 15:13:33 2014 -0400

----------------------------------------------------------------------
 external/storm-hdfs/README.md                   | 343 +++++++++++++++++++
 external/storm-hdfs/pom.xml                     |  68 ++++
 .../storm/hdfs/bolt/AbstractHdfsBolt.java       | 139 ++++++++
 .../org/apache/storm/hdfs/bolt/HdfsBolt.java    | 131 +++++++
 .../storm/hdfs/bolt/SequenceFileBolt.java       | 149 ++++++++
 .../hdfs/bolt/format/DefaultFileNameFormat.java |  86 +++++
 .../hdfs/bolt/format/DefaultSequenceFormat.java |  52 +++
 .../hdfs/bolt/format/DelimitedRecordFormat.java |  88 +++++
 .../storm/hdfs/bolt/format/FileNameFormat.java  |  42 +++
 .../storm/hdfs/bolt/format/RecordFormat.java    |  32 ++
 .../storm/hdfs/bolt/format/SequenceFormat.java  |  40 +++
 .../hdfs/bolt/rotation/FileRotationPolicy.java  |  51 +++
 .../bolt/rotation/FileSizeRotationPolicy.java   |  81 +++++
 .../hdfs/bolt/rotation/NoRotationPolicy.java    |  35 ++
 .../hdfs/bolt/rotation/TimedRotationPolicy.java |  55 +++
 .../storm/hdfs/bolt/sync/CountSyncPolicy.java   |  46 +++
 .../apache/storm/hdfs/bolt/sync/SyncPolicy.java |  46 +++
 .../hdfs/common/rotation/MoveFileAction.java    |  27 ++
 .../hdfs/common/rotation/RotationAction.java    |  12 +
 .../hdfs/common/security/HdfsSecurityUtil.java  |  48 +++
 .../apache/storm/hdfs/trident/HdfsState.java    | 317 +++++++++++++++++
 .../storm/hdfs/trident/HdfsStateFactory.java    |  29 ++
 .../apache/storm/hdfs/trident/HdfsUpdater.java  |  14 +
 .../trident/format/DefaultFileNameFormat.java   |  83 +++++
 .../trident/format/DefaultSequenceFormat.java   |  54 +++
 .../trident/format/DelimitedRecordFormat.java   |  83 +++++
 .../hdfs/trident/format/FileNameFormat.java     |  40 +++
 .../storm/hdfs/trident/format/RecordFormat.java |  32 ++
 .../hdfs/trident/format/SequenceFormat.java     |  40 +++
 .../trident/rotation/FileRotationPolicy.java    |  50 +++
 .../rotation/FileSizeRotationPolicy.java        |  81 +++++
 .../hdfs/trident/rotation/NoRotationPolicy.java |  35 ++
 .../trident/rotation/TimedRotationPolicy.java   |  54 +++
 .../hdfs/trident/sync/CountSyncPolicy.java      |  46 +++
 .../storm/hdfs/trident/sync/SyncPolicy.java     |  46 +++
 .../storm/hdfs/bolt/HdfsFileTopology.java       | 198 +++++++++++
 .../storm/hdfs/bolt/SequenceFileTopology.java   | 193 +++++++++++
 .../storm/hdfs/trident/FixedBatchSpout.java     |  80 +++++
 .../storm/hdfs/trident/TridentFileTopology.java |  73 ++++
 .../hdfs/trident/TridentSequenceTopology.java   |  71 ++++
 pom.xml                                         |   1 +
 storm-dist/binary/src/main/assembly/binary.xml  |  14 +
 42 files changed, 3205 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/581a528f/pom.xml
----------------------------------------------------------------------


[30/50] git commit: Merge branch 'master' of https://github.com/apache/incubator-storm into STORM-87

Posted by bo...@apache.org.
Merge branch 'master' of https://github.com/apache/incubator-storm into STORM-87

Conflicts:
	storm-core/src/jvm/backtype/storm/task/ShellBolt.java


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

Branch: refs/heads/security
Commit: 1e3a2b80d4ffe3431bae5912ac3ec39cf12a8ab6
Parents: cea872d b1c5e7e
Author: Kang Xiao <kx...@gmail.com>
Authored: Thu Aug 7 23:59:29 2014 +0800
Committer: Kang Xiao <kx...@gmail.com>
Committed: Thu Aug 7 23:59:29 2014 +0800

----------------------------------------------------------------------
 .gitignore                                      |    4 +-
 BYLAWS.md                                       |   96 ++
 CHANGELOG.md                                    |  106 +-
 DEVELOPER.md                                    |  343 +++++
 LICENSE                                         |  154 +-
 NOTICE                                          |    2 +-
 README.markdown                                 |   59 +-
 SECURITY.md                                     |   74 +
 STORM-UI-REST-API.md                            |  565 +++++++
 bin/storm                                       |  134 +-
 bin/storm-config.cmd                            |   27 +-
 bin/storm.cmd                                   |   59 +-
 conf/defaults.yaml                              |   16 +-
 conf/storm.yaml.example                         |    2 +-
 conf/storm_env.ini                              |   30 +
 dev-tools/github/__init__.py                    |  109 ++
 dev-tools/jira-github-join.py                   |   80 +
 dev-tools/jira/__init__.py                      |  232 +++
 examples/storm-starter/README.markdown          |  155 ++
 .../multilang/resources/splitsentence.py        |   24 +
 .../multilang/resources/splitsentence.rb        |   26 +
 .../storm-starter/multilang/resources/storm.py  |  221 +++
 .../storm-starter/multilang/resources/storm.rb  |  200 +++
 examples/storm-starter/pom.xml                  |  165 ++
 .../src/clj/storm/starter/clj/word_count.clj    |   95 ++
 .../jvm/storm/starter/BasicDRPCTopology.java    |   78 +
 .../jvm/storm/starter/ExclamationTopology.java  |   87 ++
 .../src/jvm/storm/starter/ManualDRPC.java       |   68 +
 .../jvm/storm/starter/PrintSampleStream.java    |   58 +
 .../src/jvm/storm/starter/ReachTopology.java    |  196 +++
 .../src/jvm/storm/starter/RollingTopWords.java  |  132 ++
 .../jvm/storm/starter/SingleJoinExample.java    |   64 +
 .../storm/starter/TransactionalGlobalCount.java |  173 +++
 .../jvm/storm/starter/TransactionalWords.java   |  246 +++
 .../jvm/storm/starter/WordCountTopology.java    |  107 ++
 .../storm/starter/bolt/AbstractRankerBolt.java  |  110 ++
 .../starter/bolt/IntermediateRankingsBolt.java  |   58 +
 .../src/jvm/storm/starter/bolt/PrinterBolt.java |   37 +
 .../storm/starter/bolt/RollingCountBolt.java    |  142 ++
 .../jvm/storm/starter/bolt/SingleJoinBolt.java  |  114 ++
 .../storm/starter/bolt/TotalRankingsBolt.java   |   59 +
 .../starter/spout/RandomSentenceSpout.java      |   64 +
 .../storm/starter/spout/TwitterSampleSpout.java |  164 ++
 .../tools/NthLastModifiedTimeTracker.java       |   70 +
 .../src/jvm/storm/starter/tools/Rankable.java   |   32 +
 .../starter/tools/RankableObjectWithFields.java |  148 ++
 .../src/jvm/storm/starter/tools/Rankings.java   |  156 ++
 .../starter/tools/SlidingWindowCounter.java     |  119 ++
 .../storm/starter/tools/SlotBasedCounter.java   |  118 ++
 .../jvm/storm/starter/trident/TridentReach.java |  156 ++
 .../storm/starter/trident/TridentWordCount.java |   85 +
 .../src/jvm/storm/starter/util/StormRunner.java |   47 +
 .../jvm/storm/starter/util/TupleHelpers.java    |   33 +
 .../bolt/IntermediateRankingsBoltTest.java      |  146 ++
 .../starter/bolt/RollingCountBoltTest.java      |  113 ++
 .../starter/bolt/TotalRankingsBoltTest.java     |  147 ++
 .../storm/starter/tools/MockTupleHelpers.java   |   40 +
 .../tools/NthLastModifiedTimeTrackerTest.java   |  125 ++
 .../tools/RankableObjectWithFieldsTest.java     |  252 +++
 .../jvm/storm/starter/tools/RankingsTest.java   |  368 +++++
 .../starter/tools/SlidingWindowCounterTest.java |  106 ++
 .../starter/tools/SlotBasedCounterTest.java     |  181 +++
 external/storm-kafka/CHANGELOG.md               |   13 +
 external/storm-kafka/README.md                  |   49 +
 external/storm-kafka/pom.xml                    |  119 ++
 .../storm-kafka/src/jvm/storm/kafka/Broker.java |   86 ++
 .../src/jvm/storm/kafka/BrokerHosts.java        |   25 +
 .../jvm/storm/kafka/DynamicBrokersReader.java   |  147 ++
 .../kafka/DynamicPartitionConnections.java      |   94 ++
 .../jvm/storm/kafka/FailedFetchException.java   |   29 +
 .../src/jvm/storm/kafka/KafkaConfig.java        |   52 +
 .../src/jvm/storm/kafka/KafkaError.java         |   43 +
 .../src/jvm/storm/kafka/KafkaSpout.java         |  195 +++
 .../src/jvm/storm/kafka/KafkaUtils.java         |  243 +++
 .../src/jvm/storm/kafka/KeyValueScheme.java     |   28 +
 .../kafka/KeyValueSchemeAsMultiScheme.java      |   37 +
 .../src/jvm/storm/kafka/Partition.java          |   69 +
 .../jvm/storm/kafka/PartitionCoordinator.java   |   28 +
 .../src/jvm/storm/kafka/PartitionManager.java   |  265 ++++
 .../src/jvm/storm/kafka/SpoutConfig.java        |   36 +
 .../src/jvm/storm/kafka/StaticCoordinator.java  |   51 +
 .../src/jvm/storm/kafka/StaticHosts.java        |   38 +
 .../storm/kafka/StaticPartitionConnections.java |   52 +
 .../jvm/storm/kafka/StringKeyValueScheme.java   |   37 +
 .../src/jvm/storm/kafka/StringScheme.java       |   46 +
 .../src/jvm/storm/kafka/ZkCoordinator.java      |  113 ++
 .../src/jvm/storm/kafka/ZkHosts.java            |   36 +
 .../src/jvm/storm/kafka/ZkState.java            |  116 ++
 .../src/jvm/storm/kafka/bolt/KafkaBolt.java     |   89 ++
 .../jvm/storm/kafka/trident/Coordinator.java    |   50 +
 .../storm/kafka/trident/DefaultCoordinator.java |   31 +
 .../trident/GlobalPartitionInformation.java     |   98 ++
 .../storm/kafka/trident/IBatchCoordinator.java  |   26 +
 .../jvm/storm/kafka/trident/IBrokerReader.java  |   25 +
 .../src/jvm/storm/kafka/trident/MaxMetric.java  |   40 +
 .../kafka/trident/OpaqueTridentKafkaSpout.java  |   59 +
 .../storm/kafka/trident/StaticBrokerReader.java |   36 +
 .../trident/TransactionalTridentKafkaSpout.java |   58 +
 .../storm/kafka/trident/TridentKafkaConfig.java |   37 +
 .../kafka/trident/TridentKafkaEmitter.java      |  268 ++++
 .../jvm/storm/kafka/trident/ZkBrokerReader.java |   70 +
 .../storm/kafka/DynamicBrokersReaderTest.java   |  172 +++
 .../src/test/storm/kafka/KafkaErrorTest.java    |   56 +
 .../src/test/storm/kafka/KafkaTestBroker.java   |   92 ++
 .../src/test/storm/kafka/KafkaUtilsTest.java    |  242 +++
 .../storm/kafka/StringKeyValueSchemeTest.java   |   55 +
 .../src/test/storm/kafka/TestUtils.java         |   37 +
 .../src/test/storm/kafka/ZkCoordinatorTest.java |  147 ++
 .../test/storm/kafka/bolt/KafkaBoltTest.java    |  188 +++
 logback/cluster.xml                             |    2 +-
 pom.xml                                         |  121 +-
 .../maven-shade-clojure-transformer/pom.xml     |    2 +-
 storm-core/pom.xml                              |   60 +-
 .../src/clj/backtype/storm/LocalCluster.clj     |   76 +-
 storm-core/src/clj/backtype/storm/LocalDRPC.clj |    5 +-
 storm-core/src/clj/backtype/storm/bootstrap.clj |    9 +-
 storm-core/src/clj/backtype/storm/clojure.clj   |   10 +-
 storm-core/src/clj/backtype/storm/cluster.clj   |  460 +++---
 .../src/clj/backtype/storm/command/monitor.clj  |   37 +
 .../clj/backtype/storm/command/rebalance.clj    |    7 +-
 storm-core/src/clj/backtype/storm/config.clj    |  145 +-
 .../src/clj/backtype/storm/daemon/common.clj    |    8 +-
 .../src/clj/backtype/storm/daemon/drpc.clj      |  139 +-
 .../src/clj/backtype/storm/daemon/executor.clj  |   46 +-
 .../src/clj/backtype/storm/daemon/logviewer.clj |  182 ++-
 .../src/clj/backtype/storm/daemon/nimbus.clj    |   19 +-
 .../clj/backtype/storm/daemon/supervisor.clj    |  157 +-
 .../src/clj/backtype/storm/daemon/worker.clj    |  101 +-
 storm-core/src/clj/backtype/storm/disruptor.clj |   89 +-
 storm-core/src/clj/backtype/storm/event.clj     |   49 +-
 storm-core/src/clj/backtype/storm/log.clj       |   22 +-
 .../src/clj/backtype/storm/messaging/loader.clj |   81 +-
 .../src/clj/backtype/storm/messaging/local.clj  |   20 +-
 .../clj/backtype/storm/process_simulator.clj    |   27 +-
 storm-core/src/clj/backtype/storm/stats.clj     |  289 ++--
 storm-core/src/clj/backtype/storm/testing.clj   |  545 +++----
 storm-core/src/clj/backtype/storm/testing4j.clj |   58 +-
 storm-core/src/clj/backtype/storm/thrift.clj    |  255 +--
 storm-core/src/clj/backtype/storm/timer.clj     |  109 +-
 storm-core/src/clj/backtype/storm/tuple.clj     |    7 +-
 storm-core/src/clj/backtype/storm/ui/core.clj   | 1453 ++++++++----------
 .../src/clj/backtype/storm/ui/helpers.clj       |   13 +-
 storm-core/src/clj/backtype/storm/util.clj      |  779 +++++-----
 storm-core/src/clj/backtype/storm/zookeeper.clj |  191 ++-
 .../src/dev/resources/tester_bolt_metrics.py    |   35 +
 .../src/dev/resources/tester_spout_metrics.py   |   51 +
 storm-core/src/jvm/backtype/storm/Config.java   |  182 ++-
 .../jvm/backtype/storm/ConfigValidation.java    |   87 ++
 .../src/jvm/backtype/storm/StormSubmitter.java  |  176 ++-
 .../jvm/backtype/storm/generated/ErrorInfo.java |  188 ++-
 .../backtype/storm/messaging/IConnection.java   |   15 +-
 .../backtype/storm/messaging/netty/Client.java  |  332 ++--
 .../backtype/storm/messaging/netty/Context.java |   57 +-
 .../storm/messaging/netty/ControlMessage.java   |    6 +-
 .../storm/messaging/netty/MessageBatch.java     |   52 +-
 .../storm/messaging/netty/MessageDecoder.java   |  108 +-
 .../netty/NettyRenameThreadFactory.java         |   52 +
 .../backtype/storm/messaging/netty/Server.java  |  147 +-
 .../netty/StormClientErrorHandler.java          |   41 +
 .../messaging/netty/StormClientHandler.java     |  121 --
 .../netty/StormClientPipelineFactory.java       |    2 +-
 .../messaging/netty/StormServerHandler.java     |   40 +-
 .../metric/api/rpc/AssignableShellMetric.java   |   30 +
 .../metric/api/rpc/CombinedShellMetric.java     |   31 +
 .../storm/metric/api/rpc/CountShellMetric.java  |   38 +
 .../storm/metric/api/rpc/IShellMetric.java      |   31 +
 .../metric/api/rpc/ReducedShellMetric.java      |   32 +
 .../jvm/backtype/storm/multilang/BoltMsg.java   |   80 +
 .../backtype/storm/multilang/ISerializer.java   |   82 +
 .../storm/multilang/JsonSerializer.java         |  194 +++
 .../storm/multilang/NoOutputException.java      |   40 +
 .../jvm/backtype/storm/multilang/ShellMsg.java  |  168 ++
 .../jvm/backtype/storm/multilang/SpoutMsg.java  |   51 +
 .../src/jvm/backtype/storm/spout/ISpout.java    |    2 +-
 .../jvm/backtype/storm/spout/ShellSpout.java    |  155 +-
 .../src/jvm/backtype/storm/task/ShellBolt.java  |  180 ++-
 .../backtype/storm/task/TopologyContext.java    |   50 +-
 .../storm/testing/PythonShellMetricsBolt.java   |   32 +
 .../storm/testing/PythonShellMetricsSpout.java  |   35 +
 .../storm/testing/TestEventLogSpout.java        |  139 ++
 .../storm/testing/TestEventOrderCheckBolt.java  |   76 +
 .../transactional/state/TransactionalState.java |    2 +-
 .../storm/ui/InvalidRequestException.java       |   20 +
 .../backtype/storm/utils/DisruptorQueue.java    |  121 +-
 .../src/jvm/backtype/storm/utils/Monitor.java   |  249 +++
 .../jvm/backtype/storm/utils/ShellProcess.java  |  195 ++-
 .../src/jvm/backtype/storm/utils/Time.java      |   18 +-
 .../backtype/storm/utils/TransferDrainer.java   |  113 ++
 .../src/jvm/backtype/storm/utils/Utils.java     |  120 +-
 storm-core/src/jvm/storm/trident/Stream.java    |    5 +-
 .../trident/spout/RichSpoutBatchTriggerer.java  |    1 +
 .../jvm/storm/trident/state/map/OpaqueMap.java  |    6 +-
 .../trident/state/map/RemovableMapState.java    |   25 +
 .../storm/trident/testing/MemoryMapState.java   |   27 +-
 .../topology/MasterBatchCoordinator.java        |    4 +
 .../topology/state/TransactionalState.java      |    2 +-
 .../jvm/storm/trident/util/TridentUtils.java    |   14 +-
 storm-core/src/multilang/py/storm.py            |   30 +-
 storm-core/src/multilang/rb/storm.rb            |   24 +-
 storm-core/src/py/storm/ttypes.py               |   28 +-
 storm-core/src/storm.thrift                     |    2 +
 storm-core/src/ui/public/component.html         |  125 ++
 storm-core/src/ui/public/css/style.css          |    1 +
 storm-core/src/ui/public/index.html             |   89 ++
 storm-core/src/ui/public/js/arbor-graphics.js   |   51 +
 storm-core/src/ui/public/js/arbor-tween.js      |   86 ++
 storm-core/src/ui/public/js/arbor.js            |   67 +
 storm-core/src/ui/public/js/jquery.mustache.js  |  592 +++++++
 .../src/ui/public/js/jquery.tablesorter.min.js  |    9 +-
 storm-core/src/ui/public/js/moment.min.js       |    6 +
 storm-core/src/ui/public/js/purl.js             |  267 ++++
 storm-core/src/ui/public/js/script.js           |   60 +-
 storm-core/src/ui/public/js/visualization.js    |  421 +++++
 .../templates/component-page-template.html      |  173 +++
 .../public/templates/index-page-template.html   |   78 +
 .../public/templates/json-error-template.html   |   20 +
 .../templates/topology-page-template.html       |  152 ++
 storm-core/src/ui/public/topology.html          |  119 ++
 .../test/clj/backtype/storm/cluster_test.clj    |   11 +-
 .../test/clj/backtype/storm/config_test.clj     |   61 +-
 .../test/clj/backtype/storm/drpc_test.clj       |   27 +-
 .../clj/backtype/storm/integration_test.clj     |    9 +-
 .../storm/messaging/netty_unit_test.clj         |   46 +-
 .../test/clj/backtype/storm/messaging_test.clj  |   35 +-
 .../test/clj/backtype/storm/metrics_test.clj    |  218 ++-
 .../test/clj/backtype/storm/multilang_test.clj  |    6 +-
 .../test/clj/backtype/storm/nimbus_test.clj     |   16 +-
 .../test/clj/backtype/storm/supervisor_test.clj |  184 ++-
 .../test/clj/backtype/storm/utils_test.clj      |    2 +-
 .../test/clj/storm/trident/integration_test.clj |    2 +-
 .../test/clj/storm/trident/state_test.clj       |   33 +-
 .../storm/utils/DisruptorQueueTest.java         |  152 ++
 storm-dist/binary/LICENSE                       |  154 +-
 storm-dist/binary/NOTICE                        |    4 +-
 storm-dist/binary/pom.xml                       |   42 +-
 storm-dist/binary/src/main/assembly/binary.xml  |   41 +
 storm-dist/source/pom.xml                       |   40 +-
 237 files changed, 20880 insertions(+), 3536 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/1e3a2b80/storm-core/src/jvm/backtype/storm/task/ShellBolt.java
----------------------------------------------------------------------
diff --cc storm-core/src/jvm/backtype/storm/task/ShellBolt.java
index 17938dc,4f8bca5..e677699
--- a/storm-core/src/jvm/backtype/storm/task/ShellBolt.java
+++ b/storm-core/src/jvm/backtype/storm/task/ShellBolt.java
@@@ -240,9 -290,8 +290,11 @@@ public class ShellBolt implements IBol
      }
  
      private void die(Throwable exception) {
-         _exception = exception;
+         String processInfo = _process.getProcessInfoString() + _process.getProcessTerminationInfoString();
+         _exception = new RuntimeException(processInfo, exception);
 +        LOG.error("Halting process: ShellBolt died.", exception);
 +        _collector.reportError(exception);
 +        System.exit(11);
      }
+ 
  }


[45/50] git commit: Merge branch 'STORM-279-V2' of github.com:harshach/incubator-storm

Posted by bo...@apache.org.
Merge branch 'STORM-279-V2' of github.com:harshach/incubator-storm


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

Branch: refs/heads/security
Commit: 598acf9710920028ed0c240dc6add02a895f2f48
Parents: 1e3b8c1 49c12f2
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Fri Aug 8 15:41:25 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri Aug 8 15:41:25 2014 -0400

----------------------------------------------------------------------
 bin/storm                                               |  6 +++++-
 logback/cluster.xml                                     | 12 ++++++------
 storm-core/src/clj/backtype/storm/daemon/supervisor.clj |  2 ++
 storm-core/test/clj/backtype/storm/supervisor_test.clj  |  1 +
 4 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/598acf97/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
----------------------------------------------------------------------


[19/50] git commit: STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages. Also added a topic selector interfac

Posted by bo...@apache.org.
STORM-405: Add kafka trident state so messages can be sent to kafka topics. Added a mapper interface so users can specify there own implementation that converts tuples into kafka keys and messages.
Also added a topic selector interface so users can provide custom implmentation that can chose what topics a tuple should be forwarded to.


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

Branch: refs/heads/security
Commit: c6ef84d13e9e767e6ae21f2772b5ad836e27e43e
Parents: 813ed7f
Author: Parth Brahmbhatt <br...@gmail.com>
Authored: Wed Jul 16 10:58:29 2014 -0700
Committer: Parth Brahmbhatt <br...@gmail.com>
Committed: Wed Jul 30 11:13:03 2014 -0700

----------------------------------------------------------------------
 external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java     | 2 ++
 .../src/jvm/storm/kafka/trident/TridentKafkaState.java           | 4 ++--
 .../storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java   | 3 +--
 3 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/c6ef84d1/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
index 6c9a7d1..51cbfd0 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
@@ -98,6 +98,8 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
             topic = topicSelector.getTopic(input);
             if(topic != null ) {
                 producer.send(new KeyedMessage<K, V>(topic, key, message));
+            } else {
+                LOG.warn("skipping key = " + key + ", topic selector returned null.");
             }
         } catch (Exception ex) {
             LOG.error("Could not send message with key = " + key

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/c6ef84d1/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
index c4ea38d..402ffb1 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/trident/TridentKafkaState.java
@@ -38,8 +38,6 @@ import java.util.Properties;
 public class TridentKafkaState implements State {
     private static final Logger LOG = LoggerFactory.getLogger(TridentKafkaState.class);
 
-
-    public static final String TOPIC = "topic";
     public static final String KAFKA_BROKER_PROPERTIES = "kafka.broker.properties";
 
     private Producer producer;
@@ -87,6 +85,8 @@ public class TridentKafkaState implements State {
                 if(topic != null) {
                     producer.send(new KeyedMessage(topic, mapper.getKeyFromTuple(tuple),
                             mapper.getMessageFromTuple(tuple)));
+                } else {
+                    LOG.warn("skipping key = " + mapper.getKeyFromTuple(tuple) + ", topic selector returned null.");
                 }
             } catch (Exception ex) {
                 String errorMsg = "Could not send message with key = " + mapper.getKeyFromTuple(tuple)

http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/c6ef84d1/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java b/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java
index b64e6ca..9cb7bbf 100644
--- a/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java
+++ b/external/storm-kafka/src/test/storm/kafka/TridentKafkaTopology.java
@@ -65,7 +65,7 @@ public class TridentKafkaTopology {
      * kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partition 1 --topic test
      *
      * run this program and run the kafka consumer:
-     * afka-console-consumer.sh --zookeeper localhost:2181 --whitelist test --from-beginning
+     * kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
      *
      * you should see the messages flowing through.
      *
@@ -94,7 +94,6 @@ public class TridentKafkaTopology {
         props.put("request.required.acks", "1");
         props.put("serializer.class", "kafka.serializer.StringEncoder");
         conf.put(TridentKafkaState.KAFKA_BROKER_PROPERTIES, props);
-        conf.put(TridentKafkaState.TOPIC, "test");
         return conf;
     }
 


[24/50] git commit: Merge branch 'disruptor-update' of https://github.com/miofthena/incubator-storm into STORM-350

Posted by bo...@apache.org.
Merge branch 'disruptor-update' of https://github.com/miofthena/incubator-storm into STORM-350

STORM-350: LMAX Disruptor 3.2.1


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

Branch: refs/heads/security
Commit: 78c5e231f679c84d14258d190c8658f8d0b98ad3
Parents: 9ac0111 8c4684c
Author: Robert (Bobby) Evans <bo...@apache.org>
Authored: Wed Jul 30 19:17:05 2014 -0500
Committer: Robert (Bobby) Evans <bo...@apache.org>
Committed: Wed Jul 30 19:17:05 2014 -0500

----------------------------------------------------------------------
 pom.xml                                         |  4 +-
 storm-core/pom.xml                              |  2 +-
 storm-core/src/clj/backtype/storm/disruptor.clj | 11 ++--
 .../backtype/storm/utils/DisruptorQueue.java    | 56 ++++++++++----------
 .../storm/utils/DisruptorQueueTest.java         | 25 +++++----
 5 files changed, 48 insertions(+), 50 deletions(-)
----------------------------------------------------------------------