You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by kn...@apache.org on 2015/10/19 22:07:10 UTC
[13/18] storm git commit: Remove generated files
Remove generated files
Cherry-pick YSTORM-1546
Cherry-pick YSTORM-2146
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/a77d0581
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/a77d0581
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/a77d0581
Branch: refs/heads/master
Commit: a77d0581a061efbe26600d50001c8f8c7ee866e3
Parents: 17d70d3
Author: zhuol <zh...@yahoo-inc.com>
Authored: Wed Oct 7 16:48:33 2015 -0500
Committer: zhuol <zh...@yahoo-inc.com>
Committed: Mon Oct 19 09:38:44 2015 -0500
----------------------------------------------------------------------
conf/defaults.yaml | 3 +-
.../src/clj/backtype/storm/daemon/nimbus.clj | 11 +-
.../clj/backtype/storm/daemon/supervisor.clj | 31 +-
.../src/clj/backtype/storm/local_state.clj | 9 +-
storm-core/src/clj/backtype/storm/testing.clj | 2 +-
storm-core/src/jvm/backtype/storm/Config.java | 12 +-
.../backtype/storm/generated/AccessControl.java | 627 ---------------
.../generated/HBAuthorizationException.java | 406 ----------
.../storm/generated/HBExecutionException.java | 406 ----------
.../jvm/backtype/storm/generated/HBMessage.java | 636 ---------------
.../jvm/backtype/storm/generated/HBNodes.java | 461 -----------
.../jvm/backtype/storm/generated/HBPulse.java | 522 ------------
.../jvm/backtype/storm/generated/HBRecords.java | 466 -----------
.../generated/KeyAlreadyExistsException.java | 406 ----------
.../storm/generated/KeyNotFoundException.java | 406 ----------
.../backtype/storm/generated/LSTopoHistory.java | 805 -------------------
.../storm/generated/LSTopoHistoryList.java | 460 -----------
.../storm/generated/ListBlobsResult.java | 556 -------------
.../storm/generated/ReadableBlobMeta.java | 510 ------------
.../storm/generated/SettableBlobMeta.java | 460 -----------
.../storm/generated/TopologyHistoryInfo.java | 461 -----------
.../storm/generated/WorkerResources.java | 605 --------------
.../backtype/storm/scheduler/WorkerSlot.java | 3 +-
.../test/clj/backtype/storm/supervisor_test.clj | 46 +-
24 files changed, 78 insertions(+), 8232 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/a77d0581/conf/defaults.yaml
----------------------------------------------------------------------
diff --git a/conf/defaults.yaml b/conf/defaults.yaml
index 881f8fb..dae8773 100644
--- a/conf/defaults.yaml
+++ b/conf/defaults.yaml
@@ -140,7 +140,8 @@ supervisor.memory.capacity.mb: 3072.0
supervisor.cpu.capacity: 400.0
### worker.* configs are for task workers
-worker.childopts: "-Xmx768m"
+worker.heap.memory.mb: 768
+worker.childopts: "-Xmx%HEAP-MEM%m"
worker.gc.childopts: ""
worker.heartbeat.frequency.secs: 1
http://git-wip-us.apache.org/repos/asf/storm/blob/a77d0581/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 4c3d1c1..2b0a9b5 100644
--- a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/nimbus.clj
@@ -545,12 +545,21 @@
(into {} (for [[tid assignment] existing-assignments
:let [alive-executors (topology->alive-executors tid)
executor->node+port (:executor->node+port assignment)
+ worker->resources (:worker->resources assignment)
+ ;; making a map from node+port to WorkerSlot with allocated resources
+ node+port->slot (into {} (for [[[node port] [mem-on-heap mem-off-heap cpu]] worker->resources]
+ {[node port]
+ (doto (WorkerSlot. node port)
+ (.allocateResource
+ mem-on-heap
+ mem-off-heap
+ cpu))}))
executor->slot (into {} (for [[executor [node port]] executor->node+port]
;; filter out the dead executors
(if (contains? alive-executors executor)
{(ExecutorDetails. (first executor)
(second executor))
- (WorkerSlot. node port)}
+ (get node+port->slot [node port])}
{})))]]
{tid (SchedulerAssignmentImpl. tid executor->slot)})))
http://git-wip-us.apache.org/repos/asf/storm/blob/a77d0581/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
index d87cc90..8a844f2 100644
--- a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
@@ -26,6 +26,7 @@
(:use [backtype.storm config util log timer local-state])
(:import [backtype.storm.utils VersionInfo])
(:import [backtype.storm Config])
+ (:import [backtype.storm.generated WorkerResources])
(:use [backtype.storm.daemon common])
(:require [backtype.storm.daemon [worker :as worker]]
[backtype.storm [process-simulator :as psim] [cluster :as cluster] [event :as event]]
@@ -78,7 +79,7 @@
(into {} (for [[port executors] port-executors]
;; need to cast to int b/c it might be a long (due to how yaml parses things)
;; doall is to avoid serialization/deserialization problems with lazy seqs
- [(Integer. port) (mk-local-assignment-with-resources storm-id (doall executors) (get my-slots-resources [assignment-id port]))]
+ [(Integer. port) (mk-local-assignment storm-id (doall executors) (get my-slots-resources [assignment-id port]))]
))))
(defn- read-assignments
@@ -390,7 +391,10 @@
(wait-for-workers-launch
conf
(dofor [[port assignment] reassign-executors]
- (let [id (new-worker-ids port)]
+ (let [id (new-worker-ids port)
+ storm-id (:storm-id assignment)
+ ^WorkerResources resources (:resources assignment)
+ mem-onheap (.get_mem_on_heap resources)]
(try
(log-message "Launching worker with assignment "
(pr-str assignment)
@@ -404,7 +408,8 @@
(launch-worker supervisor
(:storm-id assignment)
port
- id)
+ id
+ mem-onheap)
(catch java.io.FileNotFoundException e
(log-message "Unable to launch worker due to "
(.getMessage e)))
@@ -641,12 +646,13 @@
(str arch-resource-root File/pathSeparator resource-root File/pathSeparator (conf JAVA-LIBRARY-PATH))))
(defn substitute-childopts
- "Generates runtime childopts by replacing keys with topology-id, worker-id, port"
- [value worker-id topology-id port]
+ "Generates runtime childopts by replacing keys with topology-id, worker-id, port, mem-onheap"
+ [value worker-id topology-id port mem-onheap]
(let [replacement-map {"%ID%" (str port)
"%WORKER-ID%" (str worker-id)
"%TOPOLOGY-ID%" (str topology-id)
- "%WORKER-PORT%" (str port)}
+ "%WORKER-PORT%" (str port)
+ "%HEAP-MEM%" (str mem-onheap)}
sub-fn #(reduce (fn [string entry]
(apply clojure.string/replace string entry))
%
@@ -665,7 +671,7 @@
(defmethod launch-worker
- :distributed [supervisor storm-id port worker-id]
+ :distributed [supervisor storm-id port worker-id mem-onheap]
(let [conf (:conf supervisor)
run-worker-as-user (conf SUPERVISOR-RUN-WORKER-AS-USER)
storm-home (System/getProperty "storm.home")
@@ -689,15 +695,18 @@
(add-to-classpath [stormjar])
(add-to-classpath topo-classpath))
top-gc-opts (storm-conf TOPOLOGY-WORKER-GC-CHILDOPTS)
- gc-opts (substitute-childopts (if top-gc-opts top-gc-opts (conf WORKER-GC-CHILDOPTS)) worker-id storm-id port)
+ mem-onheap (if (and mem-onheap (> mem-onheap 0)) ;; not nil and not zero
+ (int (Math/ceil mem-onheap)) ;; round up
+ (storm-conf WORKER-HEAP-MEMORY-MB)) ;; otherwise use default value
+ gc-opts (substitute-childopts (if top-gc-opts top-gc-opts (conf WORKER-GC-CHILDOPTS)) worker-id storm-id port mem-onheap)
topo-worker-logwriter-childopts (storm-conf TOPOLOGY-WORKER-LOGWRITER-CHILDOPTS)
user (storm-conf TOPOLOGY-SUBMITTER-USER)
logging-sensitivity (storm-conf TOPOLOGY-LOGGING-SENSITIVITY "S3")
logfilename (logs-filename storm-id port)
worker-childopts (when-let [s (conf WORKER-CHILDOPTS)]
- (substitute-childopts s worker-id storm-id port))
+ (substitute-childopts s worker-id storm-id port mem-onheap))
topo-worker-childopts (when-let [s (storm-conf TOPOLOGY-WORKER-CHILDOPTS)]
- (substitute-childopts s worker-id storm-id port))
+ (substitute-childopts s worker-id storm-id port mem-onheap))
topology-worker-environment (if-let [env (storm-conf TOPOLOGY-ENVIRONMENT)]
(merge env {"LD_LIBRARY_PATH" jlp})
{"LD_LIBRARY_PATH" jlp})
@@ -786,7 +795,7 @@
(defmethod mk-code-distributor :local [conf] nil)
(defmethod launch-worker
- :local [supervisor storm-id port worker-id]
+ :local [supervisor storm-id port worker-id mem-onheap]
(let [conf (:conf supervisor)
pid (uuid)
worker (worker/mk-worker conf
http://git-wip-us.apache.org/repos/asf/storm/blob/a77d0581/storm-core/src/clj/backtype/storm/local_state.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/local_state.clj b/storm-core/src/clj/backtype/storm/local_state.clj
index 745d3b0..a8f3334 100644
--- a/storm-core/src/clj/backtype/storm/local_state.clj
+++ b/storm-core/src/clj/backtype/storm/local_state.clj
@@ -69,19 +69,16 @@
(.set_cpu (last resources)))))
assignment))
-(defn mk-local-assignment-with-resources
+(defn mk-local-assignment
[storm-id executors resources]
{:storm-id storm-id :executors executors :resources resources})
-(defn mk-local-assignment
- [storm-id executors]
- {:storm-id storm-id :executors executors})
-
(defn ->local-assignment
[^LocalAssignment thrift-local-assignment]
(mk-local-assignment
(.get_topology_id thrift-local-assignment)
- (->executor-list (.get_executors thrift-local-assignment))))
+ (->executor-list (.get_executors thrift-local-assignment))
+ (.get_resources thrift-local-assignment)))
(defn ls-local-assignments!
[^LocalState local-state assignments]
http://git-wip-us.apache.org/repos/asf/storm/blob/a77d0581/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
index e1a928c..ca43195 100644
--- a/storm-core/src/clj/backtype/storm/testing.clj
+++ b/storm-core/src/clj/backtype/storm/testing.clj
@@ -316,7 +316,7 @@
(submit-local-topology nimbus storm-name conf topology)))
(defn mk-capture-launch-fn [capture-atom]
- (fn [supervisor storm-id port worker-id]
+ (fn [supervisor storm-id port worker-id mem-onheap]
(let [supervisor-id (:supervisor-id supervisor)
conf (:conf supervisor)
existing (get @capture-atom [supervisor-id port] [])]
http://git-wip-us.apache.org/repos/asf/storm/blob/a77d0581/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
index a521b10..59dcc53 100644
--- a/storm-core/src/jvm/backtype/storm/Config.java
+++ b/storm-core/src/jvm/backtype/storm/Config.java
@@ -1032,17 +1032,25 @@ public class Config extends HashMap<String, Object> {
public static final String SUPERVISOR_CPU_CAPACITY = "supervisor.cpu.capacity";
/**
- * The jvm opts provided to workers launched by this supervisor. All "%ID%", "%WORKER-ID%", "%TOPOLOGY-ID%"
- * and "%WORKER-PORT%" substrings are replaced with:
+ * The jvm opts provided to workers launched by this supervisor.
+ * All "%ID%", "%WORKER-ID%", "%TOPOLOGY-ID%",
+ * "%WORKER-PORT%" and "%HEAP-MEM%" substrings are replaced with:
* %ID% -> port (for backward compatibility),
* %WORKER-ID% -> worker-id,
* %TOPOLOGY-ID% -> topology-id,
* %WORKER-PORT% -> port.
+ * %HEAP-MEM% -> mem-onheap.
*/
@isStringOrStringList
public static final String WORKER_CHILDOPTS = "worker.childopts";
/**
+ * The default heap memory size in MB per worker, used in the jvm -Xmx opts for launching the worker
+ */
+ public static final String WORKER_HEAP_MEMORY_MB = "worker.heap.memory.mb";
+ public static final Object WORKER_HEAP_MEMORY_MB_SCHEMA = ConfigValidation.PositiveIntegerValidator;
+
+ /**
* The jvm opts provided to workers launched by this supervisor for GC. All "%ID%" substrings are replaced
* with an identifier for this worker. Because the JVM complains about multiple GC opts the topology
* can override this default value by setting topology.worker.gc.childopts.
http://git-wip-us.apache.org/repos/asf/storm/blob/a77d0581/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 e0ff680..0000000
--- 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.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-8-5")
-public class AccessControl implements org.apache.thrift.TBase<AccessControl, AccessControl._Fields>, java.io.Serializable, Cloneable, Comparable<AccessControl> {
- 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
-
- 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 _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 int __ACCESS_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.NAME};
- 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.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, AccessControlType.class)));
- tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.ACCESS, new org.apache.thrift.meta_data.FieldMetaData("access", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AccessControl.class, metaDataMap);
- }
-
- public AccessControl() {
- }
-
- public AccessControl(
- AccessControlType type,
- int access)
- {
- this();
- this.type = type;
- this.access = access;
- set_access_isSet(true);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public AccessControl(AccessControl other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_type()) {
- this.type = other.type;
- }
- if (other.is_set_name()) {
- this.name = other.name;
- }
- this.access = other.access;
- }
-
- public AccessControl deepCopy() {
- return new AccessControl(this);
- }
-
- @Override
- public void clear() {
- this.type = null;
- this.name = null;
- set_access_isSet(false);
- this.access = 0;
- }
-
- /**
- *
- * @see AccessControlType
- */
- public AccessControlType get_type() {
- return this.type;
- }
-
- /**
- *
- * @see AccessControlType
- */
- public void set_type(AccessControlType type) {
- this.type = type;
- }
-
- public void unset_type() {
- this.type = null;
- }
-
- /** Returns true if field type is set (has been assigned a value) and false otherwise */
- public boolean is_set_type() {
- return this.type != null;
- }
-
- public void set_type_isSet(boolean value) {
- if (!value) {
- this.type = null;
- }
- }
-
- public String get_name() {
- return this.name;
- }
-
- public void set_name(String name) {
- this.name = name;
- }
-
- public void unset_name() {
- this.name = null;
- }
-
- /** Returns true if field name is set (has been assigned a value) and false otherwise */
- public boolean is_set_name() {
- return this.name != null;
- }
-
- public void set_name_isSet(boolean value) {
- if (!value) {
- this.name = null;
- }
- }
-
- public int get_access() {
- return this.access;
- }
-
- public void set_access(int access) {
- this.access = access;
- set_access_isSet(true);
- }
-
- public void unset_access() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ACCESS_ISSET_ID);
- }
-
- /** Returns true if field access is set (has been assigned a value) and false otherwise */
- public boolean is_set_access() {
- return EncodingUtils.testBit(__isset_bitfield, __ACCESS_ISSET_ID);
- }
-
- public void set_access_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ACCESS_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TYPE:
- if (value == null) {
- unset_type();
- } else {
- set_type((AccessControlType)value);
- }
- break;
-
- case NAME:
- if (value == null) {
- unset_name();
- } else {
- set_name((String)value);
- }
- break;
-
- case ACCESS:
- if (value == null) {
- unset_access();
- } else {
- set_access((Integer)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TYPE:
- return get_type();
-
- case NAME:
- return get_name();
-
- case ACCESS:
- return Integer.valueOf(get_access());
-
- }
- 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 TYPE:
- return is_set_type();
- case NAME:
- return is_set_name();
- case ACCESS:
- return is_set_access();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof AccessControl)
- return this.equals((AccessControl)that);
- return false;
- }
-
- public boolean equals(AccessControl that) {
- if (that == null)
- return false;
-
- boolean this_present_type = true && this.is_set_type();
- boolean that_present_type = true && that.is_set_type();
- if (this_present_type || that_present_type) {
- if (!(this_present_type && that_present_type))
- return false;
- if (!this.type.equals(that.type))
- return false;
- }
-
- boolean this_present_name = true && this.is_set_name();
- boolean that_present_name = true && that.is_set_name();
- if (this_present_name || that_present_name) {
- if (!(this_present_name && that_present_name))
- return false;
- if (!this.name.equals(that.name))
- return false;
- }
-
- boolean this_present_access = true;
- boolean that_present_access = true;
- if (this_present_access || that_present_access) {
- if (!(this_present_access && that_present_access))
- return false;
- if (this.access != that.access)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_type = true && (is_set_type());
- list.add(present_type);
- if (present_type)
- list.add(type.getValue());
-
- boolean present_name = true && (is_set_name());
- list.add(present_name);
- if (present_name)
- list.add(name);
-
- boolean present_access = true;
- list.add(present_access);
- if (present_access)
- list.add(access);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(AccessControl other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_type()).compareTo(other.is_set_type());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_type()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_name()).compareTo(other.is_set_name());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_name()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_access()).compareTo(other.is_set_access());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_access()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.access, other.access);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("AccessControl(");
- boolean first = true;
-
- sb.append("type:");
- if (this.type == null) {
- sb.append("null");
- } else {
- sb.append(this.type);
- }
- first = false;
- if (is_set_name()) {
- if (!first) sb.append(", ");
- sb.append("name:");
- if (this.name == null) {
- sb.append("null");
- } else {
- sb.append(this.name);
- }
- first = false;
- }
- if (!first) sb.append(", ");
- sb.append("access:");
- sb.append(this.access);
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_type()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' is unset! Struct:" + toString());
- }
-
- if (!is_set_access()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'access' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bitfield = 0;
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class AccessControlStandardSchemeFactory implements SchemeFactory {
- public AccessControlStandardScheme getScheme() {
- return new AccessControlStandardScheme();
- }
- }
-
- private static class AccessControlStandardScheme extends StandardScheme<AccessControl> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, AccessControl struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // TYPE
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.type = backtype.storm.generated.AccessControlType.findByValue(iprot.readI32());
- struct.set_type_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // NAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.name = iprot.readString();
- struct.set_name_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // ACCESS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.access = iprot.readI32();
- struct.set_access_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, AccessControl struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.type != null) {
- oprot.writeFieldBegin(TYPE_FIELD_DESC);
- oprot.writeI32(struct.type.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.name != null) {
- if (struct.is_set_name()) {
- oprot.writeFieldBegin(NAME_FIELD_DESC);
- oprot.writeString(struct.name);
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldBegin(ACCESS_FIELD_DESC);
- oprot.writeI32(struct.access);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class AccessControlTupleSchemeFactory implements SchemeFactory {
- public AccessControlTupleScheme getScheme() {
- return new AccessControlTupleScheme();
- }
- }
-
- private static class AccessControlTupleScheme extends TupleScheme<AccessControl> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, AccessControl struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeI32(struct.type.getValue());
- oprot.writeI32(struct.access);
- BitSet optionals = new BitSet();
- if (struct.is_set_name()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_name()) {
- oprot.writeString(struct.name);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, AccessControl struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.type = backtype.storm.generated.AccessControlType.findByValue(iprot.readI32());
- struct.set_type_isSet(true);
- struct.access = iprot.readI32();
- struct.set_access_isSet(true);
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.name = iprot.readString();
- struct.set_name_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a77d0581/storm-core/src/jvm/backtype/storm/generated/HBAuthorizationException.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/HBAuthorizationException.java b/storm-core/src/jvm/backtype/storm/generated/HBAuthorizationException.java
deleted file mode 100644
index e4737ed..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/HBAuthorizationException.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.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-8-5")
-public class HBAuthorizationException extends TException implements org.apache.thrift.TBase<HBAuthorizationException, HBAuthorizationException._Fields>, java.io.Serializable, Cloneable, Comparable<HBAuthorizationException> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HBAuthorizationException");
-
- 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new HBAuthorizationExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new HBAuthorizationExceptionTupleSchemeFactory());
- }
-
- 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<String, _Fields> byName = new HashMap<String, _Fields>();
-
- 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.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.MSG, new org.apache.thrift.meta_data.FieldMetaData("msg", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HBAuthorizationException.class, metaDataMap);
- }
-
- public HBAuthorizationException() {
- }
-
- public HBAuthorizationException(
- String msg)
- {
- this();
- this.msg = msg;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public HBAuthorizationException(HBAuthorizationException other) {
- if (other.is_set_msg()) {
- this.msg = other.msg;
- }
- }
-
- public HBAuthorizationException deepCopy() {
- return new HBAuthorizationException(this);
- }
-
- @Override
- public void clear() {
- this.msg = null;
- }
-
- public String get_msg() {
- return this.msg;
- }
-
- public void set_msg(String msg) {
- this.msg = msg;
- }
-
- public void unset_msg() {
- this.msg = null;
- }
-
- /** Returns true if field msg is set (has been assigned a value) and false otherwise */
- public boolean is_set_msg() {
- return this.msg != null;
- }
-
- public void set_msg_isSet(boolean value) {
- if (!value) {
- this.msg = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case MSG:
- if (value == null) {
- unset_msg();
- } else {
- set_msg((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case MSG:
- return get_msg();
-
- }
- 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 MSG:
- return is_set_msg();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof HBAuthorizationException)
- return this.equals((HBAuthorizationException)that);
- return false;
- }
-
- public boolean equals(HBAuthorizationException that) {
- if (that == null)
- return false;
-
- boolean this_present_msg = true && this.is_set_msg();
- boolean that_present_msg = true && that.is_set_msg();
- if (this_present_msg || that_present_msg) {
- if (!(this_present_msg && that_present_msg))
- return false;
- if (!this.msg.equals(that.msg))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_msg = true && (is_set_msg());
- list.add(present_msg);
- if (present_msg)
- list.add(msg);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(HBAuthorizationException other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_msg()).compareTo(other.is_set_msg());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_msg()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, other.msg);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("HBAuthorizationException(");
- boolean first = true;
-
- sb.append("msg:");
- if (this.msg == null) {
- sb.append("null");
- } else {
- sb.append(this.msg);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_msg()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class HBAuthorizationExceptionStandardSchemeFactory implements SchemeFactory {
- public HBAuthorizationExceptionStandardScheme getScheme() {
- return new HBAuthorizationExceptionStandardScheme();
- }
- }
-
- private static class HBAuthorizationExceptionStandardScheme extends StandardScheme<HBAuthorizationException> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, HBAuthorizationException struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // MSG
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.msg = iprot.readString();
- struct.set_msg_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, HBAuthorizationException struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.msg != null) {
- oprot.writeFieldBegin(MSG_FIELD_DESC);
- oprot.writeString(struct.msg);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class HBAuthorizationExceptionTupleSchemeFactory implements SchemeFactory {
- public HBAuthorizationExceptionTupleScheme getScheme() {
- return new HBAuthorizationExceptionTupleScheme();
- }
- }
-
- private static class HBAuthorizationExceptionTupleScheme extends TupleScheme<HBAuthorizationException> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, HBAuthorizationException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.msg);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, HBAuthorizationException struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.msg = iprot.readString();
- struct.set_msg_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a77d0581/storm-core/src/jvm/backtype/storm/generated/HBExecutionException.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/HBExecutionException.java b/storm-core/src/jvm/backtype/storm/generated/HBExecutionException.java
deleted file mode 100644
index b803b44..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/HBExecutionException.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.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-8-5")
-public class HBExecutionException extends TException implements org.apache.thrift.TBase<HBExecutionException, HBExecutionException._Fields>, java.io.Serializable, Cloneable, Comparable<HBExecutionException> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HBExecutionException");
-
- 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new HBExecutionExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new HBExecutionExceptionTupleSchemeFactory());
- }
-
- 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<String, _Fields> byName = new HashMap<String, _Fields>();
-
- 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.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.MSG, new org.apache.thrift.meta_data.FieldMetaData("msg", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HBExecutionException.class, metaDataMap);
- }
-
- public HBExecutionException() {
- }
-
- public HBExecutionException(
- String msg)
- {
- this();
- this.msg = msg;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public HBExecutionException(HBExecutionException other) {
- if (other.is_set_msg()) {
- this.msg = other.msg;
- }
- }
-
- public HBExecutionException deepCopy() {
- return new HBExecutionException(this);
- }
-
- @Override
- public void clear() {
- this.msg = null;
- }
-
- public String get_msg() {
- return this.msg;
- }
-
- public void set_msg(String msg) {
- this.msg = msg;
- }
-
- public void unset_msg() {
- this.msg = null;
- }
-
- /** Returns true if field msg is set (has been assigned a value) and false otherwise */
- public boolean is_set_msg() {
- return this.msg != null;
- }
-
- public void set_msg_isSet(boolean value) {
- if (!value) {
- this.msg = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case MSG:
- if (value == null) {
- unset_msg();
- } else {
- set_msg((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case MSG:
- return get_msg();
-
- }
- 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 MSG:
- return is_set_msg();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof HBExecutionException)
- return this.equals((HBExecutionException)that);
- return false;
- }
-
- public boolean equals(HBExecutionException that) {
- if (that == null)
- return false;
-
- boolean this_present_msg = true && this.is_set_msg();
- boolean that_present_msg = true && that.is_set_msg();
- if (this_present_msg || that_present_msg) {
- if (!(this_present_msg && that_present_msg))
- return false;
- if (!this.msg.equals(that.msg))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_msg = true && (is_set_msg());
- list.add(present_msg);
- if (present_msg)
- list.add(msg);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(HBExecutionException other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_msg()).compareTo(other.is_set_msg());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_msg()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, other.msg);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("HBExecutionException(");
- boolean first = true;
-
- sb.append("msg:");
- if (this.msg == null) {
- sb.append("null");
- } else {
- sb.append(this.msg);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_msg()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class HBExecutionExceptionStandardSchemeFactory implements SchemeFactory {
- public HBExecutionExceptionStandardScheme getScheme() {
- return new HBExecutionExceptionStandardScheme();
- }
- }
-
- private static class HBExecutionExceptionStandardScheme extends StandardScheme<HBExecutionException> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, HBExecutionException struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // MSG
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.msg = iprot.readString();
- struct.set_msg_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, HBExecutionException struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.msg != null) {
- oprot.writeFieldBegin(MSG_FIELD_DESC);
- oprot.writeString(struct.msg);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class HBExecutionExceptionTupleSchemeFactory implements SchemeFactory {
- public HBExecutionExceptionTupleScheme getScheme() {
- return new HBExecutionExceptionTupleScheme();
- }
- }
-
- private static class HBExecutionExceptionTupleScheme extends TupleScheme<HBExecutionException> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, HBExecutionException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.msg);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, HBExecutionException struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.msg = iprot.readString();
- struct.set_msg_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a77d0581/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 8ac963c..0000000
--- 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.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-8-5")
-public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._Fields>, java.io.Serializable, Cloneable, Comparable<HBMessage> {
- 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String, _Fields> byName = new HashMap<String, _Fields>();
-
- 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 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 int __MESSAGE_ID_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.MESSAGE_ID};
- 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.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, HBServerMessageType.class)));
- tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HBMessageData.class)));
- tmpMap.put(_Fields.MESSAGE_ID, new org.apache.thrift.meta_data.FieldMetaData("message_id", 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(HBMessage.class, metaDataMap);
- }
-
- public HBMessage() {
- this.message_id = -1;
-
- }
-
- public HBMessage(
- HBServerMessageType type,
- HBMessageData data)
- {
- this();
- this.type = type;
- this.data = data;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public HBMessage(HBMessage other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_type()) {
- this.type = other.type;
- }
- if (other.is_set_data()) {
- this.data = new HBMessageData(other.data);
- }
- this.message_id = other.message_id;
- }
-
- public HBMessage deepCopy() {
- return new HBMessage(this);
- }
-
- @Override
- public void clear() {
- this.type = null;
- this.data = null;
- this.message_id = -1;
-
- }
-
- /**
- *
- * @see HBServerMessageType
- */
- public HBServerMessageType get_type() {
- return this.type;
- }
-
- /**
- *
- * @see HBServerMessageType
- */
- public void set_type(HBServerMessageType type) {
- this.type = type;
- }
-
- public void unset_type() {
- this.type = null;
- }
-
- /** Returns true if field type is set (has been assigned a value) and false otherwise */
- public boolean is_set_type() {
- return this.type != null;
- }
-
- public void set_type_isSet(boolean value) {
- if (!value) {
- this.type = null;
- }
- }
-
- public HBMessageData get_data() {
- return this.data;
- }
-
- public void set_data(HBMessageData data) {
- this.data = data;
- }
-
- public void unset_data() {
- this.data = null;
- }
-
- /** Returns true if field data is set (has been assigned a value) and false otherwise */
- public boolean is_set_data() {
- return this.data != null;
- }
-
- public void set_data_isSet(boolean value) {
- if (!value) {
- this.data = null;
- }
- }
-
- public int get_message_id() {
- return this.message_id;
- }
-
- public void set_message_id(int message_id) {
- this.message_id = message_id;
- set_message_id_isSet(true);
- }
-
- public void unset_message_id() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MESSAGE_ID_ISSET_ID);
- }
-
- /** Returns true if field message_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_message_id() {
- return EncodingUtils.testBit(__isset_bitfield, __MESSAGE_ID_ISSET_ID);
- }
-
- public void set_message_id_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MESSAGE_ID_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TYPE:
- if (value == null) {
- unset_type();
- } else {
- set_type((HBServerMessageType)value);
- }
- break;
-
- case DATA:
- if (value == null) {
- unset_data();
- } else {
- set_data((HBMessageData)value);
- }
- break;
-
- case MESSAGE_ID:
- if (value == null) {
- unset_message_id();
- } else {
- set_message_id((Integer)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TYPE:
- return get_type();
-
- case DATA:
- return get_data();
-
- case MESSAGE_ID:
- return Integer.valueOf(get_message_id());
-
- }
- 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 TYPE:
- return is_set_type();
- case DATA:
- return is_set_data();
- case MESSAGE_ID:
- return is_set_message_id();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof HBMessage)
- return this.equals((HBMessage)that);
- return false;
- }
-
- public boolean equals(HBMessage that) {
- if (that == null)
- return false;
-
- boolean this_present_type = true && this.is_set_type();
- boolean that_present_type = true && that.is_set_type();
- if (this_present_type || that_present_type) {
- if (!(this_present_type && that_present_type))
- return false;
- if (!this.type.equals(that.type))
- return false;
- }
-
- boolean this_present_data = true && this.is_set_data();
- boolean that_present_data = true && that.is_set_data();
- if (this_present_data || that_present_data) {
- if (!(this_present_data && that_present_data))
- return false;
- if (!this.data.equals(that.data))
- return false;
- }
-
- boolean this_present_message_id = true && this.is_set_message_id();
- boolean that_present_message_id = true && that.is_set_message_id();
- if (this_present_message_id || that_present_message_id) {
- if (!(this_present_message_id && that_present_message_id))
- return false;
- if (this.message_id != that.message_id)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_type = true && (is_set_type());
- list.add(present_type);
- if (present_type)
- list.add(type.getValue());
-
- boolean present_data = true && (is_set_data());
- list.add(present_data);
- if (present_data)
- list.add(data);
-
- boolean present_message_id = true && (is_set_message_id());
- list.add(present_message_id);
- if (present_message_id)
- list.add(message_id);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(HBMessage other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_type()).compareTo(other.is_set_type());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_type()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_data()).compareTo(other.is_set_data());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_data()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_message_id()).compareTo(other.is_set_message_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_message_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message_id, other.message_id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("HBMessage(");
- boolean first = true;
-
- sb.append("type:");
- if (this.type == null) {
- sb.append("null");
- } else {
- sb.append(this.type);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("data:");
- if (this.data == null) {
- sb.append("null");
- } else {
- sb.append(this.data);
- }
- first = false;
- if (is_set_message_id()) {
- if (!first) sb.append(", ");
- sb.append("message_id:");
- sb.append(this.message_id);
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bitfield = 0;
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class HBMessageStandardSchemeFactory implements SchemeFactory {
- public HBMessageStandardScheme getScheme() {
- return new HBMessageStandardScheme();
- }
- }
-
- private static class HBMessageStandardScheme extends StandardScheme<HBMessage> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, HBMessage struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // TYPE
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.type = backtype.storm.generated.HBServerMessageType.findByValue(iprot.readI32());
- struct.set_type_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // DATA
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.data = new HBMessageData();
- struct.data.read(iprot);
- struct.set_data_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // MESSAGE_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.message_id = iprot.readI32();
- struct.set_message_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, HBMessage struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.type != null) {
- oprot.writeFieldBegin(TYPE_FIELD_DESC);
- oprot.writeI32(struct.type.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.data != null) {
- oprot.writeFieldBegin(DATA_FIELD_DESC);
- struct.data.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_message_id()) {
- oprot.writeFieldBegin(MESSAGE_ID_FIELD_DESC);
- oprot.writeI32(struct.message_id);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class HBMessageTupleSchemeFactory implements SchemeFactory {
- public HBMessageTupleScheme getScheme() {
- return new HBMessageTupleScheme();
- }
- }
-
- private static class HBMessageTupleScheme extends TupleScheme<HBMessage> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, HBMessage struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_type()) {
- optionals.set(0);
- }
- if (struct.is_set_data()) {
- optionals.set(1);
- }
- if (struct.is_set_message_id()) {
- optionals.set(2);
- }
- oprot.writeBitSet(optionals, 3);
- if (struct.is_set_type()) {
- oprot.writeI32(struct.type.getValue());
- }
- if (struct.is_set_data()) {
- struct.data.write(oprot);
- }
- if (struct.is_set_message_id()) {
- oprot.writeI32(struct.message_id);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, HBMessage struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(3);
- if (incoming.get(0)) {
- struct.type = backtype.storm.generated.HBServerMessageType.findByValue(iprot.readI32());
- struct.set_type_isSet(true);
- }
- if (incoming.get(1)) {
- struct.data = new HBMessageData();
- struct.data.read(iprot);
- struct.set_data_isSet(true);
- }
- if (incoming.get(2)) {
- struct.message_id = iprot.readI32();
- struct.set_message_id_isSet(true);
- }
- }
- }
-
-}
-