[1/3] storm git commit: Ignore socket timeout error from executor
Repository: storm Updated Branches: refs/heads/master abe3ff7f3 -> 655995962 Ignore socket timeout error from executor Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/18a8286f Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/18a8286f Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/18a8286f Branch: refs/heads/master Commit: 18a8286fac462c4616f1550048231f315adc45ef Parents: ec5c962 Author: Paul Poulosky Authored: Wed Feb 8 20:31:14 2017 + Committer: Paul Poulosky Committed: Wed Feb 8 20:31:14 2017 + -- .../jvm/org/apache/storm/executor/error/ReportErrorAndDie.java| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/18a8286f/storm-core/src/jvm/org/apache/storm/executor/error/ReportErrorAndDie.java -- diff --git a/storm-core/src/jvm/org/apache/storm/executor/error/ReportErrorAndDie.java b/storm-core/src/jvm/org/apache/storm/executor/error/ReportErrorAndDie.java index 54736e5..b2e1f34 100644 --- a/storm-core/src/jvm/org/apache/storm/executor/error/ReportErrorAndDie.java +++ b/storm-core/src/jvm/org/apache/storm/executor/error/ReportErrorAndDie.java @@ -39,7 +39,8 @@ public class ReportErrorAndDie implements Thread.UncaughtExceptionHandler { LOG.error("Error while reporting error to cluster, proceeding with shutdown", ex); } if (Utils.exceptionCauseIsInstanceOf(InterruptedException.class, e) -|| Utils.exceptionCauseIsInstanceOf(java.io.InterruptedIOException.class, e)) { +|| (Utils.exceptionCauseIsInstanceOf(java.io.InterruptedIOException.class, e) +&& !Utils.exceptionCauseIsInstanceOf(java.net.SocketTimeoutException.class, e))) { LOG.info("Got interrupted exception shutting thread down..."); } else { suicideFn.run();
[3/3] storm git commit: Updating CHANGELOG.md for STORM-2194
Updating CHANGELOG.md for STORM-2194 Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/65599596 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/65599596 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/65599596 Branch: refs/heads/master Commit: 655995962493031e0758f841bdeb4fb43c6c9950 Parents: bde9ba4 Author: Kyle Nusbaum Authored: Wed Mar 8 15:54:16 2017 -0600 Committer: Kyle Nusbaum Committed: Wed Mar 8 15:54:16 2017 -0600 -- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/storm/blob/65599596/CHANGELOG.md -- diff --git a/CHANGELOG.md b/CHANGELOG.md index 2122b38..692f787 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## 2.0.0 + * STORM-2194: Stop ignoring socket timeout error from executor * STORM-2333: CGroup memory and CPU metrics * STORM-2374: Storm Kafka Client Test Topologies Must be Serializable * STORM-2372: Pacemaker client doesn't clean up heartbeats properly
[2/3] storm git commit: Merge branch 'STORM-2194' of https://github.com/ppoulosk/storm
Merge branch 'STORM-2194' of https://github.com/ppoulosk/storm Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/bde9ba45 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/bde9ba45 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/bde9ba45 Branch: refs/heads/master Commit: bde9ba4584ebc742e51c378deaab296a3c7d5677 Parents: abe3ff7 18a8286 Author: Kyle Nusbaum Authored: Wed Mar 8 15:53:37 2017 -0600 Committer: Kyle Nusbaum Committed: Wed Mar 8 15:53:37 2017 -0600 -- .../jvm/org/apache/storm/executor/error/ReportErrorAndDie.java| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --
storm git commit: Adding STORM-2222 to changelog.
Repository: storm Updated Branches: refs/heads/1.x-branch 6f1b72e7e -> ab3ed3e95 Adding STORM- to changelog. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/ab3ed3e9 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/ab3ed3e9 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/ab3ed3e9 Branch: refs/heads/1.x-branch Commit: ab3ed3e95c091971f11616f9712f807fc12ae1b1 Parents: 6f1b72e Author: Kyle Nusbaum Authored: Thu Dec 22 14:40:19 2016 -0600 Committer: Kyle Nusbaum Committed: Thu Dec 22 14:40:19 2016 -0600 -- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/storm/blob/ab3ed3e9/CHANGELOG.md -- diff --git a/CHANGELOG.md b/CHANGELOG.md index e9065d4..14f801d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## 1.1.0 + * STORM-: Repeated NPEs thrown in nimbus if rebalance fails * STORM-2190: reduce contention between submission and scheduling * STORM-2239: Handle InterruptException in new Kafka spout * STORM-2087: Storm-kafka-client: Failed tuples are not always replayed
[1/2] storm git commit: STORM-2222 Repeated NPEs thrown in nimbus if rebalance fails
Repository: storm Updated Branches: refs/heads/1.x-branch fddd8c996 -> 6f1b72e7e STORM- Repeated NPEs thrown in nimbus if rebalance fails Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/8f610a53 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/8f610a53 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/8f610a53 Branch: refs/heads/1.x-branch Commit: 8f610a53a097d02946fea9dc832a978aec3dd9f5 Parents: 3e720c1 Author: Kyle Nusbaum Authored: Mon Nov 28 13:09:17 2016 -0600 Committer: Kyle Nusbaum Committed: Mon Nov 28 13:09:17 2016 -0600 -- storm-core/src/clj/org/apache/storm/daemon/nimbus.clj | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/8f610a53/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj -- diff --git a/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj b/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj index 2732d81..75c2823 100644 --- a/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj +++ b/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj @@ -291,7 +291,7 @@ (let [rebalance-options (:topology-action-options storm-base)] (.update-storm! (:storm-cluster-state nimbus) storm-id -(-> {:topology-action-options nil} +(-> {} (assoc-non-nil :component->executors (:component->executors rebalance-options)) (assoc-non-nil :num-workers (:num-workers rebalance-options) (mk-assignments nimbus :scratch-topology-id storm-id)) @@ -335,7 +335,9 @@ :kill (kill-transition nimbus storm-id) :do-rebalance (fn [] (do-rebalance nimbus storm-id status storm-base) - (:type (:prev-status storm-base))) + {:status {:type (:type (:prev-status storm-base))} + :prev-status :rebalancing + :topology-action-options nil}) }}) (defn transition! @@ -388,7 +390,7 @@ (defn delay-event [nimbus storm-id delay-secs event] (log-message "Delaying event " event " for " delay-secs " secs for " storm-id) (schedule (:timer nimbus) -delay-secs +(or delay-secs 0) #(try (transition! nimbus storm-id event false) (catch Exception e (log-error e "Exception while trying transition for " storm-id " and event " event)
[2/2] storm git commit: Merge branch '1.x-branch' of https://github.com/knusbaum/incubator-storm into HEAD
Merge branch '1.x-branch' of https://github.com/knusbaum/incubator-storm into HEAD Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/6f1b72e7 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/6f1b72e7 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/6f1b72e7 Branch: refs/heads/1.x-branch Commit: 6f1b72e7efbe2228519a05fdb96fedb085f501ff Parents: fddd8c9 8f610a5 Author: Kyle Nusbaum Authored: Thu Dec 22 14:23:57 2016 -0600 Committer: Kyle Nusbaum Committed: Thu Dec 22 14:23:57 2016 -0600 -- storm-core/src/clj/org/apache/storm/daemon/nimbus.clj | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/6f1b72e7/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj --
[2/3] storm git commit: Merge branch '1.0.x-branch' of https://github.com/knusbaum/incubator-storm into HEAD
Merge branch '1.0.x-branch' of https://github.com/knusbaum/incubator-storm into HEAD Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/61935a7d Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/61935a7d Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/61935a7d Branch: refs/heads/1.0.x-branch Commit: 61935a7debaca02710e4cb05301098b0a17f9de7 Parents: fabd37b c9b80da Author: Kyle Nusbaum Authored: Thu Dec 22 12:34:30 2016 -0600 Committer: Kyle Nusbaum Committed: Thu Dec 22 12:34:30 2016 -0600 -- storm-core/src/clj/org/apache/storm/daemon/nimbus.clj | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) --
[3/3] storm git commit: Updating CHANGELOG
Updating CHANGELOG Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/07410fe6 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/07410fe6 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/07410fe6 Branch: refs/heads/1.0.x-branch Commit: 07410fe6901ff1c38b35fc04d7c115413b5c3335 Parents: 61935a7 Author: Kyle Nusbaum Authored: Thu Dec 22 12:37:00 2016 -0600 Committer: Kyle Nusbaum Committed: Thu Dec 22 12:37:00 2016 -0600 -- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/storm/blob/07410fe6/CHANGELOG.md -- diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b5ddc4..823361c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## 1.0.3 + * STORM-: Repeated NPEs thrown in nimbus if rebalance fails * STORM-2251: Integration test refers specific version of Storm which should be project version * STORM-2234: heartBeatExecutorService in shellSpout don't work well with deactivate * STORM-2216: Favor JSONValue.parseWithException
[1/3] storm git commit: STORM-2222 Repeated NPEs thrown in nimbus if rebalance fails
Repository: storm Updated Branches: refs/heads/1.0.x-branch fabd37bdb -> 07410fe69 STORM- Repeated NPEs thrown in nimbus if rebalance fails Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/c9b80da9 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/c9b80da9 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/c9b80da9 Branch: refs/heads/1.0.x-branch Commit: c9b80da918510e16ce239a4e8bfbb0b8c22f9358 Parents: a06f521 Author: Kyle Nusbaum Authored: Mon Nov 28 13:09:17 2016 -0600 Committer: Kyle Nusbaum Committed: Mon Nov 28 13:21:59 2016 -0600 -- storm-core/src/clj/org/apache/storm/daemon/nimbus.clj | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/c9b80da9/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj -- diff --git a/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj b/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj index e55e7eb..daccb83 100644 --- a/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj +++ b/storm-core/src/clj/org/apache/storm/daemon/nimbus.clj @@ -276,7 +276,7 @@ (let [rebalance-options (:topology-action-options storm-base)] (.update-storm! (:storm-cluster-state nimbus) storm-id -(-> {:topology-action-options nil} +(-> {} (assoc-non-nil :component->executors (:component->executors rebalance-options)) (assoc-non-nil :num-workers (:num-workers rebalance-options) (mk-assignments nimbus :scratch-topology-id storm-id)) @@ -320,7 +320,9 @@ :kill (kill-transition nimbus storm-id) :do-rebalance (fn [] (do-rebalance nimbus storm-id status storm-base) - (:type (:prev-status storm-base))) + {:status {:type (:type (:prev-status storm-base))} + :prev-status :rebalancing + :topology-action-options nil}) }}) (defn transition! @@ -373,7 +375,7 @@ (defn delay-event [nimbus storm-id delay-secs event] (log-message "Delaying event " event " for " delay-secs " secs for " storm-id) (schedule (:timer nimbus) -delay-secs +(or delay-secs 0) #(try (transition! nimbus storm-id event false) (catch Exception e (log-error e "Exception while trying transition for " storm-id " and event " event)
[3/4] storm git commit: Merge branch 'STORM-2192' of https://github.com/tgravescs/storm
Merge branch 'STORM-2192' of https://github.com/tgravescs/storm Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/aa49508b Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/aa49508b Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/aa49508b Branch: refs/heads/master Commit: aa49508b052661a7bdc32b96a961fbc70726a7cc Parents: 397a131 afb0291 Author: Kyle Nusbaum Authored: Tue Nov 15 12:30:46 2016 -0600 Committer: Kyle Nusbaum Committed: Tue Nov 15 12:30:46 2016 -0600 -- .../org/apache/storm/security/auth/AutoSSL.java | 161 +++ .../apache/storm/security/auth/AutoSSLTest.java | 136 2 files changed, 297 insertions(+) --
[2/4] storm git commit: add license to test file
add license to test file Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/afb02919 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/afb02919 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/afb02919 Branch: refs/heads/master Commit: afb029194d94d3a0628d5c87236a75751d6e9398 Parents: 4efb0e6 Author: Thomas Graves Authored: Wed Nov 9 15:41:00 2016 + Committer: Thomas Graves Committed: Wed Nov 9 15:41:00 2016 + -- .../apache/storm/security/auth/AutoSSLTest.java| 17 + 1 file changed, 17 insertions(+) -- http://git-wip-us.apache.org/repos/asf/storm/blob/afb02919/storm-core/test/jvm/org/apache/storm/security/auth/AutoSSLTest.java -- diff --git a/storm-core/test/jvm/org/apache/storm/security/auth/AutoSSLTest.java b/storm-core/test/jvm/org/apache/storm/security/auth/AutoSSLTest.java index 282a5f9..18b76d2 100644 --- a/storm-core/test/jvm/org/apache/storm/security/auth/AutoSSLTest.java +++ b/storm-core/test/jvm/org/apache/storm/security/auth/AutoSSLTest.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 org.apache.storm.security.auth; import java.io.File;
[1/4] storm git commit: [STORM-2192] Add a new IAutoCredentials plugin to support SSL files
Repository: storm Updated Branches: refs/heads/master 397a131dd -> 69eee3129 [STORM-2192] Add a new IAutoCredentials plugin to support SSL files Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/4efb0e66 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/4efb0e66 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/4efb0e66 Branch: refs/heads/master Commit: 4efb0e66ef3088d0122a3511b55aa533f2e89cbd Parents: 6dc6407 Author: Thomas Graves Authored: Tue Nov 8 19:28:56 2016 + Committer: Thomas Graves Committed: Tue Nov 8 19:28:56 2016 + -- .../org/apache/storm/security/auth/AutoSSL.java | 161 +++ .../apache/storm/security/auth/AutoSSLTest.java | 119 ++ 2 files changed, 280 insertions(+) -- http://git-wip-us.apache.org/repos/asf/storm/blob/4efb0e66/storm-core/src/jvm/org/apache/storm/security/auth/AutoSSL.java -- diff --git a/storm-core/src/jvm/org/apache/storm/security/auth/AutoSSL.java b/storm-core/src/jvm/org/apache/storm/security/auth/AutoSSL.java new file mode 100644 index 000..7838855 --- /dev/null +++ b/storm-core/src/jvm/org/apache/storm/security/auth/AutoSSL.java @@ -0,0 +1,161 @@ +/** + * 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.security.auth; + +import com.google.common.annotations.VisibleForTesting; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.security.auth.Subject; +import javax.xml.bind.DatatypeConverter; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.util.Arrays; +import java.util.Collection; +import java.util.Map; + +/** + * This plugin is intended to be used for user topologies to send SSL keystore/truststore files + * to the remote workers. + * On the client side, this takes the files specified in ssl.credential.files, reads the + * file contents, base64's it, converts it to a String, and adds it to the credentials map. + * The key in the credentials map is the name of the file. On the worker side it uses the + * filenames from the ssl.credential.files config to lookup the keys in the credentials map and + * decodes it and writes it back out as a file. + * + * User is responsible for referencing them from the topology code as ./. + */ +public class AutoSSL implements IAutoCredentials { +private static final Logger LOG = LoggerFactory.getLogger(AutoSSL.class); +private Map conf; +private String writeDir = "./"; + +public static final String SSL_FILES_CONF = "ssl.credential.files"; + +public void prepare(Map conf) { +this.conf = conf; +writeDir = getSSLWriteDirFromConf(this.conf); +} + +@VisibleForTesting +protected String getSSLWriteDirFromConf(Map conf) { + return "./"; +} + +@VisibleForTesting +Collection getSSLFilesFromConf(Map conf) { +Object sslConf = conf.get(SSL_FILES_CONF); +if (sslConf == null) { +LOG.info("No ssl files requested, if you want to use SSL please set {} to the " + +"list of files", SSL_FILES_CONF); +return null; +} +Collection sslFiles = null; +if (sslConf instanceof Collection) { +sslFiles = (Collection) sslConf; +} else if (sslConf instanceof String) { +sslFiles = Arrays.asList(((String) sslConf).split(",")); +} else { +throw new RuntimeException( +SSL_FILES_CONF + " is not set to something that I know how to use " + sslConf); +} +return sslFiles; +} + +@Override +public void populateCredentials(Map credentials) { +try { +Collection sslFiles = getSSLFilesFromConf(conf); +if (sslFiles == null) { +return; +} +LOG.info("AutoSSL files: {}", sslFiles); +for (String inputFile : sslFiles) { +seria
[4/4] storm git commit: Updating CHANGELOG to add STORM-2192
Updating CHANGELOG to add STORM-2192 Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/69eee312 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/69eee312 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/69eee312 Branch: refs/heads/master Commit: 69eee312903f74d8dad287f97fc7227399c58f76 Parents: aa49508 Author: Kyle Nusbaum Authored: Tue Nov 15 12:32:04 2016 -0600 Committer: Kyle Nusbaum Committed: Tue Nov 15 12:32:04 2016 -0600 -- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/storm/blob/69eee312/CHANGELOG.md -- diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f73966..89ac3e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## 2.0.0 + * STORM-2192: Add a new IAutoCredentials plugin to support SSL files * STORM-2197: NimbusClient connectins leak due to leakage in ThriftClient * STORM-2185: Storm Supervisor doesn't delete directories properly sometimes * STORM-2188: Interrupt all executor threads before joining in executor shutdown
[1/3] storm git commit: STORM-2012: Upgrade Kafka to 0.8.2.2
Repository: storm Updated Branches: refs/heads/master 74c31164d -> b2e7388d6 STORM-2012: Upgrade Kafka to 0.8.2.2 Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/3fb327a8 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/3fb327a8 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/3fb327a8 Branch: refs/heads/master Commit: 3fb327a87c1c3060f96bd8b262e8526d8c1f3848 Parents: 8dd7be0 Author: Xin Wang Authored: Tue Aug 2 15:42:42 2016 +0800 Committer: GitHub Committed: Tue Aug 2 15:42:42 2016 +0800 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/3fb327a8/pom.xml -- diff --git a/pom.xml b/pom.xml index 0a4e65b..6b61199 100644 --- a/pom.xml +++ b/pom.xml @@ -259,7 +259,7 @@ 2.6.3 2.18.1 -0.8.2.1 +0.8.2.2 kafka_2.10
[2/3] storm git commit: Merge branch 'patch-26' of https://github.com/vesense/storm
Merge branch 'patch-26' of https://github.com/vesense/storm Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/8635dcfe Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/8635dcfe Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/8635dcfe Branch: refs/heads/master Commit: 8635dcfe246cd4fcdd1dfceed8111ed5640f4406 Parents: 74c3116 3fb327a Author: Kyle Nusbaum Authored: Tue Oct 18 10:37:57 2016 -0500 Committer: Kyle Nusbaum Committed: Tue Oct 18 10:37:57 2016 -0500 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/8635dcfe/pom.xml --
[3/3] storm git commit: Updating CHANGELOG with STORM-2012
Updating CHANGELOG with STORM-2012 Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/b2e7388d Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/b2e7388d Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/b2e7388d Branch: refs/heads/master Commit: b2e7388d622bac6042c7617f2232b9802e83daa5 Parents: 8635dcf Author: Kyle Nusbaum Authored: Tue Oct 18 10:38:38 2016 -0500 Committer: Kyle Nusbaum Committed: Tue Oct 18 10:38:38 2016 -0500 -- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/storm/blob/b2e7388d/CHANGELOG.md -- diff --git a/CHANGELOG.md b/CHANGELOG.md index 1944f11..2bb1ec5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## 2.0.0 + * STORM-2012: Upgrade Kafka to 0.8.2.2 * STORM-2142: ReportErrorAndDie runs suicide function only when InterruptedException or InterruptedIOException is thrown * STORM-2134: improving the current scheduling strategy for RAS * STORM-2131: Add blob command to worker-launcher, make stormdist directory not writeable by topo owner
[storm] Git Push Summary
Repository: storm Updated Branches: refs/heads/Pacemaker-HA-1.x-branch2 [deleted] 8e121dcee
[20/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/KeyNotFoundException.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/KeyNotFoundException.java b/storm-core/src/jvm/backtype/storm/generated/KeyNotFoundException.java deleted file mode 100644 index d55564c..000 --- a/storm-core/src/jvm/backtype/storm/generated/KeyNotFoundException.java +++ /dev/null @@ -1,406 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class KeyNotFoundException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("KeyNotFoundException"); - - private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("msg", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new KeyNotFoundExceptionStandardSchemeFactory()); -schemes.put(TupleScheme.class, new KeyNotFoundExceptionTupleSchemeFactory()); - } - - private String msg; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -MSG((short)1, "msg"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // MSG - return MSG; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; -} - -/** - * Find the _Fields constant that matches name, or null if its not found. - */ -public static _Fields findByName(String name) { - return byName.get(name); -} - -private final short _thriftId; -private final String _fieldName; - -_Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; -} - -public short getThriftFieldId() { - return _thriftId; -} - -public String getFieldName() { - return _fieldName; -} - } - - // isset id assignments - public static final Map<_Fields, org.apache.t
[30/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ComponentAggregateStats.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/ComponentAggregateStats.java b/storm-core/src/jvm/backtype/storm/generated/ComponentAggregateStats.java deleted file mode 100644 index 2c68331..000 --- a/storm-core/src/jvm/backtype/storm/generated/ComponentAggregateStats.java +++ /dev/null @@ -1,752 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class ComponentAggregateStats implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComponentAggregateStats"); - - private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField COMMON_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("common_stats", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField SPECIFIC_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("specific_stats", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField LAST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("last_error", org.apache.thrift.protocol.TType.STRUCT, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new ComponentAggregateStatsStandardSchemeFactory()); -schemes.put(TupleScheme.class, new ComponentAggregateStatsTupleSchemeFactory()); - } - - private ComponentType type; // optional - private CommonAggregateStats common_stats; // optional - private SpecificAggregateStats specific_stats; // optional - private ErrorInfo last_error; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -/** - * - * @see ComponentType - */ -TYPE((short)1, "type"), -COMMON_STATS((short)2, "common_stats"), -SPECIFIC_STATS((short)3, "specific_stats"), -LAST_ERROR((short)4, "last_error"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // TYPE - return TYPE; -case 2: // COMMON_STATS - return COMMON_STATS; -case 3: // SPECIFIC_
[34/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/AccessControl.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/AccessControl.java b/storm-core/src/jvm/backtype/storm/generated/AccessControl.java deleted file mode 100644 index c1c072a..000 --- a/storm-core/src/jvm/backtype/storm/generated/AccessControl.java +++ /dev/null @@ -1,627 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class AccessControl implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AccessControl"); - - private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField ACCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("access", org.apache.thrift.protocol.TType.I32, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new AccessControlStandardSchemeFactory()); -schemes.put(TupleScheme.class, new AccessControlTupleSchemeFactory()); - } - - private AccessControlType type; // required - private String name; // optional - private int access; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -/** - * - * @see AccessControlType - */ -TYPE((short)1, "type"), -NAME((short)2, "name"), -ACCESS((short)3, "access"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // TYPE - return TYPE; -case 2: // NAME - return NAME; -case 3: // ACCESS - return ACCESS; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; -} - -/** - * Find the
[41/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/ui/core.clj -- diff --git a/storm-core/src/clj/backtype/storm/ui/core.clj b/storm-core/src/clj/backtype/storm/ui/core.clj deleted file mode 100644 index 4365f27..000 --- a/storm-core/src/clj/backtype/storm/ui/core.clj +++ /dev/null @@ -1,1487 +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. - -(ns org.apache.storm.ui.core - (:use compojure.core) - (:use [clojure.java.shell :only [sh]]) - (:use ring.middleware.reload -ring.middleware.multipart-params -ring.middleware.multipart-params.temp-file) - (:use [ring.middleware.json :only [wrap-json-params]]) - (:use [hiccup core page-helpers]) - (:use [org.apache.storm config util log stats zookeeper converter]) - (:use [org.apache.storm.ui helpers]) - (:use [org.apache.storm.daemon [common :only [ACKER-COMPONENT-ID ACKER-INIT-STREAM-ID ACKER-ACK-STREAM-ID - ACKER-FAIL-STREAM-ID mk-authorization-handler - start-metrics-reporters]]]) - (:import [org.apache.storm.utils Utils TopologySpoutLag] - [org.apache.storm.generated NimbusSummary]) - (:use [clojure.string :only [blank? lower-case trim split]]) - (:import [org.apache.storm.generated ExecutorSpecificStats -ExecutorStats ExecutorSummary ExecutorInfo TopologyInfo SpoutStats BoltStats -ErrorInfo ClusterSummary SupervisorSummary TopologySummary -Nimbus$Client StormTopology GlobalStreamId RebalanceOptions -KillOptions GetInfoOptions NumErrorsChoice DebugOptions TopologyPageInfo -TopologyStats CommonAggregateStats ComponentAggregateStats -ComponentType BoltAggregateStats SpoutAggregateStats -ExecutorAggregateStats SpecificAggregateStats ComponentPageInfo -LogConfig LogLevel LogLevelAction SupervisorPageInfo WorkerSummary]) - (:import [org.apache.storm.security.auth AuthUtils ReqContext]) - (:import [org.apache.storm.generated AuthorizationException ProfileRequest ProfileAction NodeInfo]) - (:import [org.apache.storm.security.auth AuthUtils]) - (:import [org.apache.storm.utils VersionInfo]) - (:import [org.apache.storm Config]) - (:import [java.io File]) - (:require [compojure.route :as route] -[compojure.handler :as handler] -[ring.util.response :as resp] -[org.apache.storm [thrift :as thrift]]) - (:require [ring.middleware.cors :refer [wrap-cors]]) - (:require [metrics.meters :refer [defmeter mark!]]) - (:import [org.apache.commons.lang StringEscapeUtils]) - (:import [org.apache.logging.log4j Level]) - (:gen-class)) - -(def ^:dynamic *STORM-CONF* (read-storm-config)) -(def ^:dynamic *UI-ACL-HANDLER* (mk-authorization-handler (*STORM-CONF* NIMBUS-AUTHORIZER) *STORM-CONF*)) -(def ^:dynamic *UI-IMPERSONATION-HANDLER* (mk-authorization-handler (*STORM-CONF* NIMBUS-IMPERSONATION-AUTHORIZER) *STORM-CONF*)) -(def http-creds-handler (AuthUtils/GetUiHttpCredentialsPlugin *STORM-CONF*)) -(def STORM-VERSION (VersionInfo/getVersion)) - -(defmeter ui:num-cluster-configuration-http-requests) -(defmeter ui:num-cluster-summary-http-requests) -(defmeter ui:num-nimbus-summary-http-requests) -(defmeter ui:num-supervisor-http-requests) -(defmeter ui:num-supervisor-summary-http-requests) -(defmeter ui:num-all-topologies-summary-http-requests) -(defmeter ui:num-topology-page-http-requests) -(defmeter ui:num-topology-metric-http-requests) -(defmeter ui:num-topology-lag-http-requests) -(defmeter ui:num-build-visualization-http-requests) -(defmeter ui:num-mk-visualization-data-http-requests) -(defmeter ui:num-component-page-http-requests) -(defmeter ui:num-log-config-http-requests) -(defmeter ui:num-activate-topology-http-requests) -(defmeter ui:num-deactivate-topology-http-requests) -(defmeter ui:num-debug-topology-http-requests) -(defmeter ui:num-component-op-response-http-requests) -(defmeter ui:num-topology-op-response-http-requests) -(defmeter ui:num-topology-op-response-http-requests) -(defmeter ui:num-topology-op-response-http-requests) -(defmet
[19/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LSTopoHistory.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/LSTopoHistory.java b/storm-core/src/jvm/backtype/storm/generated/LSTopoHistory.java deleted file mode 100644 index 792c185..000 --- a/storm-core/src/jvm/backtype/storm/generated/LSTopoHistory.java +++ /dev/null @@ -1,805 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class LSTopoHistory implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LSTopoHistory"); - - private static final org.apache.thrift.protocol.TField TOPOLOGY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField TIME_STAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("time_stamp", org.apache.thrift.protocol.TType.I64, (short)2); - private static final org.apache.thrift.protocol.TField USERS_FIELD_DESC = new org.apache.thrift.protocol.TField("users", org.apache.thrift.protocol.TType.LIST, (short)3); - private static final org.apache.thrift.protocol.TField GROUPS_FIELD_DESC = new org.apache.thrift.protocol.TField("groups", org.apache.thrift.protocol.TType.LIST, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new LSTopoHistoryStandardSchemeFactory()); -schemes.put(TupleScheme.class, new LSTopoHistoryTupleSchemeFactory()); - } - - private String topology_id; // required - private long time_stamp; // required - private List users; // required - private List groups; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -TOPOLOGY_ID((short)1, "topology_id"), -TIME_STAMP((short)2, "time_stamp"), -USERS((short)3, "users"), -GROUPS((short)4, "groups"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // TOPOLOGY_ID - return TOPOLOGY_ID; -case 2: // TIME_STAMP - return TIME_STAMP; -case 3: // USERS - return USERS; -case 4: // GROUPS - return GROUPS; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an except
[25/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ErrorInfo.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/ErrorInfo.java b/storm-core/src/jvm/backtype/storm/generated/ErrorInfo.java deleted file mode 100644 index 2ab536d..000 --- a/storm-core/src/jvm/backtype/storm/generated/ErrorInfo.java +++ /dev/null @@ -1,714 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class ErrorInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ErrorInfo"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField ERROR_TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("error_time_secs", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new ErrorInfoStandardSchemeFactory()); -schemes.put(TupleScheme.class, new ErrorInfoTupleSchemeFactory()); - } - - private String error; // required - private int error_time_secs; // required - private String host; // optional - private int port; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -ERROR((short)1, "error"), -ERROR_TIME_SECS((short)2, "error_time_secs"), -HOST((short)3, "host"), -PORT((short)4, "port"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // ERROR - return ERROR; -case 2: // ERROR_TIME_SECS - return ERROR_TIME_SECS; -case 3: // HOST - return HOST; -case 4: // PORT - return PORT; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static
[03/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologySummary.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologySummary.java b/storm-core/src/jvm/backtype/storm/generated/TopologySummary.java deleted file mode 100644 index 8b7cd75..000 --- a/storm-core/src/jvm/backtype/storm/generated/TopologySummary.java +++ /dev/null @@ -1,1901 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TopologySummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologySummary"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField NUM_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_tasks", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField NUM_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_executors", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)5); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)6); - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)7); - private static final org.apache.thrift.protocol.TField SCHED_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("sched_status", org.apache.thrift.protocol.TType.STRING, (short)513); - private static final org.apache.thrift.protocol.TField OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)514); - private static final org.apache.thrift.protocol.TField REPLICATION_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("replication_count", org.apache.thrift.protocol.TType.I32, (short)515); - private static final org.apache.thrift.protocol.TField REQUESTED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)521); - private static final org.apache.thrift.protocol.TField REQUESTED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memoffheap", org.
[54/55] [abbrv] storm git commit: Working on cleaning up the PR.
Working on cleaning up the PR. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/737847c2 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/737847c2 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/737847c2 Branch: refs/heads/Pacemaker-HA-1.x-branch2 Commit: 737847c24f47b50c3c199d686f8e386d2cb28f2b Parents: 9c58604 Author: Kyle Nusbaum Authored: Mon Oct 10 11:10:05 2016 -0500 Committer: Kyle Nusbaum Committed: Mon Oct 10 11:10:05 2016 -0500 -- .../netty/KerberosSaslNettyClient.java | 1 - .../apache/storm/pacemaker/PacemakerClient.java | 24 +++- 2 files changed, 8 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/737847c2/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java -- diff --git a/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java b/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java index 00459e2..4402c09 100644 --- a/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java +++ b/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java @@ -111,7 +111,6 @@ public class KerberosSaslNettyClient { try { Principal principal = (Principal)subject.getPrincipals().toArray()[0]; final String fPrincipalName = principal.getName(); -KerberosName kerbName = new KerberosName(principal.getName()); final String fHost = host; final String fServiceName = serviceName; final CallbackHandler fch = ch; http://git-wip-us.apache.org/repos/asf/storm/blob/737847c2/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java -- diff --git a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java index d555dae..67201b8 100644 --- a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java +++ b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java @@ -45,7 +45,7 @@ public class PacemakerClient implements ISaslClient { private static final Logger LOG = LoggerFactory.getLogger(PacemakerClient.class); -private String topo_name; +private String client_name; private String secret; private AtomicBoolean ready; private final ClientBootstrap bootstrap; @@ -55,22 +55,16 @@ public class PacemakerClient implements ISaslClient { private HBMessage messages[]; private LinkedBlockingQueue availableMessageSlots; private ThriftNettyClientCodec.AuthMethod authMethod; -private static Timer timer; -private String host; - -static { -timer = new Timer(true); -} +private static Timer timer = new Timer(true); private StormBoundedExponentialBackoffRetry backoff = new StormBoundedExponentialBackoffRetry(100, 5000, 20); private int retryTimes = 0; public PacemakerClient(Map config, String host) { -this.host = host; int port = (int)config.get(Config.PACEMAKER_PORT); -topo_name = (String)config.get(Config.TOPOLOGY_NAME); -if(topo_name == null) { -topo_name = "pacemaker-client"; +client_name = (String)config.get(Config.TOPOLOGY_NAME); +if(client_name == null) { +client_name = "pacemaker-client"; } String auth = (String)config.get(Config.PACEMAKER_AUTH_METHOD); @@ -122,10 +116,6 @@ public class PacemakerClient implements ISaslClient { bootstrap.connect(remote_addr); } -public String toString() { -return host; -} - private void setupMessaging() { messages = new HBMessage[maxPending]; availableMessageSlots = new LinkedBlockingQueue(); @@ -134,6 +124,7 @@ public class PacemakerClient implements ISaslClient { } } +@Override public synchronized void channelConnected(Channel channel) { Channel oldChannel = channelRef.get(); if (oldChannel != null) { @@ -156,6 +147,7 @@ public class PacemakerClient implements ISaslClient { return ready.get(); } +@Override public synchronized void channelReady() { LOG.debug("Channel is ready."); ready.set(true); @@ -163,7 +155,7 @@ public class PacemakerClient implements ISaslClient { } public String name() { -return topo_name; +return client_name; } public String secretKey() {
[22/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/HBMessage.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/HBMessage.java b/storm-core/src/jvm/backtype/storm/generated/HBMessage.java deleted file mode 100644 index 29d3b21..000 --- a/storm-core/src/jvm/backtype/storm/generated/HBMessage.java +++ /dev/null @@ -1,636 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class HBMessage implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HBMessage"); - - private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField MESSAGE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("message_id", org.apache.thrift.protocol.TType.I32, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new HBMessageStandardSchemeFactory()); -schemes.put(TupleScheme.class, new HBMessageTupleSchemeFactory()); - } - - private HBServerMessageType type; // required - private HBMessageData data; // required - private int message_id; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -/** - * - * @see HBServerMessageType - */ -TYPE((short)1, "type"), -DATA((short)2, "data"), -MESSAGE_ID((short)3, "message_id"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // TYPE - return TYPE; -case 2: // DATA - return DATA; -case 3: // MESSAGE_ID - return MESSAGE_ID; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; -} - -/** - * Find
[40/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/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 deleted file mode 100644 index 75ea0dc..000 --- a/storm-core/src/clj/backtype/storm/util.clj +++ /dev/null @@ -1,1134 +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. - -(ns org.apache.storm.util - (:import [java.net InetAddress]) - (:import [java.util Map Map$Entry List ArrayList Collection Iterator HashMap]) - (:import [java.io FileReader FileNotFoundException]) - (:import [java.nio.file Paths]) - (:import [org.apache.storm Config]) - (:import [org.apache.storm.utils Time Container ClojureTimerTask Utils -MutableObject MutableInt]) - (:import [org.apache.storm.security.auth NimbusPrincipal]) - (:import [javax.security.auth Subject]) - (:import [java.util UUID Random ArrayList List Collections]) - (:import [java.util.zip ZipFile]) - (:import [java.util.concurrent.locks ReentrantReadWriteLock]) - (:import [java.util.concurrent Semaphore]) - (:import [java.nio.file Files Paths]) - (:import [java.nio.file.attribute FileAttribute]) - (:import [java.io File FileOutputStream RandomAccessFile StringWriter -PrintWriter BufferedReader InputStreamReader IOException]) - (:import [java.lang.management ManagementFactory]) - (:import [org.apache.commons.exec DefaultExecutor CommandLine]) - (:import [org.apache.commons.io FileUtils]) - (:import [org.apache.storm.logging ThriftAccessLogger]) - (:import [org.apache.commons.exec ExecuteException]) - (:import [org.json.simple JSONValue]) - (:import [org.yaml.snakeyaml Yaml] - [org.yaml.snakeyaml.constructor SafeConstructor]) - (:require [clojure [string :as str]]) - (:import [clojure.lang RT]) - (:require [clojure [set :as set]]) - (:require [clojure.java.io :as io]) - (:use [clojure walk]) - (:require [ring.util.codec :as codec]) - (:use [org.apache.storm log])) - -(defn wrap-in-runtime - "Wraps an exception in a RuntimeException if needed" - [^Exception e] - (if (instance? RuntimeException e) -e -(RuntimeException. e))) - -(def on-windows? - (= "Windows_NT" (System/getenv "OS"))) - -(def file-path-separator - (System/getProperty "file.separator")) - -(def class-path-separator - (System/getProperty "path.separator")) - -(defn is-absolute-path? [path] - (.isAbsolute (Paths/get path (into-array String [] - -(defmacro defalias - "Defines an alias for a var: a new var with the same root binding (if - any) and similar metadata. The metadata of the alias is its initial - metadata (as provided by def) merged into the metadata of the original." - ([name orig] - `(do - (alter-meta! -(if (.hasRoot (var ~orig)) - (def ~name (.getRawRoot (var ~orig))) - (def ~name)) -;; When copying metadata, disregard {:macro false}. -;; Workaround for http://www.assembla.com/spaces/clojure/tickets/273 -#(conj (dissoc % :macro) - (apply dissoc (meta (var ~orig)) (remove #{:macro} (keys %) - (var ~name))) - ([name orig doc] - (list `defalias (with-meta name (assoc (meta name) :doc doc)) orig))) - -;; name-with-attributes by Konrad Hinsen: -(defn name-with-attributes - "To be used in macro definitions. - Handles optional docstrings and attribute maps for a name to be defined - in a list of macro arguments. If the first macro argument is a string, - it is added as a docstring to name and removed from the macro argument - list. If afterwards the first macro argument is a map, its entries are - added to the name's metadata map and the map is removed from the - macro argument list. The return value is a vector containing the name - with its extended metadata map and the list of unprocessed macro - arguments." - [name macro-args] - (let [[docstring macro-args] (if (string? (first macro-args)) - [(first macro-args) (next macro-args)] - [nil macro-args]) -[attr macro-args] (if (map? (first macro-args)) -[(
[02/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/WorkerResources.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/WorkerResources.java b/storm-core/src/jvm/backtype/storm/generated/WorkerResources.java deleted file mode 100644 index ca424b3..000 --- a/storm-core/src/jvm/backtype/storm/generated/WorkerResources.java +++ /dev/null @@ -1,605 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class WorkerResources implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkerResources"); - - private static final org.apache.thrift.protocol.TField MEM_ON_HEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("mem_on_heap", org.apache.thrift.protocol.TType.DOUBLE, (short)1); - private static final org.apache.thrift.protocol.TField MEM_OFF_HEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("mem_off_heap", org.apache.thrift.protocol.TType.DOUBLE, (short)2); - private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.DOUBLE, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new WorkerResourcesStandardSchemeFactory()); -schemes.put(TupleScheme.class, new WorkerResourcesTupleSchemeFactory()); - } - - private double mem_on_heap; // optional - private double mem_off_heap; // optional - private double cpu; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -MEM_ON_HEAP((short)1, "mem_on_heap"), -MEM_OFF_HEAP((short)2, "mem_off_heap"), -CPU((short)3, "cpu"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // MEM_ON_HEAP - return MEM_ON_HEAP; -case 2: // MEM_OFF_HEAP - return MEM_OFF_HEAP; -case 3: // CPU - return CPU; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fi
[45/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/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 deleted file mode 100644 index 2888258..000 --- a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj +++ /dev/null @@ -1,1272 +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. -(ns org.apache.storm.daemon.supervisor - (:import [java.io File IOException FileOutputStream]) - (:import [org.apache.storm.scheduler ISupervisor] - [org.apache.storm.utils LocalState Time Utils] - [org.apache.storm.daemon Shutdownable] - [org.apache.storm Constants] - [org.apache.storm.cluster ClusterStateContext DaemonType] - [java.net JarURLConnection] - [java.net URI] - [org.apache.commons.io FileUtils]) - (:use [org.apache.storm config util log timer local-state]) - (:import [org.apache.storm.generated AuthorizationException KeyNotFoundException WorkerResources]) - (:import [org.apache.storm.utils NimbusLeaderNotFoundException VersionInfo]) - (:import [java.nio.file Files StandardCopyOption]) - (:import [org.apache.storm Config]) - (:import [org.apache.storm.generated WorkerResources ProfileAction StormTopology]) - (:import [org.apache.storm.localizer LocalResource]) - (:use [org.apache.storm.daemon common]) - (:require [org.apache.storm.command [healthcheck :as healthcheck]]) - (:require [org.apache.storm.daemon [worker :as worker]] -[org.apache.storm [process-simulator :as psim] [cluster :as cluster] [event :as event]] -[clojure.set :as set]) - (:import [org.apache.thrift.transport TTransportException]) - (:import [org.apache.zookeeper data.ACL ZooDefs$Ids ZooDefs$Perms]) - (:import [org.yaml.snakeyaml Yaml] - [org.yaml.snakeyaml.constructor SafeConstructor]) - (:require [metrics.gauges :refer [defgauge]]) - (:require [metrics.meters :refer [defmeter mark!]]) - (:gen-class -:methods [^{:static true} [launch [org.apache.storm.scheduler.ISupervisor] void]])) - -; declare to avoid triggering forward reference issue -(declare rm-topo-files assigned-storm-ids-from-port-assignments) - -(defmeter supervisor:num-workers-launched) - -(defmulti download-storm-code cluster-mode) -(defmulti launch-worker (fn [supervisor & _] (cluster-mode (:conf supervisor - -(def STORM-VERSION (VersionInfo/getVersion)) - -(defprotocol SupervisorDaemon - (get-id [this]) - (get-conf [this]) - (shutdown-all-workers [this]) - ) - -(defn- assignments-snapshot [storm-cluster-state callback assignment-versions] - (let [storm-ids (.assignments storm-cluster-state callback)] -(let [new-assignments - (->> - (dofor [sid storm-ids] - (let [recorded-version (:version (get assignment-versions sid))] -(if-let [assignment-version (.assignment-version storm-cluster-state sid callback)] - (if (= assignment-version recorded-version) -{sid (get assignment-versions sid)} -{sid (.assignment-info-with-version storm-cluster-state sid callback)}) - {sid nil}))) - (apply merge) - (filter-val not-nil?)) - new-profiler-actions - (->> -(dofor [sid (distinct storm-ids)] - (if-let [topo-profile-actions (.get-topology-profile-requests storm-cluster-state sid false)] - {sid topo-profile-actions})) - (apply merge))] - - {:assignments (into {} (for [[k v] new-assignments] [k (:data v)])) - :profiler-actions new-profiler-actions - :versions new-assignments}))) - -(defn- read-my-executors [assignments-snapshot storm-id assignment-id] - (let [assignment (get assignments-snapshot storm-id) -my-slots-resources (into {} - (filter (fn [[[node _] _]] (= node assignment-id)) - (:worker->resources assignment))) -my-executors (fi
[15/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/NimbusSummary.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/NimbusSummary.java b/storm-core/src/jvm/backtype/storm/generated/NimbusSummary.java deleted file mode 100644 index c0c5247..000 --- a/storm-core/src/jvm/backtype/storm/generated/NimbusSummary.java +++ /dev/null @@ -1,796 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class NimbusSummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NimbusSummary"); - - private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField IS_LEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("isLeader", org.apache.thrift.protocol.TType.BOOL, (short)4); - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new NimbusSummaryStandardSchemeFactory()); -schemes.put(TupleScheme.class, new NimbusSummaryTupleSchemeFactory()); - } - - private String host; // required - private int port; // required - private int uptime_secs; // required - private boolean isLeader; // required - private String version; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -HOST((short)1, "host"), -PORT((short)2, "port"), -UPTIME_SECS((short)3, "uptime_secs"), -IS_LEADER((short)4, "isLeader"), -VERSION((short)5, "version"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // HOST - return HOST; -case 2: // PORT - return PORT; -case 3: // UPTIME_SECS -
[26/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/DistributedRPCInvocations.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/DistributedRPCInvocations.java b/storm-core/src/jvm/backtype/storm/generated/DistributedRPCInvocations.java deleted file mode 100644 index d51175d..000 --- a/storm-core/src/jvm/backtype/storm/generated/DistributedRPCInvocations.java +++ /dev/null @@ -1,2935 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class DistributedRPCInvocations { - - public interface Iface { - -public void result(String id, String result) throws AuthorizationException, org.apache.thrift.TException; - -public DRPCRequest fetchRequest(String functionName) throws AuthorizationException, org.apache.thrift.TException; - -public void failRequest(String id) throws AuthorizationException, org.apache.thrift.TException; - - } - - public interface AsyncIface { - -public void result(String id, String result, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - -public void fetchRequest(String functionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - -public void failRequest(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - } - - public static class Client extends org.apache.thrift.TServiceClient implements Iface { -public static class Factory implements org.apache.thrift.TServiceClientFactory { - public Factory() {} - public Client getClient(org.apache.thrift.protocol.TProtocol prot) { -return new Client(prot); - } - public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { -return new Client(iprot, oprot); - } -} - -public Client(org.apache.thrift.protocol.TProtocol prot) -{ - super(prot, prot); -} - -public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - super(iprot, oprot); -} - -public void result(String id, String result) throws AuthorizationException, org.apache.thrift.TException -{ - send_result(id, result); - recv_result(); -} - -public void send_result(String id, String result) throws org.apache.thrift.TException -{ - result_args args = new result_args(); - args.set_id(id); - args.set_result(result); - sendBase("result", args); -} - -public void recv_result() throws AuthorizationException, org.apache.thrift.TException -{ - result_result result = new result_result(); - receiveBase(result, "result"); - if (result.aze != null) { -throw result.aze; - } - return; -} - -public DRPCRequest fetchRequest(String functionName) throws
[35/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/daemon/metrics/MetricsUtils.java -- diff --git a/storm-core/src/jvm/backtype/storm/daemon/metrics/MetricsUtils.java b/storm-core/src/jvm/backtype/storm/daemon/metrics/MetricsUtils.java deleted file mode 100644 index 56b920b..000 --- a/storm-core/src/jvm/backtype/storm/daemon/metrics/MetricsUtils.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.storm.daemon.metrics; - -import org.apache.storm.Config; -import org.apache.storm.daemon.metrics.reporters.JmxPreparableReporter; -import org.apache.storm.daemon.metrics.reporters.PreparableReporter; -import org.apache.storm.utils.Utils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -public class MetricsUtils { -private final static Logger LOG = LoggerFactory.getLogger(MetricsUtils.class); - -public static List getPreparableReporters(Map stormConf) { -List clazzes = (List) stormConf.get(Config.STORM_DAEMON_METRICS_REPORTER_PLUGINS); -List reporterList = new ArrayList<>(); - -if (clazzes != null) { -for (String clazz : clazzes) { -reporterList.add(getPreparableReporter(clazz)); -} -} -if (reporterList.isEmpty()) { -reporterList.add(new JmxPreparableReporter()); -} -return reporterList; -} - -private static PreparableReporter getPreparableReporter(String clazz) { -PreparableReporter reporter = null; -LOG.info("Using statistics reporter plugin:" + clazz); -if (clazz != null) { -reporter = (PreparableReporter) Utils.newInstance(clazz); -} -return reporter; -} - -public static Locale getMetricsReporterLocale(Map stormConf) { -String languageTag = Utils.getString(stormConf.get(Config.STORM_DAEMON_METRICS_REPORTER_PLUGIN_LOCALE), null); -if (languageTag != null) { -return Locale.forLanguageTag(languageTag); -} -return null; -} - -public static TimeUnit getMetricsRateUnit(Map stormConf) { -return getTimeUnitForCofig(stormConf, Config.STORM_DAEMON_METRICS_REPORTER_PLUGIN_RATE_UNIT); -} - -public static TimeUnit getMetricsDurationUnit(Map stormConf) { -return getTimeUnitForCofig(stormConf, Config.STORM_DAEMON_METRICS_REPORTER_PLUGIN_DURATION_UNIT); -} - -private static TimeUnit getTimeUnitForCofig(Map stormConf, String configName) { -String rateUnitString = Utils.getString(stormConf.get(configName), null); -if (rateUnitString != null) { -return TimeUnit.valueOf(rateUnitString); -} -return null; -} - -public static File getCsvLogDir(Map stormConf) { -String csvMetricsLogDirectory = Utils.getString(stormConf.get(Config.STORM_DAEMON_METRICS_REPORTER_CSV_LOG_DIR), null); -if (csvMetricsLogDirectory == null) { -csvMetricsLogDirectory = absoluteStormLocalDir(stormConf); -csvMetricsLogDirectory = csvMetricsLogDirectory + File.separator + "csvmetrics"; -} -File csvMetricsDir = new File(csvMetricsLogDirectory); -validateCreateOutputDir(csvMetricsDir); -return csvMetricsDir; -} - -private static void validateCreateOutputDir(File dir) { -if (!dir.exists()) { -dir.mkdirs(); -} -if (!dir.canWrite()) { -throw new IllegalStateException(dir.getName() + " does not have write permissions."); -} -if (!dir.isDirectory()) { -throw new IllegalStateException(dir.getName() + " is not a directory."); -} -} - -public static String absoluteStormLocalDir(Map conf) { -String stormHome = System.getProperty("storm.home"); -String localDir = (String) conf.get(Config.STORM_LOCAL_DIR); -if (localDir == null) { -return (stormH
[52/55] [abbrv] storm git commit: Minor cleanup.
Minor cleanup. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/20180cca Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/20180cca Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/20180cca Branch: refs/heads/Pacemaker-HA-1.x-branch2 Commit: 20180cca1de9b25dc391722a9088e10107a31443 Parents: a6171bd Author: Kyle Nusbaum Authored: Thu Sep 29 15:45:01 2016 -0500 Committer: Kyle Nusbaum Committed: Thu Sep 29 15:45:01 2016 -0500 -- storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/20180cca/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java -- diff --git a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java index 13cc02d..d555dae 100644 --- a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java +++ b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java @@ -230,7 +230,7 @@ public class PacemakerClient implements ISaslClient { public void gotMessage(HBMessage m) { int message_id = m.get_message_id(); if(message_id >= 0 && message_id < maxPending) { - + LOG.debug("Pacemaker Client got message: {}", m.toString()); HBMessage request = messages[message_id];
[48/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/executor.clj -- diff --git a/storm-core/src/clj/backtype/storm/daemon/executor.clj b/storm-core/src/clj/backtype/storm/daemon/executor.clj deleted file mode 100644 index 2436048..000 --- a/storm-core/src/clj/backtype/storm/daemon/executor.clj +++ /dev/null @@ -1,864 +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. -(ns org.apache.storm.daemon.executor - (:use [org.apache.storm.daemon common]) - (:import [org.apache.storm.generated Grouping] - [java.io Serializable]) - (:use [org.apache.storm util config log timer stats]) - (:import [java.util List Random HashMap ArrayList LinkedList Map]) - (:import [org.apache.storm ICredentialsListener]) - (:import [org.apache.storm.hooks ITaskHook]) - (:import [org.apache.storm.tuple AddressedTuple Tuple Fields TupleImpl MessageId]) - (:import [org.apache.storm.spout ISpoutWaitStrategy ISpout SpoutOutputCollector ISpoutOutputCollector]) - (:import [org.apache.storm.hooks.info SpoutAckInfo SpoutFailInfo -EmitInfo BoltFailInfo BoltAckInfo BoltExecuteInfo]) - (:import [org.apache.storm.grouping CustomStreamGrouping]) - (:import [org.apache.storm.task WorkerTopologyContext IBolt OutputCollector IOutputCollector]) - (:import [org.apache.storm.generated GlobalStreamId]) - (:import [org.apache.storm.utils Utils TupleUtils MutableObject RotatingMap RotatingMap$ExpiredCallback MutableLong Time DisruptorQueue WorkerBackpressureThread]) - (:import [com.lmax.disruptor InsufficientCapacityException]) - (:import [org.apache.storm.serialization KryoTupleSerializer]) - (:import [org.apache.storm.daemon Shutdownable]) - (:import [org.apache.storm.metric.api IMetric IMetricsConsumer$TaskInfo IMetricsConsumer$DataPoint StateMetric]) - (:import [org.apache.storm Config Constants]) - (:import [org.apache.storm.cluster ClusterStateContext DaemonType]) - (:import [org.apache.storm.grouping LoadAwareCustomStreamGrouping LoadAwareShuffleGrouping LoadMapping ShuffleGrouping]) - (:import [java.util.concurrent ConcurrentLinkedQueue]) - (:require [org.apache.storm [thrift :as thrift] - [cluster :as cluster] [disruptor :as disruptor] [stats :as stats]]) - (:require [org.apache.storm.daemon [task :as task]]) - (:require [org.apache.storm.daemon.builtin-metrics :as builtin-metrics]) - (:require [clojure.set :as set])) - -(defn- mk-fields-grouper - [^Fields out-fields ^Fields group-fields ^List target-tasks] - (let [num-tasks (count target-tasks) -task-getter (fn [i] (.get target-tasks i))] -(fn [task-id ^List values load] - (-> (.select out-fields group-fields values) - (TupleUtils/listHashCode) - (mod num-tasks) - task-getter - -(defn- mk-custom-grouper - [^CustomStreamGrouping grouping ^WorkerTopologyContext context ^String component-id ^String stream-id target-tasks] - (.prepare grouping context (GlobalStreamId. component-id stream-id) target-tasks) - (if (instance? LoadAwareCustomStreamGrouping grouping) -(fn [task-id ^List values load] - (.chooseTasks ^LoadAwareCustomStreamGrouping grouping task-id values load)) -(fn [task-id ^List values load] - (.chooseTasks grouping task-id values - -(defn mk-shuffle-grouper - [^List target-tasks topo-conf ^WorkerTopologyContext context ^String component-id ^String stream-id] - (if (.get topo-conf TOPOLOGY-DISABLE-LOADAWARE-MESSAGING) -(mk-custom-grouper (ShuffleGrouping.) context component-id stream-id target-tasks) -(mk-custom-grouper (LoadAwareShuffleGrouping.) context component-id stream-id target-tasks))) - -(defn- mk-grouper - "Returns a function that returns a vector of which task indices to send tuple to, or just a single task index." - [^WorkerTopologyContext context component-id stream-id ^Fields out-fields thrift-grouping ^List target-tasks topo-conf] - (let [num-tasks (count target-tasks) -random (Random.) -target-tasks (vec (sort target-tasks))] -(condp = (thrift/grouping-type thrift-grouping) - :fields -(if (thrift/global-grouping
[28/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ComponentType.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/ComponentType.java b/storm-core/src/jvm/backtype/storm/generated/ComponentType.java deleted file mode 100644 index 7a9fd66..000 --- a/storm-core/src/jvm/backtype/storm/generated/ComponentType.java +++ /dev/null @@ -1,62 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum ComponentType implements org.apache.thrift.TEnum { - BOLT(1), - SPOUT(2); - - private final int value; - - private ComponentType(int value) { -this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { -return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static ComponentType findByValue(int value) { -switch (value) { - case 1: -return BOLT; - case 2: -return SPOUT; - default: -return null; -} - } -} http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/Credentials.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/Credentials.java b/storm-core/src/jvm/backtype/storm/generated/Credentials.java deleted file mode 100644 index 231af06..000 --- a/storm-core/src/jvm/backtype/storm/generated/Credentials.java +++ /dev/null @@ -1,458 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class Credentials implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Credentials
[12/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SpoutStats.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/SpoutStats.java b/storm-core/src/jvm/backtype/storm/generated/SpoutStats.java deleted file mode 100644 index b1384f6..000 --- a/storm-core/src/jvm/backtype/storm/generated/SpoutStats.java +++ /dev/null @@ -1,917 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class SpoutStats implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpoutStats"); - - private static final org.apache.thrift.protocol.TField ACKED_FIELD_DESC = new org.apache.thrift.protocol.TField("acked", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.protocol.TField FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("failed", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final org.apache.thrift.protocol.TField COMPLETE_MS_AVG_FIELD_DESC = new org.apache.thrift.protocol.TField("complete_ms_avg", org.apache.thrift.protocol.TType.MAP, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new SpoutStatsStandardSchemeFactory()); -schemes.put(TupleScheme.class, new SpoutStatsTupleSchemeFactory()); - } - - private Map> acked; // required - private Map> failed; // required - private Map> complete_ms_avg; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -ACKED((short)1, "acked"), -FAILED((short)2, "failed"), -COMPLETE_MS_AVG((short)3, "complete_ms_avg"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // ACKED - return ACKED; -case 2: // FAILED - return FAILED; -case 3: // COMPLETE_MS_AVG - return COMPLETE_MS_AVG; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; -} - -/** - * Find the _Fields constant
[06/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java b/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java deleted file mode 100644 index fa95be7..000 --- a/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java +++ /dev/null @@ -1,2144 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TopologyInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyInfo"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("executors", org.apache.thrift.protocol.TType.LIST, (short)4); - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField ERRORS_FIELD_DESC = new org.apache.thrift.protocol.TField("errors", org.apache.thrift.protocol.TType.MAP, (short)6); - private static final org.apache.thrift.protocol.TField COMPONENT_DEBUG_FIELD_DESC = new org.apache.thrift.protocol.TField("component_debug", org.apache.thrift.protocol.TType.MAP, (short)7); - private static final org.apache.thrift.protocol.TField SCHED_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("sched_status", org.apache.thrift.protocol.TType.STRING, (short)513); - private static final org.apache.thrift.protocol.TField OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)514); - private static final org.apache.thrift.protocol.TField REPLICATION_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("replication_count", org.apache.thrift.protocol.TType.I32, (short)515); - private static final org.apache.thrift.protocol.TField REQUESTED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)521); - private static final org.apache.thrift.protocol.TField REQUESTED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memoffheap", org.apache.thrift.protocol.T
[49/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/config.clj -- diff --git a/storm-core/src/clj/backtype/storm/config.clj b/storm-core/src/clj/backtype/storm/config.clj deleted file mode 100644 index 1f19bd3..000 --- a/storm-core/src/clj/backtype/storm/config.clj +++ /dev/null @@ -1,338 +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. - -(ns org.apache.storm.config - (:import [java.io FileReader File IOException] - [org.apache.storm.generated StormTopology]) - (:import [org.apache.storm Config]) - (:import [org.apache.storm.utils Utils LocalState]) - (:import [org.apache.storm.validation ConfigValidation]) - (:import [org.apache.commons.io FileUtils]) - (:require [clojure [string :as str]]) - (:use [org.apache.storm log util])) - -(def RESOURCES-SUBDIR "resources") -(def NIMBUS-DO-NOT-REASSIGN "NIMBUS-DO-NOT-REASSIGN") - -(defn- clojure-config-name [name] - (.replace (.toUpperCase name) "_" "-")) - -; define clojure constants for every configuration parameter -(doseq [f (seq (.getFields Config))] - (let [name (.getName f) -new-name (clojure-config-name name)] -(eval - `(def ~(symbol new-name) (. Config ~(symbol name)) - -(def ALL-CONFIGS - (dofor [f (seq (.getFields Config))] - (.get f nil))) - - -(defn cluster-mode - [conf & args] - (keyword (conf STORM-CLUSTER-MODE))) - -(defn local-mode? - [conf] - (let [mode (conf STORM-CLUSTER-MODE)] -(condp = mode - "local" true - "distributed" false - (throw (IllegalArgumentException. - (str "Illegal cluster mode in conf: " mode)) - -(defn sampling-rate - [conf] - (->> (conf TOPOLOGY-STATS-SAMPLE-RATE) - (/ 1) - int)) - -(defn mk-stats-sampler - [conf] - (even-sampler (sampling-rate conf))) - -(defn read-default-config - [] - (clojurify-structure (Utils/readDefaultConfig))) - -(defn validate-configs-with-schemas - [conf] - (ConfigValidation/validateFields conf)) - -(defn read-storm-config - [] - (let [conf (clojurify-structure (Utils/readStormConfig))] -(validate-configs-with-schemas conf) -conf)) - -(defn read-yaml-config - ([name must-exist] - (let [conf (clojurify-structure (Utils/findAndReadConfigFile name must-exist))] - (validate-configs-with-schemas conf) - conf)) - ([name] - (read-yaml-config true))) - -(defn absolute-storm-local-dir [conf] - (let [storm-home (System/getProperty "storm.home") -path (conf STORM-LOCAL-DIR)] -(if path - (if (is-absolute-path? path) path (str storm-home file-path-separator path)) - (str storm-home file-path-separator "storm-local" - -(def LOG-DIR - (.getCanonicalPath -(clojure.java.io/file (or (System/getProperty "storm.log.dir") - (get (read-storm-config) "storm.log.dir") - (str (System/getProperty "storm.home") file-path-separator "logs") - -(defn absolute-healthcheck-dir [conf] - (let [storm-home (System/getProperty "storm.home") -path (conf STORM-HEALTH-CHECK-DIR)] -(if path - (if (is-absolute-path? path) path (str storm-home file-path-separator path)) - (str storm-home file-path-separator "healthchecks" - -(defn master-local-dir - [conf] - (let [ret (str (absolute-storm-local-dir conf) file-path-separator "nimbus")] -(FileUtils/forceMkdir (File. ret)) -ret)) - -(defn master-stormjar-key - [topology-id] - (str topology-id "-stormjar.jar")) - -(defn master-stormcode-key - [topology-id] - (str topology-id "-stormcode.ser")) - -(defn master-stormconf-key - [topology-id] - (str topology-id "-stormconf.ser")) - -(defn master-stormdist-root - ([conf] - (str (master-local-dir conf) file-path-separator "stormdist")) - ([conf storm-id] - (str (master-stormdist-root conf) file-path-separator storm-id))) - -(defn master-tmp-dir - [conf] - (let [ret (str (master-local-dir conf) file-path-separator "tmp")] -(FileUtils/forceMkdir (File. ret)) -ret )) - -(defn read-supervisor-storm-conf-given-path - [conf stormconf-path] - (merge conf (clojurify-structure (Utils/fromCompressed
[43/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/scheduler/IsolationScheduler.clj -- diff --git a/storm-core/src/clj/backtype/storm/scheduler/IsolationScheduler.clj b/storm-core/src/clj/backtype/storm/scheduler/IsolationScheduler.clj deleted file mode 100644 index 2e86748..000 --- a/storm-core/src/clj/backtype/storm/scheduler/IsolationScheduler.clj +++ /dev/null @@ -1,219 +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. -(ns org.apache.storm.scheduler.IsolationScheduler - (:use [org.apache.storm util config log]) - (:require [org.apache.storm.scheduler.DefaultScheduler :as DefaultScheduler]) - (:import [java.util HashSet Set List LinkedList ArrayList Map HashMap]) - (:import [org.apache.storm.scheduler IScheduler Topologies -Cluster TopologyDetails WorkerSlot SchedulerAssignment -EvenScheduler ExecutorDetails]) - (:gen-class -:init init -:constructors {[] []} -:state state -:implements [org.apache.storm.scheduler.IScheduler])) - -(defn -init [] - [[] (container)]) - -(defn -prepare [this conf] - (container-set! (.state this) conf)) - -(defn- compute-worker-specs "Returns mutable set of sets of executors" - [^TopologyDetails details] - (->> (.getExecutorToComponent details) - reverse-map - (map second) - (apply concat) - (map vector (repeat-seq (range (.getNumWorkers details - (group-by first) - (map-val #(map second %)) - vals - (map set) - (HashSet.) - )) - -(defn isolated-topologies [conf topologies] - (let [tset (-> conf (get ISOLATION-SCHEDULER-MACHINES) keys set)] -(filter (fn [^TopologyDetails t] (contains? tset (.getName t))) topologies) -)) - -;; map from topology id -> set of sets of executors -(defn topology-worker-specs [iso-topologies] - (->> iso-topologies - (map (fn [t] {(.getId t) (compute-worker-specs t)})) - (apply merge))) - -(defn machine-distribution [conf ^TopologyDetails topology] - (let [name->machines (get conf ISOLATION-SCHEDULER-MACHINES) -machines (get name->machines (.getName topology)) -workers (.getNumWorkers topology)] -(-> (integer-divided workers machines) -(dissoc 0) -(HashMap.) -))) - -(defn topology-machine-distribution [conf iso-topologies] - (->> iso-topologies - (map (fn [t] {(.getId t) (machine-distribution conf t)})) - (apply merge))) - -(defn host-assignments [^Cluster cluster] - (letfn [(to-slot-specs [^SchedulerAssignment ass] -(->> ass - .getExecutorToSlot - reverse-map - (map (fn [[slot executors]] -[slot (.getTopologyId ass) (set executors)]] - (->> cluster - .getAssignments - vals - (mapcat to-slot-specs) - (group-by (fn [[^WorkerSlot slot & _]] (.getHost cluster (.getNodeId slot - ))) - -(defn- decrement-distribution! [^Map distribution value] - (let [v (-> distribution (get value) dec)] -(if (zero? v) - (.remove distribution value) - (.put distribution value v - -;; returns list of list of slots, reverse sorted by number of slots -(defn- host-assignable-slots [^Cluster cluster] - (-<> cluster - .getAssignableSlots - (group-by #(.getHost cluster (.getNodeId ^WorkerSlot %)) <>) - (dissoc <> nil) - (sort-by #(-> % second count -) <>) - shuffle - (LinkedList. <>) - )) - -(defn- host->used-slots [^Cluster cluster] - (->> cluster - .getUsedSlots - (group-by #(.getHost cluster (.getNodeId ^WorkerSlot %))) - )) - -(defn- distribution->sorted-amts [distribution] - (->> distribution - (mapcat (fn [[val amt]] (repeat amt val))) - (sort-by -) - )) - -(defn- allocated-topologies [topology-worker-specs] - (->> topology-worker-specs -(filter (fn [[_ worker-specs]] (empty? worker-specs))) -(map first) -set -)) - -(defn- leftover-topologies [^Topologies topologies filter-ids-set] - (->> topologies - .getTopologies - (filter (fn [^TopologyDetails t] (not (contains?
[07/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java b/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java deleted file mode 100644 index 5e774e2..000 --- a/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java +++ /dev/null @@ -1,461 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TopologyHistoryInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyHistoryInfo"); - - private static final org.apache.thrift.protocol.TField TOPO_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("topo_ids", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new TopologyHistoryInfoStandardSchemeFactory()); -schemes.put(TupleScheme.class, new TopologyHistoryInfoTupleSchemeFactory()); - } - - private List topo_ids; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -TOPO_IDS((short)1, "topo_ids"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // TOPO_IDS - return TOPO_IDS; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; -} - -/** - * Find the _Fields constant that matches name, or null if its not found. - */ -public static _Fields findByName(String name) { - return byName.get(name); -} - -private final short _thriftId; -private final String _fieldName; - -_Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; -} - -public short getThriftFieldId() { - return _thriftId; -} - -public String getFieldName() { - return _fieldName; -} - } - - // isset id assignments - public static final Map<_Fields, org.apac
[39/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/Config.java -- diff --git a/storm-core/src/jvm/backtype/storm/Config.java b/storm-core/src/jvm/backtype/storm/Config.java deleted file mode 100644 index 80a2a5d..000 --- a/storm-core/src/jvm/backtype/storm/Config.java +++ /dev/null @@ -1,2473 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.storm; - -import org.apache.storm.scheduler.resource.strategies.eviction.IEvictionStrategy; -import org.apache.storm.scheduler.resource.strategies.priority.ISchedulingPriorityStrategy; -import org.apache.storm.scheduler.resource.strategies.scheduling.IStrategy; -import org.apache.storm.serialization.IKryoDecorator; -import org.apache.storm.serialization.IKryoFactory; -import org.apache.storm.validation.ConfigValidationAnnotations.*; -import org.apache.storm.validation.ConfigValidation.*; -import com.esotericsoftware.kryo.Serializer; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Topology configs are specified as a plain old map. This class provides a - * convenient way to create a topology config map by providing setter methods for - * all the configs that can be set. It also makes it easier to do things like add - * serializations. - * - * This class also provides constants for all the configurations possible on - * a Storm cluster and Storm topology. Each constant is paired with an annotation - * that defines the validity criterion of the corresponding field. Default - * values for these configs can be found in defaults.yaml. - * - * Note that you may put other configurations in any of the configs. Storm - * will ignore anything it doesn't recognize, but your topologies are free to make - * use of them by reading them in the prepare method of Bolts or the open method of - * Spouts. - */ -public class Config extends HashMap { - -//DO NOT CHANGE UNLESS WE ADD IN STATE NOT STORED IN THE PARENT CLASS -private static final long serialVersionUID = -1550278723792864455L; - -/** - * This is part of a temporary workaround to a ZK bug, it is the 'scheme:acl' for - * the user Nimbus and Supervisors use to authenticate with ZK. - */ -@isString -public static final String STORM_ZOOKEEPER_SUPERACL = "storm.zookeeper.superACL"; - -/** - * The transporter for communication among Storm tasks - */ -@isString -public static final String STORM_MESSAGING_TRANSPORT = "storm.messaging.transport"; - -/** - * Netty based messaging: The buffer size for send/recv buffer - */ -@isInteger -@isPositiveNumber -public static final String STORM_MESSAGING_NETTY_BUFFER_SIZE = "storm.messaging.netty.buffer_size"; - -/** - * Netty based messaging: Sets the backlog value to specify when the channel binds to a local address - */ -@isInteger -@isPositiveNumber -public static final String STORM_MESSAGING_NETTY_SOCKET_BACKLOG = "storm.messaging.netty.socket.backlog"; - -/** - * Netty based messaging: The max # of retries that a peer will perform when a remote is not accessible - *@deprecated "Since netty clients should never stop reconnecting - this does not make sense anymore. - */ -@Deprecated -@isInteger -public static final String STORM_MESSAGING_NETTY_MAX_RETRIES = "storm.messaging.netty.max_retries"; - -/** - * Netty based messaging: The min # of milliseconds that a peer will wait. - */ -@isInteger -@isPositiveNumber(includeZero = true) -public static final String STORM_MESSAGING_NETTY_MIN_SLEEP_MS = "storm.messaging.netty.min_wait_ms"; - -/** - * Netty based messaging: The max # of milliseconds that a peer will wait. - */ -@isInteger -@isPositiveNumber(includeZero = true) -public static final String STORM_MESSAGING_NETTY_MAX_SLEEP_MS = "storm.messaging.netty.max_wait_ms"; - -/** - * Netty based messaging: The # of worker threads for the server. - */ -@isInteger -@isPositiveNumber(includeZero = true) -public static final Stri
[04/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyStats.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyStats.java b/storm-core/src/jvm/backtype/storm/generated/TopologyStats.java deleted file mode 100644 index e63c486..000 --- a/storm-core/src/jvm/backtype/storm/generated/TopologyStats.java +++ /dev/null @@ -1,1094 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TopologyStats implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyStats"); - - private static final org.apache.thrift.protocol.TField WINDOW_TO_EMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_emitted", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.protocol.TField WINDOW_TO_TRANSFERRED_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_transferred", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final org.apache.thrift.protocol.TField WINDOW_TO_COMPLETE_LATENCIES_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_complete_latencies_ms", org.apache.thrift.protocol.TType.MAP, (short)3); - private static final org.apache.thrift.protocol.TField WINDOW_TO_ACKED_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_acked", org.apache.thrift.protocol.TType.MAP, (short)4); - private static final org.apache.thrift.protocol.TField WINDOW_TO_FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_failed", org.apache.thrift.protocol.TType.MAP, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new TopologyStatsStandardSchemeFactory()); -schemes.put(TupleScheme.class, new TopologyStatsTupleSchemeFactory()); - } - - private Map window_to_emitted; // optional - private Map window_to_transferred; // optional - private Map window_to_complete_latencies_ms; // optional - private Map window_to_acked; // optional - private Map window_to_failed; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -WINDOW_TO_EMITTED((short)1, "window_to_emitted"), -WINDOW_TO_TRANSFERRED((short)2, "window_to_transferred"), -WINDOW_TO_COMPLETE_LATENCIES_MS((short)3, "window_to_complete_latencies_ms"), -WINDOW_TO_ACKED((short)4, "window_to_acked"), -WINDOW_TO_FAILED((short)5, "window_to_failed"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -
[33/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/AuthorizationException.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/AuthorizationException.java b/storm-core/src/jvm/backtype/storm/generated/AuthorizationException.java deleted file mode 100644 index 7358535..000 --- a/storm-core/src/jvm/backtype/storm/generated/AuthorizationException.java +++ /dev/null @@ -1,406 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class AuthorizationException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthorizationException"); - - private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("msg", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new AuthorizationExceptionStandardSchemeFactory()); -schemes.put(TupleScheme.class, new AuthorizationExceptionTupleSchemeFactory()); - } - - private String msg; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -MSG((short)1, "msg"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // MSG - return MSG; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; -} - -/** - * Find the _Fields constant that matches name, or null if its not found. - */ -public static _Fields findByName(String name) { - return byName.get(name); -} - -private final short _thriftId; -private final String _fieldName; - -_Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; -} - -public short getThriftFieldId() { - return _thriftId; -} - -public String getFieldName() { - return _fieldName; -} - } - - // isset id assignments - public static final Map<_Fiel
[51/55] [abbrv] [partial] storm git commit: Ported successfully.
Ported successfully. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/a6171bd6 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/a6171bd6 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/a6171bd6 Branch: refs/heads/Pacemaker-HA-1.x-branch2 Commit: a6171bd6770676d4d0bdb9c9d05a4785df35b671 Parents: dd7ff1e Author: Kyle Nusbaum Authored: Thu Sep 29 15:43:09 2016 -0500 Committer: Kyle Nusbaum Committed: Thu Sep 29 15:43:09 2016 -0500 -- .../src/clj/backtype/storm/LocalCluster.clj | 106 - storm-core/src/clj/backtype/storm/LocalDRPC.clj |56 - .../src/clj/backtype/storm/MockAutoCred.clj |58 - storm-core/src/clj/backtype/storm/blobstore.clj |28 - storm-core/src/clj/backtype/storm/clojure.clj | 204 - storm-core/src/clj/backtype/storm/cluster.clj | 708 - .../cluster_state/zookeeper_state_factory.clj | 165 - .../src/clj/backtype/storm/command/activate.clj |24 - .../clj/backtype/storm/command/blobstore.clj| 162 - .../clj/backtype/storm/command/config_value.clj |24 - .../clj/backtype/storm/command/deactivate.clj |24 - .../backtype/storm/command/dev_zookeeper.clj|26 - .../clj/backtype/storm/command/get_errors.clj |52 - .../clj/backtype/storm/command/healthcheck.clj |88 - .../clj/backtype/storm/command/heartbeats.clj |52 - .../backtype/storm/command/kill_topology.clj|29 - .../clj/backtype/storm/command/kill_workers.clj |33 - .../src/clj/backtype/storm/command/list.clj |38 - .../src/clj/backtype/storm/command/monitor.clj |37 - .../clj/backtype/storm/command/rebalance.clj|46 - .../backtype/storm/command/set_log_level.clj|75 - .../backtype/storm/command/shell_submission.clj |34 - .../storm/command/upload_credentials.clj|35 - storm-core/src/clj/backtype/storm/config.clj| 338 - storm-core/src/clj/backtype/storm/converter.clj | 277 - .../src/clj/backtype/storm/daemon/acker.clj | 116 - .../backtype/storm/daemon/builtin_metrics.clj |98 - .../src/clj/backtype/storm/daemon/common.clj| 431 - .../src/clj/backtype/storm/daemon/drpc.clj | 278 - .../src/clj/backtype/storm/daemon/executor.clj | 864 - .../src/clj/backtype/storm/daemon/logviewer.clj | 1232 - .../src/clj/backtype/storm/daemon/nimbus.clj| 2514 - .../clj/backtype/storm/daemon/supervisor.clj| 1272 - .../src/clj/backtype/storm/daemon/task.clj | 189 - .../src/clj/backtype/storm/daemon/worker.clj| 768 - storm-core/src/clj/backtype/storm/disruptor.clj |89 - storm-core/src/clj/backtype/storm/event.clj |71 - .../src/clj/backtype/storm/local_state.clj | 131 - storm-core/src/clj/backtype/storm/log.clj |56 - .../src/clj/backtype/storm/messaging/loader.clj |34 - .../src/clj/backtype/storm/messaging/local.clj |23 - .../src/clj/backtype/storm/metric/testing.clj |68 - .../clj/backtype/storm/pacemaker/pacemaker.clj | 241 - .../storm/pacemaker/pacemaker_state_factory.clj | 125 - .../clj/backtype/storm/process_simulator.clj|51 - .../storm/scheduler/DefaultScheduler.clj|77 - .../backtype/storm/scheduler/EvenScheduler.clj |81 - .../storm/scheduler/IsolationScheduler.clj | 219 - storm-core/src/clj/backtype/storm/stats.clj | 1584 - storm-core/src/clj/backtype/storm/testing.clj | 702 - storm-core/src/clj/backtype/storm/testing4j.clj | 186 - storm-core/src/clj/backtype/storm/thrift.clj| 284 - storm-core/src/clj/backtype/storm/timer.clj | 128 - .../src/clj/backtype/storm/trident/testing.clj |79 - storm-core/src/clj/backtype/storm/ui/core.clj | 1487 - .../src/clj/backtype/storm/ui/helpers.clj | 275 - storm-core/src/clj/backtype/storm/util.clj | 1134 - storm-core/src/clj/backtype/storm/zookeeper.clj | 327 - .../storm/pacemaker/pacemaker_state_factory.clj | 5 +- storm-core/src/jvm/backtype/storm/Config.java | 2473 - .../src/jvm/backtype/storm/Constants.java |36 - .../backtype/storm/ICredentialsListener.java|32 - .../src/jvm/backtype/storm/ILocalCluster.java |49 - .../src/jvm/backtype/storm/ILocalDRPC.java |27 - .../src/jvm/backtype/storm/ISubmitterHook.java |31 - .../src/jvm/backtype/storm/LogWriter.java |83 - .../src/jvm/backtype/storm/StormSubmitter.java | 586 - .../storm/blobstore/AtomicOutputStream.java |32 - .../storm/blobstore/BlobKeySequenceInfo.java|40 - .../jvm/backtype/storm/blobstore/BlobStore.java | 452 - .../storm/blobstore/BlobStoreAclHandler.java| 409 - .../backtype/storm/blobstore/BlobStoreFile.java |50 - .../storm/blobstore/BlobStoreUtils.java | 276 - .../storm/blobstore/BlobSynchronizer.java | 124 - .../storm/blobstore/ClientBlobStore.j
[46/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/nimbus.clj -- diff --git a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj b/storm-core/src/clj/backtype/storm/daemon/nimbus.clj deleted file mode 100644 index 2732d81..000 --- a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj +++ /dev/null @@ -1,2514 +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. -(ns org.apache.storm.daemon.nimbus - (:import [org.apache.thrift.server THsHaServer THsHaServer$Args]) - (:import [org.apache.storm.generated KeyNotFoundException]) - (:import [org.apache.storm.blobstore LocalFsBlobStore]) - (:import [org.apache.thrift.protocol TBinaryProtocol TBinaryProtocol$Factory]) - (:import [org.apache.thrift.exception]) - (:import [org.apache.thrift.transport TNonblockingServerTransport TNonblockingServerSocket]) - (:import [org.apache.commons.io FileUtils]) - (:import [javax.security.auth Subject]) - (:import [org.apache.storm.security.auth NimbusPrincipal]) - (:import [java.nio ByteBuffer] - [java.util Collections List HashMap] - [org.apache.storm.generated NimbusSummary]) - (:import [java.nio ByteBuffer] - [java.util Collections List HashMap ArrayList Iterator]) - (:import [org.apache.storm.blobstore AtomicOutputStream BlobStoreAclHandler - InputStreamWithMeta KeyFilter KeySequenceNumber BlobSynchronizer BlobStoreUtils]) - (:import [java.io File FileOutputStream FileInputStream]) - (:import [java.net InetAddress ServerSocket BindException]) - (:import [java.nio.channels Channels WritableByteChannel]) - (:import [org.apache.storm.security.auth ThriftServer ThriftConnectionType ReqContext AuthUtils]) - (:use [org.apache.storm.scheduler.DefaultScheduler]) - (:import [org.apache.storm.scheduler INimbus SupervisorDetails WorkerSlot TopologyDetails -Cluster Topologies SchedulerAssignment SchedulerAssignmentImpl DefaultScheduler ExecutorDetails]) - (:import [org.apache.storm.nimbus NimbusInfo]) - (:import [org.apache.storm.scheduler.resource ResourceUtils]) - (:import [org.apache.storm.utils TimeCacheMap TimeCacheMap$ExpiredCallback Utils TupleUtils ThriftTopologyUtils -BufferFileInputStream BufferInputStream]) - (:import [org.apache.storm.generated NotAliveException AlreadyAliveException StormTopology ErrorInfo -ExecutorInfo InvalidTopologyException Nimbus$Iface Nimbus$Processor SubmitOptions TopologyInitialStatus -KillOptions RebalanceOptions ClusterSummary SupervisorSummary TopologySummary TopologyInfo TopologyHistoryInfo -ExecutorSummary AuthorizationException GetInfoOptions NumErrorsChoice SettableBlobMeta ReadableBlobMeta -BeginDownloadResult ListBlobsResult ComponentPageInfo TopologyPageInfo LogConfig LogLevel LogLevelAction -ProfileRequest ProfileAction NodeInfo SupervisorPageInfo WorkerSummary WorkerResources ComponentType]) - (:import [org.apache.storm.daemon Shutdownable]) - (:import [org.apache.storm.cluster ClusterStateContext DaemonType]) - (:use [org.apache.storm util config log timer zookeeper local-state]) - (:require [org.apache.storm [cluster :as cluster] -[converter :as converter] -[stats :as stats]]) - (:require [org.apache.storm.ui.core :as ui]) - (:require [clojure.set :as set]) - (:import [org.apache.storm.daemon.common StormBase Assignment]) - (:use [org.apache.storm.daemon common]) - (:use [org.apache.storm config]) - (:import [org.apache.zookeeper data.ACL ZooDefs$Ids ZooDefs$Perms]) - (:import [org.apache.storm.utils VersionInfo Time] - (org.apache.storm.metric ClusterMetricsConsumerExecutor) - (org.apache.storm.metric.api IClusterMetricsConsumer$ClusterInfo DataPoint IClusterMetricsConsumer$SupervisorInfo) - (org.apache.storm Config)) - (:require [clj-time.core :as time]) - (:require [clj-time.coerce :as coerce]) - (:require [metrics.meters :refer [defmeter mark!]]) - (:require [metrics.gauges :refer [defgauge]]) - (:gen-class -:methods [^{:s
[17/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LogLevelAction.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/LogLevelAction.java b/storm-core/src/jvm/backtype/storm/generated/LogLevelAction.java deleted file mode 100644 index 1f0a41a..000 --- a/storm-core/src/jvm/backtype/storm/generated/LogLevelAction.java +++ /dev/null @@ -1,65 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum LogLevelAction implements org.apache.thrift.TEnum { - UNCHANGED(1), - UPDATE(2), - REMOVE(3); - - private final int value; - - private LogLevelAction(int value) { -this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { -return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static LogLevelAction findByValue(int value) { -switch (value) { - case 1: -return UNCHANGED; - case 2: -return UPDATE; - case 3: -return REMOVE; - default: -return null; -} - } -}
[16/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/Nimbus.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/Nimbus.java b/storm-core/src/jvm/backtype/storm/generated/Nimbus.java deleted file mode 100644 index ba9e66a..000 --- a/storm-core/src/jvm/backtype/storm/generated/Nimbus.java +++ /dev/null @@ -1,45416 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class Nimbus { - - public interface Iface { - -public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology) throws AlreadyAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException; - -public void submitTopologyWithOpts(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, SubmitOptions options) throws AlreadyAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException; - -public void killTopology(String name) throws NotAliveException, AuthorizationException, org.apache.thrift.TException; - -public void killTopologyWithOpts(String name, KillOptions options) throws NotAliveException, AuthorizationException, org.apache.thrift.TException; - -public void activate(String name) throws NotAliveException, AuthorizationException, org.apache.thrift.TException; - -public void deactivate(String name) throws NotAliveException, AuthorizationException, org.apache.thrift.TException; - -public void rebalance(String name, RebalanceOptions options) throws NotAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException; - -public void setLogConfig(String name, LogConfig config) throws org.apache.thrift.TException; - -public LogConfig getLogConfig(String name) throws org.apache.thrift.TException; - -/** - * Enable/disable logging the tuples generated in topology via an internal EventLogger bolt. The component name is optional - * and if null or empty, the debug flag will apply to the entire topology. - * - * The 'samplingPercentage' will limit loggging to a percentage of generated tuples. - * - * - * @param name - * @param component - * @param enable - * @param samplingPercentage - */ -public void debug(String name, String component, boolean enable, double samplingPercentage) throws NotAliveException, AuthorizationException, org.apache.thrift.TException; - -public void setWorkerProfiler(String id, ProfileRequest profileRequest) throws org.apache.thrift.TException; - -public List getComponentPendingProfileActions(String id, String component_id, ProfileAction action) throws org.apache.thrift.TException; - -public void uploadNewCredentials(String name, Credentials creds) throws NotAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException; - -
[11/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/StormBase.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/StormBase.java b/storm-core/src/jvm/backtype/storm/generated/StormBase.java deleted file mode 100644 index 34b2358..000 --- a/storm-core/src/jvm/backtype/storm/generated/StormBase.java +++ /dev/null @@ -1,1382 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class StormBase implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StormBase"); - - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField COMPONENT_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("component_executors", org.apache.thrift.protocol.TType.MAP, (short)4); - private static final org.apache.thrift.protocol.TField LAUNCH_TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("launch_time_secs", org.apache.thrift.protocol.TType.I32, (short)5); - private static final org.apache.thrift.protocol.TField OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)6); - private static final org.apache.thrift.protocol.TField TOPOLOGY_ACTION_OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_action_options", org.apache.thrift.protocol.TType.STRUCT, (short)7); - private static final org.apache.thrift.protocol.TField PREV_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("prev_status", org.apache.thrift.protocol.TType.I32, (short)8); - private static final org.apache.thrift.protocol.TField COMPONENT_DEBUG_FIELD_DESC = new org.apache.thrift.protocol.TField("component_debug", org.apache.thrift.protocol.TType.MAP, (short)9); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new StormBaseStandardSchemeFactory()); -schemes.put(TupleScheme.class, new StormBaseTupleSchemeFactory()); - } - - private String name; // required - private TopologyStatus status; // required - private int num_workers; // required - private Map component_executors; // optional - private int launch_time_secs; // optional - private String owner; // optional - private TopologyActionOptions t
[53/55] [abbrv] storm git commit: Making HA backwards-compatible
Making HA backwards-compatible Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/9c586049 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/9c586049 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/9c586049 Branch: refs/heads/Pacemaker-HA-1.x-branch2 Commit: 9c5860498a71c04fda1e201283a63ec2c6352062 Parents: 20180cc Author: Kyle Nusbaum Authored: Thu Sep 29 17:06:16 2016 -0500 Committer: Kyle Nusbaum Committed: Thu Sep 29 17:06:16 2016 -0500 -- conf/defaults.yaml | 3 +-- .../org/apache/storm/pacemaker/pacemaker_state_factory.clj | 4 +++- storm-core/src/jvm/org/apache/storm/Config.java | 8 3 files changed, 12 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/9c586049/conf/defaults.yaml -- diff --git a/conf/defaults.yaml b/conf/defaults.yaml index 4d16d84..041a628 100644 --- a/conf/defaults.yaml +++ b/conf/defaults.yaml @@ -276,8 +276,7 @@ resource.aware.scheduler.priority.strategy: "org.apache.storm.scheduler.resource dev.zookeeper.path: "/tmp/dev-storm-zookeeper" -pacemaker.servers: - - "localhost" +pacemaker.host: "localhost" pacemaker.port: 6699 pacemaker.base.threads: 10 pacemaker.max.threads: 50 http://git-wip-us.apache.org/repos/asf/storm/blob/9c586049/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj -- diff --git a/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj b/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj index eda477c..b37b901 100644 --- a/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj +++ b/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj @@ -87,7 +87,9 @@ (throw (HBExecutionException. "Invalid Response Type") (defn shuffle-servers-list [conf] - (shuffle (conf PACEMAKER-SERVERS))) + (shuffle (or +(conf PACEMAKER-SERVERS) +[(conf PACEMAKER-HOST)]))) (defn shutdown-rotate [servers client-pool] ; Shutdown the client and remove from the pool http://git-wip-us.apache.org/repos/asf/storm/blob/9c586049/storm-core/src/jvm/org/apache/storm/Config.java -- diff --git a/storm-core/src/jvm/org/apache/storm/Config.java b/storm-core/src/jvm/org/apache/storm/Config.java index 80a2a5d..0854f35 100644 --- a/storm-core/src/jvm/org/apache/storm/Config.java +++ b/storm-core/src/jvm/org/apache/storm/Config.java @@ -938,6 +938,14 @@ public class Config extends HashMap { public static final String PACEMAKER_SERVERS = "pacemaker.servers"; /** + * The host that Pacemaker is running on. + * @deprecated in favor of PACEMAKER_SERVERS for Pacemaker-HA. + */ +@Deprecated +@isString +public static final String PACEMAKER_HOST = "pacemaker.host"; + +/** * The port Pacemaker should run on. Clients should * connect to this port to submit or read heartbeats. */
[14/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ProfileRequest.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/ProfileRequest.java b/storm-core/src/jvm/backtype/storm/generated/ProfileRequest.java deleted file mode 100644 index 1189175..000 --- a/storm-core/src/jvm/backtype/storm/generated/ProfileRequest.java +++ /dev/null @@ -1,631 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class ProfileRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ProfileRequest"); - - private static final org.apache.thrift.protocol.TField NODE_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("nodeInfo", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField ACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("action", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField TIME_STAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("time_stamp", org.apache.thrift.protocol.TType.I64, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new ProfileRequestStandardSchemeFactory()); -schemes.put(TupleScheme.class, new ProfileRequestTupleSchemeFactory()); - } - - private NodeInfo nodeInfo; // required - private ProfileAction action; // required - private long time_stamp; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -NODE_INFO((short)1, "nodeInfo"), -/** - * - * @see ProfileAction - */ -ACTION((short)2, "action"), -TIME_STAMP((short)3, "time_stamp"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // NODE_INFO - return NODE_INFO; -case 2: // ACTION - return ACTION; -case 3: // TIME_STAMP - return TIME_STAMP; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId +
[44/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/worker.clj -- diff --git a/storm-core/src/clj/backtype/storm/daemon/worker.clj b/storm-core/src/clj/backtype/storm/daemon/worker.clj deleted file mode 100644 index 1326672..000 --- a/storm-core/src/clj/backtype/storm/daemon/worker.clj +++ /dev/null @@ -1,768 +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. -(ns org.apache.storm.daemon.worker - (:use [org.apache.storm.daemon common]) - (:use [org.apache.storm config log util timer local-state]) - (:require [clj-time.core :as time]) - (:require [clj-time.coerce :as coerce]) - (:require [org.apache.storm.daemon [executor :as executor]]) - (:require [org.apache.storm [disruptor :as disruptor] [cluster :as cluster]]) - (:require [clojure.set :as set]) - (:require [org.apache.storm.messaging.loader :as msg-loader]) - (:import [java.util.concurrent Executors] - [org.apache.storm.hooks IWorkerHook BaseWorkerHook]) - (:import [java.util ArrayList HashMap]) - (:import [org.apache.storm.utils Utils TransferDrainer ThriftTopologyUtils WorkerBackpressureThread DisruptorQueue]) - (:import [org.apache.storm.grouping LoadMapping]) - (:import [org.apache.storm.messaging TransportFactory]) - (:import [org.apache.storm.messaging TaskMessage IContext IConnection ConnectionWithStatus ConnectionWithStatus$Status]) - (:import [org.apache.storm.daemon Shutdownable]) - (:import [org.apache.storm.serialization KryoTupleSerializer]) - (:import [org.apache.storm.generated StormTopology]) - (:import [org.apache.storm.tuple AddressedTuple Fields]) - (:import [org.apache.storm.task WorkerTopologyContext]) - (:import [org.apache.storm Constants]) - (:import [org.apache.storm.security.auth AuthUtils]) - (:import [org.apache.storm.cluster ClusterStateContext DaemonType]) - (:import [javax.security.auth Subject]) - (:import [java.security PrivilegedExceptionAction]) - (:import [org.apache.logging.log4j LogManager]) - (:import [org.apache.logging.log4j Level]) - (:import [org.apache.logging.log4j.core.config LoggerConfig]) - (:import [org.apache.storm.generated LogConfig LogLevelAction]) - (:gen-class)) - -(defmulti mk-suicide-fn cluster-mode) - -(defn read-worker-executors [storm-conf storm-cluster-state storm-id assignment-id port assignment-versions] - (log-message "Reading Assignments.") - (let [assignment (:executor->node+port (.assignment-info storm-cluster-state storm-id nil))] -(doall - (concat - [Constants/SYSTEM_EXECUTOR_ID] - (mapcat (fn [[executor loc]] -(if (= loc [assignment-id port]) - [executor] - )) - assignment) - -(defnk do-executor-heartbeats [worker :executors nil] - ;; stats is how we know what executors are assigned to this worker - (let [stats (if-not executors - (into {} (map (fn [e] {e nil}) (:executors worker))) - (->> executors -(map (fn [e] {(executor/get-executor-id e) (executor/render-stats e)})) -(apply merge))) -zk-hb {:storm-id (:storm-id worker) - :executor-stats stats - :uptime ((:uptime worker)) - :time-secs (current-time-secs) - }] -;; do the zookeeper heartbeat -(try - (.worker-heartbeat! (:storm-cluster-state worker) (:storm-id worker) (:assignment-id worker) (:port worker) zk-hb) - (catch Exception exc -(log-error exc "Worker failed to write heartbeats to ZK or Pacemaker...will retry") - -(defn do-heartbeat [worker] - (let [conf (:conf worker) -state (worker-state conf (:worker-id worker))] -;; do the local-file-system heartbeat. -(ls-worker-heartbeat! state (current-time-secs) (:storm-id worker) (:executors worker) (:port worker)) -(.cleanup state 60) ; this is just in case supervisor is down so that disk doesn't fill up. - ; it shouldn't take supervisor 120 seconds between listing dir and reading it - -)) - -(defn worker-outbound-tasks - "Returns seq of task-ids that receive
[50/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/cluster.clj -- diff --git a/storm-core/src/clj/backtype/storm/cluster.clj b/storm-core/src/clj/backtype/storm/cluster.clj deleted file mode 100644 index 914fa5b..000 --- a/storm-core/src/clj/backtype/storm/cluster.clj +++ /dev/null @@ -1,708 +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. - -(ns org.apache.storm.cluster - (:import [org.apache.zookeeper.data Stat ACL Id] - [org.apache.storm.generated SupervisorInfo Assignment StormBase ClusterWorkerHeartbeat ErrorInfo Credentials NimbusSummary -LogConfig ProfileAction ProfileRequest NodeInfo] - [java.io Serializable]) - (:import [org.apache.zookeeper KeeperException KeeperException$NoNodeException ZooDefs ZooDefs$Ids ZooDefs$Perms]) - (:import [org.apache.curator.framework CuratorFramework]) - (:import [org.apache.storm.utils Utils]) - (:import [org.apache.storm.cluster ClusterState ClusterStateContext ClusterStateListener ConnectionState]) - (:import [java.security MessageDigest]) - (:import [org.apache.zookeeper.server.auth DigestAuthenticationProvider]) - (:import [org.apache.storm.nimbus NimbusInfo]) - (:use [org.apache.storm util log config converter]) - (:require [org.apache.storm [zookeeper :as zk]]) - (:require [org.apache.storm.daemon [common :as common]])) - -(defn mk-topo-only-acls - [topo-conf] - (let [payload (.get topo-conf STORM-ZOOKEEPER-TOPOLOGY-AUTH-PAYLOAD)] -(when (Utils/isZkAuthenticationConfiguredTopology topo-conf) - [(first ZooDefs$Ids/CREATOR_ALL_ACL) - (ACL. ZooDefs$Perms/READ (Id. "digest" (DigestAuthenticationProvider/generateDigest payload)))]))) - -(defnk mk-distributed-cluster-state - [conf :auth-conf nil :acls nil :context (ClusterStateContext.)] - (let [clazz (Class/forName (or (conf STORM-CLUSTER-STATE-STORE) - "org.apache.storm.cluster_state.zookeeper_state_factory")) -state-instance (.newInstance clazz)] -(log-debug "Creating cluster state: " (.toString clazz)) -(or (.mkState state-instance conf auth-conf acls context) -nil))) - -(defprotocol StormClusterState - (assignments [this callback]) - (assignment-info [this storm-id callback]) - (assignment-info-with-version [this storm-id callback]) - (assignment-version [this storm-id callback]) - ;returns key information under /storm/blobstore/key - (blobstore-info [this blob-key]) - ;returns list of nimbus summaries stored under /stormroot/nimbuses/ -> - (nimbuses [this]) - ;adds the NimbusSummary to /stormroot/nimbuses/nimbus-id - (add-nimbus-host! [this nimbus-id nimbus-summary]) - - (active-storms [this]) - (storm-base [this storm-id callback]) - (get-worker-heartbeat [this storm-id node port]) - (get-worker-profile-requests [this storm-id nodeinfo thrift?]) - (get-topology-profile-requests [this storm-id thrift?]) - (set-worker-profile-request [this storm-id profile-request]) - (delete-topology-profile-requests [this storm-id profile-request]) - (executor-beats [this storm-id executor->node+port]) - (supervisors [this callback]) - (supervisor-info [this supervisor-id]) ;; returns nil if doesn't exist - (setup-heartbeats! [this storm-id]) - (teardown-heartbeats! [this storm-id]) - (teardown-topology-errors! [this storm-id]) - (heartbeat-storms [this]) - (error-topologies [this]) - (backpressure-topologies [this]) - (set-topology-log-config! [this storm-id log-config]) - (topology-log-config [this storm-id cb]) - (worker-heartbeat! [this storm-id node port info]) - (remove-worker-heartbeat! [this storm-id node port]) - (supervisor-heartbeat! [this supervisor-id info]) - (worker-backpressure! [this storm-id node port info]) - (topology-backpressure [this storm-id callback]) - (setup-backpressure! [this storm-id]) - (remove-backpressure! [this storm-id]) - (remove-worker-backpressure! [this storm-id node port]) - (activate-storm! [this storm-id storm-base]) - (update-storm! [this storm-id new-elems]) - (remove-storm-base! [this storm-id]) - (set-assignment! [this storm-id info]) - ;; sets up in
[21/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/HBRecords.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/HBRecords.java b/storm-core/src/jvm/backtype/storm/generated/HBRecords.java deleted file mode 100644 index 6a6d4f2..000 --- a/storm-core/src/jvm/backtype/storm/generated/HBRecords.java +++ /dev/null @@ -1,466 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class HBRecords implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HBRecords"); - - private static final org.apache.thrift.protocol.TField PULSES_FIELD_DESC = new org.apache.thrift.protocol.TField("pulses", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new HBRecordsStandardSchemeFactory()); -schemes.put(TupleScheme.class, new HBRecordsTupleSchemeFactory()); - } - - private List pulses; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -PULSES((short)1, "pulses"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // PULSES - return PULSES; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; -} - -/** - * Find the _Fields constant that matches name, or null if its not found. - */ -public static _Fields findByName(String name) { - return byName.get(name); -} - -private final short _thriftId; -private final String _fieldName; - -_Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; -} - -public short getThriftFieldId() { - return _thriftId; -} - -public String getFieldName() { - return _fieldName; -} - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { -Map<_Fields, org.apache.thrift.me
[18/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LocalAssignment.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/LocalAssignment.java b/storm-core/src/jvm/backtype/storm/generated/LocalAssignment.java deleted file mode 100644 index b48d342..000 --- a/storm-core/src/jvm/backtype/storm/generated/LocalAssignment.java +++ /dev/null @@ -1,676 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class LocalAssignment implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LocalAssignment"); - - private static final org.apache.thrift.protocol.TField TOPOLOGY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("executors", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final org.apache.thrift.protocol.TField RESOURCES_FIELD_DESC = new org.apache.thrift.protocol.TField("resources", org.apache.thrift.protocol.TType.STRUCT, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new LocalAssignmentStandardSchemeFactory()); -schemes.put(TupleScheme.class, new LocalAssignmentTupleSchemeFactory()); - } - - private String topology_id; // required - private List executors; // required - private WorkerResources resources; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -TOPOLOGY_ID((short)1, "topology_id"), -EXECUTORS((short)2, "executors"), -RESOURCES((short)3, "resources"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // TOPOLOGY_ID - return TOPOLOGY_ID; -case 2: // EXECUTORS - return EXECUTORS; -case 3: // RESOURCES - return RESOURCES; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't
[29/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ComponentPageInfo.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/ComponentPageInfo.java b/storm-core/src/jvm/backtype/storm/generated/ComponentPageInfo.java deleted file mode 100644 index 7fcebcc..000 --- a/storm-core/src/jvm/backtype/storm/generated/ComponentPageInfo.java +++ /dev/null @@ -1,2352 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class ComponentPageInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComponentPageInfo"); - - private static final org.apache.thrift.protocol.TField COMPONENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("component_id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField COMPONENT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("component_type", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField TOPOLOGY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_id", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField TOPOLOGY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_name", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField NUM_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_executors", org.apache.thrift.protocol.TType.I32, (short)5); - private static final org.apache.thrift.protocol.TField NUM_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_tasks", org.apache.thrift.protocol.TType.I32, (short)6); - private static final org.apache.thrift.protocol.TField WINDOW_TO_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_stats", org.apache.thrift.protocol.TType.MAP, (short)7); - private static final org.apache.thrift.protocol.TField GSID_TO_INPUT_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("gsid_to_input_stats", org.apache.thrift.protocol.TType.MAP, (short)8); - private static final org.apache.thrift.protocol.TField SID_TO_OUTPUT_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("sid_to_output_stats", org.apache.thrift.protocol.TType.MAP, (short)9); - private static final org.apache.thrift.protocol.TField EXEC_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("exec_stats", org.apache.thrift.protocol.TType.LIST, (short)10); - private static final org.apache.thrift.protocol.TField ERRORS_FIELD_DESC = new org.apache.thrift.protocol.TField("errors", org.apache.thrift.protocol.TType.LIST, (short)11); - private static final org.apache.thrift.protocol.TField EVENTLOG_HOST_FIELD_DESC = new org.
[31/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ClusterWorkerHeartbeat.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/ClusterWorkerHeartbeat.java b/storm-core/src/jvm/backtype/storm/generated/ClusterWorkerHeartbeat.java deleted file mode 100644 index d974f1d..000 --- a/storm-core/src/jvm/backtype/storm/generated/ClusterWorkerHeartbeat.java +++ /dev/null @@ -1,768 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ClusterWorkerHeartbeat"); - - private static final org.apache.thrift.protocol.TField STORM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("storm_id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField EXECUTOR_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("executor_stats", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final org.apache.thrift.protocol.TField TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("time_secs", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new ClusterWorkerHeartbeatStandardSchemeFactory()); -schemes.put(TupleScheme.class, new ClusterWorkerHeartbeatTupleSchemeFactory()); - } - - private String storm_id; // required - private Map executor_stats; // required - private int time_secs; // required - private int uptime_secs; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -STORM_ID((short)1, "storm_id"), -EXECUTOR_STATS((short)2, "executor_stats"), -TIME_SECS((short)3, "time_secs"), -UPTIME_SECS((short)4, "uptime_secs"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // STORM_ID - return STORM_ID; -case 2: // EXECUTOR_STATS - return EXECUTOR_STATS; -case 3: // TIME_SECS - return TIME_SECS; -case 4: // UPTIME_SECS - return UPTIME_SECS; -
[24/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ExecutorStats.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/ExecutorStats.java b/storm-core/src/jvm/backtype/storm/generated/ExecutorStats.java deleted file mode 100644 index bbb8e7a..000 --- a/storm-core/src/jvm/backtype/storm/generated/ExecutorStats.java +++ /dev/null @@ -1,915 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class ExecutorStats implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecutorStats"); - - private static final org.apache.thrift.protocol.TField EMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("emitted", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.protocol.TField TRANSFERRED_FIELD_DESC = new org.apache.thrift.protocol.TField("transferred", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final org.apache.thrift.protocol.TField SPECIFIC_FIELD_DESC = new org.apache.thrift.protocol.TField("specific", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField RATE_FIELD_DESC = new org.apache.thrift.protocol.TField("rate", org.apache.thrift.protocol.TType.DOUBLE, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new ExecutorStatsStandardSchemeFactory()); -schemes.put(TupleScheme.class, new ExecutorStatsTupleSchemeFactory()); - } - - private Map> emitted; // required - private Map> transferred; // required - private ExecutorSpecificStats specific; // required - private double rate; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -EMITTED((short)1, "emitted"), -TRANSFERRED((short)2, "transferred"), -SPECIFIC((short)3, "specific"), -RATE((short)4, "rate"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // EMITTED - return EMITTED; -case 2: // TRANSFERRED - return TRANSFERRED; -case 3: // SPECIFIC - return SPECIFIC; -case 4: // RATE - return RATE; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an ex
[27/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/DistributedRPC.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/DistributedRPC.java b/storm-core/src/jvm/backtype/storm/generated/DistributedRPC.java deleted file mode 100644 index 6ef2559..000 --- a/storm-core/src/jvm/backtype/storm/generated/DistributedRPC.java +++ /dev/null @@ -1,1328 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class DistributedRPC { - - public interface Iface { - -public String execute(String functionName, String funcArgs) throws DRPCExecutionException, AuthorizationException, org.apache.thrift.TException; - - } - - public interface AsyncIface { - -public void execute(String functionName, String funcArgs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - } - - public static class Client extends org.apache.thrift.TServiceClient implements Iface { -public static class Factory implements org.apache.thrift.TServiceClientFactory { - public Factory() {} - public Client getClient(org.apache.thrift.protocol.TProtocol prot) { -return new Client(prot); - } - public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { -return new Client(iprot, oprot); - } -} - -public Client(org.apache.thrift.protocol.TProtocol prot) -{ - super(prot, prot); -} - -public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - super(iprot, oprot); -} - -public String execute(String functionName, String funcArgs) throws DRPCExecutionException, AuthorizationException, org.apache.thrift.TException -{ - send_execute(functionName, funcArgs); - return recv_execute(); -} - -public void send_execute(String functionName, String funcArgs) throws org.apache.thrift.TException -{ - execute_args args = new execute_args(); - args.set_functionName(functionName); - args.set_funcArgs(funcArgs); - sendBase("execute", args); -} - -public String recv_execute() throws DRPCExecutionException, AuthorizationException, org.apache.thrift.TException -{ - execute_result result = new execute_result(); - receiveBase(result, "execute"); - if (result.is_set_success()) { -return result.success; - } - if (result.e != null) { -throw result.e; - } - if (result.aze != null) { -throw result.aze; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "execute failed: unknown result"); -} - - } - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { -public static class Factory implements org.apache.thrift.async
[42/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/testing.clj -- diff --git a/storm-core/src/clj/backtype/storm/testing.clj b/storm-core/src/clj/backtype/storm/testing.clj deleted file mode 100644 index 565d1b9..000 --- a/storm-core/src/clj/backtype/storm/testing.clj +++ /dev/null @@ -1,702 +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. - -(ns org.apache.storm.testing - (:require [org.apache.storm.daemon - [nimbus :as nimbus] - [supervisor :as supervisor] - [common :as common] - [worker :as worker] - [executor :as executor]]) - (:require [org.apache.storm [process-simulator :as psim]]) - (:import [org.apache.commons.io FileUtils]) - (:import [java.io File]) - (:import [java.util HashMap ArrayList]) - (:import [java.util.concurrent.atomic AtomicInteger]) - (:import [java.util.concurrent ConcurrentHashMap]) - (:import [org.apache.storm.utils Time Utils RegisteredGlobalState]) - (:import [org.apache.storm.tuple Fields Tuple TupleImpl]) - (:import [org.apache.storm.task TopologyContext]) - (:import [org.apache.storm.generated GlobalStreamId Bolt KillOptions]) - (:import [org.apache.storm.testing FeederSpout FixedTupleSpout FixedTuple -TupleCaptureBolt SpoutTracker BoltTracker NonRichBoltTracker -TestWordSpout MemoryTransactionalSpout]) - (:import [org.apache.storm.security.auth ThriftServer ThriftConnectionType ReqContext AuthUtils]) - (:import [org.apache.storm.generated NotAliveException AlreadyAliveException StormTopology ErrorInfo -ExecutorInfo InvalidTopologyException Nimbus$Iface Nimbus$Processor SubmitOptions TopologyInitialStatus -KillOptions RebalanceOptions ClusterSummary SupervisorSummary TopologySummary TopologyInfo -ExecutorSummary AuthorizationException GetInfoOptions NumErrorsChoice]) - (:import [org.apache.storm.transactional TransactionalSpoutCoordinator]) - (:import [org.apache.storm.transactional.partitioned PartitionedTransactionalSpoutExecutor]) - (:import [org.apache.storm.tuple Tuple]) - (:import [org.apache.storm.generated StormTopology]) - (:import [org.apache.storm.task TopologyContext]) - (:require [org.apache.storm [zookeeper :as zk]]) - (:require [org.apache.storm.messaging.loader :as msg-loader]) - (:require [org.apache.storm.daemon.acker :as acker]) - (:use [org.apache.storm cluster util thrift config log local-state])) - -(defn feeder-spout - [fields] - (FeederSpout. (Fields. fields))) - -(defn local-temp-path - [] - (str (System/getProperty "java.io.tmpdir") (if-not on-windows? "/") (uuid))) - -(defn delete-all - [paths] - (dorun -(for [t paths] - (if (.exists (File. t)) -(try - (FileUtils/forceDelete (File. t)) - (catch Exception e -(log-message (.getMessage e - -(defmacro with-local-tmp - [[& tmp-syms] & body] - (let [tmp-paths (mapcat (fn [t] [t `(local-temp-path)]) tmp-syms)] -`(let [~@tmp-paths] - (try - ~@body - (finally - (delete-all ~(vec tmp-syms))) - -(defn start-simulating-time! - [] - (Time/startSimulating)) - -(defn stop-simulating-time! - [] - (Time/stopSimulating)) - - (defmacro with-simulated-time - [& body] - `(try - (start-simulating-time!) - ~@body - (finally - (stop-simulating-time! - -(defn advance-time-ms! [ms] - (Time/advanceTime ms)) - -(defn advance-time-secs! [secs] - (advance-time-ms! (* (long secs) 1000))) - -(defnk add-supervisor - [cluster-map :ports 2 :conf {} :id nil] - (let [tmp-dir (local-temp-path) -port-ids (if (sequential? ports) - ports - (doall (repeatedly ports (:port-counter cluster-map -supervisor-conf (merge (:daemon-conf cluster-map) - conf - {STORM-LOCAL-DIR tmp-dir -SUPERVISOR-SLOTS-PORTS port-ids}) -id-fn (if id (fn [] id) supervisor/generate-supervisor-id) -daemon (with-var-roots [supervisor/generate-supervisor-id id-fn
[10/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/StormTopology.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/StormTopology.java b/storm-core/src/jvm/backtype/storm/generated/StormTopology.java deleted file mode 100644 index caec6c6..000 --- a/storm-core/src/jvm/backtype/storm/generated/StormTopology.java +++ /dev/null @@ -1,1272 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class StormTopology implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StormTopology"); - - private static final org.apache.thrift.protocol.TField SPOUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("spouts", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.protocol.TField BOLTS_FIELD_DESC = new org.apache.thrift.protocol.TField("bolts", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final org.apache.thrift.protocol.TField STATE_SPOUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("state_spouts", org.apache.thrift.protocol.TType.MAP, (short)3); - private static final org.apache.thrift.protocol.TField WORKER_HOOKS_FIELD_DESC = new org.apache.thrift.protocol.TField("worker_hooks", org.apache.thrift.protocol.TType.LIST, (short)4); - private static final org.apache.thrift.protocol.TField DEPENDENCY_JARS_FIELD_DESC = new org.apache.thrift.protocol.TField("dependency_jars", org.apache.thrift.protocol.TType.LIST, (short)5); - private static final org.apache.thrift.protocol.TField DEPENDENCY_ARTIFACTS_FIELD_DESC = new org.apache.thrift.protocol.TField("dependency_artifacts", org.apache.thrift.protocol.TType.LIST, (short)6); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new StormTopologyStandardSchemeFactory()); -schemes.put(TupleScheme.class, new StormTopologyTupleSchemeFactory()); - } - - private Map spouts; // required - private Map bolts; // required - private Map state_spouts; // required - private List worker_hooks; // optional - private List dependency_jars; // optional - private List dependency_artifacts; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -SPOUTS((short)1, "spouts"), -BOLTS((short)2, "bolts"), -STATE_SPOUTS((short)3, "state_spouts"), -WORKER_HOOKS((short)4, "worker_hooks"), -DEPENDENCY_JARS((short)5, "dependency_jars"), -DEPENDENCY_ARTIFACTS((short)6, "dependency_artifacts"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -
[23/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/GlobalStreamId.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/GlobalStreamId.java b/storm-core/src/jvm/backtype/storm/generated/GlobalStreamId.java deleted file mode 100644 index 677dfd8..000 --- a/storm-core/src/jvm/backtype/storm/generated/GlobalStreamId.java +++ /dev/null @@ -1,507 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class GlobalStreamId implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GlobalStreamId"); - - private static final org.apache.thrift.protocol.TField COMPONENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("componentId", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STREAM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("streamId", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new GlobalStreamIdStandardSchemeFactory()); -schemes.put(TupleScheme.class, new GlobalStreamIdTupleSchemeFactory()); - } - - private String componentId; // required - private String streamId; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -COMPONENT_ID((short)1, "componentId"), -STREAM_ID((short)2, "streamId"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // COMPONENT_ID - return COMPONENT_ID; -case 2: // STREAM_ID - return STREAM_ID; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; -} - -/** - * Find the _Fields constant that matches name, or null if its not found. - */ -public static _Fields findByName(String name) { - return byName.get(name); -} - -private final short _thriftId; -private final String _fieldName; - -_Fields(short thriftId, S
[38/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/Constants.java -- diff --git a/storm-core/src/jvm/backtype/storm/Constants.java b/storm-core/src/jvm/backtype/storm/Constants.java deleted file mode 100644 index b2c642e..000 --- a/storm-core/src/jvm/backtype/storm/Constants.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.storm; - -import org.apache.storm.coordination.CoordinatedBolt; -import clojure.lang.RT; - - -public class Constants { -public static final String COORDINATED_STREAM_ID = CoordinatedBolt.class.getName() + "/coord-stream"; - -public static final long SYSTEM_TASK_ID = -1; -public static final Object SYSTEM_EXECUTOR_ID = RT.readString("[-1 -1]"); -public static final String SYSTEM_COMPONENT_ID = "__system"; -public static final String SYSTEM_TICK_STREAM_ID = "__tick"; -public static final String METRICS_COMPONENT_ID_PREFIX = "__metrics"; -public static final String METRICS_STREAM_ID = "__metrics"; -public static final String METRICS_TICK_STREAM_ID = "__metrics_tick"; -public static final String CREDENTIALS_CHANGED_STREAM_ID = "__credentials"; -} - http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/ICredentialsListener.java -- diff --git a/storm-core/src/jvm/backtype/storm/ICredentialsListener.java b/storm-core/src/jvm/backtype/storm/ICredentialsListener.java deleted file mode 100644 index 5eed024..000 --- a/storm-core/src/jvm/backtype/storm/ICredentialsListener.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 org.apache.storm; - -import java.util.Map; - -/** - * Allows a bolt or a spout to be informed when the credentials of the topology have changed. - */ -public interface ICredentialsListener { -/** - * Called when the credentials of a topology have changed. - * @param credentials the new credentials, could be null. - */ -public void setCredentials(Map credentials); -} http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/ILocalCluster.java -- diff --git a/storm-core/src/jvm/backtype/storm/ILocalCluster.java b/storm-core/src/jvm/backtype/storm/ILocalCluster.java deleted file mode 100644 index 05b55e7..000 --- a/storm-core/src/jvm/backtype/storm/ILocalCluster.java +++ /dev/null @@ -1,49 +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 un
[55/55] [abbrv] storm git commit: Syncing java files with master.
Syncing java files with master. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/8e121dce Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/8e121dce Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/8e121dce Branch: refs/heads/Pacemaker-HA-1.x-branch2 Commit: 8e121dceedcedbddeefe2b702e8478cd3de72da4 Parents: 737847c Author: Kyle Nusbaum Authored: Mon Oct 10 21:03:25 2016 -0500 Committer: Kyle Nusbaum Committed: Mon Oct 10 21:03:25 2016 -0500 -- .../apache/storm/pacemaker/PacemakerClient.java | 50 ++-- .../pacemaker/PacemakerConnectionException.java | 24 ++ 2 files changed, 48 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/8e121dce/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java -- diff --git a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java index 67201b8..cbbfe7f 100644 --- a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java +++ b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java @@ -55,12 +55,18 @@ public class PacemakerClient implements ISaslClient { private HBMessage messages[]; private LinkedBlockingQueue availableMessageSlots; private ThriftNettyClientCodec.AuthMethod authMethod; + private static Timer timer = new Timer(true); private StormBoundedExponentialBackoffRetry backoff = new StormBoundedExponentialBackoffRetry(100, 5000, 20); private int retryTimes = 0; +//the constructor is invoked by pacemaker-state-factory-test +public PacemakerClient() { +bootstrap = new ClientBootstrap(); +} public PacemakerClient(Map config, String host) { + int port = (int)config.get(Config.PACEMAKER_PORT); client_name = (String)config.get(Config.TOPOLOGY_NAME); if(client_name == null) { @@ -143,10 +149,6 @@ public class PacemakerClient implements ISaslClient { retryTimes = 0; } -public boolean isReady() { -return ready.get(); -} - @Override public synchronized void channelReady() { LOG.debug("Channel is ready."); @@ -162,8 +164,7 @@ public class PacemakerClient implements ISaslClient { return secret; } -public HBMessage send(HBMessage m) { -waitUntilReady(); +public HBMessage send(HBMessage m) throws PacemakerConnectionException { LOG.debug("Sending message: {}", m.toString()); try { int next = availableMessageSlots.take(); @@ -172,14 +173,11 @@ public class PacemakerClient implements ISaslClient { messages[next] = m; LOG.debug("Put message in slot: {}", Integer.toString(next)); do { -try { -if (channelRef.get() != null) { -channelRef.get().write(m); -m.wait(1000); -} -} catch (Exception exp) { -LOG.error("error attempting to write to a channel {}", exp); -waitUntilReady(); +waitUntilReady(); +Channel channel = channelRef.get(); +if(channel != null) { +channel.write(m); +m.wait(1000); } } while (messages[next] == m); } @@ -199,16 +197,16 @@ public class PacemakerClient implements ISaslClient { } } -public PacemakerClient waitUntilReady() { +private void waitUntilReady() throws PacemakerConnectionException { // Wait for 'ready' (channel connected and maybe authentication) -if(!isReady() || channelRef.get() == null) { +if(!ready.get() || channelRef.get() == null) { synchronized(this) { -if(!isReady()) { +if(!ready.get()) { LOG.debug("Waiting for netty channel to be ready."); try { this.wait(1000); -if(!isReady() || channelRef.get() == null) { -throw new RuntimeException("Timed out waiting for channel ready."); +if(!ready.get() || channelRef.get() == null) { +throw new PacemakerConnectionException("Timed out waiting for channel ready."); } } catch (InterruptedException e) { throw new RuntimeException(e); @@ -216,14 +214,13 @@ public class PacemakerClient implements ISaslClient { }
[01/55] [abbrv] [partial] storm git commit: Ported successfully.
Repository: storm Updated Branches: refs/heads/Pacemaker-HA-1.x-branch2 [created] 8e121dcee http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/WorkerSummary.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/WorkerSummary.java b/storm-core/src/jvm/backtype/storm/generated/WorkerSummary.java deleted file mode 100644 index fff9373..000 --- a/storm-core/src/jvm/backtype/storm/generated/WorkerSummary.java +++ /dev/null @@ -1,1880 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class WorkerSummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkerSummary"); - - private static final org.apache.thrift.protocol.TField SUPERVISOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisor_id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField TOPOLOGY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_id", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField TOPOLOGY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_name", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField NUM_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_executors", org.apache.thrift.protocol.TType.I32, (short)6); - private static final org.apache.thrift.protocol.TField COMPONENT_TO_NUM_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("component_to_num_tasks", org.apache.thrift.protocol.TType.MAP, (short)7); - private static final org.apache.thrift.protocol.TField TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("time_secs", org.apache.thrift.protocol.TType.I32, (short)8); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)9); - private static final org.apache.thrift.protocol.TField REQUESTED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)521); - private static final org.apache.thrift.protocol.TField REQUESTED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memoffheap", org.apache.thrift.protocol.TType.DOUBLE, (short)522); - private static f
[47/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/logviewer.clj -- diff --git a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj deleted file mode 100644 index 1ad88f9..000 --- a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj +++ /dev/null @@ -1,1232 +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. -(ns org.apache.storm.daemon.logviewer - (:use compojure.core) - (:use [clojure.set :only [difference intersection]]) - (:use [clojure.string :only [blank? split]]) - (:use [hiccup core page-helpers form-helpers]) - (:use [org.apache.storm config util log timer]) - (:use [org.apache.storm.ui helpers]) - (:import [org.apache.storm.utils Utils VersionInfo]) - (:import [org.slf4j LoggerFactory]) - (:import [java.util Arrays ArrayList HashSet]) - (:import [java.util.zip GZIPInputStream]) - (:import [org.apache.logging.log4j LogManager]) - (:import [org.apache.logging.log4j.core Appender LoggerContext]) - (:import [org.apache.logging.log4j.core.appender RollingFileAppender]) - (:import [java.io BufferedInputStream File FileFilter FileInputStream -InputStream InputStreamReader]) - (:import [java.nio.file Files Path Paths DirectoryStream]) - (:import [java.nio ByteBuffer]) - (:import [org.apache.storm.utils Utils]) - (:import [org.apache.storm.daemon DirectoryCleaner]) - (:import [org.yaml.snakeyaml Yaml] - [org.yaml.snakeyaml.constructor SafeConstructor]) - (:import [org.apache.storm.ui InvalidRequestException] - [org.apache.storm.security.auth AuthUtils]) - (:require [org.apache.storm.daemon common [supervisor :as supervisor]]) - (:require [compojure.route :as route] -[compojure.handler :as handler] -[ring.middleware.keyword-params] -[ring.util.codec :as codec] -[ring.util.response :as resp] -[clojure.string :as string]) - (:require [metrics.meters :refer [defmeter mark!]]) - (:use [org.apache.storm.daemon.common :only [start-metrics-reporters]]) - (:gen-class)) - -(def ^:dynamic *STORM-CONF* (read-storm-config)) -(def STORM-VERSION (VersionInfo/getVersion)) - -(defmeter logviewer:num-log-page-http-requests) -(defmeter logviewer:num-daemonlog-page-http-requests) -(defmeter logviewer:num-download-log-file-http-requests) -(defmeter logviewer:num-download-log-daemon-file-http-requests) -(defmeter logviewer:num-list-logs-http-requests) - -(defn cleanup-cutoff-age-millis [conf now-millis] - (- now-millis (* (conf LOGVIEWER-CLEANUP-AGE-MINS) 60 1000))) - -(defn get-stream-for-dir - [^File f] - (try (Files/newDirectoryStream (.toPath f)) -(catch Exception ex (log-error ex) nil))) - -(defn- last-modifiedtime-worker-logdir - "Return the last modified time for all log files in a worker's log dir. - Using stream rather than File.listFiles is to avoid large mem usage - when a directory has too many files" - [^File log-dir] - (let [^DirectoryStream stream (get-stream-for-dir log-dir) -dir-modified (.lastModified log-dir) -last-modified (try (reduce -(fn [maximum path] - (let [curr (.lastModified (.toFile path))] -(if (> curr maximum) - curr - maximum))) -dir-modified -stream) -(catch Exception ex - (log-error ex) dir-modified) -(finally - (if (instance? DirectoryStream stream) -(.close stream] -last-modified)) - -(defn get-size-for-logdir - "Return the sum of lengths for all log files in a worker's log dir. - Using stream rather than File.listFiles is to avoid large mem usage - when a directory has too many files" - [log-dir] - (let [^DirectoryStream stream (get-stream-for-dir log-dir)] -(reduce - (fn [sum path] -(let [size (.length (.toFile path))] - (+ sum size))) - 0 - stream))) - -(defn
[09/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SupervisorInfo.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/SupervisorInfo.java b/storm-core/src/jvm/backtype/storm/generated/SupervisorInfo.java deleted file mode 100644 index 44003c2..000 --- a/storm-core/src/jvm/backtype/storm/generated/SupervisorInfo.java +++ /dev/null @@ -1,1446 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class SupervisorInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SupervisorInfo"); - - private static final org.apache.thrift.protocol.TField TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("time_secs", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField HOSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("hostname", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField ASSIGNMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("assignment_id", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField USED_PORTS_FIELD_DESC = new org.apache.thrift.protocol.TField("used_ports", org.apache.thrift.protocol.TType.LIST, (short)4); - private static final org.apache.thrift.protocol.TField META_FIELD_DESC = new org.apache.thrift.protocol.TField("meta", org.apache.thrift.protocol.TType.LIST, (short)5); - private static final org.apache.thrift.protocol.TField SCHEDULER_META_FIELD_DESC = new org.apache.thrift.protocol.TField("scheduler_meta", org.apache.thrift.protocol.TType.MAP, (short)6); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I64, (short)7); - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)8); - private static final org.apache.thrift.protocol.TField RESOURCES_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("resources_map", org.apache.thrift.protocol.TType.MAP, (short)9); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new SupervisorInfoStandardSchemeFactory()); -schemes.put(TupleScheme.class, new SupervisorInfoTupleSchemeFactory()); - } - - private long time_secs; // required - private String hostname; // required - private String assignment_id; // optional - private List used_ports; // optional - private List meta; // optional - private Map scheduler_meta; // optional - private long uptime_secs; // optional -
[05/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyPageInfo.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyPageInfo.java b/storm-core/src/jvm/backtype/storm/generated/TopologyPageInfo.java deleted file mode 100644 index a0e25ce..000 --- a/storm-core/src/jvm/backtype/storm/generated/TopologyPageInfo.java +++ /dev/null @@ -1,2757 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TopologyPageInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyPageInfo"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField NUM_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_tasks", org.apache.thrift.protocol.TType.I32, (short)5); - private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)6); - private static final org.apache.thrift.protocol.TField NUM_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_executors", org.apache.thrift.protocol.TType.I32, (short)7); - private static final org.apache.thrift.protocol.TField TOPOLOGY_CONF_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_conf", org.apache.thrift.protocol.TType.STRING, (short)8); - private static final org.apache.thrift.protocol.TField ID_TO_SPOUT_AGG_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("id_to_spout_agg_stats", org.apache.thrift.protocol.TType.MAP, (short)9); - private static final org.apache.thrift.protocol.TField ID_TO_BOLT_AGG_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("id_to_bolt_agg_stats", org.apache.thrift.protocol.TType.MAP, (short)10); - private static final org.apache.thrift.protocol.TField SCHED_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("sched_status", org.apache.thrift.protocol.TType.STRING, (short)11); - private static final org.apache.thrift.protocol.TField TOPOLOGY_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_s
[36/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/clojure/ClojureBolt.java -- diff --git a/storm-core/src/jvm/backtype/storm/clojure/ClojureBolt.java b/storm-core/src/jvm/backtype/storm/clojure/ClojureBolt.java deleted file mode 100644 index d56828b..000 --- a/storm-core/src/jvm/backtype/storm/clojure/ClojureBolt.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.storm.clojure; - -import org.apache.storm.coordination.CoordinatedBolt.FinishedCallback; -import org.apache.storm.generated.StreamInfo; -import org.apache.storm.task.IBolt; -import org.apache.storm.task.OutputCollector; -import org.apache.storm.task.TopologyContext; -import org.apache.storm.topology.IRichBolt; -import org.apache.storm.topology.OutputFieldsDeclarer; -import org.apache.storm.tuple.Fields; -import org.apache.storm.tuple.Tuple; -import org.apache.storm.utils.Utils; -import clojure.lang.IFn; -import clojure.lang.PersistentArrayMap; -import clojure.lang.Keyword; -import clojure.lang.Symbol; -import clojure.lang.RT; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - - -public class ClojureBolt implements IRichBolt, FinishedCallback { -Map _fields; -List _fnSpec; -List _confSpec; -List _params; - -IBolt _bolt; - -public ClojureBolt(List fnSpec, List confSpec, List params, Map fields) { -_fnSpec = fnSpec; -_confSpec = confSpec; -_params = params; -_fields = fields; -} - -@Override -public void prepare(final Map stormConf, final TopologyContext context, final OutputCollector collector) { -IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1)); -try { -IFn preparer = (IFn) hof.applyTo(RT.seq(_params)); -final Map collectorMap = new PersistentArrayMap( new Object[] { -Keyword.intern(Symbol.create("output-collector")), collector, -Keyword.intern(Symbol.create("context")), context}); -List args = new ArrayList() {{ -add(stormConf); -add(context); -add(collectorMap); -}}; - -_bolt = (IBolt) preparer.applyTo(RT.seq(args)); -//this is kind of unnecessary for clojure -try { -_bolt.prepare(stormConf, context, collector); -} catch(AbstractMethodError ame) { - -} -} catch (Exception e) { -throw new RuntimeException(e); -} -} - -@Override -public void execute(Tuple input) { -_bolt.execute(input); -} - -@Override -public void cleanup() { -try { -_bolt.cleanup(); -} catch(AbstractMethodError ame) { - -} -} - -@Override -public void declareOutputFields(OutputFieldsDeclarer declarer) { -for(String stream: _fields.keySet()) { -StreamInfo info = _fields.get(stream); -declarer.declareStream(stream, info.is_direct(), new Fields(info.get_output_fields())); -} -} - -@Override -public void finishedId(Object id) { -if(_bolt instanceof FinishedCallback) { -((FinishedCallback) _bolt).finishedId(id); -} -} - -@Override -public Map getComponentConfiguration() { -IFn hof = Utils.loadClojureFn(_confSpec.get(0), _confSpec.get(1)); -try { -return (Map) hof.applyTo(RT.seq(_params)); -} catch (Exception e) { -throw new RuntimeException(e); -} -} -} http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/clojure/ClojureSpout.java -- diff --git a/storm-core/src/jvm/backtype/storm/clojure/ClojureSpout.java b/storm-core/src/jvm/backtype/storm/clojure/ClojureSpout.java deleted file mode 100644 index 61de3cd..000 --- a/storm-core/src/jvm/backtype/storm/clojure/ClojureSpout.java +++ /dev/null @@ -1,153 +0,0
[08/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SupervisorSummary.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/SupervisorSummary.java b/storm-core/src/jvm/backtype/storm/generated/SupervisorSummary.java deleted file mode 100644 index bd7d7a4..000 --- a/storm-core/src/jvm/backtype/storm/generated/SupervisorSummary.java +++ /dev/null @@ -1,1265 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class SupervisorSummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SupervisorSummary"); - - private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField NUM_USED_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_used_workers", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField SUPERVISOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisor_id", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)6); - private static final org.apache.thrift.protocol.TField TOTAL_RESOURCES_FIELD_DESC = new org.apache.thrift.protocol.TField("total_resources", org.apache.thrift.protocol.TType.MAP, (short)7); - private static final org.apache.thrift.protocol.TField USED_MEM_FIELD_DESC = new org.apache.thrift.protocol.TField("used_mem", org.apache.thrift.protocol.TType.DOUBLE, (short)8); - private static final org.apache.thrift.protocol.TField USED_CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("used_cpu", org.apache.thrift.protocol.TType.DOUBLE, (short)9); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new SupervisorSummaryStandardSchemeFactory()); -schemes.put(TupleScheme.class, new SupervisorSummaryTupleSchemeFactory()); - } - - private String host; // required - private int uptime_secs; // required - private int num_workers; // required - private int num_used_workers; // required - private String supervisor_id; // required - private String version; // optional -
[32/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/BoltStats.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/BoltStats.java b/storm-core/src/jvm/backtype/storm/generated/BoltStats.java deleted file mode 100644 index cd5a497..000 --- a/storm-core/src/jvm/backtype/storm/generated/BoltStats.java +++ /dev/null @@ -1,1390 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class BoltStats implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BoltStats"); - - private static final org.apache.thrift.protocol.TField ACKED_FIELD_DESC = new org.apache.thrift.protocol.TField("acked", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.protocol.TField FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("failed", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final org.apache.thrift.protocol.TField PROCESS_MS_AVG_FIELD_DESC = new org.apache.thrift.protocol.TField("process_ms_avg", org.apache.thrift.protocol.TType.MAP, (short)3); - private static final org.apache.thrift.protocol.TField EXECUTED_FIELD_DESC = new org.apache.thrift.protocol.TField("executed", org.apache.thrift.protocol.TType.MAP, (short)4); - private static final org.apache.thrift.protocol.TField EXECUTE_MS_AVG_FIELD_DESC = new org.apache.thrift.protocol.TField("execute_ms_avg", org.apache.thrift.protocol.TType.MAP, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new BoltStatsStandardSchemeFactory()); -schemes.put(TupleScheme.class, new BoltStatsTupleSchemeFactory()); - } - - private Map> acked; // required - private Map> failed; // required - private Map> process_ms_avg; // required - private Map> executed; // required - private Map> execute_ms_avg; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -ACKED((short)1, "acked"), -FAILED((short)2, "failed"), -PROCESS_MS_AVG((short)3, "process_ms_avg"), -EXECUTED((short)4, "executed"), -EXECUTE_MS_AVG((short)5, "execute_ms_avg"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // ACKED - return ACKED; -case 2: // FAILED - return FAILED; -case
[13/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ShellComponent.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/ShellComponent.java b/storm-core/src/jvm/backtype/storm/generated/ShellComponent.java deleted file mode 100644 index 6941cb2..000 --- a/storm-core/src/jvm/backtype/storm/generated/ShellComponent.java +++ /dev/null @@ -1,516 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class ShellComponent implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ShellComponent"); - - private static final org.apache.thrift.protocol.TField EXECUTION_COMMAND_FIELD_DESC = new org.apache.thrift.protocol.TField("execution_command", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField SCRIPT_FIELD_DESC = new org.apache.thrift.protocol.TField("script", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new ShellComponentStandardSchemeFactory()); -schemes.put(TupleScheme.class, new ShellComponentTupleSchemeFactory()); - } - - private String execution_command; // required - private String script; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -EXECUTION_COMMAND((short)1, "execution_command"), -SCRIPT((short)2, "script"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // EXECUTION_COMMAND - return EXECUTION_COMMAND; -case 2: // SCRIPT - return SCRIPT; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; -} - -/** - * Find the _Fields constant that matches name, or null if its not found. - */ -public static _Fields findByName(String name) { - return byName.get(name); -} - -private final short _thriftId; -private final String _fieldName; - -_Fie
[37/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreUtils.java -- diff --git a/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreUtils.java b/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreUtils.java deleted file mode 100644 index a1d3f5a..000 --- a/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreUtils.java +++ /dev/null @@ -1,276 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.storm.blobstore; - -import org.apache.commons.lang.StringUtils; -import org.apache.storm.Config; -import org.apache.storm.generated.AuthorizationException; -import org.apache.storm.generated.KeyAlreadyExistsException; -import org.apache.storm.generated.KeyNotFoundException; -import org.apache.storm.generated.ReadableBlobMeta; -import org.apache.storm.nimbus.NimbusInfo; -import org.apache.storm.security.auth.NimbusPrincipal; -import org.apache.storm.utils.NimbusClient; -import org.apache.storm.utils.Utils; -import org.apache.storm.utils.ZookeeperAuthInfo; -import org.apache.curator.framework.CuratorFramework; -import org.apache.thrift.transport.TTransportException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.security.auth.Subject; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; - -public class BlobStoreUtils { -private static final String BLOBSTORE_SUBTREE="/blobstore"; -private static final String BLOB_DEPENDENCIES_PREFIX = "dep-"; -private static final Logger LOG = LoggerFactory.getLogger(BlobStoreUtils.class); - -public static CuratorFramework createZKClient(Map conf) { -List zkServers = (List) conf.get(Config.STORM_ZOOKEEPER_SERVERS); -Object port = conf.get(Config.STORM_ZOOKEEPER_PORT); -ZookeeperAuthInfo zkAuthInfo = new ZookeeperAuthInfo(conf); -CuratorFramework zkClient = Utils.newCurator(conf, zkServers, port, (String) conf.get(Config.STORM_ZOOKEEPER_ROOT), zkAuthInfo); -zkClient.start(); -return zkClient; -} - -public static Subject getNimbusSubject() { -Subject subject = new Subject(); -subject.getPrincipals().add(new NimbusPrincipal()); -return subject; -} - -// Normalize state -public static BlobKeySequenceInfo normalizeNimbusHostPortSequenceNumberInfo(String nimbusSeqNumberInfo) { -BlobKeySequenceInfo keySequenceInfo = new BlobKeySequenceInfo(); -int lastIndex = nimbusSeqNumberInfo.lastIndexOf("-"); -keySequenceInfo.setNimbusHostPort(nimbusSeqNumberInfo.substring(0, lastIndex)); - keySequenceInfo.setSequenceNumber(nimbusSeqNumberInfo.substring(lastIndex + 1)); -return keySequenceInfo; -} - -// Check for latest sequence number of a key inside zookeeper and return nimbodes containing the latest sequence number -public static Set getNimbodesWithLatestSequenceNumberOfBlob(CuratorFramework zkClient, String key) throws Exception { -List stateInfoList = zkClient.getChildren().forPath("/blobstore/" + key); -Set nimbusInfoSet = new HashSet(); -int latestSeqNumber = getLatestSequenceNumber(stateInfoList); -LOG.debug("getNimbodesWithLatestSequenceNumberOfBlob stateInfo {} version {}", stateInfoList, latestSeqNumber); -// Get the nimbodes with the latest version -for(String state : stateInfoList) { -BlobKeySequenceInfo sequenceInfo = normalizeNimbusHostPortSequenceNumberInfo(state); -if (latestSeqNumber == Integer.parseInt(sequenceInfo.getSequenceNumber())) { - nimbusInfoSet.add(NimbusInfo.parse(sequenceInfo.getNimbusHostPort())); -} -} -LOG.debug("nimbusInfoList {}", nimbusInfoSet); -return nimbusInfoSet; -} - -// Get sequence number details from latest sequence number of the blob -public static int getLatestSequenceNumber(List stateInfoList) { -int seqNumber = 0; -// Get latest sequence number of
[5/7] storm git commit: Addressing some comments.
Addressing some comments. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/2d570b84 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/2d570b84 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/2d570b84 Branch: refs/heads/master Commit: 2d570b844f978fa82a28f8f4b507b2e5042b1deb Parents: 1ce0f63 Author: Kyle Nusbaum Authored: Mon Oct 10 15:01:44 2016 -0500 Committer: Kyle Nusbaum Committed: Mon Oct 10 15:01:44 2016 -0500 -- .../storm/daemon/supervisor/SupervisorUtils.java | 4 ++-- storm-core/src/native/worker-launcher/impl/main.c| 2 +- .../native/worker-launcher/impl/worker-launcher.c| 15 +++ 3 files changed, 18 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/2d570b84/storm-core/src/jvm/org/apache/storm/daemon/supervisor/SupervisorUtils.java -- diff --git a/storm-core/src/jvm/org/apache/storm/daemon/supervisor/SupervisorUtils.java b/storm-core/src/jvm/org/apache/storm/daemon/supervisor/SupervisorUtils.java index fadf048..19d3b78 100644 --- a/storm-core/src/jvm/org/apache/storm/daemon/supervisor/SupervisorUtils.java +++ b/storm-core/src/jvm/org/apache/storm/daemon/supervisor/SupervisorUtils.java @@ -96,7 +96,7 @@ public class SupervisorUtils { public static void setupStormCodeDir(Map conf, Map stormConf, String dir) throws IOException { if (Utils.getBoolean(conf.get(Config.SUPERVISOR_RUN_WORKER_AS_USER), false)) { -String logPrefix = "setup conf for " + dir; +String logPrefix = "Storm Code Dir Setup for " + dir; List commands = new ArrayList<>(); commands.add("code-dir"); commands.add(dir); @@ -106,7 +106,7 @@ public class SupervisorUtils { public static void setupWorkerArtifactsDir(Map conf, Map stormConf, String dir) throws IOException { if (Utils.getBoolean(conf.get(Config.SUPERVISOR_RUN_WORKER_AS_USER), false)) { -String logPrefix = "setup conf for " + dir; +String logPrefix = "Worker Artifacts Setup for " + dir; List commands = new ArrayList<>(); commands.add("artifacts-dir"); commands.add(dir); http://git-wip-us.apache.org/repos/asf/storm/blob/2d570b84/storm-core/src/native/worker-launcher/impl/main.c -- diff --git a/storm-core/src/native/worker-launcher/impl/main.c b/storm-core/src/native/worker-launcher/impl/main.c index a990d31..b14db45 100644 --- a/storm-core/src/native/worker-launcher/impl/main.c +++ b/storm-core/src/native/worker-launcher/impl/main.c @@ -157,7 +157,7 @@ int main(int argc, char **argv) { } exit_code = setup_dir_permissions(argv[optind], 0); } else if (strcasecmp("artifacts-dir", command) == 0) { - if (argc != 4) { +if (argc != 4) { fprintf(ERRORFILE, "Incorrect number of arguments (%d vs 4) for artifacts-dir\n", argc); fflush(ERRORFILE); http://git-wip-us.apache.org/repos/asf/storm/blob/2d570b84/storm-core/src/native/worker-launcher/impl/worker-launcher.c -- diff --git a/storm-core/src/native/worker-launcher/impl/worker-launcher.c b/storm-core/src/native/worker-launcher/impl/worker-launcher.c index bbdcfb2..7baec01 100644 --- a/storm-core/src/native/worker-launcher/impl/worker-launcher.c +++ b/storm-core/src/native/worker-launcher/impl/worker-launcher.c @@ -414,6 +414,14 @@ static int copy_file(int input, const char* in_filename, return 0; } +/** + * Sets up permissions for a directory optionally making it user-writable. + * We set up the permissions r(w)xrws--- so that the file group (should be Storm's user group) + * has complete access to the directory, and the file user (The topology owner's user) + * is able to read and execute, and in certain directories, write. The setGID bit is set + * to make sure any files created under the directory will be accessible to storm's user for + * cleanup purposes. + */ static int setup_permissions(FTSENT* entry, uid_t euser, int user_write) { if (lchown(entry->fts_path, euser, launcher_gid) != 0) { fprintf(ERRORFILE, "Failure to exec app initialization process - %s, fts_path=%s\n", @@ -421,10 +429,12 @@ static int setup_permissions(FTSENT* entry, uid_t euser, int user_write) { return -1; } mode_t mode = entry->fts_statp->st_mode; + // Preserve user read and execute and set group read and write. mode_t new_mode = (mode & (S_IRUSR | S_IXUSR)) | S_IRGRP | S_IWGRP; if (user_write) { new_mode = new_mode | S_IWUSR; } + // If the entry is a directory, Add group execute and setGID bits. if ((mode & S_
[3/7] storm git commit: Fixing workers artifacts permissions.
Fixing workers artifacts permissions. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/f930b9a7 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/f930b9a7 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/f930b9a7 Branch: refs/heads/master Commit: f930b9a7e5c6d86c5782a44f5154c81bff82d9d8 Parents: 5825e14 Author: Kyle Nusbaum Authored: Mon Oct 3 15:08:33 2016 -0500 Committer: Kyle Nusbaum Committed: Mon Oct 3 15:08:33 2016 -0500 -- .../storm/daemon/supervisor/AdvancedFSOps.java | 15 +++ .../apache/storm/daemon/supervisor/Container.java| 2 +- .../storm/daemon/supervisor/SupervisorUtils.java | 10 ++ storm-core/src/native/worker-launcher/impl/main.c| 8 4 files changed, 34 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/f930b9a7/storm-core/src/jvm/org/apache/storm/daemon/supervisor/AdvancedFSOps.java -- diff --git a/storm-core/src/jvm/org/apache/storm/daemon/supervisor/AdvancedFSOps.java b/storm-core/src/jvm/org/apache/storm/daemon/supervisor/AdvancedFSOps.java index 361328e..e531b84 100644 --- a/storm-core/src/jvm/org/apache/storm/daemon/supervisor/AdvancedFSOps.java +++ b/storm-core/src/jvm/org/apache/storm/daemon/supervisor/AdvancedFSOps.java @@ -95,6 +95,11 @@ public class AdvancedFSOps { public void setupStormCodeDir(Map topologyConf, File path) throws IOException { SupervisorUtils.setupStormCodeDir(_conf, topologyConf, path.getCanonicalPath()); } + +@Override +public void setupWorkerArtifactsDir(Map topologyConf, File path) throws IOException { +SupervisorUtils.setupWorkerArtifactsDir(_conf, topologyConf, path.getCanonicalPath()); +} } /** @@ -225,6 +230,16 @@ public class AdvancedFSOps { } /** + * Setup the permissions for the worker artifacts dirs + * @param topologyConf the config of the Topology + * @param path the directory to set the permissions on + * @throws IOException on any error + */ +public void setupWorkerArtifactsDir(Map topologyConf, File path) throws IOException { +//By default this is a NOOP +} + +/** * Sanity check if everything the topology needs is there for it to run. * @param conf the config of the supervisor * @param topologyId the ID of the topology http://git-wip-us.apache.org/repos/asf/storm/blob/f930b9a7/storm-core/src/jvm/org/apache/storm/daemon/supervisor/Container.java -- diff --git a/storm-core/src/jvm/org/apache/storm/daemon/supervisor/Container.java b/storm-core/src/jvm/org/apache/storm/daemon/supervisor/Container.java index d76b950..e370bc4 100644 --- a/storm-core/src/jvm/org/apache/storm/daemon/supervisor/Container.java +++ b/storm-core/src/jvm/org/apache/storm/daemon/supervisor/Container.java @@ -316,7 +316,7 @@ public abstract class Container implements Killable { File workerArtifacts = new File(ConfigUtils.workerArtifactsRoot(_conf, _topologyId, _port)); if (!_ops.fileExists(workerArtifacts)) { _ops.forceMkdir(workerArtifacts); -_ops.setupStormCodeDir(_topoConf, workerArtifacts); +_ops.setupWorkerArtifactsDir(_topoConf, workerArtifacts); } String user = getWorkerUser(); http://git-wip-us.apache.org/repos/asf/storm/blob/f930b9a7/storm-core/src/jvm/org/apache/storm/daemon/supervisor/SupervisorUtils.java -- diff --git a/storm-core/src/jvm/org/apache/storm/daemon/supervisor/SupervisorUtils.java b/storm-core/src/jvm/org/apache/storm/daemon/supervisor/SupervisorUtils.java index 0784631..fadf048 100644 --- a/storm-core/src/jvm/org/apache/storm/daemon/supervisor/SupervisorUtils.java +++ b/storm-core/src/jvm/org/apache/storm/daemon/supervisor/SupervisorUtils.java @@ -104,6 +104,16 @@ public class SupervisorUtils { } } +public static void setupWorkerArtifactsDir(Map conf, Map stormConf, String dir) throws IOException { +if (Utils.getBoolean(conf.get(Config.SUPERVISOR_RUN_WORKER_AS_USER), false)) { +String logPrefix = "setup conf for " + dir; +List commands = new ArrayList<>(); +commands.add("artifacts-dir"); +commands.add(dir); +processLauncherAndWait(conf, (String) (stormConf.get(Config.TOPOLOGY_SUBMITTER_USER)), commands, null, logPrefix); +} +} + public static void rmrAsUser(Map conf, String id, String path) throws IOException { String user = Utils.getFileOwner(path); String logPreFix = "rmr " + id;
[1/7] storm git commit: Updating worker launcher for blobs.
Repository: storm Updated Branches: refs/heads/master 5908b33b4 -> 420e3f377 Updating worker launcher for blobs. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/49514b6e Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/49514b6e Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/49514b6e Branch: refs/heads/master Commit: 49514b6e9265d0510ce61ba998a53000e0b2e57e Parents: 08d3a5b Author: Kyle Nusbaum Authored: Mon Oct 3 14:26:24 2016 -0500 Committer: Kyle Nusbaum Committed: Mon Oct 3 14:26:24 2016 -0500 -- .../src/native/worker-launcher/impl/main.c | 12 +++-- .../worker-launcher/impl/worker-launcher.c | 26 ++-- .../worker-launcher/impl/worker-launcher.h | 2 +- 3 files changed, 24 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/49514b6e/storm-core/src/native/worker-launcher/impl/main.c -- diff --git a/storm-core/src/native/worker-launcher/impl/main.c b/storm-core/src/native/worker-launcher/impl/main.c index a51f9f9..0307751 100644 --- a/storm-core/src/native/worker-launcher/impl/main.c +++ b/storm-core/src/native/worker-launcher/impl/main.c @@ -155,7 +155,15 @@ int main(int argc, char **argv) { fflush(ERRORFILE); return INVALID_ARGUMENT_NUMBER; } -exit_code = setup_stormdist_dir(argv[optind]); +exit_code = setup_stormdist_dir(argv[optind], 0); + } else if (strcasecmp("blob", command) == 0) { + if (argc != 4) { + fprintf(ERRORFILE, "Incorrect number of arguments (%d vs 4) for blob\n", + argc); + fflush(ERRORFILE); + return INVALID_ARGUMENT_NUMBER; + } + exit_code= setup_stormdist_dir(argv[optind], 1); } else if (strcasecmp("rmr", command) == 0) { if (argc != 4) { fprintf(ERRORFILE, "Incorrect number of arguments (%d vs 4) for rmr\n", @@ -173,7 +181,7 @@ int main(int argc, char **argv) { return INVALID_ARGUMENT_NUMBER; } working_dir = argv[optind++]; -exit_code = setup_stormdist_dir(working_dir); +exit_code = setup_stormdist_dir(working_dir, 0); if (exit_code == 0) { exit_code = exec_as_user(working_dir, argv[optind]); } http://git-wip-us.apache.org/repos/asf/storm/blob/49514b6e/storm-core/src/native/worker-launcher/impl/worker-launcher.c -- diff --git a/storm-core/src/native/worker-launcher/impl/worker-launcher.c b/storm-core/src/native/worker-launcher/impl/worker-launcher.c index 5dc90d3..f353e2d 100644 --- a/storm-core/src/native/worker-launcher/impl/worker-launcher.c +++ b/storm-core/src/native/worker-launcher/impl/worker-launcher.c @@ -414,29 +414,29 @@ static int copy_file(int input, const char* in_filename, return 0; } -int setup_stormdist(FTSENT* entry, uid_t euser) { +int setup_stormdist(FTSENT* entry, uid_t euser, int user_write) { if (lchown(entry->fts_path, euser, launcher_gid) != 0) { -fprintf(ERRORFILE, "Failure to exec app initialization process - %s\n", - strerror(errno)); +fprintf(ERRORFILE, "Failure to exec app initialization process - %s, fts_path=%s\n", +strerror(errno), entry->fts_path); return -1; } mode_t mode = entry->fts_statp->st_mode; - mode_t new_mode = (mode & (S_IRWXU)) | S_IRGRP | S_IWGRP; - if ((mode & S_IXUSR) == S_IXUSR) { -new_mode = new_mode | S_IXGRP; + mode_t new_mode = (mode & (S_IRUSR | S_IXUSR)) | S_IRGRP | S_IWGRP; + if (user_write) { +new_mode = new_mpde | S_IWUSR; } if ((mode & S_IFDIR) == S_IFDIR) { -new_mode = new_mode | S_ISGID; +new_mode = new_mode | S_IXGRP | S_ISGID; } if (chmod(entry->fts_path, new_mode) != 0) { -fprintf(ERRORFILE, "Failure to exec app initialization process - %s\n", - strerror(errno)); +fprintf(ERRORFILE, "Failure to exec app initialization process - %s, fts_path=%s\n", +strerror(errno), entry->fts_path); return -1; } return 0; } -int setup_stormdist_dir(const char* local_dir) { +int setup_stormdist_dir(const char* local_dir, int for_blob_permission) { //This is the same as //> chmod g+rwX -R $local_dir //> chown -no-dereference -R $user:$supervisor-group $local_dir @@ -485,13 +485,13 @@ int setup_stormdist_dir(const char* local_dir) { case FTS_DP:// A directory being visited in post-order case FTS_DOT: // A dot directory + case FTS_SL:// A symbolic link + case FTS_SLNONE:// A broken symbolic link //NOOP fprintf(LOGFILE, "NOOP: %s\n", entry->fts_path); break; case FTS_D: // A directory in pre-order case FTS_F: // A regular file - case
[7/7] storm git commit: Updating CHANGELOG.md
Updating CHANGELOG.md Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/420e3f37 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/420e3f37 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/420e3f37 Branch: refs/heads/master Commit: 420e3f377f220bf218f67c90c503b0fa0536a06f Parents: 6ad10a3 Author: Kyle Nusbaum Authored: Tue Oct 11 11:02:26 2016 -0500 Committer: Kyle Nusbaum Committed: Tue Oct 11 11:02:26 2016 -0500 -- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/storm/blob/420e3f37/CHANGELOG.md -- diff --git a/CHANGELOG.md b/CHANGELOG.md index c5c99d0..48d11a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## 2.0.0 + * STORM-2131: Add blob command to worker-launcher, make stormdist directory not writeable by topo owner * STORM-2144: Fix Storm-sql group-by behavior in standalone mode * STORM-1546: Adding Read and Write Aggregations for Pacemaker to make it HA compatible * STORM-2124: show requested cpu mem for each component
[6/7] storm git commit: Merge branch 'STORM-2131' of https://github.com/knusbaum/incubator-storm
Merge branch 'STORM-2131' of https://github.com/knusbaum/incubator-storm Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/6ad10a36 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/6ad10a36 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/6ad10a36 Branch: refs/heads/master Commit: 6ad10a36dd4148bfae2a638d8651f76994be4bc5 Parents: 5908b33 2d570b8 Author: Kyle Nusbaum Authored: Tue Oct 11 11:01:31 2016 -0500 Committer: Kyle Nusbaum Committed: Tue Oct 11 11:01:31 2016 -0500 -- .../storm/daemon/supervisor/AdvancedFSOps.java | 15 +++ .../storm/daemon/supervisor/Container.java | 2 +- .../daemon/supervisor/SupervisorUtils.java | 12 - .../src/native/worker-launcher/impl/main.c | 20 - .../worker-launcher/impl/worker-launcher.c | 46 .../worker-launcher/impl/worker-launcher.h | 2 +- 6 files changed, 75 insertions(+), 22 deletions(-) --
[4/7] storm git commit: fixing typo.
fixing typo. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/1ce0f639 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/1ce0f639 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/1ce0f639 Branch: refs/heads/master Commit: 1ce0f639c53a8fd1d22a74ea78cfbdb15a81b90b Parents: f930b9a Author: Kyle Nusbaum Authored: Wed Oct 5 17:19:19 2016 -0500 Committer: Kyle Nusbaum Committed: Wed Oct 5 17:19:19 2016 -0500 -- storm-core/src/native/worker-launcher/impl/worker-launcher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/1ce0f639/storm-core/src/native/worker-launcher/impl/worker-launcher.c -- diff --git a/storm-core/src/native/worker-launcher/impl/worker-launcher.c b/storm-core/src/native/worker-launcher/impl/worker-launcher.c index 8f351c4..bbdcfb2 100644 --- a/storm-core/src/native/worker-launcher/impl/worker-launcher.c +++ b/storm-core/src/native/worker-launcher/impl/worker-launcher.c @@ -423,7 +423,7 @@ static int setup_permissions(FTSENT* entry, uid_t euser, int user_write) { mode_t mode = entry->fts_statp->st_mode; mode_t new_mode = (mode & (S_IRUSR | S_IXUSR)) | S_IRGRP | S_IWGRP; if (user_write) { -new_mode = new_mpde | S_IWUSR; +new_mode = new_mode | S_IWUSR; } if ((mode & S_IFDIR) == S_IFDIR) { new_mode = new_mode | S_IXGRP | S_ISGID;
[2/7] storm git commit: Fixing permissions for stormdist directory.
Fixing permissions for stormdist directory. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/5825e14a Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/5825e14a Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/5825e14a Branch: refs/heads/master Commit: 5825e14a11c3d91c10036971e7757c8e4f82283d Parents: 49514b6 Author: Kyle Nusbaum Authored: Mon Sep 26 15:42:18 2016 -0500 Committer: Kyle Nusbaum Committed: Mon Oct 3 14:30:08 2016 -0500 -- storm-core/src/native/worker-launcher/impl/main.c | 6 +++--- .../src/native/worker-launcher/impl/worker-launcher.c | 13 + .../src/native/worker-launcher/impl/worker-launcher.h | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/5825e14a/storm-core/src/native/worker-launcher/impl/main.c -- diff --git a/storm-core/src/native/worker-launcher/impl/main.c b/storm-core/src/native/worker-launcher/impl/main.c index 0307751..0bc7fbf 100644 --- a/storm-core/src/native/worker-launcher/impl/main.c +++ b/storm-core/src/native/worker-launcher/impl/main.c @@ -155,7 +155,7 @@ int main(int argc, char **argv) { fflush(ERRORFILE); return INVALID_ARGUMENT_NUMBER; } -exit_code = setup_stormdist_dir(argv[optind], 0); +exit_code = setup_dir_permissions(argv[optind], 0); } else if (strcasecmp("blob", command) == 0) { if (argc != 4) { fprintf(ERRORFILE, "Incorrect number of arguments (%d vs 4) for blob\n", @@ -163,7 +163,7 @@ int main(int argc, char **argv) { fflush(ERRORFILE); return INVALID_ARGUMENT_NUMBER; } - exit_code= setup_stormdist_dir(argv[optind], 1); + exit_code = setup_dir_permissions(argv[optind], 0); } else if (strcasecmp("rmr", command) == 0) { if (argc != 4) { fprintf(ERRORFILE, "Incorrect number of arguments (%d vs 4) for rmr\n", @@ -181,7 +181,7 @@ int main(int argc, char **argv) { return INVALID_ARGUMENT_NUMBER; } working_dir = argv[optind++]; -exit_code = setup_stormdist_dir(working_dir, 0); +exit_code = setup_dir_permissions(working_dir, 1); if (exit_code == 0) { exit_code = exec_as_user(working_dir, argv[optind]); } http://git-wip-us.apache.org/repos/asf/storm/blob/5825e14a/storm-core/src/native/worker-launcher/impl/worker-launcher.c -- diff --git a/storm-core/src/native/worker-launcher/impl/worker-launcher.c b/storm-core/src/native/worker-launcher/impl/worker-launcher.c index f353e2d..8f351c4 100644 --- a/storm-core/src/native/worker-launcher/impl/worker-launcher.c +++ b/storm-core/src/native/worker-launcher/impl/worker-launcher.c @@ -414,7 +414,7 @@ static int copy_file(int input, const char* in_filename, return 0; } -int setup_stormdist(FTSENT* entry, uid_t euser, int user_write) { +static int setup_permissions(FTSENT* entry, uid_t euser, int user_write) { if (lchown(entry->fts_path, euser, launcher_gid) != 0) { fprintf(ERRORFILE, "Failure to exec app initialization process - %s, fts_path=%s\n", strerror(errno), entry->fts_path); @@ -436,11 +436,8 @@ int setup_stormdist(FTSENT* entry, uid_t euser, int user_write) { return 0; } -int setup_stormdist_dir(const char* local_dir, int for_blob_permission) { - //This is the same as - //> chmod g+rwX -R $local_dir - //> chown -no-dereference -R $user:$supervisor-group $local_dir +int setup_dir_permissions(const char* local_dir, int user_writable) { int exit_code = 0; uid_t euser = geteuid(); @@ -450,7 +447,7 @@ int setup_stormdist_dir(const char* local_dir, int for_blob_permission) { } else { char *(paths[]) = {strndup(local_dir,PATH_MAX), 0}; if (paths[0] == NULL) { - fprintf(ERRORFILE, "Malloc failed in setup_stormdist_dir\n"); + fprintf(ERRORFILE, "Malloc failed in setup_dir_permissions\n"); return -1; } // check to make sure the directory exists @@ -491,8 +488,8 @@ int setup_stormdist_dir(const char* local_dir, int for_blob_permission) { fprintf(LOGFILE, "NOOP: %s\n", entry->fts_path); break; case FTS_D: // A directory in pre-order case FTS_F: // A regular file -if (setup_stormdist(entry, euser, for_blob_permission == 0) != 0) { - exit_code = -1; +if (setup_permissions(entry, euser, user_writable) != 0) { +exit_code = -1; } break; case FTS_DEFAULT: // Unknown type of file http://git-wip-us.apache.org/repos/asf/storm/blob/5825e14a/storm-core/src/native/worker-launcher/impl/worker-launcher.h --
[storm] Git Push Summary
Repository: storm Updated Branches: refs/heads/Pacemaker-HA-1.x-branch2 [deleted] 8e121dcee
[52/55] [abbrv] storm git commit: Minor cleanup.
Minor cleanup. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/20180cca Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/20180cca Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/20180cca Branch: refs/heads/Pacemaker-HA-1.x-branch2 Commit: 20180cca1de9b25dc391722a9088e10107a31443 Parents: a6171bd Author: Kyle Nusbaum Authored: Thu Sep 29 15:45:01 2016 -0500 Committer: Kyle Nusbaum Committed: Thu Sep 29 15:45:01 2016 -0500 -- storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/20180cca/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java -- diff --git a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java index 13cc02d..d555dae 100644 --- a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java +++ b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java @@ -230,7 +230,7 @@ public class PacemakerClient implements ISaslClient { public void gotMessage(HBMessage m) { int message_id = m.get_message_id(); if(message_id >= 0 && message_id < maxPending) { - + LOG.debug("Pacemaker Client got message: {}", m.toString()); HBMessage request = messages[message_id];
[44/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/worker.clj -- diff --git a/storm-core/src/clj/backtype/storm/daemon/worker.clj b/storm-core/src/clj/backtype/storm/daemon/worker.clj deleted file mode 100644 index 1326672..000 --- a/storm-core/src/clj/backtype/storm/daemon/worker.clj +++ /dev/null @@ -1,768 +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. -(ns org.apache.storm.daemon.worker - (:use [org.apache.storm.daemon common]) - (:use [org.apache.storm config log util timer local-state]) - (:require [clj-time.core :as time]) - (:require [clj-time.coerce :as coerce]) - (:require [org.apache.storm.daemon [executor :as executor]]) - (:require [org.apache.storm [disruptor :as disruptor] [cluster :as cluster]]) - (:require [clojure.set :as set]) - (:require [org.apache.storm.messaging.loader :as msg-loader]) - (:import [java.util.concurrent Executors] - [org.apache.storm.hooks IWorkerHook BaseWorkerHook]) - (:import [java.util ArrayList HashMap]) - (:import [org.apache.storm.utils Utils TransferDrainer ThriftTopologyUtils WorkerBackpressureThread DisruptorQueue]) - (:import [org.apache.storm.grouping LoadMapping]) - (:import [org.apache.storm.messaging TransportFactory]) - (:import [org.apache.storm.messaging TaskMessage IContext IConnection ConnectionWithStatus ConnectionWithStatus$Status]) - (:import [org.apache.storm.daemon Shutdownable]) - (:import [org.apache.storm.serialization KryoTupleSerializer]) - (:import [org.apache.storm.generated StormTopology]) - (:import [org.apache.storm.tuple AddressedTuple Fields]) - (:import [org.apache.storm.task WorkerTopologyContext]) - (:import [org.apache.storm Constants]) - (:import [org.apache.storm.security.auth AuthUtils]) - (:import [org.apache.storm.cluster ClusterStateContext DaemonType]) - (:import [javax.security.auth Subject]) - (:import [java.security PrivilegedExceptionAction]) - (:import [org.apache.logging.log4j LogManager]) - (:import [org.apache.logging.log4j Level]) - (:import [org.apache.logging.log4j.core.config LoggerConfig]) - (:import [org.apache.storm.generated LogConfig LogLevelAction]) - (:gen-class)) - -(defmulti mk-suicide-fn cluster-mode) - -(defn read-worker-executors [storm-conf storm-cluster-state storm-id assignment-id port assignment-versions] - (log-message "Reading Assignments.") - (let [assignment (:executor->node+port (.assignment-info storm-cluster-state storm-id nil))] -(doall - (concat - [Constants/SYSTEM_EXECUTOR_ID] - (mapcat (fn [[executor loc]] -(if (= loc [assignment-id port]) - [executor] - )) - assignment) - -(defnk do-executor-heartbeats [worker :executors nil] - ;; stats is how we know what executors are assigned to this worker - (let [stats (if-not executors - (into {} (map (fn [e] {e nil}) (:executors worker))) - (->> executors -(map (fn [e] {(executor/get-executor-id e) (executor/render-stats e)})) -(apply merge))) -zk-hb {:storm-id (:storm-id worker) - :executor-stats stats - :uptime ((:uptime worker)) - :time-secs (current-time-secs) - }] -;; do the zookeeper heartbeat -(try - (.worker-heartbeat! (:storm-cluster-state worker) (:storm-id worker) (:assignment-id worker) (:port worker) zk-hb) - (catch Exception exc -(log-error exc "Worker failed to write heartbeats to ZK or Pacemaker...will retry") - -(defn do-heartbeat [worker] - (let [conf (:conf worker) -state (worker-state conf (:worker-id worker))] -;; do the local-file-system heartbeat. -(ls-worker-heartbeat! state (current-time-secs) (:storm-id worker) (:executors worker) (:port worker)) -(.cleanup state 60) ; this is just in case supervisor is down so that disk doesn't fill up. - ; it shouldn't take supervisor 120 seconds between listing dir and reading it - -)) - -(defn worker-outbound-tasks - "Returns seq of task-ids that receive
[46/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/nimbus.clj -- diff --git a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj b/storm-core/src/clj/backtype/storm/daemon/nimbus.clj deleted file mode 100644 index 2732d81..000 --- a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj +++ /dev/null @@ -1,2514 +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. -(ns org.apache.storm.daemon.nimbus - (:import [org.apache.thrift.server THsHaServer THsHaServer$Args]) - (:import [org.apache.storm.generated KeyNotFoundException]) - (:import [org.apache.storm.blobstore LocalFsBlobStore]) - (:import [org.apache.thrift.protocol TBinaryProtocol TBinaryProtocol$Factory]) - (:import [org.apache.thrift.exception]) - (:import [org.apache.thrift.transport TNonblockingServerTransport TNonblockingServerSocket]) - (:import [org.apache.commons.io FileUtils]) - (:import [javax.security.auth Subject]) - (:import [org.apache.storm.security.auth NimbusPrincipal]) - (:import [java.nio ByteBuffer] - [java.util Collections List HashMap] - [org.apache.storm.generated NimbusSummary]) - (:import [java.nio ByteBuffer] - [java.util Collections List HashMap ArrayList Iterator]) - (:import [org.apache.storm.blobstore AtomicOutputStream BlobStoreAclHandler - InputStreamWithMeta KeyFilter KeySequenceNumber BlobSynchronizer BlobStoreUtils]) - (:import [java.io File FileOutputStream FileInputStream]) - (:import [java.net InetAddress ServerSocket BindException]) - (:import [java.nio.channels Channels WritableByteChannel]) - (:import [org.apache.storm.security.auth ThriftServer ThriftConnectionType ReqContext AuthUtils]) - (:use [org.apache.storm.scheduler.DefaultScheduler]) - (:import [org.apache.storm.scheduler INimbus SupervisorDetails WorkerSlot TopologyDetails -Cluster Topologies SchedulerAssignment SchedulerAssignmentImpl DefaultScheduler ExecutorDetails]) - (:import [org.apache.storm.nimbus NimbusInfo]) - (:import [org.apache.storm.scheduler.resource ResourceUtils]) - (:import [org.apache.storm.utils TimeCacheMap TimeCacheMap$ExpiredCallback Utils TupleUtils ThriftTopologyUtils -BufferFileInputStream BufferInputStream]) - (:import [org.apache.storm.generated NotAliveException AlreadyAliveException StormTopology ErrorInfo -ExecutorInfo InvalidTopologyException Nimbus$Iface Nimbus$Processor SubmitOptions TopologyInitialStatus -KillOptions RebalanceOptions ClusterSummary SupervisorSummary TopologySummary TopologyInfo TopologyHistoryInfo -ExecutorSummary AuthorizationException GetInfoOptions NumErrorsChoice SettableBlobMeta ReadableBlobMeta -BeginDownloadResult ListBlobsResult ComponentPageInfo TopologyPageInfo LogConfig LogLevel LogLevelAction -ProfileRequest ProfileAction NodeInfo SupervisorPageInfo WorkerSummary WorkerResources ComponentType]) - (:import [org.apache.storm.daemon Shutdownable]) - (:import [org.apache.storm.cluster ClusterStateContext DaemonType]) - (:use [org.apache.storm util config log timer zookeeper local-state]) - (:require [org.apache.storm [cluster :as cluster] -[converter :as converter] -[stats :as stats]]) - (:require [org.apache.storm.ui.core :as ui]) - (:require [clojure.set :as set]) - (:import [org.apache.storm.daemon.common StormBase Assignment]) - (:use [org.apache.storm.daemon common]) - (:use [org.apache.storm config]) - (:import [org.apache.zookeeper data.ACL ZooDefs$Ids ZooDefs$Perms]) - (:import [org.apache.storm.utils VersionInfo Time] - (org.apache.storm.metric ClusterMetricsConsumerExecutor) - (org.apache.storm.metric.api IClusterMetricsConsumer$ClusterInfo DataPoint IClusterMetricsConsumer$SupervisorInfo) - (org.apache.storm Config)) - (:require [clj-time.core :as time]) - (:require [clj-time.coerce :as coerce]) - (:require [metrics.meters :refer [defmeter mark!]]) - (:require [metrics.gauges :refer [defgauge]]) - (:gen-class -:methods [^{:s
[50/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/cluster.clj -- diff --git a/storm-core/src/clj/backtype/storm/cluster.clj b/storm-core/src/clj/backtype/storm/cluster.clj deleted file mode 100644 index 914fa5b..000 --- a/storm-core/src/clj/backtype/storm/cluster.clj +++ /dev/null @@ -1,708 +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. - -(ns org.apache.storm.cluster - (:import [org.apache.zookeeper.data Stat ACL Id] - [org.apache.storm.generated SupervisorInfo Assignment StormBase ClusterWorkerHeartbeat ErrorInfo Credentials NimbusSummary -LogConfig ProfileAction ProfileRequest NodeInfo] - [java.io Serializable]) - (:import [org.apache.zookeeper KeeperException KeeperException$NoNodeException ZooDefs ZooDefs$Ids ZooDefs$Perms]) - (:import [org.apache.curator.framework CuratorFramework]) - (:import [org.apache.storm.utils Utils]) - (:import [org.apache.storm.cluster ClusterState ClusterStateContext ClusterStateListener ConnectionState]) - (:import [java.security MessageDigest]) - (:import [org.apache.zookeeper.server.auth DigestAuthenticationProvider]) - (:import [org.apache.storm.nimbus NimbusInfo]) - (:use [org.apache.storm util log config converter]) - (:require [org.apache.storm [zookeeper :as zk]]) - (:require [org.apache.storm.daemon [common :as common]])) - -(defn mk-topo-only-acls - [topo-conf] - (let [payload (.get topo-conf STORM-ZOOKEEPER-TOPOLOGY-AUTH-PAYLOAD)] -(when (Utils/isZkAuthenticationConfiguredTopology topo-conf) - [(first ZooDefs$Ids/CREATOR_ALL_ACL) - (ACL. ZooDefs$Perms/READ (Id. "digest" (DigestAuthenticationProvider/generateDigest payload)))]))) - -(defnk mk-distributed-cluster-state - [conf :auth-conf nil :acls nil :context (ClusterStateContext.)] - (let [clazz (Class/forName (or (conf STORM-CLUSTER-STATE-STORE) - "org.apache.storm.cluster_state.zookeeper_state_factory")) -state-instance (.newInstance clazz)] -(log-debug "Creating cluster state: " (.toString clazz)) -(or (.mkState state-instance conf auth-conf acls context) -nil))) - -(defprotocol StormClusterState - (assignments [this callback]) - (assignment-info [this storm-id callback]) - (assignment-info-with-version [this storm-id callback]) - (assignment-version [this storm-id callback]) - ;returns key information under /storm/blobstore/key - (blobstore-info [this blob-key]) - ;returns list of nimbus summaries stored under /stormroot/nimbuses/ -> - (nimbuses [this]) - ;adds the NimbusSummary to /stormroot/nimbuses/nimbus-id - (add-nimbus-host! [this nimbus-id nimbus-summary]) - - (active-storms [this]) - (storm-base [this storm-id callback]) - (get-worker-heartbeat [this storm-id node port]) - (get-worker-profile-requests [this storm-id nodeinfo thrift?]) - (get-topology-profile-requests [this storm-id thrift?]) - (set-worker-profile-request [this storm-id profile-request]) - (delete-topology-profile-requests [this storm-id profile-request]) - (executor-beats [this storm-id executor->node+port]) - (supervisors [this callback]) - (supervisor-info [this supervisor-id]) ;; returns nil if doesn't exist - (setup-heartbeats! [this storm-id]) - (teardown-heartbeats! [this storm-id]) - (teardown-topology-errors! [this storm-id]) - (heartbeat-storms [this]) - (error-topologies [this]) - (backpressure-topologies [this]) - (set-topology-log-config! [this storm-id log-config]) - (topology-log-config [this storm-id cb]) - (worker-heartbeat! [this storm-id node port info]) - (remove-worker-heartbeat! [this storm-id node port]) - (supervisor-heartbeat! [this supervisor-id info]) - (worker-backpressure! [this storm-id node port info]) - (topology-backpressure [this storm-id callback]) - (setup-backpressure! [this storm-id]) - (remove-backpressure! [this storm-id]) - (remove-worker-backpressure! [this storm-id node port]) - (activate-storm! [this storm-id storm-base]) - (update-storm! [this storm-id new-elems]) - (remove-storm-base! [this storm-id]) - (set-assignment! [this storm-id info]) - ;; sets up in
[55/55] [abbrv] storm git commit: Syncing java files with master.
Syncing java files with master. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/8e121dce Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/8e121dce Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/8e121dce Branch: refs/heads/Pacemaker-HA-1.x-branch2 Commit: 8e121dceedcedbddeefe2b702e8478cd3de72da4 Parents: 737847c Author: Kyle Nusbaum Authored: Mon Oct 10 21:03:25 2016 -0500 Committer: Kyle Nusbaum Committed: Mon Oct 10 21:03:25 2016 -0500 -- .../apache/storm/pacemaker/PacemakerClient.java | 50 ++-- .../pacemaker/PacemakerConnectionException.java | 24 ++ 2 files changed, 48 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/8e121dce/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java -- diff --git a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java index 67201b8..cbbfe7f 100644 --- a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java +++ b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java @@ -55,12 +55,18 @@ public class PacemakerClient implements ISaslClient { private HBMessage messages[]; private LinkedBlockingQueue availableMessageSlots; private ThriftNettyClientCodec.AuthMethod authMethod; + private static Timer timer = new Timer(true); private StormBoundedExponentialBackoffRetry backoff = new StormBoundedExponentialBackoffRetry(100, 5000, 20); private int retryTimes = 0; +//the constructor is invoked by pacemaker-state-factory-test +public PacemakerClient() { +bootstrap = new ClientBootstrap(); +} public PacemakerClient(Map config, String host) { + int port = (int)config.get(Config.PACEMAKER_PORT); client_name = (String)config.get(Config.TOPOLOGY_NAME); if(client_name == null) { @@ -143,10 +149,6 @@ public class PacemakerClient implements ISaslClient { retryTimes = 0; } -public boolean isReady() { -return ready.get(); -} - @Override public synchronized void channelReady() { LOG.debug("Channel is ready."); @@ -162,8 +164,7 @@ public class PacemakerClient implements ISaslClient { return secret; } -public HBMessage send(HBMessage m) { -waitUntilReady(); +public HBMessage send(HBMessage m) throws PacemakerConnectionException { LOG.debug("Sending message: {}", m.toString()); try { int next = availableMessageSlots.take(); @@ -172,14 +173,11 @@ public class PacemakerClient implements ISaslClient { messages[next] = m; LOG.debug("Put message in slot: {}", Integer.toString(next)); do { -try { -if (channelRef.get() != null) { -channelRef.get().write(m); -m.wait(1000); -} -} catch (Exception exp) { -LOG.error("error attempting to write to a channel {}", exp); -waitUntilReady(); +waitUntilReady(); +Channel channel = channelRef.get(); +if(channel != null) { +channel.write(m); +m.wait(1000); } } while (messages[next] == m); } @@ -199,16 +197,16 @@ public class PacemakerClient implements ISaslClient { } } -public PacemakerClient waitUntilReady() { +private void waitUntilReady() throws PacemakerConnectionException { // Wait for 'ready' (channel connected and maybe authentication) -if(!isReady() || channelRef.get() == null) { +if(!ready.get() || channelRef.get() == null) { synchronized(this) { -if(!isReady()) { +if(!ready.get()) { LOG.debug("Waiting for netty channel to be ready."); try { this.wait(1000); -if(!isReady() || channelRef.get() == null) { -throw new RuntimeException("Timed out waiting for channel ready."); +if(!ready.get() || channelRef.get() == null) { +throw new PacemakerConnectionException("Timed out waiting for channel ready."); } } catch (InterruptedException e) { throw new RuntimeException(e); @@ -216,14 +214,13 @@ public class PacemakerClient implements ISaslClient { }
[01/55] [abbrv] [partial] storm git commit: Ported successfully.
Repository: storm Updated Branches: refs/heads/Pacemaker-HA-1.x-branch2 [created] 8e121dcee http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/WorkerSummary.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/WorkerSummary.java b/storm-core/src/jvm/backtype/storm/generated/WorkerSummary.java deleted file mode 100644 index fff9373..000 --- a/storm-core/src/jvm/backtype/storm/generated/WorkerSummary.java +++ /dev/null @@ -1,1880 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class WorkerSummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkerSummary"); - - private static final org.apache.thrift.protocol.TField SUPERVISOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisor_id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField TOPOLOGY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_id", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField TOPOLOGY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_name", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField NUM_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_executors", org.apache.thrift.protocol.TType.I32, (short)6); - private static final org.apache.thrift.protocol.TField COMPONENT_TO_NUM_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("component_to_num_tasks", org.apache.thrift.protocol.TType.MAP, (short)7); - private static final org.apache.thrift.protocol.TField TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("time_secs", org.apache.thrift.protocol.TType.I32, (short)8); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)9); - private static final org.apache.thrift.protocol.TField REQUESTED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)521); - private static final org.apache.thrift.protocol.TField REQUESTED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memoffheap", org.apache.thrift.protocol.TType.DOUBLE, (short)522); - private static f
[35/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/daemon/metrics/MetricsUtils.java -- diff --git a/storm-core/src/jvm/backtype/storm/daemon/metrics/MetricsUtils.java b/storm-core/src/jvm/backtype/storm/daemon/metrics/MetricsUtils.java deleted file mode 100644 index 56b920b..000 --- a/storm-core/src/jvm/backtype/storm/daemon/metrics/MetricsUtils.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.storm.daemon.metrics; - -import org.apache.storm.Config; -import org.apache.storm.daemon.metrics.reporters.JmxPreparableReporter; -import org.apache.storm.daemon.metrics.reporters.PreparableReporter; -import org.apache.storm.utils.Utils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -public class MetricsUtils { -private final static Logger LOG = LoggerFactory.getLogger(MetricsUtils.class); - -public static List getPreparableReporters(Map stormConf) { -List clazzes = (List) stormConf.get(Config.STORM_DAEMON_METRICS_REPORTER_PLUGINS); -List reporterList = new ArrayList<>(); - -if (clazzes != null) { -for (String clazz : clazzes) { -reporterList.add(getPreparableReporter(clazz)); -} -} -if (reporterList.isEmpty()) { -reporterList.add(new JmxPreparableReporter()); -} -return reporterList; -} - -private static PreparableReporter getPreparableReporter(String clazz) { -PreparableReporter reporter = null; -LOG.info("Using statistics reporter plugin:" + clazz); -if (clazz != null) { -reporter = (PreparableReporter) Utils.newInstance(clazz); -} -return reporter; -} - -public static Locale getMetricsReporterLocale(Map stormConf) { -String languageTag = Utils.getString(stormConf.get(Config.STORM_DAEMON_METRICS_REPORTER_PLUGIN_LOCALE), null); -if (languageTag != null) { -return Locale.forLanguageTag(languageTag); -} -return null; -} - -public static TimeUnit getMetricsRateUnit(Map stormConf) { -return getTimeUnitForCofig(stormConf, Config.STORM_DAEMON_METRICS_REPORTER_PLUGIN_RATE_UNIT); -} - -public static TimeUnit getMetricsDurationUnit(Map stormConf) { -return getTimeUnitForCofig(stormConf, Config.STORM_DAEMON_METRICS_REPORTER_PLUGIN_DURATION_UNIT); -} - -private static TimeUnit getTimeUnitForCofig(Map stormConf, String configName) { -String rateUnitString = Utils.getString(stormConf.get(configName), null); -if (rateUnitString != null) { -return TimeUnit.valueOf(rateUnitString); -} -return null; -} - -public static File getCsvLogDir(Map stormConf) { -String csvMetricsLogDirectory = Utils.getString(stormConf.get(Config.STORM_DAEMON_METRICS_REPORTER_CSV_LOG_DIR), null); -if (csvMetricsLogDirectory == null) { -csvMetricsLogDirectory = absoluteStormLocalDir(stormConf); -csvMetricsLogDirectory = csvMetricsLogDirectory + File.separator + "csvmetrics"; -} -File csvMetricsDir = new File(csvMetricsLogDirectory); -validateCreateOutputDir(csvMetricsDir); -return csvMetricsDir; -} - -private static void validateCreateOutputDir(File dir) { -if (!dir.exists()) { -dir.mkdirs(); -} -if (!dir.canWrite()) { -throw new IllegalStateException(dir.getName() + " does not have write permissions."); -} -if (!dir.isDirectory()) { -throw new IllegalStateException(dir.getName() + " is not a directory."); -} -} - -public static String absoluteStormLocalDir(Map conf) { -String stormHome = System.getProperty("storm.home"); -String localDir = (String) conf.get(Config.STORM_LOCAL_DIR); -if (localDir == null) { -return (stormH
[42/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/testing.clj -- diff --git a/storm-core/src/clj/backtype/storm/testing.clj b/storm-core/src/clj/backtype/storm/testing.clj deleted file mode 100644 index 565d1b9..000 --- a/storm-core/src/clj/backtype/storm/testing.clj +++ /dev/null @@ -1,702 +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. - -(ns org.apache.storm.testing - (:require [org.apache.storm.daemon - [nimbus :as nimbus] - [supervisor :as supervisor] - [common :as common] - [worker :as worker] - [executor :as executor]]) - (:require [org.apache.storm [process-simulator :as psim]]) - (:import [org.apache.commons.io FileUtils]) - (:import [java.io File]) - (:import [java.util HashMap ArrayList]) - (:import [java.util.concurrent.atomic AtomicInteger]) - (:import [java.util.concurrent ConcurrentHashMap]) - (:import [org.apache.storm.utils Time Utils RegisteredGlobalState]) - (:import [org.apache.storm.tuple Fields Tuple TupleImpl]) - (:import [org.apache.storm.task TopologyContext]) - (:import [org.apache.storm.generated GlobalStreamId Bolt KillOptions]) - (:import [org.apache.storm.testing FeederSpout FixedTupleSpout FixedTuple -TupleCaptureBolt SpoutTracker BoltTracker NonRichBoltTracker -TestWordSpout MemoryTransactionalSpout]) - (:import [org.apache.storm.security.auth ThriftServer ThriftConnectionType ReqContext AuthUtils]) - (:import [org.apache.storm.generated NotAliveException AlreadyAliveException StormTopology ErrorInfo -ExecutorInfo InvalidTopologyException Nimbus$Iface Nimbus$Processor SubmitOptions TopologyInitialStatus -KillOptions RebalanceOptions ClusterSummary SupervisorSummary TopologySummary TopologyInfo -ExecutorSummary AuthorizationException GetInfoOptions NumErrorsChoice]) - (:import [org.apache.storm.transactional TransactionalSpoutCoordinator]) - (:import [org.apache.storm.transactional.partitioned PartitionedTransactionalSpoutExecutor]) - (:import [org.apache.storm.tuple Tuple]) - (:import [org.apache.storm.generated StormTopology]) - (:import [org.apache.storm.task TopologyContext]) - (:require [org.apache.storm [zookeeper :as zk]]) - (:require [org.apache.storm.messaging.loader :as msg-loader]) - (:require [org.apache.storm.daemon.acker :as acker]) - (:use [org.apache.storm cluster util thrift config log local-state])) - -(defn feeder-spout - [fields] - (FeederSpout. (Fields. fields))) - -(defn local-temp-path - [] - (str (System/getProperty "java.io.tmpdir") (if-not on-windows? "/") (uuid))) - -(defn delete-all - [paths] - (dorun -(for [t paths] - (if (.exists (File. t)) -(try - (FileUtils/forceDelete (File. t)) - (catch Exception e -(log-message (.getMessage e - -(defmacro with-local-tmp - [[& tmp-syms] & body] - (let [tmp-paths (mapcat (fn [t] [t `(local-temp-path)]) tmp-syms)] -`(let [~@tmp-paths] - (try - ~@body - (finally - (delete-all ~(vec tmp-syms))) - -(defn start-simulating-time! - [] - (Time/startSimulating)) - -(defn stop-simulating-time! - [] - (Time/stopSimulating)) - - (defmacro with-simulated-time - [& body] - `(try - (start-simulating-time!) - ~@body - (finally - (stop-simulating-time! - -(defn advance-time-ms! [ms] - (Time/advanceTime ms)) - -(defn advance-time-secs! [secs] - (advance-time-ms! (* (long secs) 1000))) - -(defnk add-supervisor - [cluster-map :ports 2 :conf {} :id nil] - (let [tmp-dir (local-temp-path) -port-ids (if (sequential? ports) - ports - (doall (repeatedly ports (:port-counter cluster-map -supervisor-conf (merge (:daemon-conf cluster-map) - conf - {STORM-LOCAL-DIR tmp-dir -SUPERVISOR-SLOTS-PORTS port-ids}) -id-fn (if id (fn [] id) supervisor/generate-supervisor-id) -daemon (with-var-roots [supervisor/generate-supervisor-id id-fn
[14/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ProfileRequest.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/ProfileRequest.java b/storm-core/src/jvm/backtype/storm/generated/ProfileRequest.java deleted file mode 100644 index 1189175..000 --- a/storm-core/src/jvm/backtype/storm/generated/ProfileRequest.java +++ /dev/null @@ -1,631 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class ProfileRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ProfileRequest"); - - private static final org.apache.thrift.protocol.TField NODE_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("nodeInfo", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField ACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("action", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField TIME_STAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("time_stamp", org.apache.thrift.protocol.TType.I64, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new ProfileRequestStandardSchemeFactory()); -schemes.put(TupleScheme.class, new ProfileRequestTupleSchemeFactory()); - } - - private NodeInfo nodeInfo; // required - private ProfileAction action; // required - private long time_stamp; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -NODE_INFO((short)1, "nodeInfo"), -/** - * - * @see ProfileAction - */ -ACTION((short)2, "action"), -TIME_STAMP((short)3, "time_stamp"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // NODE_INFO - return NODE_INFO; -case 2: // ACTION - return ACTION; -case 3: // TIME_STAMP - return TIME_STAMP; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId +
[09/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SupervisorInfo.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/SupervisorInfo.java b/storm-core/src/jvm/backtype/storm/generated/SupervisorInfo.java deleted file mode 100644 index 44003c2..000 --- a/storm-core/src/jvm/backtype/storm/generated/SupervisorInfo.java +++ /dev/null @@ -1,1446 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class SupervisorInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SupervisorInfo"); - - private static final org.apache.thrift.protocol.TField TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("time_secs", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField HOSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("hostname", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField ASSIGNMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("assignment_id", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField USED_PORTS_FIELD_DESC = new org.apache.thrift.protocol.TField("used_ports", org.apache.thrift.protocol.TType.LIST, (short)4); - private static final org.apache.thrift.protocol.TField META_FIELD_DESC = new org.apache.thrift.protocol.TField("meta", org.apache.thrift.protocol.TType.LIST, (short)5); - private static final org.apache.thrift.protocol.TField SCHEDULER_META_FIELD_DESC = new org.apache.thrift.protocol.TField("scheduler_meta", org.apache.thrift.protocol.TType.MAP, (short)6); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I64, (short)7); - private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)8); - private static final org.apache.thrift.protocol.TField RESOURCES_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("resources_map", org.apache.thrift.protocol.TType.MAP, (short)9); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new SupervisorInfoStandardSchemeFactory()); -schemes.put(TupleScheme.class, new SupervisorInfoTupleSchemeFactory()); - } - - private long time_secs; // required - private String hostname; // required - private String assignment_id; // optional - private List used_ports; // optional - private List meta; // optional - private Map scheduler_meta; // optional - private long uptime_secs; // optional -
[10/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/StormTopology.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/StormTopology.java b/storm-core/src/jvm/backtype/storm/generated/StormTopology.java deleted file mode 100644 index caec6c6..000 --- a/storm-core/src/jvm/backtype/storm/generated/StormTopology.java +++ /dev/null @@ -1,1272 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class StormTopology implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StormTopology"); - - private static final org.apache.thrift.protocol.TField SPOUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("spouts", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.protocol.TField BOLTS_FIELD_DESC = new org.apache.thrift.protocol.TField("bolts", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final org.apache.thrift.protocol.TField STATE_SPOUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("state_spouts", org.apache.thrift.protocol.TType.MAP, (short)3); - private static final org.apache.thrift.protocol.TField WORKER_HOOKS_FIELD_DESC = new org.apache.thrift.protocol.TField("worker_hooks", org.apache.thrift.protocol.TType.LIST, (short)4); - private static final org.apache.thrift.protocol.TField DEPENDENCY_JARS_FIELD_DESC = new org.apache.thrift.protocol.TField("dependency_jars", org.apache.thrift.protocol.TType.LIST, (short)5); - private static final org.apache.thrift.protocol.TField DEPENDENCY_ARTIFACTS_FIELD_DESC = new org.apache.thrift.protocol.TField("dependency_artifacts", org.apache.thrift.protocol.TType.LIST, (short)6); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new StormTopologyStandardSchemeFactory()); -schemes.put(TupleScheme.class, new StormTopologyTupleSchemeFactory()); - } - - private Map spouts; // required - private Map bolts; // required - private Map state_spouts; // required - private List worker_hooks; // optional - private List dependency_jars; // optional - private List dependency_artifacts; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -SPOUTS((short)1, "spouts"), -BOLTS((short)2, "bolts"), -STATE_SPOUTS((short)3, "state_spouts"), -WORKER_HOOKS((short)4, "worker_hooks"), -DEPENDENCY_JARS((short)5, "dependency_jars"), -DEPENDENCY_ARTIFACTS((short)6, "dependency_artifacts"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -
[25/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ErrorInfo.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/ErrorInfo.java b/storm-core/src/jvm/backtype/storm/generated/ErrorInfo.java deleted file mode 100644 index 2ab536d..000 --- a/storm-core/src/jvm/backtype/storm/generated/ErrorInfo.java +++ /dev/null @@ -1,714 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class ErrorInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ErrorInfo"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField ERROR_TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("error_time_secs", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new ErrorInfoStandardSchemeFactory()); -schemes.put(TupleScheme.class, new ErrorInfoTupleSchemeFactory()); - } - - private String error; // required - private int error_time_secs; // required - private String host; // optional - private int port; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -ERROR((short)1, "error"), -ERROR_TIME_SECS((short)2, "error_time_secs"), -HOST((short)3, "host"), -PORT((short)4, "port"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // ERROR - return ERROR; -case 2: // ERROR_TIME_SECS - return ERROR_TIME_SECS; -case 3: // HOST - return HOST; -case 4: // PORT - return PORT; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static
[06/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java b/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java deleted file mode 100644 index fa95be7..000 --- a/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java +++ /dev/null @@ -1,2144 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TopologyInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyInfo"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("executors", org.apache.thrift.protocol.TType.LIST, (short)4); - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField ERRORS_FIELD_DESC = new org.apache.thrift.protocol.TField("errors", org.apache.thrift.protocol.TType.MAP, (short)6); - private static final org.apache.thrift.protocol.TField COMPONENT_DEBUG_FIELD_DESC = new org.apache.thrift.protocol.TField("component_debug", org.apache.thrift.protocol.TType.MAP, (short)7); - private static final org.apache.thrift.protocol.TField SCHED_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("sched_status", org.apache.thrift.protocol.TType.STRING, (short)513); - private static final org.apache.thrift.protocol.TField OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)514); - private static final org.apache.thrift.protocol.TField REPLICATION_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("replication_count", org.apache.thrift.protocol.TType.I32, (short)515); - private static final org.apache.thrift.protocol.TField REQUESTED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)521); - private static final org.apache.thrift.protocol.TField REQUESTED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memoffheap", org.apache.thrift.protocol.T
[43/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/scheduler/IsolationScheduler.clj -- diff --git a/storm-core/src/clj/backtype/storm/scheduler/IsolationScheduler.clj b/storm-core/src/clj/backtype/storm/scheduler/IsolationScheduler.clj deleted file mode 100644 index 2e86748..000 --- a/storm-core/src/clj/backtype/storm/scheduler/IsolationScheduler.clj +++ /dev/null @@ -1,219 +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. -(ns org.apache.storm.scheduler.IsolationScheduler - (:use [org.apache.storm util config log]) - (:require [org.apache.storm.scheduler.DefaultScheduler :as DefaultScheduler]) - (:import [java.util HashSet Set List LinkedList ArrayList Map HashMap]) - (:import [org.apache.storm.scheduler IScheduler Topologies -Cluster TopologyDetails WorkerSlot SchedulerAssignment -EvenScheduler ExecutorDetails]) - (:gen-class -:init init -:constructors {[] []} -:state state -:implements [org.apache.storm.scheduler.IScheduler])) - -(defn -init [] - [[] (container)]) - -(defn -prepare [this conf] - (container-set! (.state this) conf)) - -(defn- compute-worker-specs "Returns mutable set of sets of executors" - [^TopologyDetails details] - (->> (.getExecutorToComponent details) - reverse-map - (map second) - (apply concat) - (map vector (repeat-seq (range (.getNumWorkers details - (group-by first) - (map-val #(map second %)) - vals - (map set) - (HashSet.) - )) - -(defn isolated-topologies [conf topologies] - (let [tset (-> conf (get ISOLATION-SCHEDULER-MACHINES) keys set)] -(filter (fn [^TopologyDetails t] (contains? tset (.getName t))) topologies) -)) - -;; map from topology id -> set of sets of executors -(defn topology-worker-specs [iso-topologies] - (->> iso-topologies - (map (fn [t] {(.getId t) (compute-worker-specs t)})) - (apply merge))) - -(defn machine-distribution [conf ^TopologyDetails topology] - (let [name->machines (get conf ISOLATION-SCHEDULER-MACHINES) -machines (get name->machines (.getName topology)) -workers (.getNumWorkers topology)] -(-> (integer-divided workers machines) -(dissoc 0) -(HashMap.) -))) - -(defn topology-machine-distribution [conf iso-topologies] - (->> iso-topologies - (map (fn [t] {(.getId t) (machine-distribution conf t)})) - (apply merge))) - -(defn host-assignments [^Cluster cluster] - (letfn [(to-slot-specs [^SchedulerAssignment ass] -(->> ass - .getExecutorToSlot - reverse-map - (map (fn [[slot executors]] -[slot (.getTopologyId ass) (set executors)]] - (->> cluster - .getAssignments - vals - (mapcat to-slot-specs) - (group-by (fn [[^WorkerSlot slot & _]] (.getHost cluster (.getNodeId slot - ))) - -(defn- decrement-distribution! [^Map distribution value] - (let [v (-> distribution (get value) dec)] -(if (zero? v) - (.remove distribution value) - (.put distribution value v - -;; returns list of list of slots, reverse sorted by number of slots -(defn- host-assignable-slots [^Cluster cluster] - (-<> cluster - .getAssignableSlots - (group-by #(.getHost cluster (.getNodeId ^WorkerSlot %)) <>) - (dissoc <> nil) - (sort-by #(-> % second count -) <>) - shuffle - (LinkedList. <>) - )) - -(defn- host->used-slots [^Cluster cluster] - (->> cluster - .getUsedSlots - (group-by #(.getHost cluster (.getNodeId ^WorkerSlot %))) - )) - -(defn- distribution->sorted-amts [distribution] - (->> distribution - (mapcat (fn [[val amt]] (repeat amt val))) - (sort-by -) - )) - -(defn- allocated-topologies [topology-worker-specs] - (->> topology-worker-specs -(filter (fn [[_ worker-specs]] (empty? worker-specs))) -(map first) -set -)) - -(defn- leftover-topologies [^Topologies topologies filter-ids-set] - (->> topologies - .getTopologies - (filter (fn [^TopologyDetails t] (not (contains?
[12/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SpoutStats.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/SpoutStats.java b/storm-core/src/jvm/backtype/storm/generated/SpoutStats.java deleted file mode 100644 index b1384f6..000 --- a/storm-core/src/jvm/backtype/storm/generated/SpoutStats.java +++ /dev/null @@ -1,917 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class SpoutStats implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpoutStats"); - - private static final org.apache.thrift.protocol.TField ACKED_FIELD_DESC = new org.apache.thrift.protocol.TField("acked", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.protocol.TField FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("failed", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final org.apache.thrift.protocol.TField COMPLETE_MS_AVG_FIELD_DESC = new org.apache.thrift.protocol.TField("complete_ms_avg", org.apache.thrift.protocol.TType.MAP, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new SpoutStatsStandardSchemeFactory()); -schemes.put(TupleScheme.class, new SpoutStatsTupleSchemeFactory()); - } - - private Map> acked; // required - private Map> failed; // required - private Map> complete_ms_avg; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -ACKED((short)1, "acked"), -FAILED((short)2, "failed"), -COMPLETE_MS_AVG((short)3, "complete_ms_avg"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // ACKED - return ACKED; -case 2: // FAILED - return FAILED; -case 3: // COMPLETE_MS_AVG - return COMPLETE_MS_AVG; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; -} - -/** - * Find the _Fields constant
[19/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LSTopoHistory.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/LSTopoHistory.java b/storm-core/src/jvm/backtype/storm/generated/LSTopoHistory.java deleted file mode 100644 index 792c185..000 --- a/storm-core/src/jvm/backtype/storm/generated/LSTopoHistory.java +++ /dev/null @@ -1,805 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class LSTopoHistory implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LSTopoHistory"); - - private static final org.apache.thrift.protocol.TField TOPOLOGY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField TIME_STAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("time_stamp", org.apache.thrift.protocol.TType.I64, (short)2); - private static final org.apache.thrift.protocol.TField USERS_FIELD_DESC = new org.apache.thrift.protocol.TField("users", org.apache.thrift.protocol.TType.LIST, (short)3); - private static final org.apache.thrift.protocol.TField GROUPS_FIELD_DESC = new org.apache.thrift.protocol.TField("groups", org.apache.thrift.protocol.TType.LIST, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new LSTopoHistoryStandardSchemeFactory()); -schemes.put(TupleScheme.class, new LSTopoHistoryTupleSchemeFactory()); - } - - private String topology_id; // required - private long time_stamp; // required - private List users; // required - private List groups; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -TOPOLOGY_ID((short)1, "topology_id"), -TIME_STAMP((short)2, "time_stamp"), -USERS((short)3, "users"), -GROUPS((short)4, "groups"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // TOPOLOGY_ID - return TOPOLOGY_ID; -case 2: // TIME_STAMP - return TIME_STAMP; -case 3: // USERS - return USERS; -case 4: // GROUPS - return GROUPS; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an except
[07/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java b/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java deleted file mode 100644 index 5e774e2..000 --- a/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java +++ /dev/null @@ -1,461 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TopologyHistoryInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyHistoryInfo"); - - private static final org.apache.thrift.protocol.TField TOPO_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("topo_ids", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new TopologyHistoryInfoStandardSchemeFactory()); -schemes.put(TupleScheme.class, new TopologyHistoryInfoTupleSchemeFactory()); - } - - private List topo_ids; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -TOPO_IDS((short)1, "topo_ids"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // TOPO_IDS - return TOPO_IDS; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; -} - -/** - * Find the _Fields constant that matches name, or null if its not found. - */ -public static _Fields findByName(String name) { - return byName.get(name); -} - -private final short _thriftId; -private final String _fieldName; - -_Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; -} - -public short getThriftFieldId() { - return _thriftId; -} - -public String getFieldName() { - return _fieldName; -} - } - - // isset id assignments - public static final Map<_Fields, org.apac
[40/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/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 deleted file mode 100644 index 75ea0dc..000 --- a/storm-core/src/clj/backtype/storm/util.clj +++ /dev/null @@ -1,1134 +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. - -(ns org.apache.storm.util - (:import [java.net InetAddress]) - (:import [java.util Map Map$Entry List ArrayList Collection Iterator HashMap]) - (:import [java.io FileReader FileNotFoundException]) - (:import [java.nio.file Paths]) - (:import [org.apache.storm Config]) - (:import [org.apache.storm.utils Time Container ClojureTimerTask Utils -MutableObject MutableInt]) - (:import [org.apache.storm.security.auth NimbusPrincipal]) - (:import [javax.security.auth Subject]) - (:import [java.util UUID Random ArrayList List Collections]) - (:import [java.util.zip ZipFile]) - (:import [java.util.concurrent.locks ReentrantReadWriteLock]) - (:import [java.util.concurrent Semaphore]) - (:import [java.nio.file Files Paths]) - (:import [java.nio.file.attribute FileAttribute]) - (:import [java.io File FileOutputStream RandomAccessFile StringWriter -PrintWriter BufferedReader InputStreamReader IOException]) - (:import [java.lang.management ManagementFactory]) - (:import [org.apache.commons.exec DefaultExecutor CommandLine]) - (:import [org.apache.commons.io FileUtils]) - (:import [org.apache.storm.logging ThriftAccessLogger]) - (:import [org.apache.commons.exec ExecuteException]) - (:import [org.json.simple JSONValue]) - (:import [org.yaml.snakeyaml Yaml] - [org.yaml.snakeyaml.constructor SafeConstructor]) - (:require [clojure [string :as str]]) - (:import [clojure.lang RT]) - (:require [clojure [set :as set]]) - (:require [clojure.java.io :as io]) - (:use [clojure walk]) - (:require [ring.util.codec :as codec]) - (:use [org.apache.storm log])) - -(defn wrap-in-runtime - "Wraps an exception in a RuntimeException if needed" - [^Exception e] - (if (instance? RuntimeException e) -e -(RuntimeException. e))) - -(def on-windows? - (= "Windows_NT" (System/getenv "OS"))) - -(def file-path-separator - (System/getProperty "file.separator")) - -(def class-path-separator - (System/getProperty "path.separator")) - -(defn is-absolute-path? [path] - (.isAbsolute (Paths/get path (into-array String [] - -(defmacro defalias - "Defines an alias for a var: a new var with the same root binding (if - any) and similar metadata. The metadata of the alias is its initial - metadata (as provided by def) merged into the metadata of the original." - ([name orig] - `(do - (alter-meta! -(if (.hasRoot (var ~orig)) - (def ~name (.getRawRoot (var ~orig))) - (def ~name)) -;; When copying metadata, disregard {:macro false}. -;; Workaround for http://www.assembla.com/spaces/clojure/tickets/273 -#(conj (dissoc % :macro) - (apply dissoc (meta (var ~orig)) (remove #{:macro} (keys %) - (var ~name))) - ([name orig doc] - (list `defalias (with-meta name (assoc (meta name) :doc doc)) orig))) - -;; name-with-attributes by Konrad Hinsen: -(defn name-with-attributes - "To be used in macro definitions. - Handles optional docstrings and attribute maps for a name to be defined - in a list of macro arguments. If the first macro argument is a string, - it is added as a docstring to name and removed from the macro argument - list. If afterwards the first macro argument is a map, its entries are - added to the name's metadata map and the map is removed from the - macro argument list. The return value is a vector containing the name - with its extended metadata map and the list of unprocessed macro - arguments." - [name macro-args] - (let [[docstring macro-args] (if (string? (first macro-args)) - [(first macro-args) (next macro-args)] - [nil macro-args]) -[attr macro-args] (if (map? (first macro-args)) -[(
[54/55] [abbrv] storm git commit: Working on cleaning up the PR.
Working on cleaning up the PR. Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/737847c2 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/737847c2 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/737847c2 Branch: refs/heads/Pacemaker-HA-1.x-branch2 Commit: 737847c24f47b50c3c199d686f8e386d2cb28f2b Parents: 9c58604 Author: Kyle Nusbaum Authored: Mon Oct 10 11:10:05 2016 -0500 Committer: Kyle Nusbaum Committed: Mon Oct 10 11:10:05 2016 -0500 -- .../netty/KerberosSaslNettyClient.java | 1 - .../apache/storm/pacemaker/PacemakerClient.java | 24 +++- 2 files changed, 8 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/storm/blob/737847c2/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java -- diff --git a/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java b/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java index 00459e2..4402c09 100644 --- a/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java +++ b/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java @@ -111,7 +111,6 @@ public class KerberosSaslNettyClient { try { Principal principal = (Principal)subject.getPrincipals().toArray()[0]; final String fPrincipalName = principal.getName(); -KerberosName kerbName = new KerberosName(principal.getName()); final String fHost = host; final String fServiceName = serviceName; final CallbackHandler fch = ch; http://git-wip-us.apache.org/repos/asf/storm/blob/737847c2/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java -- diff --git a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java index d555dae..67201b8 100644 --- a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java +++ b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java @@ -45,7 +45,7 @@ public class PacemakerClient implements ISaslClient { private static final Logger LOG = LoggerFactory.getLogger(PacemakerClient.class); -private String topo_name; +private String client_name; private String secret; private AtomicBoolean ready; private final ClientBootstrap bootstrap; @@ -55,22 +55,16 @@ public class PacemakerClient implements ISaslClient { private HBMessage messages[]; private LinkedBlockingQueue availableMessageSlots; private ThriftNettyClientCodec.AuthMethod authMethod; -private static Timer timer; -private String host; - -static { -timer = new Timer(true); -} +private static Timer timer = new Timer(true); private StormBoundedExponentialBackoffRetry backoff = new StormBoundedExponentialBackoffRetry(100, 5000, 20); private int retryTimes = 0; public PacemakerClient(Map config, String host) { -this.host = host; int port = (int)config.get(Config.PACEMAKER_PORT); -topo_name = (String)config.get(Config.TOPOLOGY_NAME); -if(topo_name == null) { -topo_name = "pacemaker-client"; +client_name = (String)config.get(Config.TOPOLOGY_NAME); +if(client_name == null) { +client_name = "pacemaker-client"; } String auth = (String)config.get(Config.PACEMAKER_AUTH_METHOD); @@ -122,10 +116,6 @@ public class PacemakerClient implements ISaslClient { bootstrap.connect(remote_addr); } -public String toString() { -return host; -} - private void setupMessaging() { messages = new HBMessage[maxPending]; availableMessageSlots = new LinkedBlockingQueue(); @@ -134,6 +124,7 @@ public class PacemakerClient implements ISaslClient { } } +@Override public synchronized void channelConnected(Channel channel) { Channel oldChannel = channelRef.get(); if (oldChannel != null) { @@ -156,6 +147,7 @@ public class PacemakerClient implements ISaslClient { return ready.get(); } +@Override public synchronized void channelReady() { LOG.debug("Channel is ready."); ready.set(true); @@ -163,7 +155,7 @@ public class PacemakerClient implements ISaslClient { } public String name() { -return topo_name; +return client_name; } public String secretKey() {
[23/55] [abbrv] [partial] storm git commit: Ported successfully.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/GlobalStreamId.java -- diff --git a/storm-core/src/jvm/backtype/storm/generated/GlobalStreamId.java b/storm-core/src/jvm/backtype/storm/generated/GlobalStreamId.java deleted file mode 100644 index 677dfd8..000 --- a/storm-core/src/jvm/backtype/storm/generated/GlobalStreamId.java +++ /dev/null @@ -1,507 +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. - */ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.storm.generated; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class GlobalStreamId implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GlobalStreamId"); - - private static final org.apache.thrift.protocol.TField COMPONENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("componentId", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STREAM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("streamId", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { -schemes.put(StandardScheme.class, new GlobalStreamIdStandardSchemeFactory()); -schemes.put(TupleScheme.class, new GlobalStreamIdTupleSchemeFactory()); - } - - private String componentId; // required - private String streamId; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -COMPONENT_ID((short)1, "componentId"), -STREAM_ID((short)2, "streamId"); - -private static final Map byName = new HashMap(); - -static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { -byName.put(field.getFieldName(), field); - } -} - -/** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ -public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { -case 1: // COMPONENT_ID - return COMPONENT_ID; -case 2: // STREAM_ID - return STREAM_ID; -default: - return null; - } -} - -/** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ -public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; -} - -/** - * Find the _Fields constant that matches name, or null if its not found. - */ -public static _Fields findByName(String name) { - return byName.get(name); -} - -private final short _thriftId; -private final String _fieldName; - -_Fields(short thriftId, S