From d13cfe2dc9beda8fc4fda6fa6536d87b9ce514a1 Mon Sep 17 00:00:00 2001
From: Kishor Patil
Date: Thu, 24 Sep 2015 14:22:37 +0000
Subject: [PATCH 1/5] Adding thrift changes for Dynamic Logging
---
.../backtype/storm/generated/LogConfig.java | 475 +++++
.../backtype/storm/generated/LogLevel.java | 836 ++++++++
.../storm/generated/LogLevelAction.java | 65 +
.../jvm/backtype/storm/generated/Nimbus.java | 1700 ++++++++++++++++-
storm-core/src/py/storm/Nimbus-remote | 14 +
storm-core/src/py/storm/Nimbus.py | 359 +++-
storm-core/src/py/storm/ttypes.py | 213 +++
storm-core/src/storm.thrift | 37 +
8 files changed, 3696 insertions(+), 3 deletions(-)
create mode 100644 storm-core/src/jvm/backtype/storm/generated/LogConfig.java
create mode 100644 storm-core/src/jvm/backtype/storm/generated/LogLevel.java
create mode 100644 storm-core/src/jvm/backtype/storm/generated/LogLevelAction.java
diff --git a/storm-core/src/jvm/backtype/storm/generated/LogConfig.java b/storm-core/src/jvm/backtype/storm/generated/LogConfig.java
new file mode 100644
index 00000000000..318ed86433f
--- /dev/null
+++ b/storm-core/src/jvm/backtype/storm/generated/LogConfig.java
@@ -0,0 +1,475 @@
+/**
+ * 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.2)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package backtype.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.2)", date = "2015-9-24")
+public class LogConfig 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("LogConfig");
+
+ private static final org.apache.thrift.protocol.TField NAMED_LOGGER_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("named_logger_level", org.apache.thrift.protocol.TType.MAP, (short)2);
+
+ private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new LogConfigStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new LogConfigTupleSchemeFactory());
+ }
+
+ private Map named_logger_level; // 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 {
+ NAMED_LOGGER_LEVEL((short)2, "named_logger_level");
+
+ 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 2: // NAMED_LOGGER_LEVEL
+ return NAMED_LOGGER_LEVEL;
+ 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
+ private static final _Fields optionals[] = {_Fields.NAMED_LOGGER_LEVEL};
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.NAMED_LOGGER_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("named_logger_level", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LogLevel.class))));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LogConfig.class, metaDataMap);
+ }
+
+ public LogConfig() {
+ }
+
+ /**
+ * Performs a deep copy on other.
+ */
+ public LogConfig(LogConfig other) {
+ if (other.is_set_named_logger_level()) {
+ Map __this__named_logger_level = new HashMap(other.named_logger_level.size());
+ for (Map.Entry other_element : other.named_logger_level.entrySet()) {
+
+ String other_element_key = other_element.getKey();
+ LogLevel other_element_value = other_element.getValue();
+
+ String __this__named_logger_level_copy_key = other_element_key;
+
+ LogLevel __this__named_logger_level_copy_value = new LogLevel(other_element_value);
+
+ __this__named_logger_level.put(__this__named_logger_level_copy_key, __this__named_logger_level_copy_value);
+ }
+ this.named_logger_level = __this__named_logger_level;
+ }
+ }
+
+ public LogConfig deepCopy() {
+ return new LogConfig(this);
+ }
+
+ @Override
+ public void clear() {
+ this.named_logger_level = null;
+ }
+
+ public int get_named_logger_level_size() {
+ return (this.named_logger_level == null) ? 0 : this.named_logger_level.size();
+ }
+
+ public void put_to_named_logger_level(String key, LogLevel val) {
+ if (this.named_logger_level == null) {
+ this.named_logger_level = new HashMap();
+ }
+ this.named_logger_level.put(key, val);
+ }
+
+ public Map get_named_logger_level() {
+ return this.named_logger_level;
+ }
+
+ public void set_named_logger_level(Map named_logger_level) {
+ this.named_logger_level = named_logger_level;
+ }
+
+ public void unset_named_logger_level() {
+ this.named_logger_level = null;
+ }
+
+ /** Returns true if field named_logger_level is set (has been assigned a value) and false otherwise */
+ public boolean is_set_named_logger_level() {
+ return this.named_logger_level != null;
+ }
+
+ public void set_named_logger_level_isSet(boolean value) {
+ if (!value) {
+ this.named_logger_level = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case NAMED_LOGGER_LEVEL:
+ if (value == null) {
+ unset_named_logger_level();
+ } else {
+ set_named_logger_level((Map)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case NAMED_LOGGER_LEVEL:
+ return get_named_logger_level();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case NAMED_LOGGER_LEVEL:
+ return is_set_named_logger_level();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof LogConfig)
+ return this.equals((LogConfig)that);
+ return false;
+ }
+
+ public boolean equals(LogConfig that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_named_logger_level = true && this.is_set_named_logger_level();
+ boolean that_present_named_logger_level = true && that.is_set_named_logger_level();
+ if (this_present_named_logger_level || that_present_named_logger_level) {
+ if (!(this_present_named_logger_level && that_present_named_logger_level))
+ return false;
+ if (!this.named_logger_level.equals(that.named_logger_level))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List
-
\ No newline at end of file
+
+
+
+
+
+
+
diff --git a/storm-core/src/ui/public/topology.html b/storm-core/src/ui/public/topology.html
index 2b1214cc01f..e873bb63519 100644
--- a/storm-core/src/ui/public/topology.html
+++ b/storm-core/src/ui/public/topology.html
@@ -82,6 +82,146 @@ Topology summary