STORM-655: Adding topology replication count to thrift/rest/ui.
Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/1b6491f1 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/1b6491f1 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/1b6491f1 Branch: refs/heads/0.11.x-branch Commit: 1b6491f1547ccd796aec387b8622a5c34bda0a81 Parents: 01eee7a Author: Parth Brahmbhatt <[email protected]> Authored: Tue Feb 3 17:30:50 2015 -0800 Committer: Parth Brahmbhatt <[email protected]> Committed: Tue Feb 3 17:33:19 2015 -0800 ---------------------------------------------------------------------- STORM-UI-REST-API.md | 9 +- .../src/clj/backtype/storm/daemon/nimbus.clj | 2 + storm-core/src/clj/backtype/storm/ui/core.clj | 8 +- .../backtype/storm/generated/TopologyInfo.java | 93 +++++++++++++++++++- .../storm/generated/TopologySummary.java | 93 +++++++++++++++++++- storm-core/src/py/storm/ttypes.py | 48 +++++----- storm-core/src/storm.thrift | 2 + .../public/templates/index-page-template.html | 6 ++ .../templates/topology-page-template.html | 6 ++ 9 files changed, 238 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/storm/blob/1b6491f1/STORM-UI-REST-API.md ---------------------------------------------------------------------- diff --git a/STORM-UI-REST-API.md b/STORM-UI-REST-API.md index 1671262..ed26cd9 100644 --- a/STORM-UI-REST-API.md +++ b/STORM-UI-REST-API.md @@ -140,7 +140,7 @@ Response fields: |tasksTotal| Integer |Total number of tasks for this topology| |workersTotal| Integer |Number of workers used for this topology| |executorsTotal| Integer |Number of executors used for this topology| - +|replicationCount| Integer |Number of nimbus hosts on which this topology code is replicated| Sample response: ```json @@ -153,7 +153,8 @@ Sample response: "uptime": "6m 5s", "tasksTotal": 28, "workersTotal": 3, - "executorsTotal": 28 + "executorsTotal": 28, + "replicationCount": 1 } ] } @@ -219,6 +220,7 @@ Response fields: |bolts.errorWorkerLogLink| String | Link to the worker log that reported the exception | |bolts.emitted| Long |Number of tuples emitted| |antiForgeryToken| String | CSRF token| +|replicationCount| Integer |Number of nimbus hosts on which this topology code is replicated| Examples: @@ -365,7 +367,8 @@ Sample response: "supervisor.enable": true, "storm.messaging.netty.server_worker_threads": 1 }, - "antiForgeryToken": "lAFTN\/5iSedRLwJeUNqkJ8hgYubRl2OxjXGoDf9A4Bt1nZY3rvJW0\/P4zqu9yAk\/LvDhlmn7gigw\/z8C" + "antiForgeryToken": "lAFTN\/5iSedRLwJeUNqkJ8hgYubRl2OxjXGoDf9A4Bt1nZY3rvJW0\/P4zqu9yAk\/LvDhlmn7gigw\/z8C", + "replicationCount": 1 } ``` http://git-wip-us.apache.org/repos/asf/storm/blob/1b6491f1/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 index 2528825..e354fab 100644 --- a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj +++ b/storm-core/src/clj/backtype/storm/daemon/nimbus.clj @@ -1308,6 +1308,7 @@ (extract-status-str base))] (when-let [owner (:owner base)] (.set_owner topo-summ owner)) (when-let [sched-status (.get @(:id->sched-status nimbus) id)] (.set_sched_status topo-summ sched-status)) + (.set_replication_count topo-summ (.getReplicationCount (:code-distributor nimbus) id)) topo-summ ))] (ClusterSummary. supervisor-summaries @@ -1352,6 +1353,7 @@ )] (when-let [owner (:owner base)] (.set_owner topo-info owner)) (when-let [sched-status (.get @(:id->sched-status nimbus) storm-id)] (.set_sched_status topo-info sched-status)) + (.set_replication_count topo-info (.getReplicationCount (:code-distributor nimbus) storm-id)) topo-info )) http://git-wip-us.apache.org/repos/asf/storm/blob/1b6491f1/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 index 12ddb2f..3c7f578 100644 --- a/storm-core/src/clj/backtype/storm/ui/core.clj +++ b/storm-core/src/clj/backtype/storm/ui/core.clj @@ -576,6 +576,7 @@ "tasksTotal" (.get_num_tasks t) "workersTotal" (.get_num_workers t) "executorsTotal" (.get_num_executors t) + "replicationCount" (.get_replication_count t) "schedulerInfo" (.get_sched_status t)})})) (defn topology-stats [id window stats] @@ -656,7 +657,8 @@ "tasksTotal" (sum-tasks executors) "workersTotal" (count workers) "executorsTotal" (count executors) - "schedulerInfo" (.get_sched_status summ)})) + "schedulerInfo" (.get_sched_status summ) + "replicationCount" (.get_replication_count summ)})) (defn spout-summary-json [topology-id id stats window] (let [times (stats-times (:emitted stats)) @@ -689,6 +691,7 @@ msg-timeout (topology-conf TOPOLOGY-MESSAGE-TIMEOUT-SECS) spouts (.get_spouts topology) bolts (.get_bolts topology) + replication-count (.get_replication_count summ) visualizer-data (visualization-data (merge (hashmap-to-persistent spouts) (hashmap-to-persistent bolts)) spout-comp-summs @@ -706,7 +709,8 @@ "bolts" (bolt-comp id bolt-comp-summs (.get_errors summ) window include-sys?) "configuration" topology-conf "visualizationTable" (stream-boxes visualizer-data) - "antiForgeryToken" *anti-forgery-token*})))) + "antiForgeryToken" *anti-forgery-token* + "replicationCount" replication-count})))) (defn spout-output-stats [stream-summary window] http://git-wip-us.apache.org/repos/asf/storm/blob/1b6491f1/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 index 2c36d4e..1ba5c5f 100644 --- a/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java +++ b/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java @@ -49,6 +49,7 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol 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 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 String id; // required private String name; // required @@ -58,6 +59,7 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol private Map<String,List<ErrorInfo>> errors; // required private String sched_status; // required private String owner; // required + private int replication_count; // 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 { @@ -68,7 +70,8 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol STATUS((short)5, "status"), ERRORS((short)6, "errors"), SCHED_STATUS((short)513, "sched_status"), - OWNER((short)514, "owner"); + OWNER((short)514, "owner"), + REPLICATION_COUNT((short)515, "replication_count"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -99,6 +102,8 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol return SCHED_STATUS; case 514: // OWNER return OWNER; + case 515: // REPLICATION_COUNT + return REPLICATION_COUNT; default: return null; } @@ -140,7 +145,8 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol // isset id assignments private static final int __UPTIME_SECS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); + private static final int __REPLICATION_COUNT_ISSET_ID = 1; + private BitSet __isset_bit_vector = new BitSet(2); public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { @@ -165,6 +171,8 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.OWNER, new org.apache.thrift.meta_data.FieldMetaData("owner", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.REPLICATION_COUNT, new org.apache.thrift.meta_data.FieldMetaData("replication_count", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologyInfo.class, metaDataMap); } @@ -237,6 +245,7 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol if (other.is_set_owner()) { this.owner = other.owner; } + this.replication_count = other.replication_count; } public TopologyInfo deepCopy() { @@ -254,6 +263,8 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol this.errors = null; this.sched_status = null; this.owner = null; + set_replication_count_isSet(false); + this.replication_count = 0; } public String get_id() { @@ -465,6 +476,28 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol } } + public int get_replication_count() { + return this.replication_count; + } + + public void set_replication_count(int replication_count) { + this.replication_count = replication_count; + set_replication_count_isSet(true); + } + + public void unset_replication_count() { + __isset_bit_vector.clear(__REPLICATION_COUNT_ISSET_ID); + } + + /** Returns true if field replication_count is set (has been assigned a value) and false otherwise */ + public boolean is_set_replication_count() { + return __isset_bit_vector.get(__REPLICATION_COUNT_ISSET_ID); + } + + public void set_replication_count_isSet(boolean value) { + __isset_bit_vector.set(__REPLICATION_COUNT_ISSET_ID, value); + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case ID: @@ -531,6 +564,14 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol } break; + case REPLICATION_COUNT: + if (value == null) { + unset_replication_count(); + } else { + set_replication_count((Integer)value); + } + break; + } } @@ -560,6 +601,9 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol case OWNER: return get_owner(); + case REPLICATION_COUNT: + return Integer.valueOf(get_replication_count()); + } throw new IllegalStateException(); } @@ -587,6 +631,8 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol return is_set_sched_status(); case OWNER: return is_set_owner(); + case REPLICATION_COUNT: + return is_set_replication_count(); } throw new IllegalStateException(); } @@ -676,6 +722,15 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol return false; } + boolean this_present_replication_count = true && this.is_set_replication_count(); + boolean that_present_replication_count = true && that.is_set_replication_count(); + if (this_present_replication_count || that_present_replication_count) { + if (!(this_present_replication_count && that_present_replication_count)) + return false; + if (this.replication_count != that.replication_count) + return false; + } + return true; } @@ -723,6 +778,11 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol if (present_owner) builder.append(owner); + boolean present_replication_count = true && (is_set_replication_count()); + builder.append(present_replication_count); + if (present_replication_count) + builder.append(replication_count); + return builder.toHashCode(); } @@ -814,6 +874,16 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol return lastComparison; } } + lastComparison = Boolean.valueOf(is_set_replication_count()).compareTo(typedOther.is_set_replication_count()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_replication_count()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.replication_count, typedOther.replication_count); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -922,6 +992,14 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); } break; + case 515: // REPLICATION_COUNT + if (field.type == org.apache.thrift.protocol.TType.I32) { + this.replication_count = iprot.readI32(); + set_replication_count_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); } @@ -999,6 +1077,11 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol oprot.writeFieldEnd(); } } + if (is_set_replication_count()) { + oprot.writeFieldBegin(REPLICATION_COUNT_FIELD_DESC); + oprot.writeI32(this.replication_count); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -1071,6 +1154,12 @@ public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, Topol } first = false; } + if (is_set_replication_count()) { + if (!first) sb.append(", "); + sb.append("replication_count:"); + sb.append(this.replication_count); + first = false; + } sb.append(")"); return sb.toString(); } http://git-wip-us.apache.org/repos/asf/storm/blob/1b6491f1/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 index fea2137..bc09e68 100644 --- a/storm-core/src/jvm/backtype/storm/generated/TopologySummary.java +++ b/storm-core/src/jvm/backtype/storm/generated/TopologySummary.java @@ -50,6 +50,7 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, 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 String id; // required private String name; // required @@ -60,6 +61,7 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, private String status; // required private String sched_status; // required private String owner; // required + private int replication_count; // 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 { @@ -71,7 +73,8 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, UPTIME_SECS((short)6, "uptime_secs"), STATUS((short)7, "status"), SCHED_STATUS((short)513, "sched_status"), - OWNER((short)514, "owner"); + OWNER((short)514, "owner"), + REPLICATION_COUNT((short)515, "replication_count"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -104,6 +107,8 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, return SCHED_STATUS; case 514: // OWNER return OWNER; + case 515: // REPLICATION_COUNT + return REPLICATION_COUNT; default: return null; } @@ -148,7 +153,8 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, private static final int __NUM_EXECUTORS_ISSET_ID = 1; private static final int __NUM_WORKERS_ISSET_ID = 2; private static final int __UPTIME_SECS_ISSET_ID = 3; - private BitSet __isset_bit_vector = new BitSet(4); + private static final int __REPLICATION_COUNT_ISSET_ID = 4; + private BitSet __isset_bit_vector = new BitSet(5); public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { @@ -171,6 +177,8 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.OWNER, new org.apache.thrift.meta_data.FieldMetaData("owner", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.REPLICATION_COUNT, new org.apache.thrift.meta_data.FieldMetaData("replication_count", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologySummary.class, metaDataMap); } @@ -226,6 +234,7 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, if (other.is_set_owner()) { this.owner = other.owner; } + this.replication_count = other.replication_count; } public TopologySummary deepCopy() { @@ -247,6 +256,8 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, this.status = null; this.sched_status = null; this.owner = null; + set_replication_count_isSet(false); + this.replication_count = 0; } public String get_id() { @@ -452,6 +463,28 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, } } + public int get_replication_count() { + return this.replication_count; + } + + public void set_replication_count(int replication_count) { + this.replication_count = replication_count; + set_replication_count_isSet(true); + } + + public void unset_replication_count() { + __isset_bit_vector.clear(__REPLICATION_COUNT_ISSET_ID); + } + + /** Returns true if field replication_count is set (has been assigned a value) and false otherwise */ + public boolean is_set_replication_count() { + return __isset_bit_vector.get(__REPLICATION_COUNT_ISSET_ID); + } + + public void set_replication_count_isSet(boolean value) { + __isset_bit_vector.set(__REPLICATION_COUNT_ISSET_ID, value); + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case ID: @@ -526,6 +559,14 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, } break; + case REPLICATION_COUNT: + if (value == null) { + unset_replication_count(); + } else { + set_replication_count((Integer)value); + } + break; + } } @@ -558,6 +599,9 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, case OWNER: return get_owner(); + case REPLICATION_COUNT: + return Integer.valueOf(get_replication_count()); + } throw new IllegalStateException(); } @@ -587,6 +631,8 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, return is_set_sched_status(); case OWNER: return is_set_owner(); + case REPLICATION_COUNT: + return is_set_replication_count(); } throw new IllegalStateException(); } @@ -685,6 +731,15 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, return false; } + boolean this_present_replication_count = true && this.is_set_replication_count(); + boolean that_present_replication_count = true && that.is_set_replication_count(); + if (this_present_replication_count || that_present_replication_count) { + if (!(this_present_replication_count && that_present_replication_count)) + return false; + if (this.replication_count != that.replication_count) + return false; + } + return true; } @@ -737,6 +792,11 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, if (present_owner) builder.append(owner); + boolean present_replication_count = true && (is_set_replication_count()); + builder.append(present_replication_count); + if (present_replication_count) + builder.append(replication_count); + return builder.toHashCode(); } @@ -838,6 +898,16 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, return lastComparison; } } + lastComparison = Boolean.valueOf(is_set_replication_count()).compareTo(typedOther.is_set_replication_count()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_replication_count()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.replication_count, typedOther.replication_count); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -922,6 +992,14 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); } break; + case 515: // REPLICATION_COUNT + if (field.type == org.apache.thrift.protocol.TType.I32) { + this.replication_count = iprot.readI32(); + set_replication_count_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); } @@ -976,6 +1054,11 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, oprot.writeFieldEnd(); } } + if (is_set_replication_count()) { + oprot.writeFieldBegin(REPLICATION_COUNT_FIELD_DESC); + oprot.writeI32(this.replication_count); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -1044,6 +1127,12 @@ public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, } first = false; } + if (is_set_replication_count()) { + if (!first) sb.append(", "); + sb.append("replication_count:"); + sb.append(this.replication_count); + first = false; + } sb.append(")"); return sb.toString(); } http://git-wip-us.apache.org/repos/asf/storm/blob/1b6491f1/storm-core/src/py/storm/ttypes.py ---------------------------------------------------------------------- diff --git a/storm-core/src/py/storm/ttypes.py b/storm-core/src/py/storm/ttypes.py index 1bbaf37..e4fb751 100644 --- a/storm-core/src/py/storm/ttypes.py +++ b/storm-core/src/py/storm/ttypes.py @@ -1,19 +1,3 @@ -# 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.7.0) # @@ -1571,6 +1555,7 @@ class TopologySummary: - status - sched_status - owner + - replication_count """ thrift_spec = ( @@ -2089,12 +2074,13 @@ class TopologySummary: None, # 512 (513, TType.STRING, 'sched_status', None, None, ), # 513 (514, TType.STRING, 'owner', None, None, ), # 514 + (515, TType.I32, 'replication_count', None, None, ), # 515 ) def __hash__(self): - return 0 + hash(self.id) + hash(self.name) + hash(self.num_tasks) + hash(self.num_executors) + hash(self.num_workers) + hash(self.uptime_secs) + hash(self.status) + hash(self.sched_status) + hash(self.owner) + return 0 + hash(self.id) + hash(self.name) + hash(self.num_tasks) + hash(self.num_executors) + hash(self.num_workers) + hash(self.uptime_secs) + hash(self.status) + hash(self.sched_status) + hash(self.owner) + hash(self.replication_count) - def __init__(self, id=None, name=None, num_tasks=None, num_executors=None, num_workers=None, uptime_secs=None, status=None, sched_status=None, owner=None,): + def __init__(self, id=None, name=None, num_tasks=None, num_executors=None, num_workers=None, uptime_secs=None, status=None, sched_status=None, owner=None, replication_count=None,): self.id = id self.name = name self.num_tasks = num_tasks @@ -2104,6 +2090,7 @@ class TopologySummary: self.status = status self.sched_status = sched_status self.owner = owner + self.replication_count = replication_count def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -2159,6 +2146,11 @@ class TopologySummary: self.owner = iprot.readString().decode('utf-8') else: iprot.skip(ftype) + elif fid == 515: + if ftype == TType.I32: + self.replication_count = iprot.readI32(); + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -2205,6 +2197,10 @@ class TopologySummary: oprot.writeFieldBegin('owner', TType.STRING, 514) oprot.writeString(self.owner.encode('utf-8')) oprot.writeFieldEnd() + if self.replication_count is not None: + oprot.writeFieldBegin('replication_count', TType.I32, 515) + oprot.writeI32(self.replication_count) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3388,6 +3384,7 @@ class TopologyInfo: - errors - sched_status - owner + - replication_count """ thrift_spec = ( @@ -3906,12 +3903,13 @@ class TopologyInfo: None, # 512 (513, TType.STRING, 'sched_status', None, None, ), # 513 (514, TType.STRING, 'owner', None, None, ), # 514 + (515, TType.I32, 'replication_count', None, None, ), # 515 ) def __hash__(self): - return 0 + hash(self.id) + hash(self.name) + hash(self.uptime_secs) + hash(self.executors) + hash(self.status) + hash(self.errors) + hash(self.sched_status) + hash(self.owner) + return 0 + hash(self.id) + hash(self.name) + hash(self.uptime_secs) + hash(self.executors) + hash(self.status) + hash(self.errors) + hash(self.sched_status) + hash(self.owner) + hash(self.replication_count) - def __init__(self, id=None, name=None, uptime_secs=None, executors=None, status=None, errors=None, sched_status=None, owner=None,): + def __init__(self, id=None, name=None, uptime_secs=None, executors=None, status=None, errors=None, sched_status=None, owner=None, replication_count=None,): self.id = id self.name = name self.uptime_secs = uptime_secs @@ -3920,6 +3918,7 @@ class TopologyInfo: self.errors = errors self.sched_status = sched_status self.owner = owner + self.replication_count = replication_count def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -3988,6 +3987,11 @@ class TopologyInfo: self.owner = iprot.readString().decode('utf-8') else: iprot.skip(ftype) + elif fid == 515: + if ftype == TType.I32: + self.replication_count = iprot.readI32(); + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -4040,6 +4044,10 @@ class TopologyInfo: oprot.writeFieldBegin('owner', TType.STRING, 514) oprot.writeString(self.owner.encode('utf-8')) oprot.writeFieldEnd() + if self.replication_count is not None: + oprot.writeFieldBegin('replication_count', TType.I32, 515) + oprot.writeI32(self.replication_count) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() http://git-wip-us.apache.org/repos/asf/storm/blob/1b6491f1/storm-core/src/storm.thrift ---------------------------------------------------------------------- diff --git a/storm-core/src/storm.thrift b/storm-core/src/storm.thrift index f807b74..3c49d39 100644 --- a/storm-core/src/storm.thrift +++ b/storm-core/src/storm.thrift @@ -145,6 +145,7 @@ struct TopologySummary { 7: required string status; 513: optional string sched_status; 514: optional string owner; +515: optional i32 replication_count; } struct SupervisorSummary { @@ -218,6 +219,7 @@ struct TopologyInfo { 6: required map<string, list<ErrorInfo>> errors; 513: optional string sched_status; 514: optional string owner; +515: optional i32 replication_count; } struct KillOptions { http://git-wip-us.apache.org/repos/asf/storm/blob/1b6491f1/storm-core/src/ui/public/templates/index-page-template.html ---------------------------------------------------------------------- diff --git a/storm-core/src/ui/public/templates/index-page-template.html b/storm-core/src/ui/public/templates/index-page-template.html index f301ac5..0a4fdf3 100644 --- a/storm-core/src/ui/public/templates/index-page-template.html +++ b/storm-core/src/ui/public/templates/index-page-template.html @@ -153,6 +153,11 @@ </span> </th> <th> + <span class="tip above" title="Number of nimbus hosts on which this topology's code is replicated. "> + Replication count + </span> + </th> + <th> <span class="tip left" title="This shows information from the scheduler about the latest attempt to schedule the Topology on the cluster."> Scheduler Info </span> @@ -170,6 +175,7 @@ <td>{{workersTotal}}</td> <td>{{executorsTotal}}</td> <td>{{tasksTotal}}</td> + <td>{{replicationCount}}</td> <td>{{schedulerInfo}}</td> </tr> {{/topologies}} http://git-wip-us.apache.org/repos/asf/storm/blob/1b6491f1/storm-core/src/ui/public/templates/topology-page-template.html ---------------------------------------------------------------------- diff --git a/storm-core/src/ui/public/templates/topology-page-template.html b/storm-core/src/ui/public/templates/topology-page-template.html index b74edd2..2b42197 100644 --- a/storm-core/src/ui/public/templates/topology-page-template.html +++ b/storm-core/src/ui/public/templates/topology-page-template.html @@ -59,6 +59,11 @@ </span> </th> <th> + <span class="tip above" title="Number of nimbus hosts on which this topology's code is replicated. "> + Replication count + </span> + </th> + <th> <span class="tip left" title="This shows information from the scheduler about the latest attempt to schedule the Topology on the cluster."> Scheduler Info </span> @@ -75,6 +80,7 @@ <td>{{workersTotal}}</td> <td>{{executorsTotal}}</td> <td>{{tasksTotal}}</td> + <td>{{replicationCount}}</td> <td>{{schedulerInfo}}</td> </tr> </tbody>
