You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2016/10/11 23:50:39 UTC
[01/59] [abbrv] [partial] storm git commit: Ported successfully.
Repository: storm
Updated Branches:
refs/heads/1.x-branch c069734c8 -> cdcfaefd9
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/WorkerSummary.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/WorkerSummary.java b/storm-core/src/jvm/backtype/storm/generated/WorkerSummary.java
deleted file mode 100644
index fff9373..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/WorkerSummary.java
+++ /dev/null
@@ -1,1880 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class WorkerSummary implements org.apache.thrift.TBase<WorkerSummary, WorkerSummary._Fields>, java.io.Serializable, Cloneable, Comparable<WorkerSummary> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkerSummary");
-
- private static final org.apache.thrift.protocol.TField SUPERVISOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisor_id", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)3);
- private static final org.apache.thrift.protocol.TField TOPOLOGY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_id", org.apache.thrift.protocol.TType.STRING, (short)4);
- private static final org.apache.thrift.protocol.TField TOPOLOGY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_name", org.apache.thrift.protocol.TType.STRING, (short)5);
- private static final org.apache.thrift.protocol.TField NUM_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_executors", org.apache.thrift.protocol.TType.I32, (short)6);
- private static final org.apache.thrift.protocol.TField COMPONENT_TO_NUM_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("component_to_num_tasks", org.apache.thrift.protocol.TType.MAP, (short)7);
- private static final org.apache.thrift.protocol.TField TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("time_secs", org.apache.thrift.protocol.TType.I32, (short)8);
- private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)9);
- private static final org.apache.thrift.protocol.TField REQUESTED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)521);
- private static final org.apache.thrift.protocol.TField REQUESTED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memoffheap", org.apache.thrift.protocol.TType.DOUBLE, (short)522);
- private static final org.apache.thrift.protocol.TField REQUESTED_CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_cpu", org.apache.thrift.protocol.TType.DOUBLE, (short)523);
- private static final org.apache.thrift.protocol.TField ASSIGNED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("assigned_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)524);
- private static final org.apache.thrift.protocol.TField ASSIGNED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("assigned_memoffheap", org.apache.thrift.protocol.TType.DOUBLE, (short)525);
- private static final org.apache.thrift.protocol.TField ASSIGNED_CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("assigned_cpu", org.apache.thrift.protocol.TType.DOUBLE, (short)526);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new WorkerSummaryStandardSchemeFactory());
- schemes.put(TupleScheme.class, new WorkerSummaryTupleSchemeFactory());
- }
-
- private String supervisor_id; // optional
- private String host; // optional
- private int port; // optional
- private String topology_id; // optional
- private String topology_name; // optional
- private int num_executors; // optional
- private Map<String,Long> component_to_num_tasks; // optional
- private int time_secs; // optional
- private int uptime_secs; // optional
- private double requested_memonheap; // optional
- private double requested_memoffheap; // optional
- private double requested_cpu; // optional
- private double assigned_memonheap; // optional
- private double assigned_memoffheap; // optional
- private double assigned_cpu; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SUPERVISOR_ID((short)1, "supervisor_id"),
- HOST((short)2, "host"),
- PORT((short)3, "port"),
- TOPOLOGY_ID((short)4, "topology_id"),
- TOPOLOGY_NAME((short)5, "topology_name"),
- NUM_EXECUTORS((short)6, "num_executors"),
- COMPONENT_TO_NUM_TASKS((short)7, "component_to_num_tasks"),
- TIME_SECS((short)8, "time_secs"),
- UPTIME_SECS((short)9, "uptime_secs"),
- REQUESTED_MEMONHEAP((short)521, "requested_memonheap"),
- REQUESTED_MEMOFFHEAP((short)522, "requested_memoffheap"),
- REQUESTED_CPU((short)523, "requested_cpu"),
- ASSIGNED_MEMONHEAP((short)524, "assigned_memonheap"),
- ASSIGNED_MEMOFFHEAP((short)525, "assigned_memoffheap"),
- ASSIGNED_CPU((short)526, "assigned_cpu");
-
- 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: // SUPERVISOR_ID
- return SUPERVISOR_ID;
- case 2: // HOST
- return HOST;
- case 3: // PORT
- return PORT;
- case 4: // TOPOLOGY_ID
- return TOPOLOGY_ID;
- case 5: // TOPOLOGY_NAME
- return TOPOLOGY_NAME;
- case 6: // NUM_EXECUTORS
- return NUM_EXECUTORS;
- case 7: // COMPONENT_TO_NUM_TASKS
- return COMPONENT_TO_NUM_TASKS;
- case 8: // TIME_SECS
- return TIME_SECS;
- case 9: // UPTIME_SECS
- return UPTIME_SECS;
- case 521: // REQUESTED_MEMONHEAP
- return REQUESTED_MEMONHEAP;
- case 522: // REQUESTED_MEMOFFHEAP
- return REQUESTED_MEMOFFHEAP;
- case 523: // REQUESTED_CPU
- return REQUESTED_CPU;
- case 524: // ASSIGNED_MEMONHEAP
- return ASSIGNED_MEMONHEAP;
- case 525: // ASSIGNED_MEMOFFHEAP
- return ASSIGNED_MEMOFFHEAP;
- case 526: // ASSIGNED_CPU
- return ASSIGNED_CPU;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return 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 __PORT_ISSET_ID = 0;
- private static final int __NUM_EXECUTORS_ISSET_ID = 1;
- private static final int __TIME_SECS_ISSET_ID = 2;
- private static final int __UPTIME_SECS_ISSET_ID = 3;
- private static final int __REQUESTED_MEMONHEAP_ISSET_ID = 4;
- private static final int __REQUESTED_MEMOFFHEAP_ISSET_ID = 5;
- private static final int __REQUESTED_CPU_ISSET_ID = 6;
- private static final int __ASSIGNED_MEMONHEAP_ISSET_ID = 7;
- private static final int __ASSIGNED_MEMOFFHEAP_ISSET_ID = 8;
- private static final int __ASSIGNED_CPU_ISSET_ID = 9;
- private short __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.SUPERVISOR_ID,_Fields.HOST,_Fields.PORT,_Fields.TOPOLOGY_ID,_Fields.TOPOLOGY_NAME,_Fields.NUM_EXECUTORS,_Fields.COMPONENT_TO_NUM_TASKS,_Fields.TIME_SECS,_Fields.UPTIME_SECS,_Fields.REQUESTED_MEMONHEAP,_Fields.REQUESTED_MEMOFFHEAP,_Fields.REQUESTED_CPU,_Fields.ASSIGNED_MEMONHEAP,_Fields.ASSIGNED_MEMOFFHEAP,_Fields.ASSIGNED_CPU};
- 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.SUPERVISOR_ID, new org.apache.thrift.meta_data.FieldMetaData("supervisor_id", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.TOPOLOGY_ID, new org.apache.thrift.meta_data.FieldMetaData("topology_id", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.TOPOLOGY_NAME, new org.apache.thrift.meta_data.FieldMetaData("topology_name", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.NUM_EXECUTORS, new org.apache.thrift.meta_data.FieldMetaData("num_executors", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.COMPONENT_TO_NUM_TASKS, new org.apache.thrift.meta_data.FieldMetaData("component_to_num_tasks", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
- tmpMap.put(_Fields.TIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("time_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.REQUESTED_MEMONHEAP, new org.apache.thrift.meta_data.FieldMetaData("requested_memonheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.REQUESTED_MEMOFFHEAP, new org.apache.thrift.meta_data.FieldMetaData("requested_memoffheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.REQUESTED_CPU, new org.apache.thrift.meta_data.FieldMetaData("requested_cpu", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.ASSIGNED_MEMONHEAP, new org.apache.thrift.meta_data.FieldMetaData("assigned_memonheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.ASSIGNED_MEMOFFHEAP, new org.apache.thrift.meta_data.FieldMetaData("assigned_memoffheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.ASSIGNED_CPU, new org.apache.thrift.meta_data.FieldMetaData("assigned_cpu", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WorkerSummary.class, metaDataMap);
- }
-
- public WorkerSummary() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public WorkerSummary(WorkerSummary other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_supervisor_id()) {
- this.supervisor_id = other.supervisor_id;
- }
- if (other.is_set_host()) {
- this.host = other.host;
- }
- this.port = other.port;
- if (other.is_set_topology_id()) {
- this.topology_id = other.topology_id;
- }
- if (other.is_set_topology_name()) {
- this.topology_name = other.topology_name;
- }
- this.num_executors = other.num_executors;
- if (other.is_set_component_to_num_tasks()) {
- Map<String,Long> __this__component_to_num_tasks = new HashMap<String,Long>(other.component_to_num_tasks);
- this.component_to_num_tasks = __this__component_to_num_tasks;
- }
- this.time_secs = other.time_secs;
- this.uptime_secs = other.uptime_secs;
- this.requested_memonheap = other.requested_memonheap;
- this.requested_memoffheap = other.requested_memoffheap;
- this.requested_cpu = other.requested_cpu;
- this.assigned_memonheap = other.assigned_memonheap;
- this.assigned_memoffheap = other.assigned_memoffheap;
- this.assigned_cpu = other.assigned_cpu;
- }
-
- public WorkerSummary deepCopy() {
- return new WorkerSummary(this);
- }
-
- @Override
- public void clear() {
- this.supervisor_id = null;
- this.host = null;
- set_port_isSet(false);
- this.port = 0;
- this.topology_id = null;
- this.topology_name = null;
- set_num_executors_isSet(false);
- this.num_executors = 0;
- this.component_to_num_tasks = null;
- set_time_secs_isSet(false);
- this.time_secs = 0;
- set_uptime_secs_isSet(false);
- this.uptime_secs = 0;
- set_requested_memonheap_isSet(false);
- this.requested_memonheap = 0.0;
- set_requested_memoffheap_isSet(false);
- this.requested_memoffheap = 0.0;
- set_requested_cpu_isSet(false);
- this.requested_cpu = 0.0;
- set_assigned_memonheap_isSet(false);
- this.assigned_memonheap = 0.0;
- set_assigned_memoffheap_isSet(false);
- this.assigned_memoffheap = 0.0;
- set_assigned_cpu_isSet(false);
- this.assigned_cpu = 0.0;
- }
-
- public String get_supervisor_id() {
- return this.supervisor_id;
- }
-
- public void set_supervisor_id(String supervisor_id) {
- this.supervisor_id = supervisor_id;
- }
-
- public void unset_supervisor_id() {
- this.supervisor_id = null;
- }
-
- /** Returns true if field supervisor_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_supervisor_id() {
- return this.supervisor_id != null;
- }
-
- public void set_supervisor_id_isSet(boolean value) {
- if (!value) {
- this.supervisor_id = null;
- }
- }
-
- public String get_host() {
- return this.host;
- }
-
- public void set_host(String host) {
- this.host = host;
- }
-
- public void unset_host() {
- this.host = null;
- }
-
- /** Returns true if field host is set (has been assigned a value) and false otherwise */
- public boolean is_set_host() {
- return this.host != null;
- }
-
- public void set_host_isSet(boolean value) {
- if (!value) {
- this.host = null;
- }
- }
-
- public int get_port() {
- return this.port;
- }
-
- public void set_port(int port) {
- this.port = port;
- set_port_isSet(true);
- }
-
- public void unset_port() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID);
- }
-
- /** Returns true if field port is set (has been assigned a value) and false otherwise */
- public boolean is_set_port() {
- return EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID);
- }
-
- public void set_port_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value);
- }
-
- public String get_topology_id() {
- return this.topology_id;
- }
-
- public void set_topology_id(String topology_id) {
- this.topology_id = topology_id;
- }
-
- public void unset_topology_id() {
- this.topology_id = null;
- }
-
- /** Returns true if field topology_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_topology_id() {
- return this.topology_id != null;
- }
-
- public void set_topology_id_isSet(boolean value) {
- if (!value) {
- this.topology_id = null;
- }
- }
-
- public String get_topology_name() {
- return this.topology_name;
- }
-
- public void set_topology_name(String topology_name) {
- this.topology_name = topology_name;
- }
-
- public void unset_topology_name() {
- this.topology_name = null;
- }
-
- /** Returns true if field topology_name is set (has been assigned a value) and false otherwise */
- public boolean is_set_topology_name() {
- return this.topology_name != null;
- }
-
- public void set_topology_name_isSet(boolean value) {
- if (!value) {
- this.topology_name = null;
- }
- }
-
- public int get_num_executors() {
- return this.num_executors;
- }
-
- public void set_num_executors(int num_executors) {
- this.num_executors = num_executors;
- set_num_executors_isSet(true);
- }
-
- public void unset_num_executors() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID);
- }
-
- /** Returns true if field num_executors is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_executors() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID);
- }
-
- public void set_num_executors_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID, value);
- }
-
- public int get_component_to_num_tasks_size() {
- return (this.component_to_num_tasks == null) ? 0 : this.component_to_num_tasks.size();
- }
-
- public void put_to_component_to_num_tasks(String key, long val) {
- if (this.component_to_num_tasks == null) {
- this.component_to_num_tasks = new HashMap<String,Long>();
- }
- this.component_to_num_tasks.put(key, val);
- }
-
- public Map<String,Long> get_component_to_num_tasks() {
- return this.component_to_num_tasks;
- }
-
- public void set_component_to_num_tasks(Map<String,Long> component_to_num_tasks) {
- this.component_to_num_tasks = component_to_num_tasks;
- }
-
- public void unset_component_to_num_tasks() {
- this.component_to_num_tasks = null;
- }
-
- /** Returns true if field component_to_num_tasks is set (has been assigned a value) and false otherwise */
- public boolean is_set_component_to_num_tasks() {
- return this.component_to_num_tasks != null;
- }
-
- public void set_component_to_num_tasks_isSet(boolean value) {
- if (!value) {
- this.component_to_num_tasks = null;
- }
- }
-
- public int get_time_secs() {
- return this.time_secs;
- }
-
- public void set_time_secs(int time_secs) {
- this.time_secs = time_secs;
- set_time_secs_isSet(true);
- }
-
- public void unset_time_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field time_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_time_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __TIME_SECS_ISSET_ID);
- }
-
- public void set_time_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIME_SECS_ISSET_ID, value);
- }
-
- public int get_uptime_secs() {
- return this.uptime_secs;
- }
-
- public void set_uptime_secs(int uptime_secs) {
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- }
-
- public void unset_uptime_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_uptime_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- public void set_uptime_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID, value);
- }
-
- public double get_requested_memonheap() {
- return this.requested_memonheap;
- }
-
- public void set_requested_memonheap(double requested_memonheap) {
- this.requested_memonheap = requested_memonheap;
- set_requested_memonheap_isSet(true);
- }
-
- public void unset_requested_memonheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTED_MEMONHEAP_ISSET_ID);
- }
-
- /** Returns true if field requested_memonheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_requested_memonheap() {
- return EncodingUtils.testBit(__isset_bitfield, __REQUESTED_MEMONHEAP_ISSET_ID);
- }
-
- public void set_requested_memonheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTED_MEMONHEAP_ISSET_ID, value);
- }
-
- public double get_requested_memoffheap() {
- return this.requested_memoffheap;
- }
-
- public void set_requested_memoffheap(double requested_memoffheap) {
- this.requested_memoffheap = requested_memoffheap;
- set_requested_memoffheap_isSet(true);
- }
-
- public void unset_requested_memoffheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTED_MEMOFFHEAP_ISSET_ID);
- }
-
- /** Returns true if field requested_memoffheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_requested_memoffheap() {
- return EncodingUtils.testBit(__isset_bitfield, __REQUESTED_MEMOFFHEAP_ISSET_ID);
- }
-
- public void set_requested_memoffheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTED_MEMOFFHEAP_ISSET_ID, value);
- }
-
- public double get_requested_cpu() {
- return this.requested_cpu;
- }
-
- public void set_requested_cpu(double requested_cpu) {
- this.requested_cpu = requested_cpu;
- set_requested_cpu_isSet(true);
- }
-
- public void unset_requested_cpu() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTED_CPU_ISSET_ID);
- }
-
- /** Returns true if field requested_cpu is set (has been assigned a value) and false otherwise */
- public boolean is_set_requested_cpu() {
- return EncodingUtils.testBit(__isset_bitfield, __REQUESTED_CPU_ISSET_ID);
- }
-
- public void set_requested_cpu_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTED_CPU_ISSET_ID, value);
- }
-
- public double get_assigned_memonheap() {
- return this.assigned_memonheap;
- }
-
- public void set_assigned_memonheap(double assigned_memonheap) {
- this.assigned_memonheap = assigned_memonheap;
- set_assigned_memonheap_isSet(true);
- }
-
- public void unset_assigned_memonheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ASSIGNED_MEMONHEAP_ISSET_ID);
- }
-
- /** Returns true if field assigned_memonheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_assigned_memonheap() {
- return EncodingUtils.testBit(__isset_bitfield, __ASSIGNED_MEMONHEAP_ISSET_ID);
- }
-
- public void set_assigned_memonheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ASSIGNED_MEMONHEAP_ISSET_ID, value);
- }
-
- public double get_assigned_memoffheap() {
- return this.assigned_memoffheap;
- }
-
- public void set_assigned_memoffheap(double assigned_memoffheap) {
- this.assigned_memoffheap = assigned_memoffheap;
- set_assigned_memoffheap_isSet(true);
- }
-
- public void unset_assigned_memoffheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ASSIGNED_MEMOFFHEAP_ISSET_ID);
- }
-
- /** Returns true if field assigned_memoffheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_assigned_memoffheap() {
- return EncodingUtils.testBit(__isset_bitfield, __ASSIGNED_MEMOFFHEAP_ISSET_ID);
- }
-
- public void set_assigned_memoffheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ASSIGNED_MEMOFFHEAP_ISSET_ID, value);
- }
-
- public double get_assigned_cpu() {
- return this.assigned_cpu;
- }
-
- public void set_assigned_cpu(double assigned_cpu) {
- this.assigned_cpu = assigned_cpu;
- set_assigned_cpu_isSet(true);
- }
-
- public void unset_assigned_cpu() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ASSIGNED_CPU_ISSET_ID);
- }
-
- /** Returns true if field assigned_cpu is set (has been assigned a value) and false otherwise */
- public boolean is_set_assigned_cpu() {
- return EncodingUtils.testBit(__isset_bitfield, __ASSIGNED_CPU_ISSET_ID);
- }
-
- public void set_assigned_cpu_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ASSIGNED_CPU_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SUPERVISOR_ID:
- if (value == null) {
- unset_supervisor_id();
- } else {
- set_supervisor_id((String)value);
- }
- break;
-
- case HOST:
- if (value == null) {
- unset_host();
- } else {
- set_host((String)value);
- }
- break;
-
- case PORT:
- if (value == null) {
- unset_port();
- } else {
- set_port((Integer)value);
- }
- break;
-
- case TOPOLOGY_ID:
- if (value == null) {
- unset_topology_id();
- } else {
- set_topology_id((String)value);
- }
- break;
-
- case TOPOLOGY_NAME:
- if (value == null) {
- unset_topology_name();
- } else {
- set_topology_name((String)value);
- }
- break;
-
- case NUM_EXECUTORS:
- if (value == null) {
- unset_num_executors();
- } else {
- set_num_executors((Integer)value);
- }
- break;
-
- case COMPONENT_TO_NUM_TASKS:
- if (value == null) {
- unset_component_to_num_tasks();
- } else {
- set_component_to_num_tasks((Map<String,Long>)value);
- }
- break;
-
- case TIME_SECS:
- if (value == null) {
- unset_time_secs();
- } else {
- set_time_secs((Integer)value);
- }
- break;
-
- case UPTIME_SECS:
- if (value == null) {
- unset_uptime_secs();
- } else {
- set_uptime_secs((Integer)value);
- }
- break;
-
- case REQUESTED_MEMONHEAP:
- if (value == null) {
- unset_requested_memonheap();
- } else {
- set_requested_memonheap((Double)value);
- }
- break;
-
- case REQUESTED_MEMOFFHEAP:
- if (value == null) {
- unset_requested_memoffheap();
- } else {
- set_requested_memoffheap((Double)value);
- }
- break;
-
- case REQUESTED_CPU:
- if (value == null) {
- unset_requested_cpu();
- } else {
- set_requested_cpu((Double)value);
- }
- break;
-
- case ASSIGNED_MEMONHEAP:
- if (value == null) {
- unset_assigned_memonheap();
- } else {
- set_assigned_memonheap((Double)value);
- }
- break;
-
- case ASSIGNED_MEMOFFHEAP:
- if (value == null) {
- unset_assigned_memoffheap();
- } else {
- set_assigned_memoffheap((Double)value);
- }
- break;
-
- case ASSIGNED_CPU:
- if (value == null) {
- unset_assigned_cpu();
- } else {
- set_assigned_cpu((Double)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SUPERVISOR_ID:
- return get_supervisor_id();
-
- case HOST:
- return get_host();
-
- case PORT:
- return get_port();
-
- case TOPOLOGY_ID:
- return get_topology_id();
-
- case TOPOLOGY_NAME:
- return get_topology_name();
-
- case NUM_EXECUTORS:
- return get_num_executors();
-
- case COMPONENT_TO_NUM_TASKS:
- return get_component_to_num_tasks();
-
- case TIME_SECS:
- return get_time_secs();
-
- case UPTIME_SECS:
- return get_uptime_secs();
-
- case REQUESTED_MEMONHEAP:
- return get_requested_memonheap();
-
- case REQUESTED_MEMOFFHEAP:
- return get_requested_memoffheap();
-
- case REQUESTED_CPU:
- return get_requested_cpu();
-
- case ASSIGNED_MEMONHEAP:
- return get_assigned_memonheap();
-
- case ASSIGNED_MEMOFFHEAP:
- return get_assigned_memoffheap();
-
- case ASSIGNED_CPU:
- return get_assigned_cpu();
-
- }
- 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 SUPERVISOR_ID:
- return is_set_supervisor_id();
- case HOST:
- return is_set_host();
- case PORT:
- return is_set_port();
- case TOPOLOGY_ID:
- return is_set_topology_id();
- case TOPOLOGY_NAME:
- return is_set_topology_name();
- case NUM_EXECUTORS:
- return is_set_num_executors();
- case COMPONENT_TO_NUM_TASKS:
- return is_set_component_to_num_tasks();
- case TIME_SECS:
- return is_set_time_secs();
- case UPTIME_SECS:
- return is_set_uptime_secs();
- case REQUESTED_MEMONHEAP:
- return is_set_requested_memonheap();
- case REQUESTED_MEMOFFHEAP:
- return is_set_requested_memoffheap();
- case REQUESTED_CPU:
- return is_set_requested_cpu();
- case ASSIGNED_MEMONHEAP:
- return is_set_assigned_memonheap();
- case ASSIGNED_MEMOFFHEAP:
- return is_set_assigned_memoffheap();
- case ASSIGNED_CPU:
- return is_set_assigned_cpu();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof WorkerSummary)
- return this.equals((WorkerSummary)that);
- return false;
- }
-
- public boolean equals(WorkerSummary that) {
- if (that == null)
- return false;
-
- boolean this_present_supervisor_id = true && this.is_set_supervisor_id();
- boolean that_present_supervisor_id = true && that.is_set_supervisor_id();
- if (this_present_supervisor_id || that_present_supervisor_id) {
- if (!(this_present_supervisor_id && that_present_supervisor_id))
- return false;
- if (!this.supervisor_id.equals(that.supervisor_id))
- return false;
- }
-
- boolean this_present_host = true && this.is_set_host();
- boolean that_present_host = true && that.is_set_host();
- if (this_present_host || that_present_host) {
- if (!(this_present_host && that_present_host))
- return false;
- if (!this.host.equals(that.host))
- return false;
- }
-
- boolean this_present_port = true && this.is_set_port();
- boolean that_present_port = true && that.is_set_port();
- if (this_present_port || that_present_port) {
- if (!(this_present_port && that_present_port))
- return false;
- if (this.port != that.port)
- return false;
- }
-
- boolean this_present_topology_id = true && this.is_set_topology_id();
- boolean that_present_topology_id = true && that.is_set_topology_id();
- if (this_present_topology_id || that_present_topology_id) {
- if (!(this_present_topology_id && that_present_topology_id))
- return false;
- if (!this.topology_id.equals(that.topology_id))
- return false;
- }
-
- boolean this_present_topology_name = true && this.is_set_topology_name();
- boolean that_present_topology_name = true && that.is_set_topology_name();
- if (this_present_topology_name || that_present_topology_name) {
- if (!(this_present_topology_name && that_present_topology_name))
- return false;
- if (!this.topology_name.equals(that.topology_name))
- return false;
- }
-
- boolean this_present_num_executors = true && this.is_set_num_executors();
- boolean that_present_num_executors = true && that.is_set_num_executors();
- if (this_present_num_executors || that_present_num_executors) {
- if (!(this_present_num_executors && that_present_num_executors))
- return false;
- if (this.num_executors != that.num_executors)
- return false;
- }
-
- boolean this_present_component_to_num_tasks = true && this.is_set_component_to_num_tasks();
- boolean that_present_component_to_num_tasks = true && that.is_set_component_to_num_tasks();
- if (this_present_component_to_num_tasks || that_present_component_to_num_tasks) {
- if (!(this_present_component_to_num_tasks && that_present_component_to_num_tasks))
- return false;
- if (!this.component_to_num_tasks.equals(that.component_to_num_tasks))
- return false;
- }
-
- boolean this_present_time_secs = true && this.is_set_time_secs();
- boolean that_present_time_secs = true && that.is_set_time_secs();
- if (this_present_time_secs || that_present_time_secs) {
- if (!(this_present_time_secs && that_present_time_secs))
- return false;
- if (this.time_secs != that.time_secs)
- return false;
- }
-
- boolean this_present_uptime_secs = true && this.is_set_uptime_secs();
- boolean that_present_uptime_secs = true && that.is_set_uptime_secs();
- if (this_present_uptime_secs || that_present_uptime_secs) {
- if (!(this_present_uptime_secs && that_present_uptime_secs))
- return false;
- if (this.uptime_secs != that.uptime_secs)
- return false;
- }
-
- boolean this_present_requested_memonheap = true && this.is_set_requested_memonheap();
- boolean that_present_requested_memonheap = true && that.is_set_requested_memonheap();
- if (this_present_requested_memonheap || that_present_requested_memonheap) {
- if (!(this_present_requested_memonheap && that_present_requested_memonheap))
- return false;
- if (this.requested_memonheap != that.requested_memonheap)
- return false;
- }
-
- boolean this_present_requested_memoffheap = true && this.is_set_requested_memoffheap();
- boolean that_present_requested_memoffheap = true && that.is_set_requested_memoffheap();
- if (this_present_requested_memoffheap || that_present_requested_memoffheap) {
- if (!(this_present_requested_memoffheap && that_present_requested_memoffheap))
- return false;
- if (this.requested_memoffheap != that.requested_memoffheap)
- return false;
- }
-
- boolean this_present_requested_cpu = true && this.is_set_requested_cpu();
- boolean that_present_requested_cpu = true && that.is_set_requested_cpu();
- if (this_present_requested_cpu || that_present_requested_cpu) {
- if (!(this_present_requested_cpu && that_present_requested_cpu))
- return false;
- if (this.requested_cpu != that.requested_cpu)
- return false;
- }
-
- boolean this_present_assigned_memonheap = true && this.is_set_assigned_memonheap();
- boolean that_present_assigned_memonheap = true && that.is_set_assigned_memonheap();
- if (this_present_assigned_memonheap || that_present_assigned_memonheap) {
- if (!(this_present_assigned_memonheap && that_present_assigned_memonheap))
- return false;
- if (this.assigned_memonheap != that.assigned_memonheap)
- return false;
- }
-
- boolean this_present_assigned_memoffheap = true && this.is_set_assigned_memoffheap();
- boolean that_present_assigned_memoffheap = true && that.is_set_assigned_memoffheap();
- if (this_present_assigned_memoffheap || that_present_assigned_memoffheap) {
- if (!(this_present_assigned_memoffheap && that_present_assigned_memoffheap))
- return false;
- if (this.assigned_memoffheap != that.assigned_memoffheap)
- return false;
- }
-
- boolean this_present_assigned_cpu = true && this.is_set_assigned_cpu();
- boolean that_present_assigned_cpu = true && that.is_set_assigned_cpu();
- if (this_present_assigned_cpu || that_present_assigned_cpu) {
- if (!(this_present_assigned_cpu && that_present_assigned_cpu))
- return false;
- if (this.assigned_cpu != that.assigned_cpu)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_supervisor_id = true && (is_set_supervisor_id());
- list.add(present_supervisor_id);
- if (present_supervisor_id)
- list.add(supervisor_id);
-
- boolean present_host = true && (is_set_host());
- list.add(present_host);
- if (present_host)
- list.add(host);
-
- boolean present_port = true && (is_set_port());
- list.add(present_port);
- if (present_port)
- list.add(port);
-
- boolean present_topology_id = true && (is_set_topology_id());
- list.add(present_topology_id);
- if (present_topology_id)
- list.add(topology_id);
-
- boolean present_topology_name = true && (is_set_topology_name());
- list.add(present_topology_name);
- if (present_topology_name)
- list.add(topology_name);
-
- boolean present_num_executors = true && (is_set_num_executors());
- list.add(present_num_executors);
- if (present_num_executors)
- list.add(num_executors);
-
- boolean present_component_to_num_tasks = true && (is_set_component_to_num_tasks());
- list.add(present_component_to_num_tasks);
- if (present_component_to_num_tasks)
- list.add(component_to_num_tasks);
-
- boolean present_time_secs = true && (is_set_time_secs());
- list.add(present_time_secs);
- if (present_time_secs)
- list.add(time_secs);
-
- boolean present_uptime_secs = true && (is_set_uptime_secs());
- list.add(present_uptime_secs);
- if (present_uptime_secs)
- list.add(uptime_secs);
-
- boolean present_requested_memonheap = true && (is_set_requested_memonheap());
- list.add(present_requested_memonheap);
- if (present_requested_memonheap)
- list.add(requested_memonheap);
-
- boolean present_requested_memoffheap = true && (is_set_requested_memoffheap());
- list.add(present_requested_memoffheap);
- if (present_requested_memoffheap)
- list.add(requested_memoffheap);
-
- boolean present_requested_cpu = true && (is_set_requested_cpu());
- list.add(present_requested_cpu);
- if (present_requested_cpu)
- list.add(requested_cpu);
-
- boolean present_assigned_memonheap = true && (is_set_assigned_memonheap());
- list.add(present_assigned_memonheap);
- if (present_assigned_memonheap)
- list.add(assigned_memonheap);
-
- boolean present_assigned_memoffheap = true && (is_set_assigned_memoffheap());
- list.add(present_assigned_memoffheap);
- if (present_assigned_memoffheap)
- list.add(assigned_memoffheap);
-
- boolean present_assigned_cpu = true && (is_set_assigned_cpu());
- list.add(present_assigned_cpu);
- if (present_assigned_cpu)
- list.add(assigned_cpu);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(WorkerSummary other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_supervisor_id()).compareTo(other.is_set_supervisor_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_supervisor_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supervisor_id, other.supervisor_id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_host()).compareTo(other.is_set_host());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_host()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, other.host);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_port()).compareTo(other.is_set_port());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_port()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_topology_id()).compareTo(other.is_set_topology_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topology_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology_id, other.topology_id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_topology_name()).compareTo(other.is_set_topology_name());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topology_name()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology_name, other.topology_name);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_executors()).compareTo(other.is_set_num_executors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_executors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_executors, other.num_executors);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_component_to_num_tasks()).compareTo(other.is_set_component_to_num_tasks());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_component_to_num_tasks()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.component_to_num_tasks, other.component_to_num_tasks);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_time_secs()).compareTo(other.is_set_time_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_time_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.time_secs, other.time_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(other.is_set_uptime_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_uptime_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, other.uptime_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_requested_memonheap()).compareTo(other.is_set_requested_memonheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_requested_memonheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requested_memonheap, other.requested_memonheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_requested_memoffheap()).compareTo(other.is_set_requested_memoffheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_requested_memoffheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requested_memoffheap, other.requested_memoffheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_requested_cpu()).compareTo(other.is_set_requested_cpu());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_requested_cpu()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requested_cpu, other.requested_cpu);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assigned_memonheap()).compareTo(other.is_set_assigned_memonheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assigned_memonheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assigned_memonheap, other.assigned_memonheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assigned_memoffheap()).compareTo(other.is_set_assigned_memoffheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assigned_memoffheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assigned_memoffheap, other.assigned_memoffheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assigned_cpu()).compareTo(other.is_set_assigned_cpu());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assigned_cpu()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assigned_cpu, other.assigned_cpu);
- 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("WorkerSummary(");
- boolean first = true;
-
- if (is_set_supervisor_id()) {
- sb.append("supervisor_id:");
- if (this.supervisor_id == null) {
- sb.append("null");
- } else {
- sb.append(this.supervisor_id);
- }
- first = false;
- }
- if (is_set_host()) {
- if (!first) sb.append(", ");
- sb.append("host:");
- if (this.host == null) {
- sb.append("null");
- } else {
- sb.append(this.host);
- }
- first = false;
- }
- if (is_set_port()) {
- if (!first) sb.append(", ");
- sb.append("port:");
- sb.append(this.port);
- first = false;
- }
- if (is_set_topology_id()) {
- if (!first) sb.append(", ");
- sb.append("topology_id:");
- if (this.topology_id == null) {
- sb.append("null");
- } else {
- sb.append(this.topology_id);
- }
- first = false;
- }
- if (is_set_topology_name()) {
- if (!first) sb.append(", ");
- sb.append("topology_name:");
- if (this.topology_name == null) {
- sb.append("null");
- } else {
- sb.append(this.topology_name);
- }
- first = false;
- }
- if (is_set_num_executors()) {
- if (!first) sb.append(", ");
- sb.append("num_executors:");
- sb.append(this.num_executors);
- first = false;
- }
- if (is_set_component_to_num_tasks()) {
- if (!first) sb.append(", ");
- sb.append("component_to_num_tasks:");
- if (this.component_to_num_tasks == null) {
- sb.append("null");
- } else {
- sb.append(this.component_to_num_tasks);
- }
- first = false;
- }
- if (is_set_time_secs()) {
- if (!first) sb.append(", ");
- sb.append("time_secs:");
- sb.append(this.time_secs);
- first = false;
- }
- if (is_set_uptime_secs()) {
- if (!first) sb.append(", ");
- sb.append("uptime_secs:");
- sb.append(this.uptime_secs);
- first = false;
- }
- if (is_set_requested_memonheap()) {
- if (!first) sb.append(", ");
- sb.append("requested_memonheap:");
- sb.append(this.requested_memonheap);
- first = false;
- }
- if (is_set_requested_memoffheap()) {
- if (!first) sb.append(", ");
- sb.append("requested_memoffheap:");
- sb.append(this.requested_memoffheap);
- first = false;
- }
- if (is_set_requested_cpu()) {
- if (!first) sb.append(", ");
- sb.append("requested_cpu:");
- sb.append(this.requested_cpu);
- first = false;
- }
- if (is_set_assigned_memonheap()) {
- if (!first) sb.append(", ");
- sb.append("assigned_memonheap:");
- sb.append(this.assigned_memonheap);
- first = false;
- }
- if (is_set_assigned_memoffheap()) {
- if (!first) sb.append(", ");
- sb.append("assigned_memoffheap:");
- sb.append(this.assigned_memoffheap);
- first = false;
- }
- if (is_set_assigned_cpu()) {
- if (!first) sb.append(", ");
- sb.append("assigned_cpu:");
- sb.append(this.assigned_cpu);
- 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 WorkerSummaryStandardSchemeFactory implements SchemeFactory {
- public WorkerSummaryStandardScheme getScheme() {
- return new WorkerSummaryStandardScheme();
- }
- }
-
- private static class WorkerSummaryStandardScheme extends StandardScheme<WorkerSummary> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, WorkerSummary 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: // SUPERVISOR_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.supervisor_id = iprot.readString();
- struct.set_supervisor_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // HOST
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.host = iprot.readString();
- struct.set_host_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // PORT
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.port = iprot.readI32();
- struct.set_port_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // TOPOLOGY_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.topology_id = iprot.readString();
- struct.set_topology_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // TOPOLOGY_NAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.topology_name = iprot.readString();
- struct.set_topology_name_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // NUM_EXECUTORS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_executors = iprot.readI32();
- struct.set_num_executors_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // COMPONENT_TO_NUM_TASKS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map428 = iprot.readMapBegin();
- struct.component_to_num_tasks = new HashMap<String,Long>(2*_map428.size);
- String _key429;
- long _val430;
- for (int _i431 = 0; _i431 < _map428.size; ++_i431)
- {
- _key429 = iprot.readString();
- _val430 = iprot.readI64();
- struct.component_to_num_tasks.put(_key429, _val430);
- }
- iprot.readMapEnd();
- }
- struct.set_component_to_num_tasks_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 8: // TIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.time_secs = iprot.readI32();
- struct.set_time_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 9: // UPTIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 521: // REQUESTED_MEMONHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.requested_memonheap = iprot.readDouble();
- struct.set_requested_memonheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 522: // REQUESTED_MEMOFFHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.requested_memoffheap = iprot.readDouble();
- struct.set_requested_memoffheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 523: // REQUESTED_CPU
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.requested_cpu = iprot.readDouble();
- struct.set_requested_cpu_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 524: // ASSIGNED_MEMONHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.assigned_memonheap = iprot.readDouble();
- struct.set_assigned_memonheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 525: // ASSIGNED_MEMOFFHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.assigned_memoffheap = iprot.readDouble();
- struct.set_assigned_memoffheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 526: // ASSIGNED_CPU
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.assigned_cpu = iprot.readDouble();
- struct.set_assigned_cpu_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, WorkerSummary struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.supervisor_id != null) {
- if (struct.is_set_supervisor_id()) {
- oprot.writeFieldBegin(SUPERVISOR_ID_FIELD_DESC);
- oprot.writeString(struct.supervisor_id);
- oprot.writeFieldEnd();
- }
- }
- if (struct.host != null) {
- if (struct.is_set_host()) {
- oprot.writeFieldBegin(HOST_FIELD_DESC);
- oprot.writeString(struct.host);
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_port()) {
- oprot.writeFieldBegin(PORT_FIELD_DESC);
- oprot.writeI32(struct.port);
- oprot.writeFieldEnd();
- }
- if (struct.topology_id != null) {
- if (struct.is_set_topology_id()) {
- oprot.writeFieldBegin(TOPOLOGY_ID_FIELD_DESC);
- oprot.writeString(struct.topology_id);
- oprot.writeFieldEnd();
- }
- }
- if (struct.topology_name != null) {
- if (struct.is_set_topology_name()) {
- oprot.writeFieldBegin(TOPOLOGY_NAME_FIELD_DESC);
- oprot.writeString(struct.topology_name);
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_num_executors()) {
- oprot.writeFieldBegin(NUM_EXECUTORS_FIELD_DESC);
- oprot.writeI32(struct.num_executors);
- oprot.writeFieldEnd();
- }
- if (struct.component_to_num_tasks != null) {
- if (struct.is_set_component_to_num_tasks()) {
- oprot.writeFieldBegin(COMPONENT_TO_NUM_TASKS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, struct.component_to_num_tasks.size()));
- for (Map.Entry<String, Long> _iter432 : struct.component_to_num_tasks.entrySet())
- {
- oprot.writeString(_iter432.getKey());
- oprot.writeI64(_iter432.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_time_secs()) {
- oprot.writeFieldBegin(TIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.time_secs);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_uptime_secs()) {
- oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.uptime_secs);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_requested_memonheap()) {
- oprot.writeFieldBegin(REQUESTED_MEMONHEAP_FIELD_DESC);
- oprot.writeDouble(struct.requested_memonheap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_requested_memoffheap()) {
- oprot.writeFieldBegin(REQUESTED_MEMOFFHEAP_FIELD_DESC);
- oprot.writeDouble(struct.requested_memoffheap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_requested_cpu()) {
- oprot.writeFieldBegin(REQUESTED_CPU_FIELD_DESC);
- oprot.writeDouble(struct.requested_cpu);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_assigned_memonheap()) {
- oprot.writeFieldBegin(ASSIGNED_MEMONHEAP_FIELD_DESC);
- oprot.writeDouble(struct.assigned_memonheap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_assigned_memoffheap()) {
- oprot.writeFieldBegin(ASSIGNED_MEMOFFHEAP_FIELD_DESC);
- oprot.writeDouble(struct.assigned_memoffheap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_assigned_cpu()) {
- oprot.writeFieldBegin(ASSIGNED_CPU_FIELD_DESC);
- oprot.writeDouble(struct.assigned_cpu);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class WorkerSummaryTupleSchemeFactory implements SchemeFactory {
- public WorkerSummaryTupleScheme getScheme() {
- return new WorkerSummaryTupleScheme();
- }
- }
-
- private static class WorkerSummaryTupleScheme extends TupleScheme<WorkerSummary> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, WorkerSummary struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_supervisor_id()) {
- optionals.set(0);
- }
- if (struct.is_set_host()) {
- optionals.set(1);
- }
- if (struct.is_set_port()) {
- optionals.set(2);
- }
- if (struct.is_set_topology_id()) {
- optionals.set(3);
- }
- if (struct.is_set_topology_name()) {
- optionals.set(4);
- }
- if (struct.is_set_num_executors()) {
- optionals.set(5);
- }
- if (struct.is_set_component_to_num_tasks()) {
- optionals.set(6);
- }
- if (struct.is_set_time_secs()) {
- optionals.set(7);
- }
- if (struct.is_set_uptime_secs()) {
- optionals.set(8);
- }
- if (struct.is_set_requested_memonheap()) {
- optionals.set(9);
- }
- if (struct.is_set_requested_memoffheap()) {
- optionals.set(10);
- }
- if (struct.is_set_requested_cpu()) {
- optionals.set(11);
- }
- if (struct.is_set_assigned_memonheap()) {
- optionals.set(12);
- }
- if (struct.is_set_assigned_memoffheap()) {
- optionals.set(13);
- }
- if (struct.is_set_assigned_cpu()) {
- optionals.set(14);
- }
- oprot.writeBitSet(optionals, 15);
- if (struct.is_set_supervisor_id()) {
- oprot.writeString(struct.supervisor_id);
- }
- if (struct.is_set_host()) {
- oprot.writeString(struct.host);
- }
- if (struct.is_set_port()) {
- oprot.writeI32(struct.port);
- }
- if (struct.is_set_topology_id()) {
- oprot.writeString(struct.topology_id);
- }
- if (struct.is_set_topology_name()) {
- oprot.writeString(struct.topology_name);
- }
- if (struct.is_set_num_executors()) {
- oprot.writeI32(struct.num_executors);
- }
- if (struct.is_set_component_to_num_tasks()) {
- {
- oprot.writeI32(struct.component_to_num_tasks.size());
- for (Map.Entry<String, Long> _iter433 : struct.component_to_num_tasks.entrySet())
- {
- oprot.writeString(_iter433.getKey());
- oprot.writeI64(_iter433.getValue());
- }
- }
- }
- if (struct.is_set_time_secs()) {
- oprot.writeI32(struct.time_secs);
- }
- if (struct.is_set_uptime_secs()) {
- oprot.writeI32(struct.uptime_secs);
- }
- if (struct.is_set_requested_memonheap()) {
- oprot.writeDouble(struct.requested_memonheap);
- }
- if (struct.is_set_requested_memoffheap()) {
- oprot.writeDouble(struct.requested_memoffheap);
- }
- if (struct.is_set_requested_cpu()) {
- oprot.writeDouble(struct.requested_cpu);
- }
- if (struct.is_set_assigned_memonheap()) {
- oprot.writeDouble(struct.assigned_memonheap);
- }
- if (struct.is_set_assigned_memoffheap()) {
- oprot.writeDouble(struct.assigned_memoffheap);
- }
- if (struct.is_set_assigned_cpu()) {
- oprot.writeDouble(struct.assigned_cpu);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, WorkerSummary struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(15);
- if (incoming.get(0)) {
- struct.supervisor_id = iprot.readString();
- struct.set_supervisor_id_isSet(true);
- }
- if (incoming.get(1)) {
- struct.host = iprot.readString();
- struct.set_host_isSet(true);
- }
- if (incoming.get(2)) {
- struct.port = iprot.readI32();
- struct.set_port_isSet(true);
- }
- if (incoming.get(3)) {
- struct.topology_id = iprot.readString();
- struct.set_topology_id_isSet(true);
- }
- if (incoming.get(4)) {
- struct.topology_name = iprot.readString();
- struct.set_topology_name_isSet(true);
- }
- if (incoming.get(5)) {
- struct.num_executors = iprot.readI32();
- struct.set_num_executors_isSet(true);
- }
- if (incoming.get(6)) {
- {
- org.apache.thrift.protocol.TMap _map434 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- struct.component_to_num_tasks = new HashMap<String,Long>(2*_map434.size);
- String _key435;
- long _val436;
- for (int _i437 = 0; _i437 < _map434.size; ++_i437)
- {
- _key435 = iprot.readString();
- _val436 = iprot.readI64();
- struct.component_to_num_tasks.put(_key435, _val436);
- }
- }
- struct.set_component_to_num_tasks_isSet(true);
- }
- if (incoming.get(7)) {
- struct.time_secs = iprot.readI32();
- struct.set_time_secs_isSet(true);
- }
- if (incoming.get(8)) {
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- }
- if (incoming.get(9)) {
- struct.requested_memonheap = iprot.readDouble();
- struct.set_requested_memonheap_isSet(true);
- }
- if (incoming.get(10)) {
- struct.requested_memoffheap = iprot.readDouble();
- struct.set_requested_memoffheap_isSet(true);
- }
- if (incoming.get(11)) {
- struct.requested_cpu = iprot.readDouble();
- struct.set_requested_cpu_isSet(true);
- }
- if (incoming.get(12)) {
- struct.assigned_memonheap = iprot.readDouble();
- struct.set_assigned_memonheap_isSet(true);
- }
- if (incoming.get(13)) {
- struct.assigned_memoffheap = iprot.readDouble();
- struct.set_assigned_memoffheap_isSet(true);
- }
- if (incoming.get(14)) {
- struct.assigned_cpu = iprot.readDouble();
- struct.set_assigned_cpu_isSet(true);
- }
- }
- }
-
-}
-
[03/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologySummary.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologySummary.java b/storm-core/src/jvm/backtype/storm/generated/TopologySummary.java
deleted file mode 100644
index 8b7cd75..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/TopologySummary.java
+++ /dev/null
@@ -1,1901 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class TopologySummary implements org.apache.thrift.TBase<TopologySummary, TopologySummary._Fields>, java.io.Serializable, Cloneable, Comparable<TopologySummary> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologySummary");
-
- private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField NUM_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_tasks", org.apache.thrift.protocol.TType.I32, (short)3);
- private static final org.apache.thrift.protocol.TField NUM_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_executors", org.apache.thrift.protocol.TType.I32, (short)4);
- private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)5);
- private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)6);
- private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)7);
- private static final org.apache.thrift.protocol.TField SCHED_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("sched_status", org.apache.thrift.protocol.TType.STRING, (short)513);
- private static final org.apache.thrift.protocol.TField OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)514);
- private static final org.apache.thrift.protocol.TField REPLICATION_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("replication_count", org.apache.thrift.protocol.TType.I32, (short)515);
- private static final org.apache.thrift.protocol.TField REQUESTED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)521);
- private static final org.apache.thrift.protocol.TField REQUESTED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memoffheap", org.apache.thrift.protocol.TType.DOUBLE, (short)522);
- private static final org.apache.thrift.protocol.TField REQUESTED_CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_cpu", org.apache.thrift.protocol.TType.DOUBLE, (short)523);
- private static final org.apache.thrift.protocol.TField ASSIGNED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("assigned_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)524);
- private static final org.apache.thrift.protocol.TField ASSIGNED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("assigned_memoffheap", org.apache.thrift.protocol.TType.DOUBLE, (short)525);
- private static final org.apache.thrift.protocol.TField ASSIGNED_CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("assigned_cpu", org.apache.thrift.protocol.TType.DOUBLE, (short)526);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new TopologySummaryStandardSchemeFactory());
- schemes.put(TupleScheme.class, new TopologySummaryTupleSchemeFactory());
- }
-
- private String id; // required
- private String name; // required
- private int num_tasks; // required
- private int num_executors; // required
- private int num_workers; // required
- private int uptime_secs; // required
- private String status; // required
- private String sched_status; // optional
- private String owner; // optional
- private int replication_count; // optional
- private double requested_memonheap; // optional
- private double requested_memoffheap; // optional
- private double requested_cpu; // optional
- private double assigned_memonheap; // optional
- private double assigned_memoffheap; // optional
- private double assigned_cpu; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- ID((short)1, "id"),
- NAME((short)2, "name"),
- NUM_TASKS((short)3, "num_tasks"),
- NUM_EXECUTORS((short)4, "num_executors"),
- NUM_WORKERS((short)5, "num_workers"),
- UPTIME_SECS((short)6, "uptime_secs"),
- STATUS((short)7, "status"),
- SCHED_STATUS((short)513, "sched_status"),
- OWNER((short)514, "owner"),
- REPLICATION_COUNT((short)515, "replication_count"),
- REQUESTED_MEMONHEAP((short)521, "requested_memonheap"),
- REQUESTED_MEMOFFHEAP((short)522, "requested_memoffheap"),
- REQUESTED_CPU((short)523, "requested_cpu"),
- ASSIGNED_MEMONHEAP((short)524, "assigned_memonheap"),
- ASSIGNED_MEMOFFHEAP((short)525, "assigned_memoffheap"),
- ASSIGNED_CPU((short)526, "assigned_cpu");
-
- 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: // ID
- return ID;
- case 2: // NAME
- return NAME;
- case 3: // NUM_TASKS
- return NUM_TASKS;
- case 4: // NUM_EXECUTORS
- return NUM_EXECUTORS;
- case 5: // NUM_WORKERS
- return NUM_WORKERS;
- case 6: // UPTIME_SECS
- return UPTIME_SECS;
- case 7: // STATUS
- return STATUS;
- case 513: // SCHED_STATUS
- return SCHED_STATUS;
- case 514: // OWNER
- return OWNER;
- case 515: // REPLICATION_COUNT
- return REPLICATION_COUNT;
- case 521: // REQUESTED_MEMONHEAP
- return REQUESTED_MEMONHEAP;
- case 522: // REQUESTED_MEMOFFHEAP
- return REQUESTED_MEMOFFHEAP;
- case 523: // REQUESTED_CPU
- return REQUESTED_CPU;
- case 524: // ASSIGNED_MEMONHEAP
- return ASSIGNED_MEMONHEAP;
- case 525: // ASSIGNED_MEMOFFHEAP
- return ASSIGNED_MEMOFFHEAP;
- case 526: // ASSIGNED_CPU
- return ASSIGNED_CPU;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return 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 __NUM_TASKS_ISSET_ID = 0;
- 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 static final int __REPLICATION_COUNT_ISSET_ID = 4;
- private static final int __REQUESTED_MEMONHEAP_ISSET_ID = 5;
- private static final int __REQUESTED_MEMOFFHEAP_ISSET_ID = 6;
- private static final int __REQUESTED_CPU_ISSET_ID = 7;
- private static final int __ASSIGNED_MEMONHEAP_ISSET_ID = 8;
- private static final int __ASSIGNED_MEMOFFHEAP_ISSET_ID = 9;
- private static final int __ASSIGNED_CPU_ISSET_ID = 10;
- private short __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.SCHED_STATUS,_Fields.OWNER,_Fields.REPLICATION_COUNT,_Fields.REQUESTED_MEMONHEAP,_Fields.REQUESTED_MEMOFFHEAP,_Fields.REQUESTED_CPU,_Fields.ASSIGNED_MEMONHEAP,_Fields.ASSIGNED_MEMOFFHEAP,_Fields.ASSIGNED_CPU};
- 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.NUM_TASKS, new org.apache.thrift.meta_data.FieldMetaData("num_tasks", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.NUM_EXECUTORS, new org.apache.thrift.meta_data.FieldMetaData("num_executors", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.NUM_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("num_workers", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.SCHED_STATUS, new org.apache.thrift.meta_data.FieldMetaData("sched_status", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- 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)));
- tmpMap.put(_Fields.REQUESTED_MEMONHEAP, new org.apache.thrift.meta_data.FieldMetaData("requested_memonheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.REQUESTED_MEMOFFHEAP, new org.apache.thrift.meta_data.FieldMetaData("requested_memoffheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.REQUESTED_CPU, new org.apache.thrift.meta_data.FieldMetaData("requested_cpu", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.ASSIGNED_MEMONHEAP, new org.apache.thrift.meta_data.FieldMetaData("assigned_memonheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.ASSIGNED_MEMOFFHEAP, new org.apache.thrift.meta_data.FieldMetaData("assigned_memoffheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.ASSIGNED_CPU, new org.apache.thrift.meta_data.FieldMetaData("assigned_cpu", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologySummary.class, metaDataMap);
- }
-
- public TopologySummary() {
- }
-
- public TopologySummary(
- String id,
- String name,
- int num_tasks,
- int num_executors,
- int num_workers,
- int uptime_secs,
- String status)
- {
- this();
- this.id = id;
- this.name = name;
- this.num_tasks = num_tasks;
- set_num_tasks_isSet(true);
- this.num_executors = num_executors;
- set_num_executors_isSet(true);
- this.num_workers = num_workers;
- set_num_workers_isSet(true);
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- this.status = status;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public TopologySummary(TopologySummary other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_id()) {
- this.id = other.id;
- }
- if (other.is_set_name()) {
- this.name = other.name;
- }
- this.num_tasks = other.num_tasks;
- this.num_executors = other.num_executors;
- this.num_workers = other.num_workers;
- this.uptime_secs = other.uptime_secs;
- if (other.is_set_status()) {
- this.status = other.status;
- }
- if (other.is_set_sched_status()) {
- this.sched_status = other.sched_status;
- }
- if (other.is_set_owner()) {
- this.owner = other.owner;
- }
- this.replication_count = other.replication_count;
- this.requested_memonheap = other.requested_memonheap;
- this.requested_memoffheap = other.requested_memoffheap;
- this.requested_cpu = other.requested_cpu;
- this.assigned_memonheap = other.assigned_memonheap;
- this.assigned_memoffheap = other.assigned_memoffheap;
- this.assigned_cpu = other.assigned_cpu;
- }
-
- public TopologySummary deepCopy() {
- return new TopologySummary(this);
- }
-
- @Override
- public void clear() {
- this.id = null;
- this.name = null;
- set_num_tasks_isSet(false);
- this.num_tasks = 0;
- set_num_executors_isSet(false);
- this.num_executors = 0;
- set_num_workers_isSet(false);
- this.num_workers = 0;
- set_uptime_secs_isSet(false);
- this.uptime_secs = 0;
- this.status = null;
- this.sched_status = null;
- this.owner = null;
- set_replication_count_isSet(false);
- this.replication_count = 0;
- set_requested_memonheap_isSet(false);
- this.requested_memonheap = 0.0;
- set_requested_memoffheap_isSet(false);
- this.requested_memoffheap = 0.0;
- set_requested_cpu_isSet(false);
- this.requested_cpu = 0.0;
- set_assigned_memonheap_isSet(false);
- this.assigned_memonheap = 0.0;
- set_assigned_memoffheap_isSet(false);
- this.assigned_memoffheap = 0.0;
- set_assigned_cpu_isSet(false);
- this.assigned_cpu = 0.0;
- }
-
- public String get_id() {
- return this.id;
- }
-
- public void set_id(String id) {
- this.id = id;
- }
-
- public void unset_id() {
- this.id = null;
- }
-
- /** Returns true if field id is set (has been assigned a value) and false otherwise */
- public boolean is_set_id() {
- return this.id != null;
- }
-
- public void set_id_isSet(boolean value) {
- if (!value) {
- this.id = 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_num_tasks() {
- return this.num_tasks;
- }
-
- public void set_num_tasks(int num_tasks) {
- this.num_tasks = num_tasks;
- set_num_tasks_isSet(true);
- }
-
- public void unset_num_tasks() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_TASKS_ISSET_ID);
- }
-
- /** Returns true if field num_tasks is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_tasks() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_TASKS_ISSET_ID);
- }
-
- public void set_num_tasks_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_TASKS_ISSET_ID, value);
- }
-
- public int get_num_executors() {
- return this.num_executors;
- }
-
- public void set_num_executors(int num_executors) {
- this.num_executors = num_executors;
- set_num_executors_isSet(true);
- }
-
- public void unset_num_executors() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID);
- }
-
- /** Returns true if field num_executors is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_executors() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID);
- }
-
- public void set_num_executors_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID, value);
- }
-
- public int get_num_workers() {
- return this.num_workers;
- }
-
- public void set_num_workers(int num_workers) {
- this.num_workers = num_workers;
- set_num_workers_isSet(true);
- }
-
- public void unset_num_workers() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID);
- }
-
- /** Returns true if field num_workers is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_workers() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID);
- }
-
- public void set_num_workers_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID, value);
- }
-
- public int get_uptime_secs() {
- return this.uptime_secs;
- }
-
- public void set_uptime_secs(int uptime_secs) {
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- }
-
- public void unset_uptime_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_uptime_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- public void set_uptime_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID, value);
- }
-
- public String get_status() {
- return this.status;
- }
-
- public void set_status(String status) {
- this.status = status;
- }
-
- public void unset_status() {
- this.status = null;
- }
-
- /** Returns true if field status is set (has been assigned a value) and false otherwise */
- public boolean is_set_status() {
- return this.status != null;
- }
-
- public void set_status_isSet(boolean value) {
- if (!value) {
- this.status = null;
- }
- }
-
- public String get_sched_status() {
- return this.sched_status;
- }
-
- public void set_sched_status(String sched_status) {
- this.sched_status = sched_status;
- }
-
- public void unset_sched_status() {
- this.sched_status = null;
- }
-
- /** Returns true if field sched_status is set (has been assigned a value) and false otherwise */
- public boolean is_set_sched_status() {
- return this.sched_status != null;
- }
-
- public void set_sched_status_isSet(boolean value) {
- if (!value) {
- this.sched_status = null;
- }
- }
-
- public String get_owner() {
- return this.owner;
- }
-
- public void set_owner(String owner) {
- this.owner = owner;
- }
-
- public void unset_owner() {
- this.owner = null;
- }
-
- /** Returns true if field owner is set (has been assigned a value) and false otherwise */
- public boolean is_set_owner() {
- return this.owner != null;
- }
-
- public void set_owner_isSet(boolean value) {
- if (!value) {
- this.owner = null;
- }
- }
-
- 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_bitfield = EncodingUtils.clearBit(__isset_bitfield, __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 EncodingUtils.testBit(__isset_bitfield, __REPLICATION_COUNT_ISSET_ID);
- }
-
- public void set_replication_count_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REPLICATION_COUNT_ISSET_ID, value);
- }
-
- public double get_requested_memonheap() {
- return this.requested_memonheap;
- }
-
- public void set_requested_memonheap(double requested_memonheap) {
- this.requested_memonheap = requested_memonheap;
- set_requested_memonheap_isSet(true);
- }
-
- public void unset_requested_memonheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTED_MEMONHEAP_ISSET_ID);
- }
-
- /** Returns true if field requested_memonheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_requested_memonheap() {
- return EncodingUtils.testBit(__isset_bitfield, __REQUESTED_MEMONHEAP_ISSET_ID);
- }
-
- public void set_requested_memonheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTED_MEMONHEAP_ISSET_ID, value);
- }
-
- public double get_requested_memoffheap() {
- return this.requested_memoffheap;
- }
-
- public void set_requested_memoffheap(double requested_memoffheap) {
- this.requested_memoffheap = requested_memoffheap;
- set_requested_memoffheap_isSet(true);
- }
-
- public void unset_requested_memoffheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTED_MEMOFFHEAP_ISSET_ID);
- }
-
- /** Returns true if field requested_memoffheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_requested_memoffheap() {
- return EncodingUtils.testBit(__isset_bitfield, __REQUESTED_MEMOFFHEAP_ISSET_ID);
- }
-
- public void set_requested_memoffheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTED_MEMOFFHEAP_ISSET_ID, value);
- }
-
- public double get_requested_cpu() {
- return this.requested_cpu;
- }
-
- public void set_requested_cpu(double requested_cpu) {
- this.requested_cpu = requested_cpu;
- set_requested_cpu_isSet(true);
- }
-
- public void unset_requested_cpu() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTED_CPU_ISSET_ID);
- }
-
- /** Returns true if field requested_cpu is set (has been assigned a value) and false otherwise */
- public boolean is_set_requested_cpu() {
- return EncodingUtils.testBit(__isset_bitfield, __REQUESTED_CPU_ISSET_ID);
- }
-
- public void set_requested_cpu_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTED_CPU_ISSET_ID, value);
- }
-
- public double get_assigned_memonheap() {
- return this.assigned_memonheap;
- }
-
- public void set_assigned_memonheap(double assigned_memonheap) {
- this.assigned_memonheap = assigned_memonheap;
- set_assigned_memonheap_isSet(true);
- }
-
- public void unset_assigned_memonheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ASSIGNED_MEMONHEAP_ISSET_ID);
- }
-
- /** Returns true if field assigned_memonheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_assigned_memonheap() {
- return EncodingUtils.testBit(__isset_bitfield, __ASSIGNED_MEMONHEAP_ISSET_ID);
- }
-
- public void set_assigned_memonheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ASSIGNED_MEMONHEAP_ISSET_ID, value);
- }
-
- public double get_assigned_memoffheap() {
- return this.assigned_memoffheap;
- }
-
- public void set_assigned_memoffheap(double assigned_memoffheap) {
- this.assigned_memoffheap = assigned_memoffheap;
- set_assigned_memoffheap_isSet(true);
- }
-
- public void unset_assigned_memoffheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ASSIGNED_MEMOFFHEAP_ISSET_ID);
- }
-
- /** Returns true if field assigned_memoffheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_assigned_memoffheap() {
- return EncodingUtils.testBit(__isset_bitfield, __ASSIGNED_MEMOFFHEAP_ISSET_ID);
- }
-
- public void set_assigned_memoffheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ASSIGNED_MEMOFFHEAP_ISSET_ID, value);
- }
-
- public double get_assigned_cpu() {
- return this.assigned_cpu;
- }
-
- public void set_assigned_cpu(double assigned_cpu) {
- this.assigned_cpu = assigned_cpu;
- set_assigned_cpu_isSet(true);
- }
-
- public void unset_assigned_cpu() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ASSIGNED_CPU_ISSET_ID);
- }
-
- /** Returns true if field assigned_cpu is set (has been assigned a value) and false otherwise */
- public boolean is_set_assigned_cpu() {
- return EncodingUtils.testBit(__isset_bitfield, __ASSIGNED_CPU_ISSET_ID);
- }
-
- public void set_assigned_cpu_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ASSIGNED_CPU_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ID:
- if (value == null) {
- unset_id();
- } else {
- set_id((String)value);
- }
- break;
-
- case NAME:
- if (value == null) {
- unset_name();
- } else {
- set_name((String)value);
- }
- break;
-
- case NUM_TASKS:
- if (value == null) {
- unset_num_tasks();
- } else {
- set_num_tasks((Integer)value);
- }
- break;
-
- case NUM_EXECUTORS:
- if (value == null) {
- unset_num_executors();
- } else {
- set_num_executors((Integer)value);
- }
- break;
-
- case NUM_WORKERS:
- if (value == null) {
- unset_num_workers();
- } else {
- set_num_workers((Integer)value);
- }
- break;
-
- case UPTIME_SECS:
- if (value == null) {
- unset_uptime_secs();
- } else {
- set_uptime_secs((Integer)value);
- }
- break;
-
- case STATUS:
- if (value == null) {
- unset_status();
- } else {
- set_status((String)value);
- }
- break;
-
- case SCHED_STATUS:
- if (value == null) {
- unset_sched_status();
- } else {
- set_sched_status((String)value);
- }
- break;
-
- case OWNER:
- if (value == null) {
- unset_owner();
- } else {
- set_owner((String)value);
- }
- break;
-
- case REPLICATION_COUNT:
- if (value == null) {
- unset_replication_count();
- } else {
- set_replication_count((Integer)value);
- }
- break;
-
- case REQUESTED_MEMONHEAP:
- if (value == null) {
- unset_requested_memonheap();
- } else {
- set_requested_memonheap((Double)value);
- }
- break;
-
- case REQUESTED_MEMOFFHEAP:
- if (value == null) {
- unset_requested_memoffheap();
- } else {
- set_requested_memoffheap((Double)value);
- }
- break;
-
- case REQUESTED_CPU:
- if (value == null) {
- unset_requested_cpu();
- } else {
- set_requested_cpu((Double)value);
- }
- break;
-
- case ASSIGNED_MEMONHEAP:
- if (value == null) {
- unset_assigned_memonheap();
- } else {
- set_assigned_memonheap((Double)value);
- }
- break;
-
- case ASSIGNED_MEMOFFHEAP:
- if (value == null) {
- unset_assigned_memoffheap();
- } else {
- set_assigned_memoffheap((Double)value);
- }
- break;
-
- case ASSIGNED_CPU:
- if (value == null) {
- unset_assigned_cpu();
- } else {
- set_assigned_cpu((Double)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ID:
- return get_id();
-
- case NAME:
- return get_name();
-
- case NUM_TASKS:
- return get_num_tasks();
-
- case NUM_EXECUTORS:
- return get_num_executors();
-
- case NUM_WORKERS:
- return get_num_workers();
-
- case UPTIME_SECS:
- return get_uptime_secs();
-
- case STATUS:
- return get_status();
-
- case SCHED_STATUS:
- return get_sched_status();
-
- case OWNER:
- return get_owner();
-
- case REPLICATION_COUNT:
- return get_replication_count();
-
- case REQUESTED_MEMONHEAP:
- return get_requested_memonheap();
-
- case REQUESTED_MEMOFFHEAP:
- return get_requested_memoffheap();
-
- case REQUESTED_CPU:
- return get_requested_cpu();
-
- case ASSIGNED_MEMONHEAP:
- return get_assigned_memonheap();
-
- case ASSIGNED_MEMOFFHEAP:
- return get_assigned_memoffheap();
-
- case ASSIGNED_CPU:
- return get_assigned_cpu();
-
- }
- 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 ID:
- return is_set_id();
- case NAME:
- return is_set_name();
- case NUM_TASKS:
- return is_set_num_tasks();
- case NUM_EXECUTORS:
- return is_set_num_executors();
- case NUM_WORKERS:
- return is_set_num_workers();
- case UPTIME_SECS:
- return is_set_uptime_secs();
- case STATUS:
- return is_set_status();
- case SCHED_STATUS:
- return is_set_sched_status();
- case OWNER:
- return is_set_owner();
- case REPLICATION_COUNT:
- return is_set_replication_count();
- case REQUESTED_MEMONHEAP:
- return is_set_requested_memonheap();
- case REQUESTED_MEMOFFHEAP:
- return is_set_requested_memoffheap();
- case REQUESTED_CPU:
- return is_set_requested_cpu();
- case ASSIGNED_MEMONHEAP:
- return is_set_assigned_memonheap();
- case ASSIGNED_MEMOFFHEAP:
- return is_set_assigned_memoffheap();
- case ASSIGNED_CPU:
- return is_set_assigned_cpu();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof TopologySummary)
- return this.equals((TopologySummary)that);
- return false;
- }
-
- public boolean equals(TopologySummary that) {
- if (that == null)
- return false;
-
- boolean this_present_id = true && this.is_set_id();
- boolean that_present_id = true && that.is_set_id();
- if (this_present_id || that_present_id) {
- if (!(this_present_id && that_present_id))
- return false;
- if (!this.id.equals(that.id))
- 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_num_tasks = true;
- boolean that_present_num_tasks = true;
- if (this_present_num_tasks || that_present_num_tasks) {
- if (!(this_present_num_tasks && that_present_num_tasks))
- return false;
- if (this.num_tasks != that.num_tasks)
- return false;
- }
-
- boolean this_present_num_executors = true;
- boolean that_present_num_executors = true;
- if (this_present_num_executors || that_present_num_executors) {
- if (!(this_present_num_executors && that_present_num_executors))
- return false;
- if (this.num_executors != that.num_executors)
- return false;
- }
-
- boolean this_present_num_workers = true;
- boolean that_present_num_workers = true;
- if (this_present_num_workers || that_present_num_workers) {
- if (!(this_present_num_workers && that_present_num_workers))
- return false;
- if (this.num_workers != that.num_workers)
- return false;
- }
-
- boolean this_present_uptime_secs = true;
- boolean that_present_uptime_secs = true;
- if (this_present_uptime_secs || that_present_uptime_secs) {
- if (!(this_present_uptime_secs && that_present_uptime_secs))
- return false;
- if (this.uptime_secs != that.uptime_secs)
- return false;
- }
-
- boolean this_present_status = true && this.is_set_status();
- boolean that_present_status = true && that.is_set_status();
- if (this_present_status || that_present_status) {
- if (!(this_present_status && that_present_status))
- return false;
- if (!this.status.equals(that.status))
- return false;
- }
-
- boolean this_present_sched_status = true && this.is_set_sched_status();
- boolean that_present_sched_status = true && that.is_set_sched_status();
- if (this_present_sched_status || that_present_sched_status) {
- if (!(this_present_sched_status && that_present_sched_status))
- return false;
- if (!this.sched_status.equals(that.sched_status))
- return false;
- }
-
- boolean this_present_owner = true && this.is_set_owner();
- boolean that_present_owner = true && that.is_set_owner();
- if (this_present_owner || that_present_owner) {
- if (!(this_present_owner && that_present_owner))
- return false;
- if (!this.owner.equals(that.owner))
- 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;
- }
-
- boolean this_present_requested_memonheap = true && this.is_set_requested_memonheap();
- boolean that_present_requested_memonheap = true && that.is_set_requested_memonheap();
- if (this_present_requested_memonheap || that_present_requested_memonheap) {
- if (!(this_present_requested_memonheap && that_present_requested_memonheap))
- return false;
- if (this.requested_memonheap != that.requested_memonheap)
- return false;
- }
-
- boolean this_present_requested_memoffheap = true && this.is_set_requested_memoffheap();
- boolean that_present_requested_memoffheap = true && that.is_set_requested_memoffheap();
- if (this_present_requested_memoffheap || that_present_requested_memoffheap) {
- if (!(this_present_requested_memoffheap && that_present_requested_memoffheap))
- return false;
- if (this.requested_memoffheap != that.requested_memoffheap)
- return false;
- }
-
- boolean this_present_requested_cpu = true && this.is_set_requested_cpu();
- boolean that_present_requested_cpu = true && that.is_set_requested_cpu();
- if (this_present_requested_cpu || that_present_requested_cpu) {
- if (!(this_present_requested_cpu && that_present_requested_cpu))
- return false;
- if (this.requested_cpu != that.requested_cpu)
- return false;
- }
-
- boolean this_present_assigned_memonheap = true && this.is_set_assigned_memonheap();
- boolean that_present_assigned_memonheap = true && that.is_set_assigned_memonheap();
- if (this_present_assigned_memonheap || that_present_assigned_memonheap) {
- if (!(this_present_assigned_memonheap && that_present_assigned_memonheap))
- return false;
- if (this.assigned_memonheap != that.assigned_memonheap)
- return false;
- }
-
- boolean this_present_assigned_memoffheap = true && this.is_set_assigned_memoffheap();
- boolean that_present_assigned_memoffheap = true && that.is_set_assigned_memoffheap();
- if (this_present_assigned_memoffheap || that_present_assigned_memoffheap) {
- if (!(this_present_assigned_memoffheap && that_present_assigned_memoffheap))
- return false;
- if (this.assigned_memoffheap != that.assigned_memoffheap)
- return false;
- }
-
- boolean this_present_assigned_cpu = true && this.is_set_assigned_cpu();
- boolean that_present_assigned_cpu = true && that.is_set_assigned_cpu();
- if (this_present_assigned_cpu || that_present_assigned_cpu) {
- if (!(this_present_assigned_cpu && that_present_assigned_cpu))
- return false;
- if (this.assigned_cpu != that.assigned_cpu)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_id = true && (is_set_id());
- list.add(present_id);
- if (present_id)
- list.add(id);
-
- boolean present_name = true && (is_set_name());
- list.add(present_name);
- if (present_name)
- list.add(name);
-
- boolean present_num_tasks = true;
- list.add(present_num_tasks);
- if (present_num_tasks)
- list.add(num_tasks);
-
- boolean present_num_executors = true;
- list.add(present_num_executors);
- if (present_num_executors)
- list.add(num_executors);
-
- boolean present_num_workers = true;
- list.add(present_num_workers);
- if (present_num_workers)
- list.add(num_workers);
-
- boolean present_uptime_secs = true;
- list.add(present_uptime_secs);
- if (present_uptime_secs)
- list.add(uptime_secs);
-
- boolean present_status = true && (is_set_status());
- list.add(present_status);
- if (present_status)
- list.add(status);
-
- boolean present_sched_status = true && (is_set_sched_status());
- list.add(present_sched_status);
- if (present_sched_status)
- list.add(sched_status);
-
- boolean present_owner = true && (is_set_owner());
- list.add(present_owner);
- if (present_owner)
- list.add(owner);
-
- boolean present_replication_count = true && (is_set_replication_count());
- list.add(present_replication_count);
- if (present_replication_count)
- list.add(replication_count);
-
- boolean present_requested_memonheap = true && (is_set_requested_memonheap());
- list.add(present_requested_memonheap);
- if (present_requested_memonheap)
- list.add(requested_memonheap);
-
- boolean present_requested_memoffheap = true && (is_set_requested_memoffheap());
- list.add(present_requested_memoffheap);
- if (present_requested_memoffheap)
- list.add(requested_memoffheap);
-
- boolean present_requested_cpu = true && (is_set_requested_cpu());
- list.add(present_requested_cpu);
- if (present_requested_cpu)
- list.add(requested_cpu);
-
- boolean present_assigned_memonheap = true && (is_set_assigned_memonheap());
- list.add(present_assigned_memonheap);
- if (present_assigned_memonheap)
- list.add(assigned_memonheap);
-
- boolean present_assigned_memoffheap = true && (is_set_assigned_memoffheap());
- list.add(present_assigned_memoffheap);
- if (present_assigned_memoffheap)
- list.add(assigned_memoffheap);
-
- boolean present_assigned_cpu = true && (is_set_assigned_cpu());
- list.add(present_assigned_cpu);
- if (present_assigned_cpu)
- list.add(assigned_cpu);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(TopologySummary other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_id()).compareTo(other.is_set_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
- 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_num_tasks()).compareTo(other.is_set_num_tasks());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_tasks()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_tasks, other.num_tasks);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_executors()).compareTo(other.is_set_num_executors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_executors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_executors, other.num_executors);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_workers()).compareTo(other.is_set_num_workers());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_workers()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_workers, other.num_workers);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(other.is_set_uptime_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_uptime_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, other.uptime_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_status()).compareTo(other.is_set_status());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_status()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_sched_status()).compareTo(other.is_set_sched_status());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_sched_status()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sched_status, other.sched_status);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_owner()).compareTo(other.is_set_owner());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_owner()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, other.owner);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_replication_count()).compareTo(other.is_set_replication_count());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_replication_count()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.replication_count, other.replication_count);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_requested_memonheap()).compareTo(other.is_set_requested_memonheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_requested_memonheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requested_memonheap, other.requested_memonheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_requested_memoffheap()).compareTo(other.is_set_requested_memoffheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_requested_memoffheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requested_memoffheap, other.requested_memoffheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_requested_cpu()).compareTo(other.is_set_requested_cpu());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_requested_cpu()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requested_cpu, other.requested_cpu);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assigned_memonheap()).compareTo(other.is_set_assigned_memonheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assigned_memonheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assigned_memonheap, other.assigned_memonheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assigned_memoffheap()).compareTo(other.is_set_assigned_memoffheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assigned_memoffheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assigned_memoffheap, other.assigned_memoffheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assigned_cpu()).compareTo(other.is_set_assigned_cpu());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assigned_cpu()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assigned_cpu, other.assigned_cpu);
- 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("TopologySummary(");
- boolean first = true;
-
- sb.append("id:");
- if (this.id == null) {
- sb.append("null");
- } else {
- sb.append(this.id);
- }
- first = false;
- 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("num_tasks:");
- sb.append(this.num_tasks);
- first = false;
- if (!first) sb.append(", ");
- sb.append("num_executors:");
- sb.append(this.num_executors);
- first = false;
- if (!first) sb.append(", ");
- sb.append("num_workers:");
- sb.append(this.num_workers);
- first = false;
- if (!first) sb.append(", ");
- sb.append("uptime_secs:");
- sb.append(this.uptime_secs);
- first = false;
- if (!first) sb.append(", ");
- sb.append("status:");
- if (this.status == null) {
- sb.append("null");
- } else {
- sb.append(this.status);
- }
- first = false;
- if (is_set_sched_status()) {
- if (!first) sb.append(", ");
- sb.append("sched_status:");
- if (this.sched_status == null) {
- sb.append("null");
- } else {
- sb.append(this.sched_status);
- }
- first = false;
- }
- if (is_set_owner()) {
- if (!first) sb.append(", ");
- sb.append("owner:");
- if (this.owner == null) {
- sb.append("null");
- } else {
- sb.append(this.owner);
- }
- first = false;
- }
- if (is_set_replication_count()) {
- if (!first) sb.append(", ");
- sb.append("replication_count:");
- sb.append(this.replication_count);
- first = false;
- }
- if (is_set_requested_memonheap()) {
- if (!first) sb.append(", ");
- sb.append("requested_memonheap:");
- sb.append(this.requested_memonheap);
- first = false;
- }
- if (is_set_requested_memoffheap()) {
- if (!first) sb.append(", ");
- sb.append("requested_memoffheap:");
- sb.append(this.requested_memoffheap);
- first = false;
- }
- if (is_set_requested_cpu()) {
- if (!first) sb.append(", ");
- sb.append("requested_cpu:");
- sb.append(this.requested_cpu);
- first = false;
- }
- if (is_set_assigned_memonheap()) {
- if (!first) sb.append(", ");
- sb.append("assigned_memonheap:");
- sb.append(this.assigned_memonheap);
- first = false;
- }
- if (is_set_assigned_memoffheap()) {
- if (!first) sb.append(", ");
- sb.append("assigned_memoffheap:");
- sb.append(this.assigned_memoffheap);
- first = false;
- }
- if (is_set_assigned_cpu()) {
- if (!first) sb.append(", ");
- sb.append("assigned_cpu:");
- sb.append(this.assigned_cpu);
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' is unset! Struct:" + toString());
- }
-
- if (!is_set_name()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' is unset! Struct:" + toString());
- }
-
- if (!is_set_num_tasks()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_tasks' is unset! Struct:" + toString());
- }
-
- if (!is_set_num_executors()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_executors' is unset! Struct:" + toString());
- }
-
- if (!is_set_num_workers()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_workers' is unset! Struct:" + toString());
- }
-
- if (!is_set_uptime_secs()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString());
- }
-
- if (!is_set_status()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' 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 TopologySummaryStandardSchemeFactory implements SchemeFactory {
- public TopologySummaryStandardScheme getScheme() {
- return new TopologySummaryStandardScheme();
- }
- }
-
- private static class TopologySummaryStandardScheme extends StandardScheme<TopologySummary> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, TopologySummary 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: // ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.id = iprot.readString();
- struct.set_id_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: // NUM_TASKS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_tasks = iprot.readI32();
- struct.set_num_tasks_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // NUM_EXECUTORS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_executors = iprot.readI32();
- struct.set_num_executors_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // NUM_WORKERS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_workers = iprot.readI32();
- struct.set_num_workers_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // UPTIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // STATUS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.status = iprot.readString();
- struct.set_status_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 513: // SCHED_STATUS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.sched_status = iprot.readString();
- struct.set_sched_status_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 514: // OWNER
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.owner = iprot.readString();
- struct.set_owner_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 515: // REPLICATION_COUNT
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.replication_count = iprot.readI32();
- struct.set_replication_count_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 521: // REQUESTED_MEMONHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.requested_memonheap = iprot.readDouble();
- struct.set_requested_memonheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 522: // REQUESTED_MEMOFFHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.requested_memoffheap = iprot.readDouble();
- struct.set_requested_memoffheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 523: // REQUESTED_CPU
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.requested_cpu = iprot.readDouble();
- struct.set_requested_cpu_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 524: // ASSIGNED_MEMONHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.assigned_memonheap = iprot.readDouble();
- struct.set_assigned_memonheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 525: // ASSIGNED_MEMOFFHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.assigned_memoffheap = iprot.readDouble();
- struct.set_assigned_memoffheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 526: // ASSIGNED_CPU
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.assigned_cpu = iprot.readDouble();
- struct.set_assigned_cpu_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, TopologySummary struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.id != null) {
- oprot.writeFieldBegin(ID_FIELD_DESC);
- oprot.writeString(struct.id);
- oprot.writeFieldEnd();
- }
- if (struct.name != null) {
- oprot.writeFieldBegin(NAME_FIELD_DESC);
- oprot.writeString(struct.name);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(NUM_TASKS_FIELD_DESC);
- oprot.writeI32(struct.num_tasks);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(NUM_EXECUTORS_FIELD_DESC);
- oprot.writeI32(struct.num_executors);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(NUM_WORKERS_FIELD_DESC);
- oprot.writeI32(struct.num_workers);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.uptime_secs);
- oprot.writeFieldEnd();
- if (struct.status != null) {
- oprot.writeFieldBegin(STATUS_FIELD_DESC);
- oprot.writeString(struct.status);
- oprot.writeFieldEnd();
- }
- if (struct.sched_status != null) {
- if (struct.is_set_sched_status()) {
- oprot.writeFieldBegin(SCHED_STATUS_FIELD_DESC);
- oprot.writeString(struct.sched_status);
- oprot.writeFieldEnd();
- }
- }
- if (struct.owner != null) {
- if (struct.is_set_owner()) {
- oprot.writeFieldBegin(OWNER_FIELD_DESC);
- oprot.writeString(struct.owner);
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_replication_count()) {
- oprot.writeFieldBegin(REPLICATION_COUNT_FIELD_DESC);
- oprot.writeI32(struct.replication_count);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_requested_memonheap()) {
- oprot.writeFieldBegin(REQUESTED_MEMONHEAP_FIELD_DESC);
- oprot.writeDouble(struct.requested_memonheap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_requested_memoffheap()) {
- oprot.writeFieldBegin(REQUESTED_MEMOFFHEAP_FIELD_DESC);
- oprot.writeDouble(struct.requested_memoffheap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_requested_cpu()) {
- oprot.writeFieldBegin(REQUESTED_CPU_FIELD_DESC);
- oprot.writeDouble(struct.requested_cpu);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_assigned_memonheap()) {
- oprot.writeFieldBegin(ASSIGNED_MEMONHEAP_FIELD_DESC);
- oprot.writeDouble(struct.assigned_memonheap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_assigned_memoffheap()) {
- oprot.writeFieldBegin(ASSIGNED_MEMOFFHEAP_FIELD_DESC);
- oprot.writeDouble(struct.assigned_memoffheap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_assigned_cpu()) {
- oprot.writeFieldBegin(ASSIGNED_CPU_FIELD_DESC);
- oprot.writeDouble(struct.assigned_cpu);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class TopologySummaryTupleSchemeFactory implements SchemeFactory {
- public TopologySummaryTupleScheme getScheme() {
- return new TopologySummaryTupleScheme();
- }
- }
-
- private static class TopologySummaryTupleScheme extends TupleScheme<TopologySummary> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, TopologySummary struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.id);
- oprot.writeString(struct.name);
- oprot.writeI32(struct.num_tasks);
- oprot.writeI32(struct.num_executors);
- oprot.writeI32(struct.num_workers);
- oprot.writeI32(struct.uptime_secs);
- oprot.writeString(struct.status);
- BitSet optionals = new BitSet();
- if (struct.is_set_sched_status()) {
- optionals.set(0);
- }
- if (struct.is_set_owner()) {
- optionals.set(1);
- }
- if (struct.is_set_replication_count()) {
- optionals.set(2);
- }
- if (struct.is_set_requested_memonheap()) {
- optionals.set(3);
- }
- if (struct.is_set_requested_memoffheap()) {
- optionals.set(4);
- }
- if (struct.is_set_requested_cpu()) {
- optionals.set(5);
- }
- if (struct.is_set_assigned_memonheap()) {
- optionals.set(6);
- }
- if (struct.is_set_assigned_memoffheap()) {
- optionals.set(7);
- }
- if (struct.is_set_assigned_cpu()) {
- optionals.set(8);
- }
- oprot.writeBitSet(optionals, 9);
- if (struct.is_set_sched_status()) {
- oprot.writeString(struct.sched_status);
- }
- if (struct.is_set_owner()) {
- oprot.writeString(struct.owner);
- }
- if (struct.is_set_replication_count()) {
- oprot.writeI32(struct.replication_count);
- }
- if (struct.is_set_requested_memonheap()) {
- oprot.writeDouble(struct.requested_memonheap);
- }
- if (struct.is_set_requested_memoffheap()) {
- oprot.writeDouble(struct.requested_memoffheap);
- }
- if (struct.is_set_requested_cpu()) {
- oprot.writeDouble(struct.requested_cpu);
- }
- if (struct.is_set_assigned_memonheap()) {
- oprot.writeDouble(struct.assigned_memonheap);
- }
- if (struct.is_set_assigned_memoffheap()) {
- oprot.writeDouble(struct.assigned_memoffheap);
- }
- if (struct.is_set_assigned_cpu()) {
- oprot.writeDouble(struct.assigned_cpu);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, TopologySummary struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.id = iprot.readString();
- struct.set_id_isSet(true);
- struct.name = iprot.readString();
- struct.set_name_isSet(true);
- struct.num_tasks = iprot.readI32();
- struct.set_num_tasks_isSet(true);
- struct.num_executors = iprot.readI32();
- struct.set_num_executors_isSet(true);
- struct.num_workers = iprot.readI32();
- struct.set_num_workers_isSet(true);
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- struct.status = iprot.readString();
- struct.set_status_isSet(true);
- BitSet incoming = iprot.readBitSet(9);
- if (incoming.get(0)) {
- struct.sched_status = iprot.readString();
- struct.set_sched_status_isSet(true);
- }
- if (incoming.get(1)) {
- struct.owner = iprot.readString();
- struct.set_owner_isSet(true);
- }
- if (incoming.get(2)) {
- struct.replication_count = iprot.readI32();
- struct.set_replication_count_isSet(true);
- }
- if (incoming.get(3)) {
- struct.requested_memonheap = iprot.readDouble();
- struct.set_requested_memonheap_isSet(true);
- }
- if (incoming.get(4)) {
- struct.requested_memoffheap = iprot.readDouble();
- struct.set_requested_memoffheap_isSet(true);
- }
- if (incoming.get(5)) {
- struct.requested_cpu = iprot.readDouble();
- struct.set_requested_cpu_isSet(true);
- }
- if (incoming.get(6)) {
- struct.assigned_memonheap = iprot.readDouble();
- struct.set_assigned_memonheap_isSet(true);
- }
- if (incoming.get(7)) {
- struct.assigned_memoffheap = iprot.readDouble();
- struct.set_assigned_memoffheap_isSet(true);
- }
- if (incoming.get(8)) {
- struct.assigned_cpu = iprot.readDouble();
- struct.set_assigned_cpu_isSet(true);
- }
- }
- }
-
-}
-
[08/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SupervisorSummary.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/SupervisorSummary.java b/storm-core/src/jvm/backtype/storm/generated/SupervisorSummary.java
deleted file mode 100644
index bd7d7a4..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/SupervisorSummary.java
+++ /dev/null
@@ -1,1265 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class SupervisorSummary implements org.apache.thrift.TBase<SupervisorSummary, SupervisorSummary._Fields>, java.io.Serializable, Cloneable, Comparable<SupervisorSummary> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SupervisorSummary");
-
- private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)3);
- private static final org.apache.thrift.protocol.TField NUM_USED_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_used_workers", org.apache.thrift.protocol.TType.I32, (short)4);
- private static final org.apache.thrift.protocol.TField SUPERVISOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisor_id", org.apache.thrift.protocol.TType.STRING, (short)5);
- private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)6);
- private static final org.apache.thrift.protocol.TField TOTAL_RESOURCES_FIELD_DESC = new org.apache.thrift.protocol.TField("total_resources", org.apache.thrift.protocol.TType.MAP, (short)7);
- private static final org.apache.thrift.protocol.TField USED_MEM_FIELD_DESC = new org.apache.thrift.protocol.TField("used_mem", org.apache.thrift.protocol.TType.DOUBLE, (short)8);
- private static final org.apache.thrift.protocol.TField USED_CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("used_cpu", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new SupervisorSummaryStandardSchemeFactory());
- schemes.put(TupleScheme.class, new SupervisorSummaryTupleSchemeFactory());
- }
-
- private String host; // required
- private int uptime_secs; // required
- private int num_workers; // required
- private int num_used_workers; // required
- private String supervisor_id; // required
- private String version; // optional
- private Map<String,Double> total_resources; // optional
- private double used_mem; // optional
- private double used_cpu; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- HOST((short)1, "host"),
- UPTIME_SECS((short)2, "uptime_secs"),
- NUM_WORKERS((short)3, "num_workers"),
- NUM_USED_WORKERS((short)4, "num_used_workers"),
- SUPERVISOR_ID((short)5, "supervisor_id"),
- VERSION((short)6, "version"),
- TOTAL_RESOURCES((short)7, "total_resources"),
- USED_MEM((short)8, "used_mem"),
- USED_CPU((short)9, "used_cpu");
-
- 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: // HOST
- return HOST;
- case 2: // UPTIME_SECS
- return UPTIME_SECS;
- case 3: // NUM_WORKERS
- return NUM_WORKERS;
- case 4: // NUM_USED_WORKERS
- return NUM_USED_WORKERS;
- case 5: // SUPERVISOR_ID
- return SUPERVISOR_ID;
- case 6: // VERSION
- return VERSION;
- case 7: // TOTAL_RESOURCES
- return TOTAL_RESOURCES;
- case 8: // USED_MEM
- return USED_MEM;
- case 9: // USED_CPU
- return USED_CPU;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return 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 __UPTIME_SECS_ISSET_ID = 0;
- private static final int __NUM_WORKERS_ISSET_ID = 1;
- private static final int __NUM_USED_WORKERS_ISSET_ID = 2;
- private static final int __USED_MEM_ISSET_ID = 3;
- private static final int __USED_CPU_ISSET_ID = 4;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.VERSION,_Fields.TOTAL_RESOURCES,_Fields.USED_MEM,_Fields.USED_CPU};
- 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.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.NUM_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("num_workers", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.NUM_USED_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("num_used_workers", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.SUPERVISOR_ID, new org.apache.thrift.meta_data.FieldMetaData("supervisor_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.TOTAL_RESOURCES, new org.apache.thrift.meta_data.FieldMetaData("total_resources", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
- tmpMap.put(_Fields.USED_MEM, new org.apache.thrift.meta_data.FieldMetaData("used_mem", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.USED_CPU, new org.apache.thrift.meta_data.FieldMetaData("used_cpu", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SupervisorSummary.class, metaDataMap);
- }
-
- public SupervisorSummary() {
- this.version = "VERSION_NOT_PROVIDED";
-
- }
-
- public SupervisorSummary(
- String host,
- int uptime_secs,
- int num_workers,
- int num_used_workers,
- String supervisor_id)
- {
- this();
- this.host = host;
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- this.num_workers = num_workers;
- set_num_workers_isSet(true);
- this.num_used_workers = num_used_workers;
- set_num_used_workers_isSet(true);
- this.supervisor_id = supervisor_id;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public SupervisorSummary(SupervisorSummary other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_host()) {
- this.host = other.host;
- }
- this.uptime_secs = other.uptime_secs;
- this.num_workers = other.num_workers;
- this.num_used_workers = other.num_used_workers;
- if (other.is_set_supervisor_id()) {
- this.supervisor_id = other.supervisor_id;
- }
- if (other.is_set_version()) {
- this.version = other.version;
- }
- if (other.is_set_total_resources()) {
- Map<String,Double> __this__total_resources = new HashMap<String,Double>(other.total_resources);
- this.total_resources = __this__total_resources;
- }
- this.used_mem = other.used_mem;
- this.used_cpu = other.used_cpu;
- }
-
- public SupervisorSummary deepCopy() {
- return new SupervisorSummary(this);
- }
-
- @Override
- public void clear() {
- this.host = null;
- set_uptime_secs_isSet(false);
- this.uptime_secs = 0;
- set_num_workers_isSet(false);
- this.num_workers = 0;
- set_num_used_workers_isSet(false);
- this.num_used_workers = 0;
- this.supervisor_id = null;
- this.version = "VERSION_NOT_PROVIDED";
-
- this.total_resources = null;
- set_used_mem_isSet(false);
- this.used_mem = 0.0;
- set_used_cpu_isSet(false);
- this.used_cpu = 0.0;
- }
-
- public String get_host() {
- return this.host;
- }
-
- public void set_host(String host) {
- this.host = host;
- }
-
- public void unset_host() {
- this.host = null;
- }
-
- /** Returns true if field host is set (has been assigned a value) and false otherwise */
- public boolean is_set_host() {
- return this.host != null;
- }
-
- public void set_host_isSet(boolean value) {
- if (!value) {
- this.host = null;
- }
- }
-
- public int get_uptime_secs() {
- return this.uptime_secs;
- }
-
- public void set_uptime_secs(int uptime_secs) {
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- }
-
- public void unset_uptime_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_uptime_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- public void set_uptime_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID, value);
- }
-
- public int get_num_workers() {
- return this.num_workers;
- }
-
- public void set_num_workers(int num_workers) {
- this.num_workers = num_workers;
- set_num_workers_isSet(true);
- }
-
- public void unset_num_workers() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID);
- }
-
- /** Returns true if field num_workers is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_workers() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID);
- }
-
- public void set_num_workers_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID, value);
- }
-
- public int get_num_used_workers() {
- return this.num_used_workers;
- }
-
- public void set_num_used_workers(int num_used_workers) {
- this.num_used_workers = num_used_workers;
- set_num_used_workers_isSet(true);
- }
-
- public void unset_num_used_workers() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_USED_WORKERS_ISSET_ID);
- }
-
- /** Returns true if field num_used_workers is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_used_workers() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_USED_WORKERS_ISSET_ID);
- }
-
- public void set_num_used_workers_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_USED_WORKERS_ISSET_ID, value);
- }
-
- public String get_supervisor_id() {
- return this.supervisor_id;
- }
-
- public void set_supervisor_id(String supervisor_id) {
- this.supervisor_id = supervisor_id;
- }
-
- public void unset_supervisor_id() {
- this.supervisor_id = null;
- }
-
- /** Returns true if field supervisor_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_supervisor_id() {
- return this.supervisor_id != null;
- }
-
- public void set_supervisor_id_isSet(boolean value) {
- if (!value) {
- this.supervisor_id = null;
- }
- }
-
- public String get_version() {
- return this.version;
- }
-
- public void set_version(String version) {
- this.version = version;
- }
-
- public void unset_version() {
- this.version = null;
- }
-
- /** Returns true if field version is set (has been assigned a value) and false otherwise */
- public boolean is_set_version() {
- return this.version != null;
- }
-
- public void set_version_isSet(boolean value) {
- if (!value) {
- this.version = null;
- }
- }
-
- public int get_total_resources_size() {
- return (this.total_resources == null) ? 0 : this.total_resources.size();
- }
-
- public void put_to_total_resources(String key, double val) {
- if (this.total_resources == null) {
- this.total_resources = new HashMap<String,Double>();
- }
- this.total_resources.put(key, val);
- }
-
- public Map<String,Double> get_total_resources() {
- return this.total_resources;
- }
-
- public void set_total_resources(Map<String,Double> total_resources) {
- this.total_resources = total_resources;
- }
-
- public void unset_total_resources() {
- this.total_resources = null;
- }
-
- /** Returns true if field total_resources is set (has been assigned a value) and false otherwise */
- public boolean is_set_total_resources() {
- return this.total_resources != null;
- }
-
- public void set_total_resources_isSet(boolean value) {
- if (!value) {
- this.total_resources = null;
- }
- }
-
- public double get_used_mem() {
- return this.used_mem;
- }
-
- public void set_used_mem(double used_mem) {
- this.used_mem = used_mem;
- set_used_mem_isSet(true);
- }
-
- public void unset_used_mem() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USED_MEM_ISSET_ID);
- }
-
- /** Returns true if field used_mem is set (has been assigned a value) and false otherwise */
- public boolean is_set_used_mem() {
- return EncodingUtils.testBit(__isset_bitfield, __USED_MEM_ISSET_ID);
- }
-
- public void set_used_mem_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USED_MEM_ISSET_ID, value);
- }
-
- public double get_used_cpu() {
- return this.used_cpu;
- }
-
- public void set_used_cpu(double used_cpu) {
- this.used_cpu = used_cpu;
- set_used_cpu_isSet(true);
- }
-
- public void unset_used_cpu() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USED_CPU_ISSET_ID);
- }
-
- /** Returns true if field used_cpu is set (has been assigned a value) and false otherwise */
- public boolean is_set_used_cpu() {
- return EncodingUtils.testBit(__isset_bitfield, __USED_CPU_ISSET_ID);
- }
-
- public void set_used_cpu_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USED_CPU_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case HOST:
- if (value == null) {
- unset_host();
- } else {
- set_host((String)value);
- }
- break;
-
- case UPTIME_SECS:
- if (value == null) {
- unset_uptime_secs();
- } else {
- set_uptime_secs((Integer)value);
- }
- break;
-
- case NUM_WORKERS:
- if (value == null) {
- unset_num_workers();
- } else {
- set_num_workers((Integer)value);
- }
- break;
-
- case NUM_USED_WORKERS:
- if (value == null) {
- unset_num_used_workers();
- } else {
- set_num_used_workers((Integer)value);
- }
- break;
-
- case SUPERVISOR_ID:
- if (value == null) {
- unset_supervisor_id();
- } else {
- set_supervisor_id((String)value);
- }
- break;
-
- case VERSION:
- if (value == null) {
- unset_version();
- } else {
- set_version((String)value);
- }
- break;
-
- case TOTAL_RESOURCES:
- if (value == null) {
- unset_total_resources();
- } else {
- set_total_resources((Map<String,Double>)value);
- }
- break;
-
- case USED_MEM:
- if (value == null) {
- unset_used_mem();
- } else {
- set_used_mem((Double)value);
- }
- break;
-
- case USED_CPU:
- if (value == null) {
- unset_used_cpu();
- } else {
- set_used_cpu((Double)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case HOST:
- return get_host();
-
- case UPTIME_SECS:
- return get_uptime_secs();
-
- case NUM_WORKERS:
- return get_num_workers();
-
- case NUM_USED_WORKERS:
- return get_num_used_workers();
-
- case SUPERVISOR_ID:
- return get_supervisor_id();
-
- case VERSION:
- return get_version();
-
- case TOTAL_RESOURCES:
- return get_total_resources();
-
- case USED_MEM:
- return get_used_mem();
-
- case USED_CPU:
- return get_used_cpu();
-
- }
- 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 HOST:
- return is_set_host();
- case UPTIME_SECS:
- return is_set_uptime_secs();
- case NUM_WORKERS:
- return is_set_num_workers();
- case NUM_USED_WORKERS:
- return is_set_num_used_workers();
- case SUPERVISOR_ID:
- return is_set_supervisor_id();
- case VERSION:
- return is_set_version();
- case TOTAL_RESOURCES:
- return is_set_total_resources();
- case USED_MEM:
- return is_set_used_mem();
- case USED_CPU:
- return is_set_used_cpu();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof SupervisorSummary)
- return this.equals((SupervisorSummary)that);
- return false;
- }
-
- public boolean equals(SupervisorSummary that) {
- if (that == null)
- return false;
-
- boolean this_present_host = true && this.is_set_host();
- boolean that_present_host = true && that.is_set_host();
- if (this_present_host || that_present_host) {
- if (!(this_present_host && that_present_host))
- return false;
- if (!this.host.equals(that.host))
- return false;
- }
-
- boolean this_present_uptime_secs = true;
- boolean that_present_uptime_secs = true;
- if (this_present_uptime_secs || that_present_uptime_secs) {
- if (!(this_present_uptime_secs && that_present_uptime_secs))
- return false;
- if (this.uptime_secs != that.uptime_secs)
- return false;
- }
-
- boolean this_present_num_workers = true;
- boolean that_present_num_workers = true;
- if (this_present_num_workers || that_present_num_workers) {
- if (!(this_present_num_workers && that_present_num_workers))
- return false;
- if (this.num_workers != that.num_workers)
- return false;
- }
-
- boolean this_present_num_used_workers = true;
- boolean that_present_num_used_workers = true;
- if (this_present_num_used_workers || that_present_num_used_workers) {
- if (!(this_present_num_used_workers && that_present_num_used_workers))
- return false;
- if (this.num_used_workers != that.num_used_workers)
- return false;
- }
-
- boolean this_present_supervisor_id = true && this.is_set_supervisor_id();
- boolean that_present_supervisor_id = true && that.is_set_supervisor_id();
- if (this_present_supervisor_id || that_present_supervisor_id) {
- if (!(this_present_supervisor_id && that_present_supervisor_id))
- return false;
- if (!this.supervisor_id.equals(that.supervisor_id))
- return false;
- }
-
- boolean this_present_version = true && this.is_set_version();
- boolean that_present_version = true && that.is_set_version();
- if (this_present_version || that_present_version) {
- if (!(this_present_version && that_present_version))
- return false;
- if (!this.version.equals(that.version))
- return false;
- }
-
- boolean this_present_total_resources = true && this.is_set_total_resources();
- boolean that_present_total_resources = true && that.is_set_total_resources();
- if (this_present_total_resources || that_present_total_resources) {
- if (!(this_present_total_resources && that_present_total_resources))
- return false;
- if (!this.total_resources.equals(that.total_resources))
- return false;
- }
-
- boolean this_present_used_mem = true && this.is_set_used_mem();
- boolean that_present_used_mem = true && that.is_set_used_mem();
- if (this_present_used_mem || that_present_used_mem) {
- if (!(this_present_used_mem && that_present_used_mem))
- return false;
- if (this.used_mem != that.used_mem)
- return false;
- }
-
- boolean this_present_used_cpu = true && this.is_set_used_cpu();
- boolean that_present_used_cpu = true && that.is_set_used_cpu();
- if (this_present_used_cpu || that_present_used_cpu) {
- if (!(this_present_used_cpu && that_present_used_cpu))
- return false;
- if (this.used_cpu != that.used_cpu)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_host = true && (is_set_host());
- list.add(present_host);
- if (present_host)
- list.add(host);
-
- boolean present_uptime_secs = true;
- list.add(present_uptime_secs);
- if (present_uptime_secs)
- list.add(uptime_secs);
-
- boolean present_num_workers = true;
- list.add(present_num_workers);
- if (present_num_workers)
- list.add(num_workers);
-
- boolean present_num_used_workers = true;
- list.add(present_num_used_workers);
- if (present_num_used_workers)
- list.add(num_used_workers);
-
- boolean present_supervisor_id = true && (is_set_supervisor_id());
- list.add(present_supervisor_id);
- if (present_supervisor_id)
- list.add(supervisor_id);
-
- boolean present_version = true && (is_set_version());
- list.add(present_version);
- if (present_version)
- list.add(version);
-
- boolean present_total_resources = true && (is_set_total_resources());
- list.add(present_total_resources);
- if (present_total_resources)
- list.add(total_resources);
-
- boolean present_used_mem = true && (is_set_used_mem());
- list.add(present_used_mem);
- if (present_used_mem)
- list.add(used_mem);
-
- boolean present_used_cpu = true && (is_set_used_cpu());
- list.add(present_used_cpu);
- if (present_used_cpu)
- list.add(used_cpu);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(SupervisorSummary other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_host()).compareTo(other.is_set_host());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_host()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, other.host);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(other.is_set_uptime_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_uptime_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, other.uptime_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_workers()).compareTo(other.is_set_num_workers());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_workers()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_workers, other.num_workers);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_used_workers()).compareTo(other.is_set_num_used_workers());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_used_workers()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_used_workers, other.num_used_workers);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_supervisor_id()).compareTo(other.is_set_supervisor_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_supervisor_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supervisor_id, other.supervisor_id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_version()).compareTo(other.is_set_version());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_version()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_total_resources()).compareTo(other.is_set_total_resources());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_total_resources()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.total_resources, other.total_resources);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_used_mem()).compareTo(other.is_set_used_mem());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_used_mem()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.used_mem, other.used_mem);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_used_cpu()).compareTo(other.is_set_used_cpu());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_used_cpu()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.used_cpu, other.used_cpu);
- 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("SupervisorSummary(");
- boolean first = true;
-
- sb.append("host:");
- if (this.host == null) {
- sb.append("null");
- } else {
- sb.append(this.host);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("uptime_secs:");
- sb.append(this.uptime_secs);
- first = false;
- if (!first) sb.append(", ");
- sb.append("num_workers:");
- sb.append(this.num_workers);
- first = false;
- if (!first) sb.append(", ");
- sb.append("num_used_workers:");
- sb.append(this.num_used_workers);
- first = false;
- if (!first) sb.append(", ");
- sb.append("supervisor_id:");
- if (this.supervisor_id == null) {
- sb.append("null");
- } else {
- sb.append(this.supervisor_id);
- }
- first = false;
- if (is_set_version()) {
- if (!first) sb.append(", ");
- sb.append("version:");
- if (this.version == null) {
- sb.append("null");
- } else {
- sb.append(this.version);
- }
- first = false;
- }
- if (is_set_total_resources()) {
- if (!first) sb.append(", ");
- sb.append("total_resources:");
- if (this.total_resources == null) {
- sb.append("null");
- } else {
- sb.append(this.total_resources);
- }
- first = false;
- }
- if (is_set_used_mem()) {
- if (!first) sb.append(", ");
- sb.append("used_mem:");
- sb.append(this.used_mem);
- first = false;
- }
- if (is_set_used_cpu()) {
- if (!first) sb.append(", ");
- sb.append("used_cpu:");
- sb.append(this.used_cpu);
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_host()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'host' is unset! Struct:" + toString());
- }
-
- if (!is_set_uptime_secs()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString());
- }
-
- if (!is_set_num_workers()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_workers' is unset! Struct:" + toString());
- }
-
- if (!is_set_num_used_workers()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_used_workers' is unset! Struct:" + toString());
- }
-
- if (!is_set_supervisor_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'supervisor_id' 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 SupervisorSummaryStandardSchemeFactory implements SchemeFactory {
- public SupervisorSummaryStandardScheme getScheme() {
- return new SupervisorSummaryStandardScheme();
- }
- }
-
- private static class SupervisorSummaryStandardScheme extends StandardScheme<SupervisorSummary> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, SupervisorSummary 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: // HOST
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.host = iprot.readString();
- struct.set_host_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // UPTIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // NUM_WORKERS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_workers = iprot.readI32();
- struct.set_num_workers_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // NUM_USED_WORKERS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_used_workers = iprot.readI32();
- struct.set_num_used_workers_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // SUPERVISOR_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.supervisor_id = iprot.readString();
- struct.set_supervisor_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // VERSION
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.version = iprot.readString();
- struct.set_version_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // TOTAL_RESOURCES
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map98 = iprot.readMapBegin();
- struct.total_resources = new HashMap<String,Double>(2*_map98.size);
- String _key99;
- double _val100;
- for (int _i101 = 0; _i101 < _map98.size; ++_i101)
- {
- _key99 = iprot.readString();
- _val100 = iprot.readDouble();
- struct.total_resources.put(_key99, _val100);
- }
- iprot.readMapEnd();
- }
- struct.set_total_resources_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 8: // USED_MEM
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.used_mem = iprot.readDouble();
- struct.set_used_mem_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 9: // USED_CPU
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.used_cpu = iprot.readDouble();
- struct.set_used_cpu_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, SupervisorSummary struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.host != null) {
- oprot.writeFieldBegin(HOST_FIELD_DESC);
- oprot.writeString(struct.host);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.uptime_secs);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(NUM_WORKERS_FIELD_DESC);
- oprot.writeI32(struct.num_workers);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(NUM_USED_WORKERS_FIELD_DESC);
- oprot.writeI32(struct.num_used_workers);
- oprot.writeFieldEnd();
- if (struct.supervisor_id != null) {
- oprot.writeFieldBegin(SUPERVISOR_ID_FIELD_DESC);
- oprot.writeString(struct.supervisor_id);
- oprot.writeFieldEnd();
- }
- if (struct.version != null) {
- if (struct.is_set_version()) {
- oprot.writeFieldBegin(VERSION_FIELD_DESC);
- oprot.writeString(struct.version);
- oprot.writeFieldEnd();
- }
- }
- if (struct.total_resources != null) {
- if (struct.is_set_total_resources()) {
- oprot.writeFieldBegin(TOTAL_RESOURCES_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, struct.total_resources.size()));
- for (Map.Entry<String, Double> _iter102 : struct.total_resources.entrySet())
- {
- oprot.writeString(_iter102.getKey());
- oprot.writeDouble(_iter102.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_used_mem()) {
- oprot.writeFieldBegin(USED_MEM_FIELD_DESC);
- oprot.writeDouble(struct.used_mem);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_used_cpu()) {
- oprot.writeFieldBegin(USED_CPU_FIELD_DESC);
- oprot.writeDouble(struct.used_cpu);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class SupervisorSummaryTupleSchemeFactory implements SchemeFactory {
- public SupervisorSummaryTupleScheme getScheme() {
- return new SupervisorSummaryTupleScheme();
- }
- }
-
- private static class SupervisorSummaryTupleScheme extends TupleScheme<SupervisorSummary> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, SupervisorSummary struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.host);
- oprot.writeI32(struct.uptime_secs);
- oprot.writeI32(struct.num_workers);
- oprot.writeI32(struct.num_used_workers);
- oprot.writeString(struct.supervisor_id);
- BitSet optionals = new BitSet();
- if (struct.is_set_version()) {
- optionals.set(0);
- }
- if (struct.is_set_total_resources()) {
- optionals.set(1);
- }
- if (struct.is_set_used_mem()) {
- optionals.set(2);
- }
- if (struct.is_set_used_cpu()) {
- optionals.set(3);
- }
- oprot.writeBitSet(optionals, 4);
- if (struct.is_set_version()) {
- oprot.writeString(struct.version);
- }
- if (struct.is_set_total_resources()) {
- {
- oprot.writeI32(struct.total_resources.size());
- for (Map.Entry<String, Double> _iter103 : struct.total_resources.entrySet())
- {
- oprot.writeString(_iter103.getKey());
- oprot.writeDouble(_iter103.getValue());
- }
- }
- }
- if (struct.is_set_used_mem()) {
- oprot.writeDouble(struct.used_mem);
- }
- if (struct.is_set_used_cpu()) {
- oprot.writeDouble(struct.used_cpu);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, SupervisorSummary struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.host = iprot.readString();
- struct.set_host_isSet(true);
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- struct.num_workers = iprot.readI32();
- struct.set_num_workers_isSet(true);
- struct.num_used_workers = iprot.readI32();
- struct.set_num_used_workers_isSet(true);
- struct.supervisor_id = iprot.readString();
- struct.set_supervisor_id_isSet(true);
- BitSet incoming = iprot.readBitSet(4);
- if (incoming.get(0)) {
- struct.version = iprot.readString();
- struct.set_version_isSet(true);
- }
- if (incoming.get(1)) {
- {
- org.apache.thrift.protocol.TMap _map104 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32());
- struct.total_resources = new HashMap<String,Double>(2*_map104.size);
- String _key105;
- double _val106;
- for (int _i107 = 0; _i107 < _map104.size; ++_i107)
- {
- _key105 = iprot.readString();
- _val106 = iprot.readDouble();
- struct.total_resources.put(_key105, _val106);
- }
- }
- struct.set_total_resources_isSet(true);
- }
- if (incoming.get(2)) {
- struct.used_mem = iprot.readDouble();
- struct.set_used_mem_isSet(true);
- }
- if (incoming.get(3)) {
- struct.used_cpu = iprot.readDouble();
- struct.set_used_cpu_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ThriftSerializedObject.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ThriftSerializedObject.java b/storm-core/src/jvm/backtype/storm/generated/ThriftSerializedObject.java
deleted file mode 100644
index 4aee162..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ThriftSerializedObject.java
+++ /dev/null
@@ -1,516 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSerializedObject, ThriftSerializedObject._Fields>, java.io.Serializable, Cloneable, Comparable<ThriftSerializedObject> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ThriftSerializedObject");
-
- private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField BITS_FIELD_DESC = new org.apache.thrift.protocol.TField("bits", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ThriftSerializedObjectStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ThriftSerializedObjectTupleSchemeFactory());
- }
-
- private String name; // required
- private ByteBuffer bits; // 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 {
- NAME((short)1, "name"),
- BITS((short)2, "bits");
-
- 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: // NAME
- return NAME;
- case 2: // BITS
- return BITS;
- 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.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.BITS, new org.apache.thrift.meta_data.FieldMetaData("bits", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ThriftSerializedObject.class, metaDataMap);
- }
-
- public ThriftSerializedObject() {
- }
-
- public ThriftSerializedObject(
- String name,
- ByteBuffer bits)
- {
- this();
- this.name = name;
- this.bits = org.apache.thrift.TBaseHelper.copyBinary(bits);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ThriftSerializedObject(ThriftSerializedObject other) {
- if (other.is_set_name()) {
- this.name = other.name;
- }
- if (other.is_set_bits()) {
- this.bits = org.apache.thrift.TBaseHelper.copyBinary(other.bits);
- }
- }
-
- public ThriftSerializedObject deepCopy() {
- return new ThriftSerializedObject(this);
- }
-
- @Override
- public void clear() {
- this.name = null;
- this.bits = 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 byte[] get_bits() {
- set_bits(org.apache.thrift.TBaseHelper.rightSize(bits));
- return bits == null ? null : bits.array();
- }
-
- public ByteBuffer buffer_for_bits() {
- return org.apache.thrift.TBaseHelper.copyBinary(bits);
- }
-
- public void set_bits(byte[] bits) {
- this.bits = bits == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(bits, bits.length));
- }
-
- public void set_bits(ByteBuffer bits) {
- this.bits = org.apache.thrift.TBaseHelper.copyBinary(bits);
- }
-
- public void unset_bits() {
- this.bits = null;
- }
-
- /** Returns true if field bits is set (has been assigned a value) and false otherwise */
- public boolean is_set_bits() {
- return this.bits != null;
- }
-
- public void set_bits_isSet(boolean value) {
- if (!value) {
- this.bits = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case NAME:
- if (value == null) {
- unset_name();
- } else {
- set_name((String)value);
- }
- break;
-
- case BITS:
- if (value == null) {
- unset_bits();
- } else {
- set_bits((ByteBuffer)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case NAME:
- return get_name();
-
- case BITS:
- return get_bits();
-
- }
- 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 NAME:
- return is_set_name();
- case BITS:
- return is_set_bits();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ThriftSerializedObject)
- return this.equals((ThriftSerializedObject)that);
- return false;
- }
-
- public boolean equals(ThriftSerializedObject that) {
- if (that == null)
- 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_bits = true && this.is_set_bits();
- boolean that_present_bits = true && that.is_set_bits();
- if (this_present_bits || that_present_bits) {
- if (!(this_present_bits && that_present_bits))
- return false;
- if (!this.bits.equals(that.bits))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_name = true && (is_set_name());
- list.add(present_name);
- if (present_name)
- list.add(name);
-
- boolean present_bits = true && (is_set_bits());
- list.add(present_bits);
- if (present_bits)
- list.add(bits);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ThriftSerializedObject other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- 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_bits()).compareTo(other.is_set_bits());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_bits()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bits, other.bits);
- 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("ThriftSerializedObject(");
- boolean first = true;
-
- sb.append("name:");
- if (this.name == null) {
- sb.append("null");
- } else {
- sb.append(this.name);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("bits:");
- if (this.bits == null) {
- sb.append("null");
- } else {
- org.apache.thrift.TBaseHelper.toString(this.bits, sb);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_name()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' is unset! Struct:" + toString());
- }
-
- if (!is_set_bits()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'bits' 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 ThriftSerializedObjectStandardSchemeFactory implements SchemeFactory {
- public ThriftSerializedObjectStandardScheme getScheme() {
- return new ThriftSerializedObjectStandardScheme();
- }
- }
-
- private static class ThriftSerializedObjectStandardScheme extends StandardScheme<ThriftSerializedObject> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ThriftSerializedObject 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: // 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 2: // BITS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.bits = iprot.readBinary();
- struct.set_bits_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, ThriftSerializedObject struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.name != null) {
- oprot.writeFieldBegin(NAME_FIELD_DESC);
- oprot.writeString(struct.name);
- oprot.writeFieldEnd();
- }
- if (struct.bits != null) {
- oprot.writeFieldBegin(BITS_FIELD_DESC);
- oprot.writeBinary(struct.bits);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ThriftSerializedObjectTupleSchemeFactory implements SchemeFactory {
- public ThriftSerializedObjectTupleScheme getScheme() {
- return new ThriftSerializedObjectTupleScheme();
- }
- }
-
- private static class ThriftSerializedObjectTupleScheme extends TupleScheme<ThriftSerializedObject> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ThriftSerializedObject struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.name);
- oprot.writeBinary(struct.bits);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ThriftSerializedObject struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.name = iprot.readString();
- struct.set_name_isSet(true);
- struct.bits = iprot.readBinary();
- struct.set_bits_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyActionOptions.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyActionOptions.java b/storm-core/src/jvm/backtype/storm/generated/TopologyActionOptions.java
deleted file mode 100644
index 1b6b69d..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/TopologyActionOptions.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActionOptions, TopologyActionOptions._Fields> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyActionOptions");
- private static final org.apache.thrift.protocol.TField KILL_OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("kill_options", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField REBALANCE_OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("rebalance_options", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- KILL_OPTIONS((short)1, "kill_options"),
- REBALANCE_OPTIONS((short)2, "rebalance_options");
-
- 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: // KILL_OPTIONS
- return KILL_OPTIONS;
- case 2: // REBALANCE_OPTIONS
- return REBALANCE_OPTIONS;
- 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;
- }
- }
-
- 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.KILL_OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("kill_options", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, KillOptions.class)));
- tmpMap.put(_Fields.REBALANCE_OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("rebalance_options", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RebalanceOptions.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologyActionOptions.class, metaDataMap);
- }
-
- public TopologyActionOptions() {
- super();
- }
-
- public TopologyActionOptions(_Fields setField, Object value) {
- super(setField, value);
- }
-
- public TopologyActionOptions(TopologyActionOptions other) {
- super(other);
- }
- public TopologyActionOptions deepCopy() {
- return new TopologyActionOptions(this);
- }
-
- public static TopologyActionOptions kill_options(KillOptions value) {
- TopologyActionOptions x = new TopologyActionOptions();
- x.set_kill_options(value);
- return x;
- }
-
- public static TopologyActionOptions rebalance_options(RebalanceOptions value) {
- TopologyActionOptions x = new TopologyActionOptions();
- x.set_rebalance_options(value);
- return x;
- }
-
-
- @Override
- protected void checkType(_Fields setField, Object value) throws ClassCastException {
- switch (setField) {
- case KILL_OPTIONS:
- if (value instanceof KillOptions) {
- break;
- }
- throw new ClassCastException("Was expecting value of type KillOptions for field 'kill_options', but got " + value.getClass().getSimpleName());
- case REBALANCE_OPTIONS:
- if (value instanceof RebalanceOptions) {
- break;
- }
- throw new ClassCastException("Was expecting value of type RebalanceOptions for field 'rebalance_options', but got " + value.getClass().getSimpleName());
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(field.id);
- if (setField != null) {
- switch (setField) {
- case KILL_OPTIONS:
- if (field.type == KILL_OPTIONS_FIELD_DESC.type) {
- KillOptions kill_options;
- kill_options = new KillOptions();
- kill_options.read(iprot);
- return kill_options;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case REBALANCE_OPTIONS:
- if (field.type == REBALANCE_OPTIONS_FIELD_DESC.type) {
- RebalanceOptions rebalance_options;
- rebalance_options = new RebalanceOptions();
- rebalance_options.read(iprot);
- return rebalance_options;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- }
-
- @Override
- protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case KILL_OPTIONS:
- KillOptions kill_options = (KillOptions)value_;
- kill_options.write(oprot);
- return;
- case REBALANCE_OPTIONS:
- RebalanceOptions rebalance_options = (RebalanceOptions)value_;
- rebalance_options.write(oprot);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(fieldID);
- if (setField != null) {
- switch (setField) {
- case KILL_OPTIONS:
- KillOptions kill_options;
- kill_options = new KillOptions();
- kill_options.read(iprot);
- return kill_options;
- case REBALANCE_OPTIONS:
- RebalanceOptions rebalance_options;
- rebalance_options = new RebalanceOptions();
- rebalance_options.read(iprot);
- return rebalance_options;
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- throw new TProtocolException("Couldn't find a field with field id " + fieldID);
- }
- }
-
- @Override
- protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case KILL_OPTIONS:
- KillOptions kill_options = (KillOptions)value_;
- kill_options.write(oprot);
- return;
- case REBALANCE_OPTIONS:
- RebalanceOptions rebalance_options = (RebalanceOptions)value_;
- rebalance_options.write(oprot);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) {
- switch (setField) {
- case KILL_OPTIONS:
- return KILL_OPTIONS_FIELD_DESC;
- case REBALANCE_OPTIONS:
- return REBALANCE_OPTIONS_FIELD_DESC;
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TStruct getStructDesc() {
- return STRUCT_DESC;
- }
-
- @Override
- protected _Fields enumForId(short id) {
- return _Fields.findByThriftIdOrThrow(id);
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
-
- public KillOptions get_kill_options() {
- if (getSetField() == _Fields.KILL_OPTIONS) {
- return (KillOptions)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'kill_options' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_kill_options(KillOptions value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.KILL_OPTIONS;
- value_ = value;
- }
-
- public RebalanceOptions get_rebalance_options() {
- if (getSetField() == _Fields.REBALANCE_OPTIONS) {
- return (RebalanceOptions)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'rebalance_options' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_rebalance_options(RebalanceOptions value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.REBALANCE_OPTIONS;
- value_ = value;
- }
-
- public boolean is_set_kill_options() {
- return setField_ == _Fields.KILL_OPTIONS;
- }
-
-
- public boolean is_set_rebalance_options() {
- return setField_ == _Fields.REBALANCE_OPTIONS;
- }
-
-
- public boolean equals(Object other) {
- if (other instanceof TopologyActionOptions) {
- return equals((TopologyActionOptions)other);
- } else {
- return false;
- }
- }
-
- public boolean equals(TopologyActionOptions other) {
- return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue());
- }
-
- @Override
- public int compareTo(TopologyActionOptions other) {
- int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField());
- if (lastComparison == 0) {
- return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue());
- }
- return lastComparison;
- }
-
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
- list.add(this.getClass().getName());
- org.apache.thrift.TFieldIdEnum setField = getSetField();
- if (setField != null) {
- list.add(setField.getThriftFieldId());
- Object value = getFieldValue();
- if (value instanceof org.apache.thrift.TEnum) {
- list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
- } else {
- list.add(value);
- }
- }
- return list.hashCode();
- }
- 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);
- }
- }
-
-
-}
[54/59] [abbrv] storm git commit: Working on cleaning up the PR.
Posted by ka...@apache.org.
Working on cleaning up the PR.
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/737847c2
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/737847c2
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/737847c2
Branch: refs/heads/1.x-branch
Commit: 737847c24f47b50c3c199d686f8e386d2cb28f2b
Parents: 9c58604
Author: Kyle Nusbaum <Ky...@gmail.com>
Authored: Mon Oct 10 11:10:05 2016 -0500
Committer: Kyle Nusbaum <Ky...@gmail.com>
Committed: Mon Oct 10 11:10:05 2016 -0500
----------------------------------------------------------------------
.../netty/KerberosSaslNettyClient.java | 1 -
.../apache/storm/pacemaker/PacemakerClient.java | 24 +++++++-------------
2 files changed, 8 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/737847c2/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java b/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java
index 00459e2..4402c09 100644
--- a/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java
+++ b/storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslNettyClient.java
@@ -111,7 +111,6 @@ public class KerberosSaslNettyClient {
try {
Principal principal = (Principal)subject.getPrincipals().toArray()[0];
final String fPrincipalName = principal.getName();
- KerberosName kerbName = new KerberosName(principal.getName());
final String fHost = host;
final String fServiceName = serviceName;
final CallbackHandler fch = ch;
http://git-wip-us.apache.org/repos/asf/storm/blob/737847c2/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
index d555dae..67201b8 100644
--- a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
+++ b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
@@ -45,7 +45,7 @@ public class PacemakerClient implements ISaslClient {
private static final Logger LOG = LoggerFactory.getLogger(PacemakerClient.class);
- private String topo_name;
+ private String client_name;
private String secret;
private AtomicBoolean ready;
private final ClientBootstrap bootstrap;
@@ -55,22 +55,16 @@ public class PacemakerClient implements ISaslClient {
private HBMessage messages[];
private LinkedBlockingQueue<Integer> availableMessageSlots;
private ThriftNettyClientCodec.AuthMethod authMethod;
- private static Timer timer;
- private String host;
-
- static {
- timer = new Timer(true);
- }
+ private static Timer timer = new Timer(true);
private StormBoundedExponentialBackoffRetry backoff = new StormBoundedExponentialBackoffRetry(100, 5000, 20);
private int retryTimes = 0;
public PacemakerClient(Map config, String host) {
- this.host = host;
int port = (int)config.get(Config.PACEMAKER_PORT);
- topo_name = (String)config.get(Config.TOPOLOGY_NAME);
- if(topo_name == null) {
- topo_name = "pacemaker-client";
+ client_name = (String)config.get(Config.TOPOLOGY_NAME);
+ if(client_name == null) {
+ client_name = "pacemaker-client";
}
String auth = (String)config.get(Config.PACEMAKER_AUTH_METHOD);
@@ -122,10 +116,6 @@ public class PacemakerClient implements ISaslClient {
bootstrap.connect(remote_addr);
}
- public String toString() {
- return host;
- }
-
private void setupMessaging() {
messages = new HBMessage[maxPending];
availableMessageSlots = new LinkedBlockingQueue<Integer>();
@@ -134,6 +124,7 @@ public class PacemakerClient implements ISaslClient {
}
}
+ @Override
public synchronized void channelConnected(Channel channel) {
Channel oldChannel = channelRef.get();
if (oldChannel != null) {
@@ -156,6 +147,7 @@ public class PacemakerClient implements ISaslClient {
return ready.get();
}
+ @Override
public synchronized void channelReady() {
LOG.debug("Channel is ready.");
ready.set(true);
@@ -163,7 +155,7 @@ public class PacemakerClient implements ISaslClient {
}
public String name() {
- return topo_name;
+ return client_name;
}
public String secretKey() {
[12/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SpoutStats.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/SpoutStats.java b/storm-core/src/jvm/backtype/storm/generated/SpoutStats.java
deleted file mode 100644
index b1384f6..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/SpoutStats.java
+++ /dev/null
@@ -1,917 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class SpoutStats implements org.apache.thrift.TBase<SpoutStats, SpoutStats._Fields>, java.io.Serializable, Cloneable, Comparable<SpoutStats> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpoutStats");
-
- private static final org.apache.thrift.protocol.TField ACKED_FIELD_DESC = new org.apache.thrift.protocol.TField("acked", org.apache.thrift.protocol.TType.MAP, (short)1);
- private static final org.apache.thrift.protocol.TField FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("failed", org.apache.thrift.protocol.TType.MAP, (short)2);
- private static final org.apache.thrift.protocol.TField COMPLETE_MS_AVG_FIELD_DESC = new org.apache.thrift.protocol.TField("complete_ms_avg", org.apache.thrift.protocol.TType.MAP, (short)3);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new SpoutStatsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new SpoutStatsTupleSchemeFactory());
- }
-
- private Map<String,Map<String,Long>> acked; // required
- private Map<String,Map<String,Long>> failed; // required
- private Map<String,Map<String,Double>> complete_ms_avg; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- ACKED((short)1, "acked"),
- FAILED((short)2, "failed"),
- COMPLETE_MS_AVG((short)3, "complete_ms_avg");
-
- private static final Map<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: // ACKED
- return ACKED;
- case 2: // FAILED
- return FAILED;
- case 3: // COMPLETE_MS_AVG
- return COMPLETE_MS_AVG;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant 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.ACKED, new org.apache.thrift.meta_data.FieldMetaData("acked", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.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.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))));
- tmpMap.put(_Fields.FAILED, new org.apache.thrift.meta_data.FieldMetaData("failed", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.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.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))));
- tmpMap.put(_Fields.COMPLETE_MS_AVG, new org.apache.thrift.meta_data.FieldMetaData("complete_ms_avg", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.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.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SpoutStats.class, metaDataMap);
- }
-
- public SpoutStats() {
- }
-
- public SpoutStats(
- Map<String,Map<String,Long>> acked,
- Map<String,Map<String,Long>> failed,
- Map<String,Map<String,Double>> complete_ms_avg)
- {
- this();
- this.acked = acked;
- this.failed = failed;
- this.complete_ms_avg = complete_ms_avg;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public SpoutStats(SpoutStats other) {
- if (other.is_set_acked()) {
- Map<String,Map<String,Long>> __this__acked = new HashMap<String,Map<String,Long>>(other.acked.size());
- for (Map.Entry<String, Map<String,Long>> other_element : other.acked.entrySet()) {
-
- String other_element_key = other_element.getKey();
- Map<String,Long> other_element_value = other_element.getValue();
-
- String __this__acked_copy_key = other_element_key;
-
- Map<String,Long> __this__acked_copy_value = new HashMap<String,Long>(other_element_value);
-
- __this__acked.put(__this__acked_copy_key, __this__acked_copy_value);
- }
- this.acked = __this__acked;
- }
- if (other.is_set_failed()) {
- Map<String,Map<String,Long>> __this__failed = new HashMap<String,Map<String,Long>>(other.failed.size());
- for (Map.Entry<String, Map<String,Long>> other_element : other.failed.entrySet()) {
-
- String other_element_key = other_element.getKey();
- Map<String,Long> other_element_value = other_element.getValue();
-
- String __this__failed_copy_key = other_element_key;
-
- Map<String,Long> __this__failed_copy_value = new HashMap<String,Long>(other_element_value);
-
- __this__failed.put(__this__failed_copy_key, __this__failed_copy_value);
- }
- this.failed = __this__failed;
- }
- if (other.is_set_complete_ms_avg()) {
- Map<String,Map<String,Double>> __this__complete_ms_avg = new HashMap<String,Map<String,Double>>(other.complete_ms_avg.size());
- for (Map.Entry<String, Map<String,Double>> other_element : other.complete_ms_avg.entrySet()) {
-
- String other_element_key = other_element.getKey();
- Map<String,Double> other_element_value = other_element.getValue();
-
- String __this__complete_ms_avg_copy_key = other_element_key;
-
- Map<String,Double> __this__complete_ms_avg_copy_value = new HashMap<String,Double>(other_element_value);
-
- __this__complete_ms_avg.put(__this__complete_ms_avg_copy_key, __this__complete_ms_avg_copy_value);
- }
- this.complete_ms_avg = __this__complete_ms_avg;
- }
- }
-
- public SpoutStats deepCopy() {
- return new SpoutStats(this);
- }
-
- @Override
- public void clear() {
- this.acked = null;
- this.failed = null;
- this.complete_ms_avg = null;
- }
-
- public int get_acked_size() {
- return (this.acked == null) ? 0 : this.acked.size();
- }
-
- public void put_to_acked(String key, Map<String,Long> val) {
- if (this.acked == null) {
- this.acked = new HashMap<String,Map<String,Long>>();
- }
- this.acked.put(key, val);
- }
-
- public Map<String,Map<String,Long>> get_acked() {
- return this.acked;
- }
-
- public void set_acked(Map<String,Map<String,Long>> acked) {
- this.acked = acked;
- }
-
- public void unset_acked() {
- this.acked = null;
- }
-
- /** Returns true if field acked is set (has been assigned a value) and false otherwise */
- public boolean is_set_acked() {
- return this.acked != null;
- }
-
- public void set_acked_isSet(boolean value) {
- if (!value) {
- this.acked = null;
- }
- }
-
- public int get_failed_size() {
- return (this.failed == null) ? 0 : this.failed.size();
- }
-
- public void put_to_failed(String key, Map<String,Long> val) {
- if (this.failed == null) {
- this.failed = new HashMap<String,Map<String,Long>>();
- }
- this.failed.put(key, val);
- }
-
- public Map<String,Map<String,Long>> get_failed() {
- return this.failed;
- }
-
- public void set_failed(Map<String,Map<String,Long>> failed) {
- this.failed = failed;
- }
-
- public void unset_failed() {
- this.failed = null;
- }
-
- /** Returns true if field failed is set (has been assigned a value) and false otherwise */
- public boolean is_set_failed() {
- return this.failed != null;
- }
-
- public void set_failed_isSet(boolean value) {
- if (!value) {
- this.failed = null;
- }
- }
-
- public int get_complete_ms_avg_size() {
- return (this.complete_ms_avg == null) ? 0 : this.complete_ms_avg.size();
- }
-
- public void put_to_complete_ms_avg(String key, Map<String,Double> val) {
- if (this.complete_ms_avg == null) {
- this.complete_ms_avg = new HashMap<String,Map<String,Double>>();
- }
- this.complete_ms_avg.put(key, val);
- }
-
- public Map<String,Map<String,Double>> get_complete_ms_avg() {
- return this.complete_ms_avg;
- }
-
- public void set_complete_ms_avg(Map<String,Map<String,Double>> complete_ms_avg) {
- this.complete_ms_avg = complete_ms_avg;
- }
-
- public void unset_complete_ms_avg() {
- this.complete_ms_avg = null;
- }
-
- /** Returns true if field complete_ms_avg is set (has been assigned a value) and false otherwise */
- public boolean is_set_complete_ms_avg() {
- return this.complete_ms_avg != null;
- }
-
- public void set_complete_ms_avg_isSet(boolean value) {
- if (!value) {
- this.complete_ms_avg = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ACKED:
- if (value == null) {
- unset_acked();
- } else {
- set_acked((Map<String,Map<String,Long>>)value);
- }
- break;
-
- case FAILED:
- if (value == null) {
- unset_failed();
- } else {
- set_failed((Map<String,Map<String,Long>>)value);
- }
- break;
-
- case COMPLETE_MS_AVG:
- if (value == null) {
- unset_complete_ms_avg();
- } else {
- set_complete_ms_avg((Map<String,Map<String,Double>>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ACKED:
- return get_acked();
-
- case FAILED:
- return get_failed();
-
- case COMPLETE_MS_AVG:
- return get_complete_ms_avg();
-
- }
- 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 ACKED:
- return is_set_acked();
- case FAILED:
- return is_set_failed();
- case COMPLETE_MS_AVG:
- return is_set_complete_ms_avg();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof SpoutStats)
- return this.equals((SpoutStats)that);
- return false;
- }
-
- public boolean equals(SpoutStats that) {
- if (that == null)
- return false;
-
- boolean this_present_acked = true && this.is_set_acked();
- boolean that_present_acked = true && that.is_set_acked();
- if (this_present_acked || that_present_acked) {
- if (!(this_present_acked && that_present_acked))
- return false;
- if (!this.acked.equals(that.acked))
- return false;
- }
-
- boolean this_present_failed = true && this.is_set_failed();
- boolean that_present_failed = true && that.is_set_failed();
- if (this_present_failed || that_present_failed) {
- if (!(this_present_failed && that_present_failed))
- return false;
- if (!this.failed.equals(that.failed))
- return false;
- }
-
- boolean this_present_complete_ms_avg = true && this.is_set_complete_ms_avg();
- boolean that_present_complete_ms_avg = true && that.is_set_complete_ms_avg();
- if (this_present_complete_ms_avg || that_present_complete_ms_avg) {
- if (!(this_present_complete_ms_avg && that_present_complete_ms_avg))
- return false;
- if (!this.complete_ms_avg.equals(that.complete_ms_avg))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_acked = true && (is_set_acked());
- list.add(present_acked);
- if (present_acked)
- list.add(acked);
-
- boolean present_failed = true && (is_set_failed());
- list.add(present_failed);
- if (present_failed)
- list.add(failed);
-
- boolean present_complete_ms_avg = true && (is_set_complete_ms_avg());
- list.add(present_complete_ms_avg);
- if (present_complete_ms_avg)
- list.add(complete_ms_avg);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(SpoutStats other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_acked()).compareTo(other.is_set_acked());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_acked()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acked, other.acked);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_failed()).compareTo(other.is_set_failed());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_failed()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failed, other.failed);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_complete_ms_avg()).compareTo(other.is_set_complete_ms_avg());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_complete_ms_avg()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.complete_ms_avg, other.complete_ms_avg);
- 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("SpoutStats(");
- boolean first = true;
-
- sb.append("acked:");
- if (this.acked == null) {
- sb.append("null");
- } else {
- sb.append(this.acked);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("failed:");
- if (this.failed == null) {
- sb.append("null");
- } else {
- sb.append(this.failed);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("complete_ms_avg:");
- if (this.complete_ms_avg == null) {
- sb.append("null");
- } else {
- sb.append(this.complete_ms_avg);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_acked()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'acked' is unset! Struct:" + toString());
- }
-
- if (!is_set_failed()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'failed' is unset! Struct:" + toString());
- }
-
- if (!is_set_complete_ms_avg()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'complete_ms_avg' 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 SpoutStatsStandardSchemeFactory implements SchemeFactory {
- public SpoutStatsStandardScheme getScheme() {
- return new SpoutStatsStandardScheme();
- }
- }
-
- private static class SpoutStatsStandardScheme extends StandardScheme<SpoutStats> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, SpoutStats 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: // ACKED
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map232 = iprot.readMapBegin();
- struct.acked = new HashMap<String,Map<String,Long>>(2*_map232.size);
- String _key233;
- Map<String,Long> _val234;
- for (int _i235 = 0; _i235 < _map232.size; ++_i235)
- {
- _key233 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map236 = iprot.readMapBegin();
- _val234 = new HashMap<String,Long>(2*_map236.size);
- String _key237;
- long _val238;
- for (int _i239 = 0; _i239 < _map236.size; ++_i239)
- {
- _key237 = iprot.readString();
- _val238 = iprot.readI64();
- _val234.put(_key237, _val238);
- }
- iprot.readMapEnd();
- }
- struct.acked.put(_key233, _val234);
- }
- iprot.readMapEnd();
- }
- struct.set_acked_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // FAILED
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map240 = iprot.readMapBegin();
- struct.failed = new HashMap<String,Map<String,Long>>(2*_map240.size);
- String _key241;
- Map<String,Long> _val242;
- for (int _i243 = 0; _i243 < _map240.size; ++_i243)
- {
- _key241 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map244 = iprot.readMapBegin();
- _val242 = new HashMap<String,Long>(2*_map244.size);
- String _key245;
- long _val246;
- for (int _i247 = 0; _i247 < _map244.size; ++_i247)
- {
- _key245 = iprot.readString();
- _val246 = iprot.readI64();
- _val242.put(_key245, _val246);
- }
- iprot.readMapEnd();
- }
- struct.failed.put(_key241, _val242);
- }
- iprot.readMapEnd();
- }
- struct.set_failed_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // COMPLETE_MS_AVG
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map248 = iprot.readMapBegin();
- struct.complete_ms_avg = new HashMap<String,Map<String,Double>>(2*_map248.size);
- String _key249;
- Map<String,Double> _val250;
- for (int _i251 = 0; _i251 < _map248.size; ++_i251)
- {
- _key249 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map252 = iprot.readMapBegin();
- _val250 = new HashMap<String,Double>(2*_map252.size);
- String _key253;
- double _val254;
- for (int _i255 = 0; _i255 < _map252.size; ++_i255)
- {
- _key253 = iprot.readString();
- _val254 = iprot.readDouble();
- _val250.put(_key253, _val254);
- }
- iprot.readMapEnd();
- }
- struct.complete_ms_avg.put(_key249, _val250);
- }
- iprot.readMapEnd();
- }
- struct.set_complete_ms_avg_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, SpoutStats struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.acked != null) {
- oprot.writeFieldBegin(ACKED_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.acked.size()));
- for (Map.Entry<String, Map<String,Long>> _iter256 : struct.acked.entrySet())
- {
- oprot.writeString(_iter256.getKey());
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, _iter256.getValue().size()));
- for (Map.Entry<String, Long> _iter257 : _iter256.getValue().entrySet())
- {
- oprot.writeString(_iter257.getKey());
- oprot.writeI64(_iter257.getValue());
- }
- oprot.writeMapEnd();
- }
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.failed != null) {
- oprot.writeFieldBegin(FAILED_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.failed.size()));
- for (Map.Entry<String, Map<String,Long>> _iter258 : struct.failed.entrySet())
- {
- oprot.writeString(_iter258.getKey());
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, _iter258.getValue().size()));
- for (Map.Entry<String, Long> _iter259 : _iter258.getValue().entrySet())
- {
- oprot.writeString(_iter259.getKey());
- oprot.writeI64(_iter259.getValue());
- }
- oprot.writeMapEnd();
- }
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.complete_ms_avg != null) {
- oprot.writeFieldBegin(COMPLETE_MS_AVG_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.complete_ms_avg.size()));
- for (Map.Entry<String, Map<String,Double>> _iter260 : struct.complete_ms_avg.entrySet())
- {
- oprot.writeString(_iter260.getKey());
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, _iter260.getValue().size()));
- for (Map.Entry<String, Double> _iter261 : _iter260.getValue().entrySet())
- {
- oprot.writeString(_iter261.getKey());
- oprot.writeDouble(_iter261.getValue());
- }
- oprot.writeMapEnd();
- }
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class SpoutStatsTupleSchemeFactory implements SchemeFactory {
- public SpoutStatsTupleScheme getScheme() {
- return new SpoutStatsTupleScheme();
- }
- }
-
- private static class SpoutStatsTupleScheme extends TupleScheme<SpoutStats> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, SpoutStats struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.acked.size());
- for (Map.Entry<String, Map<String,Long>> _iter262 : struct.acked.entrySet())
- {
- oprot.writeString(_iter262.getKey());
- {
- oprot.writeI32(_iter262.getValue().size());
- for (Map.Entry<String, Long> _iter263 : _iter262.getValue().entrySet())
- {
- oprot.writeString(_iter263.getKey());
- oprot.writeI64(_iter263.getValue());
- }
- }
- }
- }
- {
- oprot.writeI32(struct.failed.size());
- for (Map.Entry<String, Map<String,Long>> _iter264 : struct.failed.entrySet())
- {
- oprot.writeString(_iter264.getKey());
- {
- oprot.writeI32(_iter264.getValue().size());
- for (Map.Entry<String, Long> _iter265 : _iter264.getValue().entrySet())
- {
- oprot.writeString(_iter265.getKey());
- oprot.writeI64(_iter265.getValue());
- }
- }
- }
- }
- {
- oprot.writeI32(struct.complete_ms_avg.size());
- for (Map.Entry<String, Map<String,Double>> _iter266 : struct.complete_ms_avg.entrySet())
- {
- oprot.writeString(_iter266.getKey());
- {
- oprot.writeI32(_iter266.getValue().size());
- for (Map.Entry<String, Double> _iter267 : _iter266.getValue().entrySet())
- {
- oprot.writeString(_iter267.getKey());
- oprot.writeDouble(_iter267.getValue());
- }
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, SpoutStats struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TMap _map268 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32());
- struct.acked = new HashMap<String,Map<String,Long>>(2*_map268.size);
- String _key269;
- Map<String,Long> _val270;
- for (int _i271 = 0; _i271 < _map268.size; ++_i271)
- {
- _key269 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map272 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- _val270 = new HashMap<String,Long>(2*_map272.size);
- String _key273;
- long _val274;
- for (int _i275 = 0; _i275 < _map272.size; ++_i275)
- {
- _key273 = iprot.readString();
- _val274 = iprot.readI64();
- _val270.put(_key273, _val274);
- }
- }
- struct.acked.put(_key269, _val270);
- }
- }
- struct.set_acked_isSet(true);
- {
- org.apache.thrift.protocol.TMap _map276 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32());
- struct.failed = new HashMap<String,Map<String,Long>>(2*_map276.size);
- String _key277;
- Map<String,Long> _val278;
- for (int _i279 = 0; _i279 < _map276.size; ++_i279)
- {
- _key277 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map280 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- _val278 = new HashMap<String,Long>(2*_map280.size);
- String _key281;
- long _val282;
- for (int _i283 = 0; _i283 < _map280.size; ++_i283)
- {
- _key281 = iprot.readString();
- _val282 = iprot.readI64();
- _val278.put(_key281, _val282);
- }
- }
- struct.failed.put(_key277, _val278);
- }
- }
- struct.set_failed_isSet(true);
- {
- org.apache.thrift.protocol.TMap _map284 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32());
- struct.complete_ms_avg = new HashMap<String,Map<String,Double>>(2*_map284.size);
- String _key285;
- Map<String,Double> _val286;
- for (int _i287 = 0; _i287 < _map284.size; ++_i287)
- {
- _key285 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map288 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32());
- _val286 = new HashMap<String,Double>(2*_map288.size);
- String _key289;
- double _val290;
- for (int _i291 = 0; _i291 < _map288.size; ++_i291)
- {
- _key289 = iprot.readString();
- _val290 = iprot.readDouble();
- _val286.put(_key289, _val290);
- }
- }
- struct.complete_ms_avg.put(_key285, _val286);
- }
- }
- struct.set_complete_ms_avg_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/StateSpoutSpec.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/StateSpoutSpec.java b/storm-core/src/jvm/backtype/storm/generated/StateSpoutSpec.java
deleted file mode 100644
index c6ab89d..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/StateSpoutSpec.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class StateSpoutSpec implements org.apache.thrift.TBase<StateSpoutSpec, StateSpoutSpec._Fields>, java.io.Serializable, Cloneable, Comparable<StateSpoutSpec> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StateSpoutSpec");
-
- private static final org.apache.thrift.protocol.TField STATE_SPOUT_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("state_spout_object", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField COMMON_FIELD_DESC = new org.apache.thrift.protocol.TField("common", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new StateSpoutSpecStandardSchemeFactory());
- schemes.put(TupleScheme.class, new StateSpoutSpecTupleSchemeFactory());
- }
-
- private ComponentObject state_spout_object; // required
- private ComponentCommon common; // 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 {
- STATE_SPOUT_OBJECT((short)1, "state_spout_object"),
- COMMON((short)2, "common");
-
- 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: // STATE_SPOUT_OBJECT
- return STATE_SPOUT_OBJECT;
- case 2: // COMMON
- return COMMON;
- 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.STATE_SPOUT_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("state_spout_object", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentObject.class)));
- tmpMap.put(_Fields.COMMON, new org.apache.thrift.meta_data.FieldMetaData("common", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentCommon.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StateSpoutSpec.class, metaDataMap);
- }
-
- public StateSpoutSpec() {
- }
-
- public StateSpoutSpec(
- ComponentObject state_spout_object,
- ComponentCommon common)
- {
- this();
- this.state_spout_object = state_spout_object;
- this.common = common;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public StateSpoutSpec(StateSpoutSpec other) {
- if (other.is_set_state_spout_object()) {
- this.state_spout_object = new ComponentObject(other.state_spout_object);
- }
- if (other.is_set_common()) {
- this.common = new ComponentCommon(other.common);
- }
- }
-
- public StateSpoutSpec deepCopy() {
- return new StateSpoutSpec(this);
- }
-
- @Override
- public void clear() {
- this.state_spout_object = null;
- this.common = null;
- }
-
- public ComponentObject get_state_spout_object() {
- return this.state_spout_object;
- }
-
- public void set_state_spout_object(ComponentObject state_spout_object) {
- this.state_spout_object = state_spout_object;
- }
-
- public void unset_state_spout_object() {
- this.state_spout_object = null;
- }
-
- /** Returns true if field state_spout_object is set (has been assigned a value) and false otherwise */
- public boolean is_set_state_spout_object() {
- return this.state_spout_object != null;
- }
-
- public void set_state_spout_object_isSet(boolean value) {
- if (!value) {
- this.state_spout_object = null;
- }
- }
-
- public ComponentCommon get_common() {
- return this.common;
- }
-
- public void set_common(ComponentCommon common) {
- this.common = common;
- }
-
- public void unset_common() {
- this.common = null;
- }
-
- /** Returns true if field common is set (has been assigned a value) and false otherwise */
- public boolean is_set_common() {
- return this.common != null;
- }
-
- public void set_common_isSet(boolean value) {
- if (!value) {
- this.common = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case STATE_SPOUT_OBJECT:
- if (value == null) {
- unset_state_spout_object();
- } else {
- set_state_spout_object((ComponentObject)value);
- }
- break;
-
- case COMMON:
- if (value == null) {
- unset_common();
- } else {
- set_common((ComponentCommon)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case STATE_SPOUT_OBJECT:
- return get_state_spout_object();
-
- case COMMON:
- return get_common();
-
- }
- 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 STATE_SPOUT_OBJECT:
- return is_set_state_spout_object();
- case COMMON:
- return is_set_common();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof StateSpoutSpec)
- return this.equals((StateSpoutSpec)that);
- return false;
- }
-
- public boolean equals(StateSpoutSpec that) {
- if (that == null)
- return false;
-
- boolean this_present_state_spout_object = true && this.is_set_state_spout_object();
- boolean that_present_state_spout_object = true && that.is_set_state_spout_object();
- if (this_present_state_spout_object || that_present_state_spout_object) {
- if (!(this_present_state_spout_object && that_present_state_spout_object))
- return false;
- if (!this.state_spout_object.equals(that.state_spout_object))
- return false;
- }
-
- boolean this_present_common = true && this.is_set_common();
- boolean that_present_common = true && that.is_set_common();
- if (this_present_common || that_present_common) {
- if (!(this_present_common && that_present_common))
- return false;
- if (!this.common.equals(that.common))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_state_spout_object = true && (is_set_state_spout_object());
- list.add(present_state_spout_object);
- if (present_state_spout_object)
- list.add(state_spout_object);
-
- boolean present_common = true && (is_set_common());
- list.add(present_common);
- if (present_common)
- list.add(common);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(StateSpoutSpec other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_state_spout_object()).compareTo(other.is_set_state_spout_object());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_state_spout_object()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state_spout_object, other.state_spout_object);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_common()).compareTo(other.is_set_common());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_common()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.common, other.common);
- 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("StateSpoutSpec(");
- boolean first = true;
-
- sb.append("state_spout_object:");
- if (this.state_spout_object == null) {
- sb.append("null");
- } else {
- sb.append(this.state_spout_object);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("common:");
- if (this.common == null) {
- sb.append("null");
- } else {
- sb.append(this.common);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_state_spout_object()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'state_spout_object' is unset! Struct:" + toString());
- }
-
- if (!is_set_common()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'common' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- if (common != null) {
- common.validate();
- }
- }
-
- 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 StateSpoutSpecStandardSchemeFactory implements SchemeFactory {
- public StateSpoutSpecStandardScheme getScheme() {
- return new StateSpoutSpecStandardScheme();
- }
- }
-
- private static class StateSpoutSpecStandardScheme extends StandardScheme<StateSpoutSpec> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, StateSpoutSpec 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: // STATE_SPOUT_OBJECT
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.state_spout_object = new ComponentObject();
- struct.state_spout_object.read(iprot);
- struct.set_state_spout_object_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // COMMON
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.common = new ComponentCommon();
- struct.common.read(iprot);
- struct.set_common_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, StateSpoutSpec struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.state_spout_object != null) {
- oprot.writeFieldBegin(STATE_SPOUT_OBJECT_FIELD_DESC);
- struct.state_spout_object.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.common != null) {
- oprot.writeFieldBegin(COMMON_FIELD_DESC);
- struct.common.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class StateSpoutSpecTupleSchemeFactory implements SchemeFactory {
- public StateSpoutSpecTupleScheme getScheme() {
- return new StateSpoutSpecTupleScheme();
- }
- }
-
- private static class StateSpoutSpecTupleScheme extends TupleScheme<StateSpoutSpec> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, StateSpoutSpec struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- struct.state_spout_object.write(oprot);
- struct.common.write(oprot);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, StateSpoutSpec struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.state_spout_object = new ComponentObject();
- struct.state_spout_object.read(iprot);
- struct.set_state_spout_object_isSet(true);
- struct.common = new ComponentCommon();
- struct.common.read(iprot);
- struct.set_common_isSet(true);
- }
- }
-
-}
-
[51/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
Ported successfully.
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/a6171bd6
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/a6171bd6
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/a6171bd6
Branch: refs/heads/1.x-branch
Commit: a6171bd6770676d4d0bdb9c9d05a4785df35b671
Parents: dd7ff1e
Author: Kyle Nusbaum <Ky...@gmail.com>
Authored: Thu Sep 29 15:43:09 2016 -0500
Committer: Kyle Nusbaum <Ky...@gmail.com>
Committed: Thu Sep 29 15:43:09 2016 -0500
----------------------------------------------------------------------
.../src/clj/backtype/storm/LocalCluster.clj | 106 -
storm-core/src/clj/backtype/storm/LocalDRPC.clj | 56 -
.../src/clj/backtype/storm/MockAutoCred.clj | 58 -
storm-core/src/clj/backtype/storm/blobstore.clj | 28 -
storm-core/src/clj/backtype/storm/clojure.clj | 204 -
storm-core/src/clj/backtype/storm/cluster.clj | 708 -
.../cluster_state/zookeeper_state_factory.clj | 165 -
.../src/clj/backtype/storm/command/activate.clj | 24 -
.../clj/backtype/storm/command/blobstore.clj | 162 -
.../clj/backtype/storm/command/config_value.clj | 24 -
.../clj/backtype/storm/command/deactivate.clj | 24 -
.../backtype/storm/command/dev_zookeeper.clj | 26 -
.../clj/backtype/storm/command/get_errors.clj | 52 -
.../clj/backtype/storm/command/healthcheck.clj | 88 -
.../clj/backtype/storm/command/heartbeats.clj | 52 -
.../backtype/storm/command/kill_topology.clj | 29 -
.../clj/backtype/storm/command/kill_workers.clj | 33 -
.../src/clj/backtype/storm/command/list.clj | 38 -
.../src/clj/backtype/storm/command/monitor.clj | 37 -
.../clj/backtype/storm/command/rebalance.clj | 46 -
.../backtype/storm/command/set_log_level.clj | 75 -
.../backtype/storm/command/shell_submission.clj | 34 -
.../storm/command/upload_credentials.clj | 35 -
storm-core/src/clj/backtype/storm/config.clj | 338 -
storm-core/src/clj/backtype/storm/converter.clj | 277 -
.../src/clj/backtype/storm/daemon/acker.clj | 116 -
.../backtype/storm/daemon/builtin_metrics.clj | 98 -
.../src/clj/backtype/storm/daemon/common.clj | 431 -
.../src/clj/backtype/storm/daemon/drpc.clj | 278 -
.../src/clj/backtype/storm/daemon/executor.clj | 864 -
.../src/clj/backtype/storm/daemon/logviewer.clj | 1232 -
.../src/clj/backtype/storm/daemon/nimbus.clj | 2514 -
.../clj/backtype/storm/daemon/supervisor.clj | 1272 -
.../src/clj/backtype/storm/daemon/task.clj | 189 -
.../src/clj/backtype/storm/daemon/worker.clj | 768 -
storm-core/src/clj/backtype/storm/disruptor.clj | 89 -
storm-core/src/clj/backtype/storm/event.clj | 71 -
.../src/clj/backtype/storm/local_state.clj | 131 -
storm-core/src/clj/backtype/storm/log.clj | 56 -
.../src/clj/backtype/storm/messaging/loader.clj | 34 -
.../src/clj/backtype/storm/messaging/local.clj | 23 -
.../src/clj/backtype/storm/metric/testing.clj | 68 -
.../clj/backtype/storm/pacemaker/pacemaker.clj | 241 -
.../storm/pacemaker/pacemaker_state_factory.clj | 125 -
.../clj/backtype/storm/process_simulator.clj | 51 -
.../storm/scheduler/DefaultScheduler.clj | 77 -
.../backtype/storm/scheduler/EvenScheduler.clj | 81 -
.../storm/scheduler/IsolationScheduler.clj | 219 -
storm-core/src/clj/backtype/storm/stats.clj | 1584 -
storm-core/src/clj/backtype/storm/testing.clj | 702 -
storm-core/src/clj/backtype/storm/testing4j.clj | 186 -
storm-core/src/clj/backtype/storm/thrift.clj | 284 -
storm-core/src/clj/backtype/storm/timer.clj | 128 -
.../src/clj/backtype/storm/trident/testing.clj | 79 -
storm-core/src/clj/backtype/storm/ui/core.clj | 1487 -
.../src/clj/backtype/storm/ui/helpers.clj | 275 -
storm-core/src/clj/backtype/storm/util.clj | 1134 -
storm-core/src/clj/backtype/storm/zookeeper.clj | 327 -
.../storm/pacemaker/pacemaker_state_factory.clj | 5 +-
storm-core/src/jvm/backtype/storm/Config.java | 2473 -
.../src/jvm/backtype/storm/Constants.java | 36 -
.../backtype/storm/ICredentialsListener.java | 32 -
.../src/jvm/backtype/storm/ILocalCluster.java | 49 -
.../src/jvm/backtype/storm/ILocalDRPC.java | 27 -
.../src/jvm/backtype/storm/ISubmitterHook.java | 31 -
.../src/jvm/backtype/storm/LogWriter.java | 83 -
.../src/jvm/backtype/storm/StormSubmitter.java | 586 -
.../storm/blobstore/AtomicOutputStream.java | 32 -
.../storm/blobstore/BlobKeySequenceInfo.java | 40 -
.../jvm/backtype/storm/blobstore/BlobStore.java | 452 -
.../storm/blobstore/BlobStoreAclHandler.java | 409 -
.../backtype/storm/blobstore/BlobStoreFile.java | 50 -
.../storm/blobstore/BlobStoreUtils.java | 276 -
.../storm/blobstore/BlobSynchronizer.java | 124 -
.../storm/blobstore/ClientBlobStore.java | 184 -
.../storm/blobstore/FileBlobStoreImpl.java | 248 -
.../storm/blobstore/InputStreamWithMeta.java | 26 -
.../jvm/backtype/storm/blobstore/KeyFilter.java | 22 -
.../storm/blobstore/KeySequenceNumber.java | 229 -
.../storm/blobstore/LocalFsBlobStore.java | 311 -
.../storm/blobstore/LocalFsBlobStoreFile.java | 159 -
.../storm/blobstore/NimbusBlobStore.java | 423 -
.../jvm/backtype/storm/clojure/ClojureBolt.java | 119 -
.../backtype/storm/clojure/ClojureSpout.java | 153 -
.../backtype/storm/clojure/RichShellBolt.java | 51 -
.../backtype/storm/clojure/RichShellSpout.java | 51 -
.../backtype/storm/cluster/ClusterState.java | 217 -
.../storm/cluster/ClusterStateContext.java | 41 -
.../storm/cluster/ClusterStateFactory.java | 28 -
.../storm/cluster/ClusterStateListener.java | 22 -
.../backtype/storm/cluster/ConnectionState.java | 24 -
.../jvm/backtype/storm/cluster/DaemonType.java | 27 -
.../storm/coordination/BatchBoltExecutor.java | 108 -
.../coordination/BatchOutputCollector.java | 46 -
.../coordination/BatchOutputCollectorImpl.java | 53 -
.../coordination/BatchSubtopologyBuilder.java | 447 -
.../storm/coordination/CoordinatedBolt.java | 386 -
.../backtype/storm/coordination/IBatchBolt.java | 30 -
.../daemon/ClientJarTransformerRunner.java | 41 -
.../backtype/storm/daemon/DirectoryCleaner.java | 177 -
.../backtype/storm/daemon/JarTransformer.java | 31 -
.../jvm/backtype/storm/daemon/Shutdownable.java | 22 -
.../storm/daemon/metrics/MetricsUtils.java | 121 -
.../reporters/ConsolePreparableReporter.java | 76 -
.../reporters/CsvPreparableReporter.java | 80 -
.../reporters/JmxPreparableReporter.java | 70 -
.../metrics/reporters/PreparableReporter.java | 32 -
.../dependency/DependencyPropertiesParser.java | 61 -
.../storm/dependency/DependencyUploader.java | 166 -
.../dependency/FileNotAvailableException.java | 33 -
.../storm/drpc/DRPCInvocationsClient.java | 113 -
.../src/jvm/backtype/storm/drpc/DRPCSpout.java | 263 -
.../src/jvm/backtype/storm/drpc/JoinResult.java | 75 -
.../jvm/backtype/storm/drpc/KeyedFairBolt.java | 93 -
.../storm/drpc/LinearDRPCInputDeclarer.java | 52 -
.../storm/drpc/LinearDRPCTopologyBuilder.java | 393 -
.../jvm/backtype/storm/drpc/PrepareRequest.java | 59 -
.../jvm/backtype/storm/drpc/ReturnResults.java | 129 -
.../backtype/storm/generated/AccessControl.java | 627 -
.../storm/generated/AccessControlType.java | 62 -
.../storm/generated/AlreadyAliveException.java | 406 -
.../backtype/storm/generated/Assignment.java | 1159 -
.../storm/generated/AuthorizationException.java | 406 -
.../storm/generated/BeginDownloadResult.java | 608 -
.../src/jvm/backtype/storm/generated/Bolt.java | 514 -
.../storm/generated/BoltAggregateStats.java | 704 -
.../jvm/backtype/storm/generated/BoltStats.java | 1390 -
.../storm/generated/ClusterSummary.java | 879 -
.../storm/generated/ClusterWorkerHeartbeat.java | 768 -
.../storm/generated/CommonAggregateStats.java | 1060 -
.../generated/ComponentAggregateStats.java | 752 -
.../storm/generated/ComponentCommon.java | 852 -
.../storm/generated/ComponentObject.java | 462 -
.../storm/generated/ComponentPageInfo.java | 2352 -
.../backtype/storm/generated/ComponentType.java | 62 -
.../backtype/storm/generated/Credentials.java | 458 -
.../storm/generated/DRPCExecutionException.java | 406 -
.../backtype/storm/generated/DRPCRequest.java | 507 -
.../backtype/storm/generated/DebugOptions.java | 506 -
.../storm/generated/DistributedRPC.java | 1328 -
.../generated/DistributedRPCInvocations.java | 2935 --
.../jvm/backtype/storm/generated/ErrorInfo.java | 714 -
.../storm/generated/ExecutorAggregateStats.java | 526 -
.../backtype/storm/generated/ExecutorInfo.java | 499 -
.../storm/generated/ExecutorSpecificStats.java | 387 -
.../backtype/storm/generated/ExecutorStats.java | 915 -
.../storm/generated/ExecutorSummary.java | 922 -
.../storm/generated/GetInfoOptions.java | 422 -
.../storm/generated/GlobalStreamId.java | 507 -
.../jvm/backtype/storm/generated/Grouping.java | 800 -
.../generated/HBAuthorizationException.java | 406 -
.../storm/generated/HBExecutionException.java | 406 -
.../jvm/backtype/storm/generated/HBMessage.java | 636 -
.../backtype/storm/generated/HBMessageData.java | 640 -
.../jvm/backtype/storm/generated/HBNodes.java | 461 -
.../jvm/backtype/storm/generated/HBPulse.java | 522 -
.../jvm/backtype/storm/generated/HBRecords.java | 466 -
.../storm/generated/HBServerMessageType.java | 113 -
.../generated/InvalidTopologyException.java | 406 -
.../backtype/storm/generated/JavaObject.java | 561 -
.../backtype/storm/generated/JavaObjectArg.java | 631 -
.../generated/KeyAlreadyExistsException.java | 406 -
.../storm/generated/KeyNotFoundException.java | 406 -
.../backtype/storm/generated/KillOptions.java | 407 -
.../storm/generated/LSApprovedWorkers.java | 458 -
.../generated/LSSupervisorAssignments.java | 471 -
.../storm/generated/LSSupervisorId.java | 406 -
.../backtype/storm/generated/LSTopoHistory.java | 805 -
.../storm/generated/LSTopoHistoryList.java | 460 -
.../storm/generated/LSWorkerHeartbeat.java | 755 -
.../storm/generated/ListBlobsResult.java | 556 -
.../storm/generated/LocalAssignment.java | 676 -
.../storm/generated/LocalStateData.java | 471 -
.../jvm/backtype/storm/generated/LogConfig.java | 475 -
.../jvm/backtype/storm/generated/LogLevel.java | 836 -
.../storm/generated/LogLevelAction.java | 65 -
.../jvm/backtype/storm/generated/Nimbus.java | 45416 -----------------
.../backtype/storm/generated/NimbusSummary.java | 796 -
.../jvm/backtype/storm/generated/NodeInfo.java | 556 -
.../storm/generated/NotAliveException.java | 406 -
.../backtype/storm/generated/NullStruct.java | 300 -
.../storm/generated/NumErrorsChoice.java | 65 -
.../backtype/storm/generated/ProfileAction.java | 74 -
.../storm/generated/ProfileRequest.java | 631 -
.../storm/generated/ReadableBlobMeta.java | 510 -
.../storm/generated/RebalanceOptions.java | 664 -
.../storm/generated/SettableBlobMeta.java | 567 -
.../storm/generated/ShellComponent.java | 516 -
.../storm/generated/SpecificAggregateStats.java | 387 -
.../storm/generated/SpoutAggregateStats.java | 407 -
.../jvm/backtype/storm/generated/SpoutSpec.java | 514 -
.../backtype/storm/generated/SpoutStats.java | 917 -
.../storm/generated/StateSpoutSpec.java | 514 -
.../jvm/backtype/storm/generated/StormBase.java | 1382 -
.../backtype/storm/generated/StormTopology.java | 1272 -
.../backtype/storm/generated/StreamInfo.java | 554 -
.../backtype/storm/generated/SubmitOptions.java | 533 -
.../storm/generated/SupervisorInfo.java | 1446 -
.../storm/generated/SupervisorPageInfo.java | 624 -
.../storm/generated/SupervisorSummary.java | 1265 -
.../storm/generated/ThriftSerializedObject.java | 516 -
.../storm/generated/TopologyActionOptions.java | 387 -
.../storm/generated/TopologyHistoryInfo.java | 461 -
.../backtype/storm/generated/TopologyInfo.java | 2144 -
.../storm/generated/TopologyInitialStatus.java | 62 -
.../storm/generated/TopologyPageInfo.java | 2757 -
.../backtype/storm/generated/TopologyStats.java | 1094 -
.../storm/generated/TopologyStatus.java | 68 -
.../storm/generated/TopologySummary.java | 1901 -
.../storm/generated/WorkerResources.java | 605 -
.../backtype/storm/generated/WorkerSummary.java | 1880 -
.../storm/grouping/CustomStreamGrouping.java | 43 -
.../src/jvm/backtype/storm/grouping/Load.java | 77 -
.../grouping/LoadAwareCustomStreamGrouping.java | 24 -
.../grouping/LoadAwareShuffleGrouping.java | 76 -
.../backtype/storm/grouping/LoadMapping.java | 64 -
.../storm/grouping/PartialKeyGrouping.java | 106 -
.../storm/grouping/ShuffleGrouping.java | 65 -
.../jvm/backtype/storm/hooks/BaseTaskHook.java | 61 -
.../backtype/storm/hooks/BaseWorkerHook.java | 51 -
.../src/jvm/backtype/storm/hooks/ITaskHook.java | 38 -
.../jvm/backtype/storm/hooks/IWorkerHook.java | 44 -
.../storm/hooks/SubmitterHookException.java | 41 -
.../backtype/storm/hooks/info/BoltAckInfo.java | 32 -
.../storm/hooks/info/BoltExecuteInfo.java | 32 -
.../backtype/storm/hooks/info/BoltFailInfo.java | 32 -
.../jvm/backtype/storm/hooks/info/EmitInfo.java | 35 -
.../backtype/storm/hooks/info/SpoutAckInfo.java | 30 -
.../storm/hooks/info/SpoutFailInfo.java | 30 -
.../backtype/storm/localizer/LocalResource.java | 44 -
.../storm/localizer/LocalizedResource.java | 130 -
.../LocalizedResourceRetentionSet.java | 140 -
.../storm/localizer/LocalizedResourceSet.java | 101 -
.../jvm/backtype/storm/localizer/Localizer.java | 695 -
.../storm/logging/ThriftAccessLogger.java | 27 -
.../logging/filters/AccessLoggingFilter.java | 52 -
.../storm/messaging/ConnectionWithStatus.java | 49 -
.../DeserializingConnectionCallback.java | 60 -
.../backtype/storm/messaging/IConnection.java | 63 -
.../storm/messaging/IConnectionCallback.java | 31 -
.../jvm/backtype/storm/messaging/IContext.java | 59 -
.../backtype/storm/messaging/TaskMessage.java | 53 -
.../storm/messaging/TransportFactory.java | 57 -
.../backtype/storm/messaging/local/Context.java | 218 -
.../backtype/storm/messaging/netty/Client.java | 611 -
.../backtype/storm/messaging/netty/Context.java | 113 -
.../storm/messaging/netty/ControlMessage.java | 75 -
.../messaging/netty/INettySerializable.java | 26 -
.../storm/messaging/netty/ISaslClient.java | 28 -
.../storm/messaging/netty/ISaslServer.java | 26 -
.../backtype/storm/messaging/netty/IServer.java | 26 -
.../netty/KerberosSaslClientHandler.java | 154 -
.../netty/KerberosSaslNettyClient.java | 202 -
.../netty/KerberosSaslNettyClientState.java | 31 -
.../netty/KerberosSaslNettyServer.java | 209 -
.../netty/KerberosSaslNettyServerState.java | 30 -
.../netty/KerberosSaslServerHandler.java | 133 -
.../backtype/storm/messaging/netty/Login.java | 411 -
.../storm/messaging/netty/MessageBatch.java | 118 -
.../storm/messaging/netty/MessageBuffer.java | 58 -
.../storm/messaging/netty/MessageDecoder.java | 144 -
.../storm/messaging/netty/MessageEncoder.java | 43 -
.../netty/NettyRenameThreadFactory.java | 56 -
.../netty/NettyUncaughtExceptionHandler.java | 35 -
.../storm/messaging/netty/SaslMessageToken.java | 114 -
.../storm/messaging/netty/SaslNettyClient.java | 154 -
.../messaging/netty/SaslNettyClientState.java | 31 -
.../storm/messaging/netty/SaslNettyServer.java | 157 -
.../messaging/netty/SaslNettyServerState.java | 30 -
.../messaging/netty/SaslStormClientHandler.java | 158 -
.../netty/SaslStormServerAuthorizeHandler.java | 83 -
.../messaging/netty/SaslStormServerHandler.java | 153 -
.../storm/messaging/netty/SaslUtils.java | 68 -
.../backtype/storm/messaging/netty/Server.java | 273 -
.../messaging/netty/StormClientHandler.java | 91 -
.../netty/StormClientPipelineFactory.java | 56 -
.../messaging/netty/StormServerHandler.java | 74 -
.../netty/StormServerPipelineFactory.java | 57 -
.../metric/ClusterMetricsConsumerExecutor.java | 76 -
.../backtype/storm/metric/EventLoggerBolt.java | 67 -
.../storm/metric/FileBasedEventLogger.java | 149 -
.../metric/HttpForwardingMetricsConsumer.java | 85 -
.../metric/HttpForwardingMetricsServer.java | 118 -
.../jvm/backtype/storm/metric/IEventLogger.java | 70 -
.../metric/LoggingClusterMetricsConsumer.java | 86 -
.../storm/metric/LoggingMetricsConsumer.java | 76 -
.../storm/metric/MetricsConsumerBolt.java | 145 -
.../jvm/backtype/storm/metric/SystemBolt.java | 165 -
.../storm/metric/api/AssignableMetric.java | 34 -
.../storm/metric/api/CombinedMetric.java | 38 -
.../backtype/storm/metric/api/CountMetric.java | 39 -
.../backtype/storm/metric/api/DataPoint.java | 43 -
.../metric/api/IClusterMetricsConsumer.java | 63 -
.../backtype/storm/metric/api/ICombiner.java | 23 -
.../jvm/backtype/storm/metric/api/IMetric.java | 22 -
.../storm/metric/api/IMetricsConsumer.java | 80 -
.../jvm/backtype/storm/metric/api/IReducer.java | 24 -
.../storm/metric/api/IStatefulObject.java | 22 -
.../backtype/storm/metric/api/MeanReducer.java | 53 -
.../storm/metric/api/MultiCountMetric.java | 45 -
.../storm/metric/api/MultiReducedMetric.java | 50 -
.../storm/metric/api/ReducedMetric.java | 38 -
.../backtype/storm/metric/api/StateMetric.java | 31 -
.../metric/api/rpc/AssignableShellMetric.java | 30 -
.../metric/api/rpc/CombinedShellMetric.java | 31 -
.../storm/metric/api/rpc/CountShellMetric.java | 37 -
.../storm/metric/api/rpc/IShellMetric.java | 31 -
.../metric/api/rpc/ReducedShellMetric.java | 32 -
.../storm/metric/filter/FilterByMetricName.java | 111 -
.../storm/metric/filter/MetricsFilter.java | 26 -
.../metric/internal/CountStatAndMetric.java | 211 -
.../metric/internal/LatencyStatAndMetric.java | 262 -
.../storm/metric/internal/MetricStatTimer.java | 27 -
.../internal/MultiCountStatAndMetric.java | 112 -
.../internal/MultiLatencyStatAndMetric.java | 109 -
.../storm/metric/internal/RateTracker.java | 139 -
.../storm/metric/util/DataPointExpander.java | 79 -
.../jvm/backtype/storm/multilang/BoltMsg.java | 79 -
.../backtype/storm/multilang/ISerializer.java | 82 -
.../storm/multilang/JsonSerializer.java | 204 -
.../storm/multilang/NoOutputException.java | 40 -
.../jvm/backtype/storm/multilang/ShellMsg.java | 184 -
.../jvm/backtype/storm/multilang/SpoutMsg.java | 50 -
.../AbstractDNSToSwitchMapping.java | 96 -
.../networktopography/DNSToSwitchMapping.java | 49 -
.../DefaultRackDNSToSwitchMapping.java | 52 -
.../storm/nimbus/DefaultTopologyValidator.java | 31 -
.../backtype/storm/nimbus/ILeaderElector.java | 73 -
.../nimbus/ITopologyActionNotifierPlugin.java | 43 -
.../storm/nimbus/ITopologyValidator.java | 28 -
.../jvm/backtype/storm/nimbus/NimbusInfo.java | 116 -
.../storm/pacemaker/IServerMessageHandler.java | 25 -
.../storm/pacemaker/PacemakerClient.java | 270 -
.../storm/pacemaker/PacemakerClientHandler.java | 75 -
.../storm/pacemaker/PacemakerServer.java | 168 -
.../storm/pacemaker/codec/ThriftDecoder.java | 69 -
.../storm/pacemaker/codec/ThriftEncoder.java | 110 -
.../pacemaker/codec/ThriftNettyClientCodec.java | 94 -
.../pacemaker/codec/ThriftNettyServerCodec.java | 99 -
.../backtype/storm/planner/CompoundSpout.java | 25 -
.../backtype/storm/planner/CompoundTask.java | 25 -
.../jvm/backtype/storm/planner/TaskBundle.java | 33 -
.../jvm/backtype/storm/scheduler/Cluster.java | 855 -
.../storm/scheduler/ExecutorDetails.java | 54 -
.../jvm/backtype/storm/scheduler/INimbus.java | 49 -
.../backtype/storm/scheduler/IScheduler.java | 40 -
.../backtype/storm/scheduler/ISupervisor.java | 45 -
.../storm/scheduler/SchedulerAssignment.java | 61 -
.../scheduler/SchedulerAssignmentImpl.java | 119 -
.../storm/scheduler/SupervisorDetails.java | 132 -
.../backtype/storm/scheduler/Topologies.java | 87 -
.../storm/scheduler/TopologyDetails.java | 515 -
.../backtype/storm/scheduler/WorkerSlot.java | 81 -
.../scheduler/multitenant/DefaultPool.java | 219 -
.../storm/scheduler/multitenant/FreePool.java | 125 -
.../scheduler/multitenant/IsolatedPool.java | 363 -
.../multitenant/MultitenantScheduler.java | 98 -
.../storm/scheduler/multitenant/Node.java | 340 -
.../storm/scheduler/multitenant/NodePool.java | 296 -
.../storm/scheduler/resource/Component.java | 54 -
.../storm/scheduler/resource/RAS_Node.java | 517 -
.../storm/scheduler/resource/RAS_Nodes.java | 138 -
.../resource/ResourceAwareScheduler.java | 435 -
.../storm/scheduler/resource/ResourceUtils.java | 184 -
.../scheduler/resource/SchedulingResult.java | 116 -
.../scheduler/resource/SchedulingState.java | 56 -
.../scheduler/resource/SchedulingStatus.java | 40 -
.../backtype/storm/scheduler/resource/User.java | 350 -
.../eviction/DefaultEvictionStrategy.java | 126 -
.../strategies/eviction/IEvictionStrategy.java | 42 -
.../DefaultSchedulingPriorityStrategy.java | 80 -
.../priority/ISchedulingPriorityStrategy.java | 36 -
.../DefaultResourceAwareStrategy.java | 580 -
.../strategies/scheduling/IStrategy.java | 47 -
.../storm/security/INimbusCredentialPlugin.java | 47 -
.../auth/AbstractSaslClientCallbackHandler.java | 76 -
.../auth/AbstractSaslServerCallbackHandler.java | 94 -
.../backtype/storm/security/auth/AuthUtils.java | 388 -
.../auth/DefaultHttpCredentialsPlugin.java | 96 -
.../security/auth/DefaultPrincipalToLocal.java | 42 -
.../storm/security/auth/IAuthorizer.java | 53 -
.../storm/security/auth/IAutoCredentials.java | 55 -
.../security/auth/ICredentialsRenewer.java | 40 -
.../auth/IGroupMappingServiceProvider.java | 42 -
.../security/auth/IHttpCredentialsPlugin.java | 48 -
.../storm/security/auth/IPrincipalToLocal.java | 41 -
.../storm/security/auth/ITransportPlugin.java | 57 -
.../security/auth/KerberosPrincipalToLocal.java | 45 -
.../storm/security/auth/NimbusPrincipal.java | 29 -
.../storm/security/auth/ReqContext.java | 154 -
.../security/auth/SaslTransportPlugin.java | 174 -
.../security/auth/ShellBasedGroupsMapping.java | 94 -
.../security/auth/SimpleTransportPlugin.java | 163 -
.../security/auth/SingleUserPrincipal.java | 53 -
.../storm/security/auth/TBackoffConnect.java | 82 -
.../storm/security/auth/ThriftClient.java | 117 -
.../security/auth/ThriftConnectionType.java | 83 -
.../storm/security/auth/ThriftServer.java | 78 -
.../auth/authorizer/DRPCAuthorizerBase.java | 63 -
.../authorizer/DRPCSimpleACLAuthorizer.java | 174 -
.../auth/authorizer/DenyAuthorizer.java | 47 -
.../authorizer/ImpersonationAuthorizer.java | 172 -
.../auth/authorizer/NoopAuthorizer.java | 47 -
.../auth/authorizer/SimpleACLAuthorizer.java | 173 -
.../authorizer/SimpleWhitelistAuthorizer.java | 60 -
.../auth/digest/ClientCallbackHandler.java | 58 -
.../auth/digest/DigestSaslTransportPlugin.java | 68 -
.../auth/digest/ServerCallbackHandler.java | 85 -
.../storm/security/auth/kerberos/AutoTGT.java | 269 -
.../auth/kerberos/AutoTGTKrb5LoginModule.java | 112 -
.../kerberos/AutoTGTKrb5LoginModuleTest.java | 44 -
.../auth/kerberos/ClientCallbackHandler.java | 104 -
.../kerberos/KerberosSaslTransportPlugin.java | 210 -
.../security/auth/kerberos/NoOpTTrasport.java | 54 -
.../auth/kerberos/ServerCallbackHandler.java | 96 -
.../auth/kerberos/jaas_kerberos_cluster.conf | 49 -
.../auth/kerberos/jaas_kerberos_launcher.conf | 31 -
.../auth/plain/PlainClientCallbackHandler.java | 31 -
.../auth/plain/PlainSaslTransportPlugin.java | 71 -
.../auth/plain/PlainServerCallbackHandler.java | 55 -
.../security/auth/plain/SaslPlainServer.java | 158 -
.../serialization/BlowfishTupleSerializer.java | 92 -
.../storm/serialization/DefaultKryoFactory.java | 64 -
.../DefaultSerializationDelegate.java | 58 -
.../GzipBridgeSerializationDelegate.java | 65 -
.../GzipBridgeThriftSerializationDelegate.java | 64 -
.../GzipSerializationDelegate.java | 64 -
.../GzipThriftSerializationDelegate.java | 56 -
.../storm/serialization/IKryoDecorator.java | 23 -
.../storm/serialization/IKryoFactory.java | 40 -
.../storm/serialization/ITupleDeserializer.java | 24 -
.../storm/serialization/ITupleSerializer.java | 26 -
.../serialization/KryoTupleDeserializer.java | 56 -
.../serialization/KryoTupleSerializer.java | 60 -
.../serialization/KryoValuesDeserializer.java | 50 -
.../serialization/KryoValuesSerializer.java | 58 -
.../serialization/SerializableSerializer.java | 61 -
.../serialization/SerializationDelegate.java | 35 -
.../serialization/SerializationFactory.java | 225 -
.../ThriftSerializationDelegate.java | 52 -
.../types/ArrayListSerializer.java | 32 -
.../serialization/types/HashMapSerializer.java | 32 -
.../serialization/types/HashSetSerializer.java | 32 -
.../types/ListDelegateSerializer.java | 32 -
.../backtype/storm/spout/CheckPointState.java | 172 -
.../backtype/storm/spout/CheckpointSpout.java | 232 -
.../storm/spout/IMultiSchemableSpout.java | 23 -
.../backtype/storm/spout/ISchemableSpout.java | 24 -
.../src/jvm/backtype/storm/spout/ISpout.java | 105 -
.../storm/spout/ISpoutOutputCollector.java | 32 -
.../storm/spout/ISpoutWaitStrategy.java | 34 -
.../jvm/backtype/storm/spout/MultiScheme.java | 29 -
.../storm/spout/NothingEmptyEmitStrategy.java | 31 -
.../backtype/storm/spout/RawMultiScheme.java | 40 -
.../src/jvm/backtype/storm/spout/RawScheme.java | 37 -
.../src/jvm/backtype/storm/spout/Scheme.java | 29 -
.../storm/spout/SchemeAsMultiScheme.java | 42 -
.../jvm/backtype/storm/spout/ShellSpout.java | 316 -
.../storm/spout/SleepSpoutWaitStrategy.java | 41 -
.../storm/spout/SpoutOutputCollector.java | 143 -
.../storm/state/DefaultStateSerializer.java | 65 -
.../jvm/backtype/storm/state/IStateSpout.java | 29 -
.../storm/state/IStateSpoutOutputCollector.java | 22 -
.../backtype/storm/state/ISubscribedState.java | 25 -
.../state/ISynchronizeOutputCollector.java | 24 -
.../storm/state/InMemoryKeyValueState.java | 114 -
.../state/InMemoryKeyValueStateProvider.java | 43 -
.../jvm/backtype/storm/state/KeyValueState.java | 48 -
.../jvm/backtype/storm/state/Serializer.java | 30 -
.../src/jvm/backtype/storm/state/State.java | 55 -
.../jvm/backtype/storm/state/StateFactory.java | 69 -
.../jvm/backtype/storm/state/StateProvider.java | 38 -
.../storm/state/StateSpoutOutputCollector.java | 28 -
.../storm/state/SynchronizeOutputCollector.java | 30 -
.../storm/task/GeneralTopologyContext.java | 199 -
.../src/jvm/backtype/storm/task/IBolt.java | 84 -
.../jvm/backtype/storm/task/IErrorReporter.java | 22 -
.../backtype/storm/task/IMetricsContext.java | 31 -
.../backtype/storm/task/IOutputCollector.java | 33 -
.../backtype/storm/task/OutputCollector.java | 236 -
.../src/jvm/backtype/storm/task/ShellBolt.java | 412 -
.../backtype/storm/task/TopologyContext.java | 389 -
.../storm/task/WorkerTopologyContext.java | 106 -
.../backtype/storm/testing/AckFailDelegate.java | 25 -
.../storm/testing/AckFailMapTracker.java | 52 -
.../jvm/backtype/storm/testing/AckTracker.java | 52 -
.../AlternateRackDNSToSwitchMapping.java | 65 -
.../backtype/storm/testing/BatchNumberList.java | 72 -
.../storm/testing/BatchProcessWord.java | 39 -
.../backtype/storm/testing/BatchRepeatA.java | 48 -
.../jvm/backtype/storm/testing/BoltTracker.java | 42 -
.../storm/testing/CompleteTopologyParam.java | 87 -
.../storm/testing/CountingBatchBolt.java | 55 -
.../storm/testing/CountingCommitBolt.java | 57 -
.../jvm/backtype/storm/testing/FeederSpout.java | 100 -
.../jvm/backtype/storm/testing/FixedTuple.java | 42 -
.../backtype/storm/testing/FixedTupleSpout.java | 179 -
.../testing/ForwardingMetricsConsumer.java | 100 -
.../backtype/storm/testing/IdentityBolt.java | 42 -
.../backtype/storm/testing/IntegrationTest.java | 38 -
.../storm/testing/KeyedCountingBatchBolt.java | 61 -
.../testing/KeyedCountingCommitterBolt.java | 24 -
.../storm/testing/KeyedSummingBatchBolt.java | 61 -
.../storm/testing/MemoryTransactionalSpout.java | 180 -
.../testing/MemoryTransactionalSpoutMeta.java | 38 -
.../backtype/storm/testing/MkClusterParam.java | 69 -
.../backtype/storm/testing/MkTupleParam.java | 51 -
.../backtype/storm/testing/MockedSources.java | 60 -
.../jvm/backtype/storm/testing/NGrouping.java | 50 -
.../storm/testing/NonRichBoltTracker.java | 51 -
.../testing/OpaqueMemoryTransactionalSpout.java | 186 -
.../storm/testing/PrepareBatchBolt.java | 52 -
.../storm/testing/PythonShellMetricsBolt.java | 49 -
.../storm/testing/PythonShellMetricsSpout.java | 52 -
.../testing/SingleUserSimpleTransport.java | 40 -
.../backtype/storm/testing/SpoutTracker.java | 111 -
.../storm/testing/TestAggregatesCounter.java | 63 -
.../backtype/storm/testing/TestConfBolt.java | 62 -
.../storm/testing/TestEventLogSpout.java | 139 -
.../storm/testing/TestEventOrderCheckBolt.java | 76 -
.../backtype/storm/testing/TestGlobalCount.java | 60 -
.../src/jvm/backtype/storm/testing/TestJob.java | 43 -
.../storm/testing/TestKryoDecorator.java | 31 -
.../backtype/storm/testing/TestPlannerBolt.java | 45 -
.../storm/testing/TestPlannerSpout.java | 85 -
.../backtype/storm/testing/TestSerObject.java | 37 -
.../storm/testing/TestWordBytesCounter.java | 27 -
.../backtype/storm/testing/TestWordCounter.java | 65 -
.../backtype/storm/testing/TestWordSpout.java | 86 -
.../backtype/storm/testing/TrackedTopology.java | 34 -
.../storm/testing/TupleCaptureBolt.java | 83 -
.../topology/BaseConfigurationDeclarer.java | 84 -
.../topology/BaseStatefulBoltExecutor.java | 209 -
.../storm/topology/BasicBoltExecutor.java | 67 -
.../storm/topology/BasicOutputCollector.java | 72 -
.../backtype/storm/topology/BoltDeclarer.java | 26 -
.../topology/CheckpointTupleForwarder.java | 103 -
.../ComponentConfigurationDeclarer.java | 29 -
.../storm/topology/FailedException.java | 36 -
.../jvm/backtype/storm/topology/IBasicBolt.java | 33 -
.../storm/topology/IBasicOutputCollector.java | 29 -
.../jvm/backtype/storm/topology/IComponent.java | 44 -
.../jvm/backtype/storm/topology/IRichBolt.java | 29 -
.../jvm/backtype/storm/topology/IRichSpout.java | 29 -
.../storm/topology/IRichStateSpout.java | 25 -
.../backtype/storm/topology/IStatefulBolt.java | 48 -
.../storm/topology/IStatefulComponent.java | 56 -
.../storm/topology/IStatefulWindowedBolt.java | 26 -
.../backtype/storm/topology/IWindowedBolt.java | 40 -
.../backtype/storm/topology/InputDeclarer.java | 184 -
.../storm/topology/OutputFieldsDeclarer.java | 32 -
.../storm/topology/OutputFieldsGetter.java | 53 -
.../storm/topology/ReportedFailedException.java | 36 -
.../storm/topology/ResourceDeclarer.java | 28 -
.../backtype/storm/topology/SpoutDeclarer.java | 22 -
.../storm/topology/StatefulBoltExecutor.java | 193 -
.../topology/StatefulWindowedBoltExecutor.java | 372 -
.../storm/topology/TopologyBuilder.java | 580 -
.../storm/topology/WindowedBoltExecutor.java | 361 -
.../storm/topology/base/BaseBasicBolt.java | 33 -
.../storm/topology/base/BaseBatchBolt.java | 24 -
.../storm/topology/base/BaseComponent.java | 28 -
...BaseOpaquePartitionedTransactionalSpout.java | 25 -
.../base/BasePartitionedTransactionalSpout.java | 25 -
.../storm/topology/base/BaseRichBolt.java | 26 -
.../storm/topology/base/BaseRichSpout.java | 46 -
.../storm/topology/base/BaseStatefulBolt.java | 64 -
.../topology/base/BaseStatefulWindowedBolt.java | 158 -
.../topology/base/BaseTransactionalBolt.java | 24 -
.../topology/base/BaseTransactionalSpout.java | 24 -
.../storm/topology/base/BaseWindowedBolt.java | 312 -
.../storm/transactional/ICommitter.java | 26 -
.../ICommitterTransactionalSpout.java | 31 -
.../transactional/ITransactionalSpout.java | 94 -
.../storm/transactional/TransactionAttempt.java | 61 -
.../TransactionalSpoutBatchExecutor.java | 96 -
.../TransactionalSpoutCoordinator.java | 212 -
.../TransactionalTopologyBuilder.java | 521 -
.../IOpaquePartitionedTransactionalSpout.java | 56 -
.../IPartitionedTransactionalSpout.java | 69 -
...uePartitionedTransactionalSpoutExecutor.java | 160 -
.../PartitionedTransactionalSpoutExecutor.java | 142 -
.../state/RotatingTransactionalState.java | 149 -
.../state/TestTransactionalState.java | 47 -
.../transactional/state/TransactionalState.java | 173 -
.../storm/trident/JoinOutFieldsMode.java | 33 -
.../jvm/backtype/storm/trident/JoinType.java | 30 -
.../src/jvm/backtype/storm/trident/Stream.java | 857 -
.../backtype/storm/trident/TridentState.java | 59 -
.../backtype/storm/trident/TridentTopology.java | 986 -
.../trident/drpc/ReturnResultsReducer.java | 121 -
.../fluent/ChainedAggregatorDeclarer.java | 183 -
.../fluent/ChainedFullAggregatorDeclarer.java | 32 -
.../ChainedPartitionAggregatorDeclarer.java | 32 -
.../trident/fluent/GlobalAggregationScheme.java | 26 -
.../storm/trident/fluent/GroupedStream.java | 174 -
.../trident/fluent/IAggregatableStream.java | 31 -
.../fluent/IChainedAggregatorDeclarer.java | 24 -
.../storm/trident/fluent/UniqueIdGen.java | 38 -
.../storm/trident/graph/GraphGrouper.java | 119 -
.../jvm/backtype/storm/trident/graph/Group.java | 150 -
.../storm/trident/operation/Aggregator.java | 26 -
.../storm/trident/operation/Assembly.java | 45 -
.../storm/trident/operation/BaseAggregator.java | 23 -
.../storm/trident/operation/BaseFilter.java | 23 -
.../storm/trident/operation/BaseFunction.java | 23 -
.../trident/operation/BaseMultiReducer.java | 33 -
.../storm/trident/operation/BaseOperation.java | 47 -
.../trident/operation/CombinerAggregator.java | 29 -
.../storm/trident/operation/Consumer.java | 35 -
.../operation/DefaultResourceDeclarer.java | 68 -
.../storm/trident/operation/EachOperation.java | 22 -
.../storm/trident/operation/Filter.java | 48 -
.../trident/operation/FlatMapFunction.java | 37 -
.../storm/trident/operation/Function.java | 92 -
.../trident/operation/GroupedMultiReducer.java | 31 -
.../trident/operation/ITridentResource.java | 32 -
.../storm/trident/operation/MapFunction.java | 36 -
.../storm/trident/operation/MultiReducer.java | 31 -
.../storm/trident/operation/Operation.java | 46 -
.../trident/operation/ReducerAggregator.java | 26 -
.../trident/operation/TridentCollector.java | 52 -
.../operation/TridentMultiReducerContext.java | 36 -
.../operation/TridentOperationContext.java | 65 -
.../operation/builtin/ComparisonAggregator.java | 91 -
.../storm/trident/operation/builtin/Count.java | 41 -
.../storm/trident/operation/builtin/Debug.java | 48 -
.../storm/trident/operation/builtin/Equals.java | 38 -
.../trident/operation/builtin/FilterNull.java | 35 -
.../storm/trident/operation/builtin/FirstN.java | 130 -
.../storm/trident/operation/builtin/MapGet.java | 38 -
.../storm/trident/operation/builtin/Max.java | 37 -
.../operation/builtin/MaxWithComparator.java | 51 -
.../storm/trident/operation/builtin/Min.java | 36 -
.../operation/builtin/MinWithComparator.java | 51 -
.../storm/trident/operation/builtin/Negate.java | 76 -
.../trident/operation/builtin/SnapshotGet.java | 44 -
.../storm/trident/operation/builtin/Sum.java | 42 -
.../operation/builtin/TupleCollectionGet.java | 46 -
.../operation/impl/CaptureCollector.java | 42 -
.../operation/impl/ChainedAggregatorImpl.java | 113 -
.../trident/operation/impl/ChainedResult.java | 53 -
.../operation/impl/CombinerAggStateUpdater.java | 56 -
.../impl/CombinerAggregatorCombineImpl.java | 61 -
.../impl/CombinerAggregatorInitImpl.java | 49 -
.../operation/impl/ConsumerExecutor.java | 38 -
.../trident/operation/impl/FilterExecutor.java | 53 -
.../operation/impl/FlatMapFunctionExecutor.java | 43 -
.../operation/impl/GlobalBatchToPartition.java | 29 -
.../trident/operation/impl/GroupCollector.java | 48 -
.../operation/impl/GroupedAggregator.java | 96 -
.../impl/GroupedMultiReducerExecutor.java | 95 -
.../operation/impl/IdentityMultiReducer.java | 51 -
.../impl/IndexHashBatchToPartition.java | 29 -
.../storm/trident/operation/impl/JoinState.java | 39 -
.../operation/impl/JoinerMultiReducer.java | 142 -
.../operation/impl/MapFunctionExecutor.java | 41 -
...PreservingFieldsOrderJoinerMultiReducer.java | 175 -
.../operation/impl/ReducerAggStateUpdater.java | 53 -
.../operation/impl/ReducerAggregatorImpl.java | 56 -
.../storm/trident/operation/impl/Result.java | 27 -
.../operation/impl/SingleEmitAggregator.java | 95 -
.../trident/operation/impl/TrueFilter.java | 40 -
.../storm/trident/partition/GlobalGrouping.java | 42 -
.../trident/partition/IdentityGrouping.java | 59 -
.../trident/partition/IndexHashGrouping.java | 55 -
.../storm/trident/planner/BridgeReceiver.java | 38 -
.../backtype/storm/trident/planner/Node.java | 69 -
.../storm/trident/planner/NodeStateInfo.java | 31 -
.../storm/trident/planner/PartitionNode.java | 50 -
.../storm/trident/planner/ProcessorContext.java | 29 -
.../storm/trident/planner/ProcessorNode.java | 38 -
.../storm/trident/planner/SpoutNode.java | 39 -
.../storm/trident/planner/SubtopologyBolt.java | 217 -
.../storm/trident/planner/TridentProcessor.java | 40 -
.../storm/trident/planner/TupleReceiver.java | 27 -
.../planner/processor/AggregateProcessor.java | 84 -
.../planner/processor/AppendCollector.java | 62 -
.../planner/processor/EachProcessor.java | 80 -
.../planner/processor/FreshCollector.java | 59 -
.../trident/planner/processor/MapProcessor.java | 87 -
.../processor/MultiReducerProcessor.java | 93 -
.../processor/PartitionPersistProcessor.java | 107 -
.../planner/processor/ProjectedProcessor.java | 73 -
.../planner/processor/StateQueryProcessor.java | 107 -
.../planner/processor/TridentContext.java | 76 -
.../storm/trident/spout/BatchSpoutExecutor.java | 92 -
.../backtype/storm/trident/spout/IBatchID.java | 24 -
.../storm/trident/spout/IBatchSpout.java | 33 -
.../trident/spout/ICommitterTridentSpout.java | 31 -
.../spout/IOpaquePartitionedTridentSpout.java | 63 -
.../trident/spout/IPartitionedTridentSpout.java | 77 -
.../storm/trident/spout/ISpoutPartition.java | 25 -
.../storm/trident/spout/ITridentDataSource.java | 26 -
.../storm/trident/spout/ITridentSpout.java | 125 -
.../OpaquePartitionedTridentSpoutExecutor.java | 201 -
.../spout/PartitionedTridentSpoutExecutor.java | 172 -
.../trident/spout/RichSpoutBatchExecutor.java | 204 -
.../storm/trident/spout/RichSpoutBatchId.java | 49 -
.../spout/RichSpoutBatchIdSerializer.java | 38 -
.../trident/spout/RichSpoutBatchTriggerer.java | 182 -
.../trident/spout/TridentSpoutCoordinator.java | 94 -
.../trident/spout/TridentSpoutExecutor.java | 138 -
.../storm/trident/state/BaseQueryFunction.java | 25 -
.../storm/trident/state/BaseStateUpdater.java | 25 -
.../trident/state/CombinerValueUpdater.java | 36 -
.../storm/trident/state/ITupleCollection.java | 26 -
.../state/JSONNonTransactionalSerializer.java | 44 -
.../trident/state/JSONOpaqueSerializer.java | 52 -
.../state/JSONTransactionalSerializer.java | 50 -
.../storm/trident/state/OpaqueValue.java | 75 -
.../storm/trident/state/QueryFunction.java | 28 -
.../storm/trident/state/ReadOnlyState.java | 31 -
.../trident/state/ReducerValueUpdater.java | 41 -
.../storm/trident/state/Serializer.java | 26 -
.../jvm/backtype/storm/trident/state/State.java | 39 -
.../storm/trident/state/StateFactory.java | 26 -
.../backtype/storm/trident/state/StateSpec.java | 30 -
.../backtype/storm/trident/state/StateType.java | 25 -
.../storm/trident/state/StateUpdater.java | 33 -
.../storm/trident/state/TransactionalValue.java | 44 -
.../storm/trident/state/ValueUpdater.java | 23 -
.../trident/state/map/CachedBatchReadsMap.java | 80 -
.../storm/trident/state/map/CachedMap.java | 78 -
.../storm/trident/state/map/IBackingMap.java | 26 -
.../state/map/MapCombinerAggStateUpdater.java | 84 -
.../state/map/MapReducerAggStateUpdater.java | 91 -
.../storm/trident/state/map/MapState.java | 26 -
.../state/map/MicroBatchIBackingMap.java | 85 -
.../trident/state/map/NonTransactionalMap.java | 67 -
.../storm/trident/state/map/OpaqueMap.java | 124 -
.../trident/state/map/ReadOnlyMapState.java | 26 -
.../trident/state/map/RemovableMapState.java | 25 -
.../trident/state/map/SnapshottableMap.java | 76 -
.../trident/state/map/TransactionalMap.java | 109 -
.../state/snapshot/ReadOnlySnapshottable.java | 24 -
.../trident/state/snapshot/Snapshottable.java | 27 -
.../trident/testing/CountAsAggregator.java | 47 -
.../storm/trident/testing/FeederBatchSpout.java | 185 -
.../testing/FeederCommitterBatchSpout.java | 96 -
.../storm/trident/testing/FixedBatchSpout.java | 97 -
.../backtype/storm/trident/testing/IFeeder.java | 23 -
.../trident/testing/LRUMemoryMapState.java | 154 -
.../storm/trident/testing/MemoryBackingMap.java | 47 -
.../storm/trident/testing/MemoryMapState.java | 176 -
.../backtype/storm/trident/testing/Split.java | 36 -
.../storm/trident/testing/StringLength.java | 32 -
.../storm/trident/testing/TrueFilter.java | 30 -
.../storm/trident/testing/TuplifyArgs.java | 37 -
.../storm/trident/topology/BatchInfo.java | 33 -
.../trident/topology/ITridentBatchBolt.java | 32 -
.../topology/MasterBatchCoordinator.java | 289 -
.../trident/topology/TransactionAttempt.java | 66 -
.../trident/topology/TridentBoltExecutor.java | 439 -
.../topology/TridentTopologyBuilder.java | 751 -
.../state/RotatingTransactionalState.java | 147 -
.../topology/state/TestTransactionalState.java | 47 -
.../topology/state/TransactionalState.java | 171 -
.../backtype/storm/trident/tuple/ComboList.java | 92 -
.../backtype/storm/trident/tuple/ConsList.java | 60 -
.../storm/trident/tuple/TridentTuple.java | 34 -
.../storm/trident/tuple/TridentTupleView.java | 361 -
.../storm/trident/tuple/ValuePointer.java | 60 -
.../storm/trident/util/ErrorEdgeFactory.java | 28 -
.../storm/trident/util/IndexedEdge.java | 50 -
.../jvm/backtype/storm/trident/util/LRUMap.java | 35 -
.../storm/trident/util/TridentUtils.java | 117 -
.../windowing/AbstractTridentWindowManager.java | 238 -
.../windowing/ITridentWindowManager.java | 59 -
.../windowing/InMemoryTridentWindowManager.java | 72 -
.../trident/windowing/InMemoryWindowsStore.java | 200 -
.../windowing/InMemoryWindowsStoreFactory.java | 44 -
.../StoreBasedTridentWindowManager.java | 217 -
.../trident/windowing/TridentBatchTuple.java | 42 -
.../trident/windowing/WindowKryoSerializer.java | 87 -
.../windowing/WindowTridentProcessor.java | 265 -
.../storm/trident/windowing/WindowsState.java | 52 -
.../trident/windowing/WindowsStateFactory.java | 40 -
.../trident/windowing/WindowsStateUpdater.java | 81 -
.../storm/trident/windowing/WindowsStore.java | 79 -
.../trident/windowing/WindowsStoreFactory.java | 40 -
.../windowing/config/BaseWindowConfig.java | 48 -
.../windowing/config/SlidingCountWindow.java | 43 -
.../windowing/config/SlidingDurationWindow.java | 44 -
.../windowing/config/TumblingCountWindow.java | 43 -
.../config/TumblingDurationWindow.java | 42 -
.../trident/windowing/config/WindowConfig.java | 57 -
.../windowing/strategy/BaseWindowStrategy.java | 32 -
.../strategy/SlidingCountWindowStrategy.java | 59 -
.../strategy/SlidingDurationWindowStrategy.java | 60 -
.../strategy/TumblingCountWindowStrategy.java | 60 -
.../TumblingDurationWindowStrategy.java | 60 -
.../windowing/strategy/WindowStrategy.java | 45 -
.../backtype/storm/tuple/AddressedTuple.java | 48 -
.../src/jvm/backtype/storm/tuple/Fields.java | 117 -
.../src/jvm/backtype/storm/tuple/ITuple.java | 214 -
.../src/jvm/backtype/storm/tuple/MessageId.java | 94 -
.../src/jvm/backtype/storm/tuple/Tuple.java | 68 -
.../src/jvm/backtype/storm/tuple/TupleImpl.java | 356 -
.../src/jvm/backtype/storm/tuple/Values.java | 37 -
.../storm/ui/InvalidRequestException.java | 37 -
.../jvm/backtype/storm/utils/BatchHelper.java | 92 -
.../storm/utils/BufferFileInputStream.java | 54 -
.../backtype/storm/utils/BufferInputStream.java | 53 -
.../backtype/storm/utils/CRC32OutputStream.java | 44 -
.../backtype/storm/utils/ClojureTimerTask.java | 35 -
.../src/jvm/backtype/storm/utils/Container.java | 24 -
.../jvm/backtype/storm/utils/DRPCClient.java | 66 -
.../utils/DisruptorBackpressureCallback.java | 27 -
.../backtype/storm/utils/DisruptorQueue.java | 564 -
.../storm/utils/ExtendedThreadPoolExecutor.java | 67 -
.../storm/utils/IndifferentAccessMap.java | 177 -
.../backtype/storm/utils/InprocMessaging.java | 59 -
.../storm/utils/KeyedRoundRobinQueue.java | 68 -
.../jvm/backtype/storm/utils/ListDelegate.java | 156 -
.../jvm/backtype/storm/utils/LocalState.java | 189 -
.../src/jvm/backtype/storm/utils/Monitor.java | 252 -
.../jvm/backtype/storm/utils/MutableInt.java | 43 -
.../jvm/backtype/storm/utils/MutableLong.java | 43 -
.../jvm/backtype/storm/utils/MutableObject.java | 38 -
.../jvm/backtype/storm/utils/NimbusClient.java | 117 -
.../utils/NimbusLeaderNotFoundException.java | 41 -
.../storm/utils/RegisteredGlobalState.java | 62 -
.../jvm/backtype/storm/utils/RotatingMap.java | 128 -
.../backtype/storm/utils/ServiceRegistry.java | 47 -
.../storm/utils/ShellBoltMessageQueue.java | 121 -
.../jvm/backtype/storm/utils/ShellProcess.java | 210 -
.../jvm/backtype/storm/utils/ShellUtils.java | 505 -
.../StormBoundedExponentialBackoffRetry.java | 76 -
.../utils/StormConnectionStateConverter.java | 44 -
.../src/jvm/backtype/storm/utils/TestUtils.java | 34 -
.../storm/utils/ThriftTopologyUtils.java | 70 -
.../src/jvm/backtype/storm/utils/Time.java | 119 -
.../jvm/backtype/storm/utils/TimeCacheMap.java | 125 -
.../backtype/storm/utils/TopologySpoutLag.java | 185 -
.../backtype/storm/utils/TransferDrainer.java | 132 -
.../jvm/backtype/storm/utils/TupleUtils.java | 64 -
.../src/jvm/backtype/storm/utils/Utils.java | 1421 -
.../jvm/backtype/storm/utils/VersionInfo.java | 131 -
.../backtype/storm/utils/VersionedStore.java | 188 -
.../storm/utils/WindowedTimeThrottler.java | 51 -
.../storm/utils/WorkerBackpressureCallback.java | 25 -
.../storm/utils/WorkerBackpressureThread.java | 79 -
.../jvm/backtype/storm/utils/WritableUtils.java | 375 -
.../backtype/storm/utils/ZookeeperAuthInfo.java | 53 -
.../storm/utils/ZookeeperServerCnxnFactory.java | 84 -
.../storm/validation/ConfigValidation.java | 716 -
.../validation/ConfigValidationAnnotations.java | 218 -
.../storm/validation/ConfigValidationUtils.java | 175 -
.../storm/windowing/CountEvictionPolicy.java | 75 -
.../storm/windowing/CountTriggerPolicy.java | 76 -
.../storm/windowing/DefaultEvictionContext.java | 53 -
.../src/jvm/backtype/storm/windowing/Event.java | 49 -
.../jvm/backtype/storm/windowing/EventImpl.java | 51 -
.../storm/windowing/EvictionContext.java | 47 -
.../storm/windowing/EvictionPolicy.java | 75 -
.../storm/windowing/TimeEvictionPolicy.java | 71 -
.../storm/windowing/TimeTriggerPolicy.java | 132 -
.../storm/windowing/TriggerHandler.java | 31 -
.../backtype/storm/windowing/TriggerPolicy.java | 49 -
.../backtype/storm/windowing/TupleWindow.java | 26 -
.../storm/windowing/TupleWindowImpl.java | 82 -
.../storm/windowing/WaterMarkEvent.java | 38 -
.../windowing/WaterMarkEventGenerator.java | 121 -
.../windowing/WatermarkCountEvictionPolicy.java | 74 -
.../windowing/WatermarkCountTriggerPolicy.java | 91 -
.../windowing/WatermarkTimeEvictionPolicy.java | 77 -
.../windowing/WatermarkTimeTriggerPolicy.java | 126 -
.../jvm/backtype/storm/windowing/Window.java | 48 -
.../windowing/WindowLifecycleListener.java | 42 -
.../backtype/storm/windowing/WindowManager.java | 289 -
storm-core/src/jvm/org/apache/storm/Config.java | 6 +-
.../apache/storm/messaging/netty/Client.java | 1 -
.../netty/KerberosSaslClientHandler.java | 6 +-
.../netty/KerberosSaslNettyClient.java | 6 +-
875 files changed, 13 insertions(+), 200987 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/LocalCluster.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/LocalCluster.clj b/storm-core/src/clj/backtype/storm/LocalCluster.clj
deleted file mode 100644
index df3c180..0000000
--- a/storm-core/src/clj/backtype/storm/LocalCluster.clj
+++ /dev/null
@@ -1,106 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.LocalCluster
- (:use [org.apache.storm testing config util])
- (:import [org.apache.storm.utils Utils])
- (:import [java.util Map])
- (:gen-class
- :init init
- :implements [org.apache.storm.ILocalCluster]
- :constructors {[] []
- [java.util.Map] []
- [String Long] []}
- :state state))
-
-(defn -init
- ([]
- (let [ret (mk-local-storm-cluster
- :daemon-conf
- {TOPOLOGY-ENABLE-MESSAGE-TIMEOUTS true})]
- [[] ret]))
- ([^String zk-host ^Long zk-port]
- (let [ret (mk-local-storm-cluster :daemon-conf {TOPOLOGY-ENABLE-MESSAGE-TIMEOUTS true
- STORM-ZOOKEEPER-SERVERS (list zk-host)
- STORM-ZOOKEEPER-PORT zk-port})]
- [[] ret]))
- ([^Map stateMap]
- [[] stateMap]))
-
-(defn submit-hook [hook name conf topology]
- (let [topologyInfo (Utils/getTopologyInfo name nil conf)]
- (.notify hook topologyInfo conf topology)))
-
-(defn -submitTopology
- [this name conf topology]
- (submit-local-topology
- (:nimbus (. this state)) name conf topology)
- (let [hook (get-configured-class conf STORM-TOPOLOGY-SUBMISSION-NOTIFIER-PLUGIN)]
- (when hook (submit-hook hook name conf topology))))
-
-
-(defn -submitTopologyWithOpts
- [this name conf topology submit-opts]
- (submit-local-topology-with-opts
- (:nimbus (. this state)) name conf topology submit-opts))
-
-(defn -uploadNewCredentials
- [this name creds]
- (.uploadNewCredentials (:nimbus (. this state)) name creds))
-
-(defn -shutdown
- [this]
- (kill-local-storm-cluster (. this state)))
-
-(defn -killTopology
- [this name]
- (.killTopology (:nimbus (. this state)) name))
-
-(defn -getTopologyConf
- [this id]
- (.getTopologyConf (:nimbus (. this state)) id))
-
-(defn -getTopology
- [this id]
- (.getTopology (:nimbus (. this state)) id))
-
-(defn -getClusterInfo
- [this]
- (.getClusterInfo (:nimbus (. this state))))
-
-(defn -getTopologyInfo
- [this id]
- (.getTopologyInfo (:nimbus (. this state)) id))
-
-(defn -killTopologyWithOpts
- [this name opts]
- (.killTopologyWithOpts (:nimbus (. this state)) name opts))
-
-(defn -activate
- [this name]
- (.activate (:nimbus (. this state)) name))
-
-(defn -deactivate
- [this name]
- (.deactivate (:nimbus (. this state)) name))
-
-(defn -rebalance
- [this name opts]
- (.rebalance (:nimbus (. this state)) name opts))
-
-(defn -getState
- [this]
- (.state this))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/LocalDRPC.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/LocalDRPC.clj b/storm-core/src/clj/backtype/storm/LocalDRPC.clj
deleted file mode 100644
index 21b2bd3..0000000
--- a/storm-core/src/clj/backtype/storm/LocalDRPC.clj
+++ /dev/null
@@ -1,56 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.LocalDRPC
- (:require [org.apache.storm.daemon [drpc :as drpc]])
- (:use [org.apache.storm config util])
- (:import [org.apache.storm.utils InprocMessaging ServiceRegistry])
- (:gen-class
- :init init
- :implements [org.apache.storm.ILocalDRPC]
- :constructors {[] []}
- :state state ))
-
-(defn -init []
- (let [handler (drpc/service-handler (read-storm-config))
- id (ServiceRegistry/registerService handler)
- ]
- [[] {:service-id id :handler handler}]
- ))
-
-(defn -execute [this func funcArgs]
- (.execute (:handler (. this state)) func funcArgs)
- )
-
-(defn -result [this id result]
- (.result (:handler (. this state)) id result)
- )
-
-(defn -fetchRequest [this func]
- (.fetchRequest (:handler (. this state)) func)
- )
-
-(defn -failRequest [this id]
- (.failRequest (:handler (. this state)) id)
- )
-
-(defn -getServiceId [this]
- (:service-id (. this state)))
-
-(defn -shutdown [this]
- (ServiceRegistry/unregisterService (:service-id (. this state)))
- (.shutdown (:handler (. this state)))
- )
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/MockAutoCred.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/MockAutoCred.clj b/storm-core/src/clj/backtype/storm/MockAutoCred.clj
deleted file mode 100644
index 7e23c6b..0000000
--- a/storm-core/src/clj/backtype/storm/MockAutoCred.clj
+++ /dev/null
@@ -1,58 +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.
-
-;;mock implementation of INimbusCredentialPlugin,IAutoCredentials and ICredentialsRenewer for testing only.
-(ns org.apache.storm.MockAutoCred
- (:use [org.apache.storm testing config])
- (:import [org.apache.storm.security.INimbusCredentialPlugin]
- [org.apache.storm.security.auth ICredentialsRenewer])
- (:gen-class
- :implements [org.apache.storm.security.INimbusCredentialPlugin
- org.apache.storm.security.auth.IAutoCredentials
- org.apache.storm.security.auth.ICredentialsRenewer]))
-
-(def nimbus-cred-key "nimbusCredTestKey")
-(def nimbus-cred-val "nimbusTestCred")
-(def nimbus-cred-renew-val "renewedNimbusTestCred")
-(def gateway-cred-key "gatewayCredTestKey")
-(def gateway-cred-val "gatewayTestCred")
-(def gateway-cred-renew-val "renewedGatewayTestCred")
-
-(defn -populateCredentials
- ([this creds conf]
- (.put creds nimbus-cred-key nimbus-cred-val))
- ([this creds]
- (.put creds gateway-cred-key gateway-cred-val)))
-
-(defn -prepare
- [this conf])
-
-(defn -renew
- [this cred conf]
- (.put cred nimbus-cred-key nimbus-cred-renew-val)
- (.put cred gateway-cred-key gateway-cred-renew-val))
-
-(defn -populateSubject
- [subject credentials]
- (.add (.getPublicCredentials subject) (.get credentials nimbus-cred-key))
- (.add (.getPublicCredentials subject) (.get credentials gateway-cred-key)))
-
-(defn -updateSubject
- [subject credentials]
- (-populateSubject subject credentials))
-
-
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/blobstore.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/blobstore.clj b/storm-core/src/clj/backtype/storm/blobstore.clj
deleted file mode 100644
index 0b1c994..0000000
--- a/storm-core/src/clj/backtype/storm/blobstore.clj
+++ /dev/null
@@ -1,28 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.blobstore
- (:import [org.apache.storm.utils Utils])
- (:import [org.apache.storm.blobstore ClientBlobStore])
- (:use [org.apache.storm config]))
-
-(defmacro with-configured-blob-client
- [client-sym & body]
- `(let [conf# (read-storm-config)
- ^ClientBlobStore ~client-sym (Utils/getClientBlobStore conf#)]
- (try
- ~@body
- (finally (.shutdown ~client-sym)))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/clojure.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/clojure.clj b/storm-core/src/clj/backtype/storm/clojure.clj
deleted file mode 100644
index 6e88cb6..0000000
--- a/storm-core/src/clj/backtype/storm/clojure.clj
+++ /dev/null
@@ -1,204 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.clojure
- (:use [org.apache.storm util])
- (:import [org.apache.storm StormSubmitter])
- (:import [org.apache.storm.generated StreamInfo])
- (:import [org.apache.storm.tuple Tuple])
- (:import [org.apache.storm.task OutputCollector IBolt TopologyContext])
- (:import [org.apache.storm.spout SpoutOutputCollector ISpout])
- (:import [org.apache.storm.utils Utils])
- (:import [org.apache.storm.clojure ClojureBolt ClojureSpout])
- (:import [java.util List])
- (:require [org.apache.storm [thrift :as thrift]]))
-
-(defn direct-stream [fields]
- (StreamInfo. fields true))
-
-(defn to-spec [avar]
- (let [m (meta avar)]
- [(str (:ns m)) (str (:name m))]))
-
-(defn clojure-bolt* [output-spec fn-var conf-fn-var args]
- (ClojureBolt. (to-spec fn-var) (to-spec conf-fn-var) args (thrift/mk-output-spec output-spec)))
-
-(defmacro clojure-bolt [output-spec fn-sym conf-fn-sym args]
- `(clojure-bolt* ~output-spec (var ~fn-sym) (var ~conf-fn-sym) ~args))
-
-(defn clojure-spout* [output-spec fn-var conf-var args]
- (let [m (meta fn-var)]
- (ClojureSpout. (to-spec fn-var) (to-spec conf-var) args (thrift/mk-output-spec output-spec))
- ))
-
-(defmacro clojure-spout [output-spec fn-sym conf-sym args]
- `(clojure-spout* ~output-spec (var ~fn-sym) (var ~conf-sym) ~args))
-
-(defn normalize-fns [body]
- (for [[name args & impl] body
- :let [args (-> "this"
- gensym
- (cons args)
- vec)]]
- (concat [name args] impl)
- ))
-
-(defmacro bolt [& body]
- (let [[bolt-fns other-fns] (split-with #(not (symbol? %)) body)
- fns (normalize-fns bolt-fns)]
- `(reify IBolt
- ~@fns
- ~@other-fns)))
-
-(defmacro bolt-execute [& body]
- `(bolt
- (~'execute ~@body)))
-
-(defmacro spout [& body]
- (let [[spout-fns other-fns] (split-with #(not (symbol? %)) body)
- fns (normalize-fns spout-fns)]
- `(reify ISpout
- ~@fns
- ~@other-fns)))
-
-(defmacro defbolt [name output-spec & [opts & impl :as all]]
- (if-not (map? opts)
- `(defbolt ~name ~output-spec {} ~@all)
- (let [worker-name (symbol (str name "__"))
- conf-fn-name (symbol (str name "__conf__"))
- params (:params opts)
- conf-code (:conf opts)
- fn-body (if (:prepare opts)
- (cons 'fn impl)
- (let [[args & impl-body] impl
- coll-sym (nth args 1)
- args (vec (take 1 args))
- prepargs [(gensym "conf") (gensym "context") coll-sym]]
- `(fn ~prepargs (bolt (~'execute ~args ~@impl-body)))))
- definer (if params
- `(defn ~name [& args#]
- (clojure-bolt ~output-spec ~worker-name ~conf-fn-name args#))
- `(def ~name
- (clojure-bolt ~output-spec ~worker-name ~conf-fn-name []))
- )
- ]
- `(do
- (defn ~conf-fn-name ~(if params params [])
- ~conf-code
- )
- (defn ~worker-name ~(if params params [])
- ~fn-body
- )
- ~definer
- ))))
-
-(defmacro defspout [name output-spec & [opts & impl :as all]]
- (if-not (map? opts)
- `(defspout ~name ~output-spec {} ~@all)
- (let [worker-name (symbol (str name "__"))
- conf-fn-name (symbol (str name "__conf__"))
- params (:params opts)
- conf-code (:conf opts)
- prepare? (:prepare opts)
- prepare? (if (nil? prepare?) true prepare?)
- fn-body (if prepare?
- (cons 'fn impl)
- (let [[args & impl-body] impl
- coll-sym (first args)
- prepargs [(gensym "conf") (gensym "context") coll-sym]]
- `(fn ~prepargs (spout (~'nextTuple [] ~@impl-body)))))
- definer (if params
- `(defn ~name [& args#]
- (clojure-spout ~output-spec ~worker-name ~conf-fn-name args#))
- `(def ~name
- (clojure-spout ~output-spec ~worker-name ~conf-fn-name []))
- )
- ]
- `(do
- (defn ~conf-fn-name ~(if params params [])
- ~conf-code
- )
- (defn ~worker-name ~(if params params [])
- ~fn-body
- )
- ~definer
- ))))
-
-(defprotocol TupleValues
- (tuple-values [values collector stream]))
-
-(extend-protocol TupleValues
- java.util.Map
- (tuple-values [this collector ^String stream]
- (let [^TopologyContext context (:context collector)
- fields (.. context (getThisOutputFields stream) toList) ]
- (vec (map (into
- (empty this) (for [[k v] this]
- [(if (keyword? k) (name k) k) v]))
- fields))))
- java.util.List
- (tuple-values [this collector stream]
- this))
-
-(defnk emit-bolt! [collector values
- :stream Utils/DEFAULT_STREAM_ID :anchor []]
- (let [^List anchor (collectify anchor)
- values (tuple-values values collector stream) ]
- (.emit ^OutputCollector (:output-collector collector) stream anchor values)
- ))
-
-(defnk emit-direct-bolt! [collector task values
- :stream Utils/DEFAULT_STREAM_ID :anchor []]
- (let [^List anchor (collectify anchor)
- values (tuple-values values collector stream) ]
- (.emitDirect ^OutputCollector (:output-collector collector) task stream anchor values)
- ))
-
-(defn ack! [collector ^Tuple tuple]
- (.ack ^OutputCollector (:output-collector collector) tuple))
-
-(defn fail! [collector ^Tuple tuple]
- (.fail ^OutputCollector (:output-collector collector) tuple))
-
-(defn reset-timeout! [collector ^Tuple tuple]
- (.resetTimeout ^OutputCollector (:output-collector collector) tuple))
-
-(defn report-error! [collector ^Tuple tuple]
- (.reportError ^OutputCollector (:output-collector collector) tuple))
-
-(defnk emit-spout! [collector values
- :stream Utils/DEFAULT_STREAM_ID :id nil]
- (let [values (tuple-values values collector stream)]
- (.emit ^SpoutOutputCollector (:output-collector collector) stream values id)))
-
-(defnk emit-direct-spout! [collector task values
- :stream Utils/DEFAULT_STREAM_ID :id nil]
- (let [values (tuple-values values collector stream)]
- (.emitDirect ^SpoutOutputCollector (:output-collector collector) task stream values id)))
-
-(defalias topology thrift/mk-topology)
-(defalias bolt-spec thrift/mk-bolt-spec)
-(defalias spout-spec thrift/mk-spout-spec)
-(defalias shell-bolt-spec thrift/mk-shell-bolt-spec)
-(defalias shell-spout-spec thrift/mk-shell-spout-spec)
-
-(defn submit-remote-topology [name conf topology]
- (StormSubmitter/submitTopology name conf topology))
-
-(defn local-cluster []
- ;; do this to avoid a cyclic dependency of
- ;; LocalCluster -> testing -> nimbus -> bootstrap -> clojure -> LocalCluster
- (eval '(new org.apache.storm.LocalCluster)))
[53/59] [abbrv] storm git commit: Making HA backwards-compatible
Posted by ka...@apache.org.
Making HA backwards-compatible
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/9c586049
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/9c586049
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/9c586049
Branch: refs/heads/1.x-branch
Commit: 9c5860498a71c04fda1e201283a63ec2c6352062
Parents: 20180cc
Author: Kyle Nusbaum <Ky...@gmail.com>
Authored: Thu Sep 29 17:06:16 2016 -0500
Committer: Kyle Nusbaum <Ky...@gmail.com>
Committed: Thu Sep 29 17:06:16 2016 -0500
----------------------------------------------------------------------
conf/defaults.yaml | 3 +--
.../org/apache/storm/pacemaker/pacemaker_state_factory.clj | 4 +++-
storm-core/src/jvm/org/apache/storm/Config.java | 8 ++++++++
3 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/9c586049/conf/defaults.yaml
----------------------------------------------------------------------
diff --git a/conf/defaults.yaml b/conf/defaults.yaml
index 4d16d84..041a628 100644
--- a/conf/defaults.yaml
+++ b/conf/defaults.yaml
@@ -276,8 +276,7 @@ resource.aware.scheduler.priority.strategy: "org.apache.storm.scheduler.resource
dev.zookeeper.path: "/tmp/dev-storm-zookeeper"
-pacemaker.servers:
- - "localhost"
+pacemaker.host: "localhost"
pacemaker.port: 6699
pacemaker.base.threads: 10
pacemaker.max.threads: 50
http://git-wip-us.apache.org/repos/asf/storm/blob/9c586049/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj b/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
index eda477c..b37b901 100644
--- a/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
+++ b/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
@@ -87,7 +87,9 @@
(throw (HBExecutionException. "Invalid Response Type")))))
(defn shuffle-servers-list [conf]
- (shuffle (conf PACEMAKER-SERVERS)))
+ (shuffle (or
+ (conf PACEMAKER-SERVERS)
+ [(conf PACEMAKER-HOST)])))
(defn shutdown-rotate [servers client-pool]
; Shutdown the client and remove from the pool
http://git-wip-us.apache.org/repos/asf/storm/blob/9c586049/storm-core/src/jvm/org/apache/storm/Config.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/Config.java b/storm-core/src/jvm/org/apache/storm/Config.java
index 80a2a5d..0854f35 100644
--- a/storm-core/src/jvm/org/apache/storm/Config.java
+++ b/storm-core/src/jvm/org/apache/storm/Config.java
@@ -938,6 +938,14 @@ public class Config extends HashMap<String, Object> {
public static final String PACEMAKER_SERVERS = "pacemaker.servers";
/**
+ * The host that Pacemaker is running on.
+ * @deprecated in favor of PACEMAKER_SERVERS for Pacemaker-HA.
+ */
+ @Deprecated
+ @isString
+ public static final String PACEMAKER_HOST = "pacemaker.host";
+
+ /**
* The port Pacemaker should run on. Clients should
* connect to this port to submit or read heartbeats.
*/
[29/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ComponentPageInfo.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ComponentPageInfo.java b/storm-core/src/jvm/backtype/storm/generated/ComponentPageInfo.java
deleted file mode 100644
index 7fcebcc..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ComponentPageInfo.java
+++ /dev/null
@@ -1,2352 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ComponentPageInfo implements org.apache.thrift.TBase<ComponentPageInfo, ComponentPageInfo._Fields>, java.io.Serializable, Cloneable, Comparable<ComponentPageInfo> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComponentPageInfo");
-
- private static final org.apache.thrift.protocol.TField COMPONENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("component_id", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField COMPONENT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("component_type", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField TOPOLOGY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_id", org.apache.thrift.protocol.TType.STRING, (short)3);
- private static final org.apache.thrift.protocol.TField TOPOLOGY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_name", org.apache.thrift.protocol.TType.STRING, (short)4);
- private static final org.apache.thrift.protocol.TField NUM_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_executors", org.apache.thrift.protocol.TType.I32, (short)5);
- private static final org.apache.thrift.protocol.TField NUM_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_tasks", org.apache.thrift.protocol.TType.I32, (short)6);
- private static final org.apache.thrift.protocol.TField WINDOW_TO_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_stats", org.apache.thrift.protocol.TType.MAP, (short)7);
- private static final org.apache.thrift.protocol.TField GSID_TO_INPUT_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("gsid_to_input_stats", org.apache.thrift.protocol.TType.MAP, (short)8);
- private static final org.apache.thrift.protocol.TField SID_TO_OUTPUT_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("sid_to_output_stats", org.apache.thrift.protocol.TType.MAP, (short)9);
- private static final org.apache.thrift.protocol.TField EXEC_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("exec_stats", org.apache.thrift.protocol.TType.LIST, (short)10);
- private static final org.apache.thrift.protocol.TField ERRORS_FIELD_DESC = new org.apache.thrift.protocol.TField("errors", org.apache.thrift.protocol.TType.LIST, (short)11);
- private static final org.apache.thrift.protocol.TField EVENTLOG_HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("eventlog_host", org.apache.thrift.protocol.TType.STRING, (short)12);
- private static final org.apache.thrift.protocol.TField EVENTLOG_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("eventlog_port", org.apache.thrift.protocol.TType.I32, (short)13);
- private static final org.apache.thrift.protocol.TField DEBUG_OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("debug_options", org.apache.thrift.protocol.TType.STRUCT, (short)14);
- private static final org.apache.thrift.protocol.TField TOPOLOGY_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_status", org.apache.thrift.protocol.TType.STRING, (short)15);
- private static final org.apache.thrift.protocol.TField RESOURCES_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("resources_map", org.apache.thrift.protocol.TType.MAP, (short)16);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ComponentPageInfoStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ComponentPageInfoTupleSchemeFactory());
- }
-
- private String component_id; // required
- private ComponentType component_type; // required
- private String topology_id; // optional
- private String topology_name; // optional
- private int num_executors; // optional
- private int num_tasks; // optional
- private Map<String,ComponentAggregateStats> window_to_stats; // optional
- private Map<GlobalStreamId,ComponentAggregateStats> gsid_to_input_stats; // optional
- private Map<String,ComponentAggregateStats> sid_to_output_stats; // optional
- private List<ExecutorAggregateStats> exec_stats; // optional
- private List<ErrorInfo> errors; // optional
- private String eventlog_host; // optional
- private int eventlog_port; // optional
- private DebugOptions debug_options; // optional
- private String topology_status; // optional
- private Map<String,Double> resources_map; // 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 {
- COMPONENT_ID((short)1, "component_id"),
- /**
- *
- * @see ComponentType
- */
- COMPONENT_TYPE((short)2, "component_type"),
- TOPOLOGY_ID((short)3, "topology_id"),
- TOPOLOGY_NAME((short)4, "topology_name"),
- NUM_EXECUTORS((short)5, "num_executors"),
- NUM_TASKS((short)6, "num_tasks"),
- WINDOW_TO_STATS((short)7, "window_to_stats"),
- GSID_TO_INPUT_STATS((short)8, "gsid_to_input_stats"),
- SID_TO_OUTPUT_STATS((short)9, "sid_to_output_stats"),
- EXEC_STATS((short)10, "exec_stats"),
- ERRORS((short)11, "errors"),
- EVENTLOG_HOST((short)12, "eventlog_host"),
- EVENTLOG_PORT((short)13, "eventlog_port"),
- DEBUG_OPTIONS((short)14, "debug_options"),
- TOPOLOGY_STATUS((short)15, "topology_status"),
- RESOURCES_MAP((short)16, "resources_map");
-
- 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: // COMPONENT_ID
- return COMPONENT_ID;
- case 2: // COMPONENT_TYPE
- return COMPONENT_TYPE;
- case 3: // TOPOLOGY_ID
- return TOPOLOGY_ID;
- case 4: // TOPOLOGY_NAME
- return TOPOLOGY_NAME;
- case 5: // NUM_EXECUTORS
- return NUM_EXECUTORS;
- case 6: // NUM_TASKS
- return NUM_TASKS;
- case 7: // WINDOW_TO_STATS
- return WINDOW_TO_STATS;
- case 8: // GSID_TO_INPUT_STATS
- return GSID_TO_INPUT_STATS;
- case 9: // SID_TO_OUTPUT_STATS
- return SID_TO_OUTPUT_STATS;
- case 10: // EXEC_STATS
- return EXEC_STATS;
- case 11: // ERRORS
- return ERRORS;
- case 12: // EVENTLOG_HOST
- return EVENTLOG_HOST;
- case 13: // EVENTLOG_PORT
- return EVENTLOG_PORT;
- case 14: // DEBUG_OPTIONS
- return DEBUG_OPTIONS;
- case 15: // TOPOLOGY_STATUS
- return TOPOLOGY_STATUS;
- case 16: // RESOURCES_MAP
- return RESOURCES_MAP;
- 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 __NUM_EXECUTORS_ISSET_ID = 0;
- private static final int __NUM_TASKS_ISSET_ID = 1;
- private static final int __EVENTLOG_PORT_ISSET_ID = 2;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.TOPOLOGY_ID,_Fields.TOPOLOGY_NAME,_Fields.NUM_EXECUTORS,_Fields.NUM_TASKS,_Fields.WINDOW_TO_STATS,_Fields.GSID_TO_INPUT_STATS,_Fields.SID_TO_OUTPUT_STATS,_Fields.EXEC_STATS,_Fields.ERRORS,_Fields.EVENTLOG_HOST,_Fields.EVENTLOG_PORT,_Fields.DEBUG_OPTIONS,_Fields.TOPOLOGY_STATUS,_Fields.RESOURCES_MAP};
- 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.COMPONENT_ID, new org.apache.thrift.meta_data.FieldMetaData("component_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.COMPONENT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("component_type", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ComponentType.class)));
- tmpMap.put(_Fields.TOPOLOGY_ID, new org.apache.thrift.meta_data.FieldMetaData("topology_id", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.TOPOLOGY_NAME, new org.apache.thrift.meta_data.FieldMetaData("topology_name", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.NUM_EXECUTORS, new org.apache.thrift.meta_data.FieldMetaData("num_executors", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.NUM_TASKS, new org.apache.thrift.meta_data.FieldMetaData("num_tasks", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.WINDOW_TO_STATS, new org.apache.thrift.meta_data.FieldMetaData("window_to_stats", 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, ComponentAggregateStats.class))));
- tmpMap.put(_Fields.GSID_TO_INPUT_STATS, new org.apache.thrift.meta_data.FieldMetaData("gsid_to_input_stats", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class),
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentAggregateStats.class))));
- tmpMap.put(_Fields.SID_TO_OUTPUT_STATS, new org.apache.thrift.meta_data.FieldMetaData("sid_to_output_stats", 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, ComponentAggregateStats.class))));
- tmpMap.put(_Fields.EXEC_STATS, new org.apache.thrift.meta_data.FieldMetaData("exec_stats", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ExecutorAggregateStats.class))));
- tmpMap.put(_Fields.ERRORS, new org.apache.thrift.meta_data.FieldMetaData("errors", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ErrorInfo.class))));
- tmpMap.put(_Fields.EVENTLOG_HOST, new org.apache.thrift.meta_data.FieldMetaData("eventlog_host", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.EVENTLOG_PORT, new org.apache.thrift.meta_data.FieldMetaData("eventlog_port", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.DEBUG_OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("debug_options", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DebugOptions.class)));
- tmpMap.put(_Fields.TOPOLOGY_STATUS, new org.apache.thrift.meta_data.FieldMetaData("topology_status", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.RESOURCES_MAP, new org.apache.thrift.meta_data.FieldMetaData("resources_map", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ComponentPageInfo.class, metaDataMap);
- }
-
- public ComponentPageInfo() {
- }
-
- public ComponentPageInfo(
- String component_id,
- ComponentType component_type)
- {
- this();
- this.component_id = component_id;
- this.component_type = component_type;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ComponentPageInfo(ComponentPageInfo other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_component_id()) {
- this.component_id = other.component_id;
- }
- if (other.is_set_component_type()) {
- this.component_type = other.component_type;
- }
- if (other.is_set_topology_id()) {
- this.topology_id = other.topology_id;
- }
- if (other.is_set_topology_name()) {
- this.topology_name = other.topology_name;
- }
- this.num_executors = other.num_executors;
- this.num_tasks = other.num_tasks;
- if (other.is_set_window_to_stats()) {
- Map<String,ComponentAggregateStats> __this__window_to_stats = new HashMap<String,ComponentAggregateStats>(other.window_to_stats.size());
- for (Map.Entry<String, ComponentAggregateStats> other_element : other.window_to_stats.entrySet()) {
-
- String other_element_key = other_element.getKey();
- ComponentAggregateStats other_element_value = other_element.getValue();
-
- String __this__window_to_stats_copy_key = other_element_key;
-
- ComponentAggregateStats __this__window_to_stats_copy_value = new ComponentAggregateStats(other_element_value);
-
- __this__window_to_stats.put(__this__window_to_stats_copy_key, __this__window_to_stats_copy_value);
- }
- this.window_to_stats = __this__window_to_stats;
- }
- if (other.is_set_gsid_to_input_stats()) {
- Map<GlobalStreamId,ComponentAggregateStats> __this__gsid_to_input_stats = new HashMap<GlobalStreamId,ComponentAggregateStats>(other.gsid_to_input_stats.size());
- for (Map.Entry<GlobalStreamId, ComponentAggregateStats> other_element : other.gsid_to_input_stats.entrySet()) {
-
- GlobalStreamId other_element_key = other_element.getKey();
- ComponentAggregateStats other_element_value = other_element.getValue();
-
- GlobalStreamId __this__gsid_to_input_stats_copy_key = new GlobalStreamId(other_element_key);
-
- ComponentAggregateStats __this__gsid_to_input_stats_copy_value = new ComponentAggregateStats(other_element_value);
-
- __this__gsid_to_input_stats.put(__this__gsid_to_input_stats_copy_key, __this__gsid_to_input_stats_copy_value);
- }
- this.gsid_to_input_stats = __this__gsid_to_input_stats;
- }
- if (other.is_set_sid_to_output_stats()) {
- Map<String,ComponentAggregateStats> __this__sid_to_output_stats = new HashMap<String,ComponentAggregateStats>(other.sid_to_output_stats.size());
- for (Map.Entry<String, ComponentAggregateStats> other_element : other.sid_to_output_stats.entrySet()) {
-
- String other_element_key = other_element.getKey();
- ComponentAggregateStats other_element_value = other_element.getValue();
-
- String __this__sid_to_output_stats_copy_key = other_element_key;
-
- ComponentAggregateStats __this__sid_to_output_stats_copy_value = new ComponentAggregateStats(other_element_value);
-
- __this__sid_to_output_stats.put(__this__sid_to_output_stats_copy_key, __this__sid_to_output_stats_copy_value);
- }
- this.sid_to_output_stats = __this__sid_to_output_stats;
- }
- if (other.is_set_exec_stats()) {
- List<ExecutorAggregateStats> __this__exec_stats = new ArrayList<ExecutorAggregateStats>(other.exec_stats.size());
- for (ExecutorAggregateStats other_element : other.exec_stats) {
- __this__exec_stats.add(new ExecutorAggregateStats(other_element));
- }
- this.exec_stats = __this__exec_stats;
- }
- if (other.is_set_errors()) {
- List<ErrorInfo> __this__errors = new ArrayList<ErrorInfo>(other.errors.size());
- for (ErrorInfo other_element : other.errors) {
- __this__errors.add(new ErrorInfo(other_element));
- }
- this.errors = __this__errors;
- }
- if (other.is_set_eventlog_host()) {
- this.eventlog_host = other.eventlog_host;
- }
- this.eventlog_port = other.eventlog_port;
- if (other.is_set_debug_options()) {
- this.debug_options = new DebugOptions(other.debug_options);
- }
- if (other.is_set_topology_status()) {
- this.topology_status = other.topology_status;
- }
- if (other.is_set_resources_map()) {
- Map<String,Double> __this__resources_map = new HashMap<String,Double>(other.resources_map);
- this.resources_map = __this__resources_map;
- }
- }
-
- public ComponentPageInfo deepCopy() {
- return new ComponentPageInfo(this);
- }
-
- @Override
- public void clear() {
- this.component_id = null;
- this.component_type = null;
- this.topology_id = null;
- this.topology_name = null;
- set_num_executors_isSet(false);
- this.num_executors = 0;
- set_num_tasks_isSet(false);
- this.num_tasks = 0;
- this.window_to_stats = null;
- this.gsid_to_input_stats = null;
- this.sid_to_output_stats = null;
- this.exec_stats = null;
- this.errors = null;
- this.eventlog_host = null;
- set_eventlog_port_isSet(false);
- this.eventlog_port = 0;
- this.debug_options = null;
- this.topology_status = null;
- this.resources_map = null;
- }
-
- public String get_component_id() {
- return this.component_id;
- }
-
- public void set_component_id(String component_id) {
- this.component_id = component_id;
- }
-
- public void unset_component_id() {
- this.component_id = null;
- }
-
- /** Returns true if field component_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_component_id() {
- return this.component_id != null;
- }
-
- public void set_component_id_isSet(boolean value) {
- if (!value) {
- this.component_id = null;
- }
- }
-
- /**
- *
- * @see ComponentType
- */
- public ComponentType get_component_type() {
- return this.component_type;
- }
-
- /**
- *
- * @see ComponentType
- */
- public void set_component_type(ComponentType component_type) {
- this.component_type = component_type;
- }
-
- public void unset_component_type() {
- this.component_type = null;
- }
-
- /** Returns true if field component_type is set (has been assigned a value) and false otherwise */
- public boolean is_set_component_type() {
- return this.component_type != null;
- }
-
- public void set_component_type_isSet(boolean value) {
- if (!value) {
- this.component_type = null;
- }
- }
-
- public String get_topology_id() {
- return this.topology_id;
- }
-
- public void set_topology_id(String topology_id) {
- this.topology_id = topology_id;
- }
-
- public void unset_topology_id() {
- this.topology_id = null;
- }
-
- /** Returns true if field topology_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_topology_id() {
- return this.topology_id != null;
- }
-
- public void set_topology_id_isSet(boolean value) {
- if (!value) {
- this.topology_id = null;
- }
- }
-
- public String get_topology_name() {
- return this.topology_name;
- }
-
- public void set_topology_name(String topology_name) {
- this.topology_name = topology_name;
- }
-
- public void unset_topology_name() {
- this.topology_name = null;
- }
-
- /** Returns true if field topology_name is set (has been assigned a value) and false otherwise */
- public boolean is_set_topology_name() {
- return this.topology_name != null;
- }
-
- public void set_topology_name_isSet(boolean value) {
- if (!value) {
- this.topology_name = null;
- }
- }
-
- public int get_num_executors() {
- return this.num_executors;
- }
-
- public void set_num_executors(int num_executors) {
- this.num_executors = num_executors;
- set_num_executors_isSet(true);
- }
-
- public void unset_num_executors() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID);
- }
-
- /** Returns true if field num_executors is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_executors() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID);
- }
-
- public void set_num_executors_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID, value);
- }
-
- public int get_num_tasks() {
- return this.num_tasks;
- }
-
- public void set_num_tasks(int num_tasks) {
- this.num_tasks = num_tasks;
- set_num_tasks_isSet(true);
- }
-
- public void unset_num_tasks() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_TASKS_ISSET_ID);
- }
-
- /** Returns true if field num_tasks is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_tasks() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_TASKS_ISSET_ID);
- }
-
- public void set_num_tasks_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_TASKS_ISSET_ID, value);
- }
-
- public int get_window_to_stats_size() {
- return (this.window_to_stats == null) ? 0 : this.window_to_stats.size();
- }
-
- public void put_to_window_to_stats(String key, ComponentAggregateStats val) {
- if (this.window_to_stats == null) {
- this.window_to_stats = new HashMap<String,ComponentAggregateStats>();
- }
- this.window_to_stats.put(key, val);
- }
-
- public Map<String,ComponentAggregateStats> get_window_to_stats() {
- return this.window_to_stats;
- }
-
- public void set_window_to_stats(Map<String,ComponentAggregateStats> window_to_stats) {
- this.window_to_stats = window_to_stats;
- }
-
- public void unset_window_to_stats() {
- this.window_to_stats = null;
- }
-
- /** Returns true if field window_to_stats is set (has been assigned a value) and false otherwise */
- public boolean is_set_window_to_stats() {
- return this.window_to_stats != null;
- }
-
- public void set_window_to_stats_isSet(boolean value) {
- if (!value) {
- this.window_to_stats = null;
- }
- }
-
- public int get_gsid_to_input_stats_size() {
- return (this.gsid_to_input_stats == null) ? 0 : this.gsid_to_input_stats.size();
- }
-
- public void put_to_gsid_to_input_stats(GlobalStreamId key, ComponentAggregateStats val) {
- if (this.gsid_to_input_stats == null) {
- this.gsid_to_input_stats = new HashMap<GlobalStreamId,ComponentAggregateStats>();
- }
- this.gsid_to_input_stats.put(key, val);
- }
-
- public Map<GlobalStreamId,ComponentAggregateStats> get_gsid_to_input_stats() {
- return this.gsid_to_input_stats;
- }
-
- public void set_gsid_to_input_stats(Map<GlobalStreamId,ComponentAggregateStats> gsid_to_input_stats) {
- this.gsid_to_input_stats = gsid_to_input_stats;
- }
-
- public void unset_gsid_to_input_stats() {
- this.gsid_to_input_stats = null;
- }
-
- /** Returns true if field gsid_to_input_stats is set (has been assigned a value) and false otherwise */
- public boolean is_set_gsid_to_input_stats() {
- return this.gsid_to_input_stats != null;
- }
-
- public void set_gsid_to_input_stats_isSet(boolean value) {
- if (!value) {
- this.gsid_to_input_stats = null;
- }
- }
-
- public int get_sid_to_output_stats_size() {
- return (this.sid_to_output_stats == null) ? 0 : this.sid_to_output_stats.size();
- }
-
- public void put_to_sid_to_output_stats(String key, ComponentAggregateStats val) {
- if (this.sid_to_output_stats == null) {
- this.sid_to_output_stats = new HashMap<String,ComponentAggregateStats>();
- }
- this.sid_to_output_stats.put(key, val);
- }
-
- public Map<String,ComponentAggregateStats> get_sid_to_output_stats() {
- return this.sid_to_output_stats;
- }
-
- public void set_sid_to_output_stats(Map<String,ComponentAggregateStats> sid_to_output_stats) {
- this.sid_to_output_stats = sid_to_output_stats;
- }
-
- public void unset_sid_to_output_stats() {
- this.sid_to_output_stats = null;
- }
-
- /** Returns true if field sid_to_output_stats is set (has been assigned a value) and false otherwise */
- public boolean is_set_sid_to_output_stats() {
- return this.sid_to_output_stats != null;
- }
-
- public void set_sid_to_output_stats_isSet(boolean value) {
- if (!value) {
- this.sid_to_output_stats = null;
- }
- }
-
- public int get_exec_stats_size() {
- return (this.exec_stats == null) ? 0 : this.exec_stats.size();
- }
-
- public java.util.Iterator<ExecutorAggregateStats> get_exec_stats_iterator() {
- return (this.exec_stats == null) ? null : this.exec_stats.iterator();
- }
-
- public void add_to_exec_stats(ExecutorAggregateStats elem) {
- if (this.exec_stats == null) {
- this.exec_stats = new ArrayList<ExecutorAggregateStats>();
- }
- this.exec_stats.add(elem);
- }
-
- public List<ExecutorAggregateStats> get_exec_stats() {
- return this.exec_stats;
- }
-
- public void set_exec_stats(List<ExecutorAggregateStats> exec_stats) {
- this.exec_stats = exec_stats;
- }
-
- public void unset_exec_stats() {
- this.exec_stats = null;
- }
-
- /** Returns true if field exec_stats is set (has been assigned a value) and false otherwise */
- public boolean is_set_exec_stats() {
- return this.exec_stats != null;
- }
-
- public void set_exec_stats_isSet(boolean value) {
- if (!value) {
- this.exec_stats = null;
- }
- }
-
- public int get_errors_size() {
- return (this.errors == null) ? 0 : this.errors.size();
- }
-
- public java.util.Iterator<ErrorInfo> get_errors_iterator() {
- return (this.errors == null) ? null : this.errors.iterator();
- }
-
- public void add_to_errors(ErrorInfo elem) {
- if (this.errors == null) {
- this.errors = new ArrayList<ErrorInfo>();
- }
- this.errors.add(elem);
- }
-
- public List<ErrorInfo> get_errors() {
- return this.errors;
- }
-
- public void set_errors(List<ErrorInfo> errors) {
- this.errors = errors;
- }
-
- public void unset_errors() {
- this.errors = null;
- }
-
- /** Returns true if field errors is set (has been assigned a value) and false otherwise */
- public boolean is_set_errors() {
- return this.errors != null;
- }
-
- public void set_errors_isSet(boolean value) {
- if (!value) {
- this.errors = null;
- }
- }
-
- public String get_eventlog_host() {
- return this.eventlog_host;
- }
-
- public void set_eventlog_host(String eventlog_host) {
- this.eventlog_host = eventlog_host;
- }
-
- public void unset_eventlog_host() {
- this.eventlog_host = null;
- }
-
- /** Returns true if field eventlog_host is set (has been assigned a value) and false otherwise */
- public boolean is_set_eventlog_host() {
- return this.eventlog_host != null;
- }
-
- public void set_eventlog_host_isSet(boolean value) {
- if (!value) {
- this.eventlog_host = null;
- }
- }
-
- public int get_eventlog_port() {
- return this.eventlog_port;
- }
-
- public void set_eventlog_port(int eventlog_port) {
- this.eventlog_port = eventlog_port;
- set_eventlog_port_isSet(true);
- }
-
- public void unset_eventlog_port() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EVENTLOG_PORT_ISSET_ID);
- }
-
- /** Returns true if field eventlog_port is set (has been assigned a value) and false otherwise */
- public boolean is_set_eventlog_port() {
- return EncodingUtils.testBit(__isset_bitfield, __EVENTLOG_PORT_ISSET_ID);
- }
-
- public void set_eventlog_port_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EVENTLOG_PORT_ISSET_ID, value);
- }
-
- public DebugOptions get_debug_options() {
- return this.debug_options;
- }
-
- public void set_debug_options(DebugOptions debug_options) {
- this.debug_options = debug_options;
- }
-
- public void unset_debug_options() {
- this.debug_options = null;
- }
-
- /** Returns true if field debug_options is set (has been assigned a value) and false otherwise */
- public boolean is_set_debug_options() {
- return this.debug_options != null;
- }
-
- public void set_debug_options_isSet(boolean value) {
- if (!value) {
- this.debug_options = null;
- }
- }
-
- public String get_topology_status() {
- return this.topology_status;
- }
-
- public void set_topology_status(String topology_status) {
- this.topology_status = topology_status;
- }
-
- public void unset_topology_status() {
- this.topology_status = null;
- }
-
- /** Returns true if field topology_status is set (has been assigned a value) and false otherwise */
- public boolean is_set_topology_status() {
- return this.topology_status != null;
- }
-
- public void set_topology_status_isSet(boolean value) {
- if (!value) {
- this.topology_status = null;
- }
- }
-
- public int get_resources_map_size() {
- return (this.resources_map == null) ? 0 : this.resources_map.size();
- }
-
- public void put_to_resources_map(String key, double val) {
- if (this.resources_map == null) {
- this.resources_map = new HashMap<String,Double>();
- }
- this.resources_map.put(key, val);
- }
-
- public Map<String,Double> get_resources_map() {
- return this.resources_map;
- }
-
- public void set_resources_map(Map<String,Double> resources_map) {
- this.resources_map = resources_map;
- }
-
- public void unset_resources_map() {
- this.resources_map = null;
- }
-
- /** Returns true if field resources_map is set (has been assigned a value) and false otherwise */
- public boolean is_set_resources_map() {
- return this.resources_map != null;
- }
-
- public void set_resources_map_isSet(boolean value) {
- if (!value) {
- this.resources_map = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case COMPONENT_ID:
- if (value == null) {
- unset_component_id();
- } else {
- set_component_id((String)value);
- }
- break;
-
- case COMPONENT_TYPE:
- if (value == null) {
- unset_component_type();
- } else {
- set_component_type((ComponentType)value);
- }
- break;
-
- case TOPOLOGY_ID:
- if (value == null) {
- unset_topology_id();
- } else {
- set_topology_id((String)value);
- }
- break;
-
- case TOPOLOGY_NAME:
- if (value == null) {
- unset_topology_name();
- } else {
- set_topology_name((String)value);
- }
- break;
-
- case NUM_EXECUTORS:
- if (value == null) {
- unset_num_executors();
- } else {
- set_num_executors((Integer)value);
- }
- break;
-
- case NUM_TASKS:
- if (value == null) {
- unset_num_tasks();
- } else {
- set_num_tasks((Integer)value);
- }
- break;
-
- case WINDOW_TO_STATS:
- if (value == null) {
- unset_window_to_stats();
- } else {
- set_window_to_stats((Map<String,ComponentAggregateStats>)value);
- }
- break;
-
- case GSID_TO_INPUT_STATS:
- if (value == null) {
- unset_gsid_to_input_stats();
- } else {
- set_gsid_to_input_stats((Map<GlobalStreamId,ComponentAggregateStats>)value);
- }
- break;
-
- case SID_TO_OUTPUT_STATS:
- if (value == null) {
- unset_sid_to_output_stats();
- } else {
- set_sid_to_output_stats((Map<String,ComponentAggregateStats>)value);
- }
- break;
-
- case EXEC_STATS:
- if (value == null) {
- unset_exec_stats();
- } else {
- set_exec_stats((List<ExecutorAggregateStats>)value);
- }
- break;
-
- case ERRORS:
- if (value == null) {
- unset_errors();
- } else {
- set_errors((List<ErrorInfo>)value);
- }
- break;
-
- case EVENTLOG_HOST:
- if (value == null) {
- unset_eventlog_host();
- } else {
- set_eventlog_host((String)value);
- }
- break;
-
- case EVENTLOG_PORT:
- if (value == null) {
- unset_eventlog_port();
- } else {
- set_eventlog_port((Integer)value);
- }
- break;
-
- case DEBUG_OPTIONS:
- if (value == null) {
- unset_debug_options();
- } else {
- set_debug_options((DebugOptions)value);
- }
- break;
-
- case TOPOLOGY_STATUS:
- if (value == null) {
- unset_topology_status();
- } else {
- set_topology_status((String)value);
- }
- break;
-
- case RESOURCES_MAP:
- if (value == null) {
- unset_resources_map();
- } else {
- set_resources_map((Map<String,Double>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case COMPONENT_ID:
- return get_component_id();
-
- case COMPONENT_TYPE:
- return get_component_type();
-
- case TOPOLOGY_ID:
- return get_topology_id();
-
- case TOPOLOGY_NAME:
- return get_topology_name();
-
- case NUM_EXECUTORS:
- return get_num_executors();
-
- case NUM_TASKS:
- return get_num_tasks();
-
- case WINDOW_TO_STATS:
- return get_window_to_stats();
-
- case GSID_TO_INPUT_STATS:
- return get_gsid_to_input_stats();
-
- case SID_TO_OUTPUT_STATS:
- return get_sid_to_output_stats();
-
- case EXEC_STATS:
- return get_exec_stats();
-
- case ERRORS:
- return get_errors();
-
- case EVENTLOG_HOST:
- return get_eventlog_host();
-
- case EVENTLOG_PORT:
- return get_eventlog_port();
-
- case DEBUG_OPTIONS:
- return get_debug_options();
-
- case TOPOLOGY_STATUS:
- return get_topology_status();
-
- case RESOURCES_MAP:
- return get_resources_map();
-
- }
- 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 COMPONENT_ID:
- return is_set_component_id();
- case COMPONENT_TYPE:
- return is_set_component_type();
- case TOPOLOGY_ID:
- return is_set_topology_id();
- case TOPOLOGY_NAME:
- return is_set_topology_name();
- case NUM_EXECUTORS:
- return is_set_num_executors();
- case NUM_TASKS:
- return is_set_num_tasks();
- case WINDOW_TO_STATS:
- return is_set_window_to_stats();
- case GSID_TO_INPUT_STATS:
- return is_set_gsid_to_input_stats();
- case SID_TO_OUTPUT_STATS:
- return is_set_sid_to_output_stats();
- case EXEC_STATS:
- return is_set_exec_stats();
- case ERRORS:
- return is_set_errors();
- case EVENTLOG_HOST:
- return is_set_eventlog_host();
- case EVENTLOG_PORT:
- return is_set_eventlog_port();
- case DEBUG_OPTIONS:
- return is_set_debug_options();
- case TOPOLOGY_STATUS:
- return is_set_topology_status();
- case RESOURCES_MAP:
- return is_set_resources_map();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ComponentPageInfo)
- return this.equals((ComponentPageInfo)that);
- return false;
- }
-
- public boolean equals(ComponentPageInfo that) {
- if (that == null)
- return false;
-
- boolean this_present_component_id = true && this.is_set_component_id();
- boolean that_present_component_id = true && that.is_set_component_id();
- if (this_present_component_id || that_present_component_id) {
- if (!(this_present_component_id && that_present_component_id))
- return false;
- if (!this.component_id.equals(that.component_id))
- return false;
- }
-
- boolean this_present_component_type = true && this.is_set_component_type();
- boolean that_present_component_type = true && that.is_set_component_type();
- if (this_present_component_type || that_present_component_type) {
- if (!(this_present_component_type && that_present_component_type))
- return false;
- if (!this.component_type.equals(that.component_type))
- return false;
- }
-
- boolean this_present_topology_id = true && this.is_set_topology_id();
- boolean that_present_topology_id = true && that.is_set_topology_id();
- if (this_present_topology_id || that_present_topology_id) {
- if (!(this_present_topology_id && that_present_topology_id))
- return false;
- if (!this.topology_id.equals(that.topology_id))
- return false;
- }
-
- boolean this_present_topology_name = true && this.is_set_topology_name();
- boolean that_present_topology_name = true && that.is_set_topology_name();
- if (this_present_topology_name || that_present_topology_name) {
- if (!(this_present_topology_name && that_present_topology_name))
- return false;
- if (!this.topology_name.equals(that.topology_name))
- return false;
- }
-
- boolean this_present_num_executors = true && this.is_set_num_executors();
- boolean that_present_num_executors = true && that.is_set_num_executors();
- if (this_present_num_executors || that_present_num_executors) {
- if (!(this_present_num_executors && that_present_num_executors))
- return false;
- if (this.num_executors != that.num_executors)
- return false;
- }
-
- boolean this_present_num_tasks = true && this.is_set_num_tasks();
- boolean that_present_num_tasks = true && that.is_set_num_tasks();
- if (this_present_num_tasks || that_present_num_tasks) {
- if (!(this_present_num_tasks && that_present_num_tasks))
- return false;
- if (this.num_tasks != that.num_tasks)
- return false;
- }
-
- boolean this_present_window_to_stats = true && this.is_set_window_to_stats();
- boolean that_present_window_to_stats = true && that.is_set_window_to_stats();
- if (this_present_window_to_stats || that_present_window_to_stats) {
- if (!(this_present_window_to_stats && that_present_window_to_stats))
- return false;
- if (!this.window_to_stats.equals(that.window_to_stats))
- return false;
- }
-
- boolean this_present_gsid_to_input_stats = true && this.is_set_gsid_to_input_stats();
- boolean that_present_gsid_to_input_stats = true && that.is_set_gsid_to_input_stats();
- if (this_present_gsid_to_input_stats || that_present_gsid_to_input_stats) {
- if (!(this_present_gsid_to_input_stats && that_present_gsid_to_input_stats))
- return false;
- if (!this.gsid_to_input_stats.equals(that.gsid_to_input_stats))
- return false;
- }
-
- boolean this_present_sid_to_output_stats = true && this.is_set_sid_to_output_stats();
- boolean that_present_sid_to_output_stats = true && that.is_set_sid_to_output_stats();
- if (this_present_sid_to_output_stats || that_present_sid_to_output_stats) {
- if (!(this_present_sid_to_output_stats && that_present_sid_to_output_stats))
- return false;
- if (!this.sid_to_output_stats.equals(that.sid_to_output_stats))
- return false;
- }
-
- boolean this_present_exec_stats = true && this.is_set_exec_stats();
- boolean that_present_exec_stats = true && that.is_set_exec_stats();
- if (this_present_exec_stats || that_present_exec_stats) {
- if (!(this_present_exec_stats && that_present_exec_stats))
- return false;
- if (!this.exec_stats.equals(that.exec_stats))
- return false;
- }
-
- boolean this_present_errors = true && this.is_set_errors();
- boolean that_present_errors = true && that.is_set_errors();
- if (this_present_errors || that_present_errors) {
- if (!(this_present_errors && that_present_errors))
- return false;
- if (!this.errors.equals(that.errors))
- return false;
- }
-
- boolean this_present_eventlog_host = true && this.is_set_eventlog_host();
- boolean that_present_eventlog_host = true && that.is_set_eventlog_host();
- if (this_present_eventlog_host || that_present_eventlog_host) {
- if (!(this_present_eventlog_host && that_present_eventlog_host))
- return false;
- if (!this.eventlog_host.equals(that.eventlog_host))
- return false;
- }
-
- boolean this_present_eventlog_port = true && this.is_set_eventlog_port();
- boolean that_present_eventlog_port = true && that.is_set_eventlog_port();
- if (this_present_eventlog_port || that_present_eventlog_port) {
- if (!(this_present_eventlog_port && that_present_eventlog_port))
- return false;
- if (this.eventlog_port != that.eventlog_port)
- return false;
- }
-
- boolean this_present_debug_options = true && this.is_set_debug_options();
- boolean that_present_debug_options = true && that.is_set_debug_options();
- if (this_present_debug_options || that_present_debug_options) {
- if (!(this_present_debug_options && that_present_debug_options))
- return false;
- if (!this.debug_options.equals(that.debug_options))
- return false;
- }
-
- boolean this_present_topology_status = true && this.is_set_topology_status();
- boolean that_present_topology_status = true && that.is_set_topology_status();
- if (this_present_topology_status || that_present_topology_status) {
- if (!(this_present_topology_status && that_present_topology_status))
- return false;
- if (!this.topology_status.equals(that.topology_status))
- return false;
- }
-
- boolean this_present_resources_map = true && this.is_set_resources_map();
- boolean that_present_resources_map = true && that.is_set_resources_map();
- if (this_present_resources_map || that_present_resources_map) {
- if (!(this_present_resources_map && that_present_resources_map))
- return false;
- if (!this.resources_map.equals(that.resources_map))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_component_id = true && (is_set_component_id());
- list.add(present_component_id);
- if (present_component_id)
- list.add(component_id);
-
- boolean present_component_type = true && (is_set_component_type());
- list.add(present_component_type);
- if (present_component_type)
- list.add(component_type.getValue());
-
- boolean present_topology_id = true && (is_set_topology_id());
- list.add(present_topology_id);
- if (present_topology_id)
- list.add(topology_id);
-
- boolean present_topology_name = true && (is_set_topology_name());
- list.add(present_topology_name);
- if (present_topology_name)
- list.add(topology_name);
-
- boolean present_num_executors = true && (is_set_num_executors());
- list.add(present_num_executors);
- if (present_num_executors)
- list.add(num_executors);
-
- boolean present_num_tasks = true && (is_set_num_tasks());
- list.add(present_num_tasks);
- if (present_num_tasks)
- list.add(num_tasks);
-
- boolean present_window_to_stats = true && (is_set_window_to_stats());
- list.add(present_window_to_stats);
- if (present_window_to_stats)
- list.add(window_to_stats);
-
- boolean present_gsid_to_input_stats = true && (is_set_gsid_to_input_stats());
- list.add(present_gsid_to_input_stats);
- if (present_gsid_to_input_stats)
- list.add(gsid_to_input_stats);
-
- boolean present_sid_to_output_stats = true && (is_set_sid_to_output_stats());
- list.add(present_sid_to_output_stats);
- if (present_sid_to_output_stats)
- list.add(sid_to_output_stats);
-
- boolean present_exec_stats = true && (is_set_exec_stats());
- list.add(present_exec_stats);
- if (present_exec_stats)
- list.add(exec_stats);
-
- boolean present_errors = true && (is_set_errors());
- list.add(present_errors);
- if (present_errors)
- list.add(errors);
-
- boolean present_eventlog_host = true && (is_set_eventlog_host());
- list.add(present_eventlog_host);
- if (present_eventlog_host)
- list.add(eventlog_host);
-
- boolean present_eventlog_port = true && (is_set_eventlog_port());
- list.add(present_eventlog_port);
- if (present_eventlog_port)
- list.add(eventlog_port);
-
- boolean present_debug_options = true && (is_set_debug_options());
- list.add(present_debug_options);
- if (present_debug_options)
- list.add(debug_options);
-
- boolean present_topology_status = true && (is_set_topology_status());
- list.add(present_topology_status);
- if (present_topology_status)
- list.add(topology_status);
-
- boolean present_resources_map = true && (is_set_resources_map());
- list.add(present_resources_map);
- if (present_resources_map)
- list.add(resources_map);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ComponentPageInfo other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_component_id()).compareTo(other.is_set_component_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_component_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.component_id, other.component_id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_component_type()).compareTo(other.is_set_component_type());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_component_type()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.component_type, other.component_type);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_topology_id()).compareTo(other.is_set_topology_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topology_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology_id, other.topology_id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_topology_name()).compareTo(other.is_set_topology_name());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topology_name()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology_name, other.topology_name);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_executors()).compareTo(other.is_set_num_executors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_executors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_executors, other.num_executors);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_tasks()).compareTo(other.is_set_num_tasks());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_tasks()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_tasks, other.num_tasks);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_window_to_stats()).compareTo(other.is_set_window_to_stats());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_window_to_stats()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.window_to_stats, other.window_to_stats);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_gsid_to_input_stats()).compareTo(other.is_set_gsid_to_input_stats());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_gsid_to_input_stats()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gsid_to_input_stats, other.gsid_to_input_stats);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_sid_to_output_stats()).compareTo(other.is_set_sid_to_output_stats());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_sid_to_output_stats()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sid_to_output_stats, other.sid_to_output_stats);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_exec_stats()).compareTo(other.is_set_exec_stats());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_exec_stats()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.exec_stats, other.exec_stats);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_errors()).compareTo(other.is_set_errors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_errors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errors, other.errors);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_eventlog_host()).compareTo(other.is_set_eventlog_host());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_eventlog_host()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eventlog_host, other.eventlog_host);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_eventlog_port()).compareTo(other.is_set_eventlog_port());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_eventlog_port()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eventlog_port, other.eventlog_port);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_debug_options()).compareTo(other.is_set_debug_options());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_debug_options()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.debug_options, other.debug_options);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_topology_status()).compareTo(other.is_set_topology_status());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topology_status()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology_status, other.topology_status);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_resources_map()).compareTo(other.is_set_resources_map());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_resources_map()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resources_map, other.resources_map);
- 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("ComponentPageInfo(");
- boolean first = true;
-
- sb.append("component_id:");
- if (this.component_id == null) {
- sb.append("null");
- } else {
- sb.append(this.component_id);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("component_type:");
- if (this.component_type == null) {
- sb.append("null");
- } else {
- sb.append(this.component_type);
- }
- first = false;
- if (is_set_topology_id()) {
- if (!first) sb.append(", ");
- sb.append("topology_id:");
- if (this.topology_id == null) {
- sb.append("null");
- } else {
- sb.append(this.topology_id);
- }
- first = false;
- }
- if (is_set_topology_name()) {
- if (!first) sb.append(", ");
- sb.append("topology_name:");
- if (this.topology_name == null) {
- sb.append("null");
- } else {
- sb.append(this.topology_name);
- }
- first = false;
- }
- if (is_set_num_executors()) {
- if (!first) sb.append(", ");
- sb.append("num_executors:");
- sb.append(this.num_executors);
- first = false;
- }
- if (is_set_num_tasks()) {
- if (!first) sb.append(", ");
- sb.append("num_tasks:");
- sb.append(this.num_tasks);
- first = false;
- }
- if (is_set_window_to_stats()) {
- if (!first) sb.append(", ");
- sb.append("window_to_stats:");
- if (this.window_to_stats == null) {
- sb.append("null");
- } else {
- sb.append(this.window_to_stats);
- }
- first = false;
- }
- if (is_set_gsid_to_input_stats()) {
- if (!first) sb.append(", ");
- sb.append("gsid_to_input_stats:");
- if (this.gsid_to_input_stats == null) {
- sb.append("null");
- } else {
- sb.append(this.gsid_to_input_stats);
- }
- first = false;
- }
- if (is_set_sid_to_output_stats()) {
- if (!first) sb.append(", ");
- sb.append("sid_to_output_stats:");
- if (this.sid_to_output_stats == null) {
- sb.append("null");
- } else {
- sb.append(this.sid_to_output_stats);
- }
- first = false;
- }
- if (is_set_exec_stats()) {
- if (!first) sb.append(", ");
- sb.append("exec_stats:");
- if (this.exec_stats == null) {
- sb.append("null");
- } else {
- sb.append(this.exec_stats);
- }
- first = false;
- }
- if (is_set_errors()) {
- if (!first) sb.append(", ");
- sb.append("errors:");
- if (this.errors == null) {
- sb.append("null");
- } else {
- sb.append(this.errors);
- }
- first = false;
- }
- if (is_set_eventlog_host()) {
- if (!first) sb.append(", ");
- sb.append("eventlog_host:");
- if (this.eventlog_host == null) {
- sb.append("null");
- } else {
- sb.append(this.eventlog_host);
- }
- first = false;
- }
- if (is_set_eventlog_port()) {
- if (!first) sb.append(", ");
- sb.append("eventlog_port:");
- sb.append(this.eventlog_port);
- first = false;
- }
- if (is_set_debug_options()) {
- if (!first) sb.append(", ");
- sb.append("debug_options:");
- if (this.debug_options == null) {
- sb.append("null");
- } else {
- sb.append(this.debug_options);
- }
- first = false;
- }
- if (is_set_topology_status()) {
- if (!first) sb.append(", ");
- sb.append("topology_status:");
- if (this.topology_status == null) {
- sb.append("null");
- } else {
- sb.append(this.topology_status);
- }
- first = false;
- }
- if (is_set_resources_map()) {
- if (!first) sb.append(", ");
- sb.append("resources_map:");
- if (this.resources_map == null) {
- sb.append("null");
- } else {
- sb.append(this.resources_map);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_component_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'component_id' is unset! Struct:" + toString());
- }
-
- if (!is_set_component_type()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'component_type' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- if (debug_options != null) {
- debug_options.validate();
- }
- }
-
- 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 ComponentPageInfoStandardSchemeFactory implements SchemeFactory {
- public ComponentPageInfoStandardScheme getScheme() {
- return new ComponentPageInfoStandardScheme();
- }
- }
-
- private static class ComponentPageInfoStandardScheme extends StandardScheme<ComponentPageInfo> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ComponentPageInfo 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: // COMPONENT_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.component_id = iprot.readString();
- struct.set_component_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // COMPONENT_TYPE
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.component_type = org.apache.storm.generated.ComponentType.findByValue(iprot.readI32());
- struct.set_component_type_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // TOPOLOGY_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.topology_id = iprot.readString();
- struct.set_topology_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // TOPOLOGY_NAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.topology_name = iprot.readString();
- struct.set_topology_name_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // NUM_EXECUTORS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_executors = iprot.readI32();
- struct.set_num_executors_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // NUM_TASKS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_tasks = iprot.readI32();
- struct.set_num_tasks_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // WINDOW_TO_STATS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map482 = iprot.readMapBegin();
- struct.window_to_stats = new HashMap<String,ComponentAggregateStats>(2*_map482.size);
- String _key483;
- ComponentAggregateStats _val484;
- for (int _i485 = 0; _i485 < _map482.size; ++_i485)
- {
- _key483 = iprot.readString();
- _val484 = new ComponentAggregateStats();
- _val484.read(iprot);
- struct.window_to_stats.put(_key483, _val484);
- }
- iprot.readMapEnd();
- }
- struct.set_window_to_stats_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 8: // GSID_TO_INPUT_STATS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map486 = iprot.readMapBegin();
- struct.gsid_to_input_stats = new HashMap<GlobalStreamId,ComponentAggregateStats>(2*_map486.size);
- GlobalStreamId _key487;
- ComponentAggregateStats _val488;
- for (int _i489 = 0; _i489 < _map486.size; ++_i489)
- {
- _key487 = new GlobalStreamId();
- _key487.read(iprot);
- _val488 = new ComponentAggregateStats();
- _val488.read(iprot);
- struct.gsid_to_input_stats.put(_key487, _val488);
- }
- iprot.readMapEnd();
- }
- struct.set_gsid_to_input_stats_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 9: // SID_TO_OUTPUT_STATS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map490 = iprot.readMapBegin();
- struct.sid_to_output_stats = new HashMap<String,ComponentAggregateStats>(2*_map490.size);
- String _key491;
- ComponentAggregateStats _val492;
- for (int _i493 = 0; _i493 < _map490.size; ++_i493)
- {
- _key491 = iprot.readString();
- _val492 = new ComponentAggregateStats();
- _val492.read(iprot);
- struct.sid_to_output_stats.put(_key491, _val492);
- }
- iprot.readMapEnd();
- }
- struct.set_sid_to_output_stats_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 10: // EXEC_STATS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list494 = iprot.readListBegin();
- struct.exec_stats = new ArrayList<ExecutorAggregateStats>(_list494.size);
- ExecutorAggregateStats _elem495;
- for (int _i496 = 0; _i496 < _list494.size; ++_i496)
- {
- _elem495 = new ExecutorAggregateStats();
- _elem495.read(iprot);
- struct.exec_stats.add(_elem495);
- }
- iprot.readListEnd();
- }
- struct.set_exec_stats_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 11: // ERRORS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list497 = iprot.readListBegin();
- struct.errors = new ArrayList<ErrorInfo>(_list497.size);
- ErrorInfo _elem498;
- for (int _i499 = 0; _i499 < _list497.size; ++_i499)
- {
- _elem498 = new ErrorInfo();
- _elem498.read(iprot);
- struct.errors.add(_elem498);
- }
- iprot.readListEnd();
- }
- struct.set_errors_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 12: // EVENTLOG_HOST
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.eventlog_host = iprot.readString();
- struct.set_eventlog_host_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 13: // EVENTLOG_PORT
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.eventlog_port = iprot.readI32();
- struct.set_eventlog_port_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 14: // DEBUG_OPTIONS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.debug_options = new DebugOptions();
- struct.debug_options.read(iprot);
- struct.set_debug_options_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 15: // TOPOLOGY_STATUS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.topology_status = iprot.readString();
- struct.set_topology_status_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 16: // RESOURCES_MAP
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map500 = iprot.readMapBegin();
- struct.resources_map = new HashMap<String,Double>(2*_map500.size);
- String _key501;
- double _val502;
- for (int _i503 = 0; _i503 < _map500.size; ++_i503)
- {
- _key501 = iprot.readString();
- _val502 = iprot.readDouble();
- struct.resources_map.put(_key501, _val502);
- }
- iprot.readMapEnd();
- }
- struct.set_resources_map_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, ComponentPageInfo struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.component_id != null) {
- oprot.writeFieldBegin(COMPONENT_ID_FIELD_DESC);
- oprot.writeString(struct.component_id);
- oprot.writeFieldEnd();
- }
- if (struct.component_type != null) {
- oprot.writeFieldBegin(COMPONENT_TYPE_FIELD_DESC);
- oprot.writeI32(struct.component_type.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.topology_id != null) {
- if (struct.is_set_topology_id()) {
- oprot.writeFieldBegin(TOPOLOGY_ID_FIELD_DESC);
- oprot.writeString(struct.topology_id);
- oprot.writeFieldEnd();
- }
- }
- if (struct.topology_name != null) {
- if (struct.is_set_topology_name()) {
- oprot.writeFieldBegin(TOPOLOGY_NAME_FIELD_DESC);
- oprot.writeString(struct.topology_name);
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_num_executors()) {
- oprot.writeFieldBegin(NUM_EXECUTORS_FIELD_DESC);
- oprot.writeI32(struct.num_executors);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_num_tasks()) {
- oprot.writeFieldBegin(NUM_TASKS_FIELD_DESC);
- oprot.writeI32(struct.num_tasks);
- oprot.writeFieldEnd();
- }
- if (struct.window_to_stats != null) {
- if (struct.is_set_window_to_stats()) {
- oprot.writeFieldBegin(WINDOW_TO_STATS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.window_to_stats.size()));
- for (Map.Entry<String, ComponentAggregateStats> _iter504 : struct.window_to_stats.entrySet())
- {
- oprot.writeString(_iter504.getKey());
- _iter504.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.gsid_to_input_stats != null) {
- if (struct.is_set_gsid_to_input_stats()) {
- oprot.writeFieldBegin(GSID_TO_INPUT_STATS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, struct.gsid_to_input_stats.size()));
- for (Map.Entry<GlobalStreamId, ComponentAggregateStats> _iter505 : struct.gsid_to_input_stats.entrySet())
- {
- _iter505.getKey().write(oprot);
- _iter505.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.sid_to_output_stats != null) {
- if (struct.is_set_sid_to_output_stats()) {
- oprot.writeFieldBegin(SID_TO_OUTPUT_STATS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.sid_to_output_stats.size()));
- for (Map.Entry<String, ComponentAggregateStats> _iter506 : struct.sid_to_output_stats.entrySet())
- {
- oprot.writeString(_iter506.getKey());
- _iter506.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.exec_stats != null) {
- if (struct.is_set_exec_stats()) {
- oprot.writeFieldBegin(EXEC_STATS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.exec_stats.size()));
- for (ExecutorAggregateStats _iter507 : struct.exec_stats)
- {
- _iter507.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.errors != null) {
- if (struct.is_set_errors()) {
- oprot.writeFieldBegin(ERRORS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.errors.size()));
- for (ErrorInfo _iter508 : struct.errors)
- {
- _iter508.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.eventlog_host != null) {
- if (struct.is_set_eventlog_host()) {
- oprot.writeFieldBegin(EVENTLOG_HOST_FIELD_DESC);
- oprot.writeString(struct.eventlog_host);
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_eventlog_port()) {
- oprot.writeFieldBegin(EVENTLOG_PORT_FIELD_DESC);
- oprot.writeI32(struct.eventlog_port);
- oprot.writeFieldEnd();
- }
- if (struct.debug_options != null) {
- if (struct.is_set_debug_options()) {
- oprot.writeFieldBegin(DEBUG_OPTIONS_FIELD_DESC);
- struct.debug_options.write(oprot);
- oprot.writeFieldEnd();
- }
- }
- if (struct.topology_status != null) {
- if (struct.is_set_topology_status()) {
- oprot.writeFieldBegin(TOPOLOGY_STATUS_FIELD_DESC);
- oprot.writeString(struct.topology_status);
- oprot.writeFieldEnd();
- }
- }
- if (struct.resources_map != null) {
- if (struct.is_set_resources_map()) {
- oprot.writeFieldBegin(RESOURCES_MAP_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, struct.resources_map.size()));
- for (Map.Entry<String, Double> _iter509 : struct.resources_map.entrySet())
- {
- oprot.writeString(_iter509.getKey());
- oprot.writeDouble(_iter509.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ComponentPageInfoTupleSchemeFactory implements SchemeFactory {
- public ComponentPageInfoTupleScheme getScheme() {
- return new ComponentPageInfoTupleScheme();
- }
- }
-
- private static class ComponentPageInfoTupleScheme extends TupleScheme<ComponentPageInfo> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ComponentPageInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.component_id);
- oprot.writeI32(struct.component_type.getValue());
- BitSet optionals = new BitSet();
- if (struct.is_set_topology_id()) {
- optionals.set(0);
- }
- if (struct.is_set_topology_name()) {
- optionals.set(1);
- }
- if (struct.is_set_num_executors()) {
- optionals.set(2);
- }
- if (struct.is_set_num_tasks()) {
- optionals.set(3);
- }
- if (struct.is_set_window_to_stats()) {
- optionals.set(4);
- }
- if (struct.is_set_gsid_to_input_stats()) {
- optionals.set(5);
- }
- if (struct.is_set_sid_to_output_stats()) {
- optionals.set(6);
- }
- if (struct.is_set_exec_stats()) {
- optionals.set(7);
- }
- if (struct.is_set_errors()) {
- optionals.set(8);
- }
- if (struct.is_set_eventlog_host()) {
- optionals.set(9);
- }
- if (struct.is_set_eventlog_port()) {
- optionals.set(10);
- }
- if (struct.is_set_debug_options()) {
- optionals.set(11);
- }
- if (struct.is_set_topology_status()) {
- optionals.set(12);
- }
- if (struct.is_set_resources_map()) {
- optionals.set(13);
- }
- oprot.writeBitSet(optionals, 14);
- if (struct.is_set_topology_id()) {
- oprot.writeString(struct.topology_id);
- }
- if (struct.is_set_topology_name()) {
- oprot.writeString(struct.topology_name);
- }
- if (struct.is_set_num_executors()) {
- oprot.writeI32(struct.num_executors);
- }
- if (struct.is_set_num_tasks()) {
- oprot.writeI32(struct.num_tasks);
- }
- if (struct.is_set_window_to_stats()) {
- {
- oprot.writeI32(struct.window_to_stats.size());
- for (Map.Entry<String, ComponentAggregateStats> _iter510 : struct.window_to_stats.entrySet())
- {
- oprot.writeString(_iter510.getKey());
- _iter510.getValue().write(oprot);
- }
- }
- }
- if (struct.is_set_gsid_to_input_stats()) {
- {
- oprot.writeI32(struct.gsid_to_input_stats.size());
- for (Map.Entry<GlobalStreamId, ComponentAggregateStats> _iter511 : struct.gsid_to_input_stats.entrySet())
- {
- _iter511.getKey().write(oprot);
- _iter511.getValue().write(oprot);
- }
- }
- }
- if (struct.is_set_sid_to_output_stats()) {
- {
- oprot.writeI32(struct.sid_to_output_stats.size());
- for (Map.Entry<String, ComponentAggregateStats> _iter512 : struct.sid_to_output_stats.entrySet())
- {
- oprot.writeString(_iter512.getKey());
- _iter512.getValue().write(oprot);
- }
- }
- }
- if (struct.is_set_exec_stats()) {
- {
- oprot.writeI32(struct.exec_stats.size());
- for (ExecutorAggregateStats _iter513 : struct.exec_stats)
- {
- _iter513.write(oprot);
- }
- }
- }
- if (struct.is_set_errors()) {
- {
- oprot.writeI32(struct.errors.size());
- for (ErrorInfo _iter514 : struct.errors)
- {
- _iter514.write(oprot);
- }
- }
- }
- if (struct.is_set_eventlog_host()) {
- oprot.writeString(struct.eventlog_host);
- }
- if (struct.is_set_eventlog_port()) {
- oprot.writeI32(struct.eventlog_port);
- }
- if (struct.is_set_debug_options()) {
- struct.debug_options.write(oprot);
- }
- if (struct.is_set_topology_status()) {
- oprot.writeString(struct.topology_status);
- }
- if (struct.is_set_resources_map()) {
- {
- oprot.writeI32(struct.resources_map.size());
- for (Map.Entry<String, Double> _iter515 : struct.resources_map.entrySet())
- {
- oprot.writeString(_iter515.getKey());
- oprot.writeDouble(_iter515.getValue());
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ComponentPageInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.component_id = iprot.readString();
- struct.set_component_id_isSet(true);
- struct.component_type = org.apache.storm.generated.ComponentType.findByValue(iprot.readI32());
- struct.set_component_type_isSet(true);
- BitSet incoming = iprot.readBitSet(14);
- if (incoming.get(0)) {
- struct.topology_id = iprot.readString();
- struct.set_topology_id_isSet(true);
- }
- if (incoming.get(1)) {
- struct.topology_name = iprot.readString();
- struct.set_topology_name_isSet(true);
- }
- if (incoming.get(2)) {
- struct.num_executors = iprot.readI32();
- struct.set_num_executors_isSet(true);
- }
- if (incoming.get(3)) {
- struct.num_tasks = iprot.readI32();
- struct.set_num_tasks_isSet(true);
- }
- if (incoming.get(4)) {
- {
- org.apache.thrift.protocol.TMap _map516 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.window_to_stats = new HashMap<String,ComponentAggregateStats>(2*_map516.size);
- String _key517;
- ComponentAggregateStats _val518;
- for (int _i519 = 0; _i519 < _map516.size; ++_i519)
- {
- _key517 = iprot.readString();
- _val518 = new ComponentAggregateStats();
- _val518.read(iprot);
- struct.window_to_stats.put(_key517, _val518);
- }
- }
- struct.set_window_to_stats_isSet(true);
- }
- if (incoming.get(5)) {
- {
- org.apache.thrift.protocol.TMap _map520 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.gsid_to_input_stats = new HashMap<GlobalStreamId,ComponentAggregateStats>(2*_map520.size);
- GlobalStreamId _key521;
- ComponentAggregateStats _val522;
- for (int _i523 = 0; _i523 < _map520.size; ++_i523)
- {
- _key521 = new GlobalStreamId();
- _key521.read(iprot);
- _val522 = new ComponentAggregateStats();
- _val522.read(iprot);
- struct.gsid_to_input_stats.put(_key521, _val522);
- }
- }
- struct.set_gsid_to_input_stats_isSet(true);
- }
- if (incoming.get(6)) {
- {
- org.apache.thrift.protocol.TMap _map524 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.sid_to_output_stats = new HashMap<String,ComponentAggregateStats>(2*_map524.size);
- String _key525;
- ComponentAggregateStats _val526;
- for (int _i527 = 0; _i527 < _map524.size; ++_i527)
- {
- _key525 = iprot.readString();
- _val526 = new ComponentAggregateStats();
- _val526.read(iprot);
- struct.sid_to_output_stats.put(_key525, _val526);
- }
- }
- struct.set_sid_to_output_stats_isSet(true);
- }
- if (incoming.get(7)) {
- {
- org.apache.thrift.protocol.TList _list528 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.exec_stats = new ArrayList<ExecutorAggregateStats>(_list528.size);
- ExecutorAggregateStats _elem529;
- for (int _i530 = 0; _i530 < _list528.size; ++_i530)
- {
- _elem529 = new ExecutorAggregateStats();
- _elem529.read(iprot);
- struct.exec_stats.add(_elem529);
- }
- }
- struct.set_exec_stats_isSet(true);
- }
- if (incoming.get(8)) {
- {
- org.apache.thrift.protocol.TList _list531 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.errors = new ArrayList<ErrorInfo>(_list531.size);
- ErrorInfo _elem532;
- for (int _i533 = 0; _i533 < _list531.size; ++_i533)
- {
- _elem532 = new ErrorInfo();
- _elem532.read(iprot);
- struct.errors.add(_elem532);
- }
- }
- struct.set_errors_isSet(true);
- }
- if (incoming.get(9)) {
- struct.eventlog_host = iprot.readString();
- struct.set_eventlog_host_isSet(true);
- }
- if (incoming.get(10)) {
- struct.eventlog_port = iprot.readI32();
- struct.set_eventlog_port_isSet(true);
- }
- if (incoming.get(11)) {
- struct.debug_options = new DebugOptions();
- struct.debug_options.read(iprot);
- struct.set_debug_options_isSet(true);
- }
- if (incoming.get(12)) {
- struct.topology_status = iprot.readString();
- struct.set_topology_status_isSet(true);
- }
- if (incoming.get(13)) {
- {
- org.apache.thrift.protocol.TMap _map534 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32());
- struct.resources_map = new HashMap<String,Double>(2*_map534.size);
- String _key535;
- double _val536;
- for (int _i537 = 0; _i537 < _map534.size; ++_i537)
- {
- _key535 = iprot.readString();
- _val536 = iprot.readDouble();
- struct.resources_map.put(_key535, _val536);
- }
- }
- struct.set_resou
<TRUNCATED>
[20/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/KeyNotFoundException.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/KeyNotFoundException.java b/storm-core/src/jvm/backtype/storm/generated/KeyNotFoundException.java
deleted file mode 100644
index d55564c..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/KeyNotFoundException.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class KeyNotFoundException extends TException implements org.apache.thrift.TBase<KeyNotFoundException, KeyNotFoundException._Fields>, java.io.Serializable, Cloneable, Comparable<KeyNotFoundException> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("KeyNotFoundException");
-
- private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("msg", org.apache.thrift.protocol.TType.STRING, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new KeyNotFoundExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new KeyNotFoundExceptionTupleSchemeFactory());
- }
-
- private String msg; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- MSG((short)1, "msg");
-
- private static final Map<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(KeyNotFoundException.class, metaDataMap);
- }
-
- public KeyNotFoundException() {
- }
-
- public KeyNotFoundException(
- String msg)
- {
- this();
- this.msg = msg;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public KeyNotFoundException(KeyNotFoundException other) {
- if (other.is_set_msg()) {
- this.msg = other.msg;
- }
- }
-
- public KeyNotFoundException deepCopy() {
- return new KeyNotFoundException(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 KeyNotFoundException)
- return this.equals((KeyNotFoundException)that);
- return false;
- }
-
- public boolean equals(KeyNotFoundException 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(KeyNotFoundException 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("KeyNotFoundException(");
- 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 KeyNotFoundExceptionStandardSchemeFactory implements SchemeFactory {
- public KeyNotFoundExceptionStandardScheme getScheme() {
- return new KeyNotFoundExceptionStandardScheme();
- }
- }
-
- private static class KeyNotFoundExceptionStandardScheme extends StandardScheme<KeyNotFoundException> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, KeyNotFoundException 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, KeyNotFoundException 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 KeyNotFoundExceptionTupleSchemeFactory implements SchemeFactory {
- public KeyNotFoundExceptionTupleScheme getScheme() {
- return new KeyNotFoundExceptionTupleScheme();
- }
- }
-
- private static class KeyNotFoundExceptionTupleScheme extends TupleScheme<KeyNotFoundException> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, KeyNotFoundException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.msg);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, KeyNotFoundException 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/a6171bd6/storm-core/src/jvm/backtype/storm/generated/KillOptions.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/KillOptions.java b/storm-core/src/jvm/backtype/storm/generated/KillOptions.java
deleted file mode 100644
index f2ad8e2..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/KillOptions.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class KillOptions implements org.apache.thrift.TBase<KillOptions, KillOptions._Fields>, java.io.Serializable, Cloneable, Comparable<KillOptions> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("KillOptions");
-
- private static final org.apache.thrift.protocol.TField WAIT_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("wait_secs", org.apache.thrift.protocol.TType.I32, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new KillOptionsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new KillOptionsTupleSchemeFactory());
- }
-
- private int wait_secs; // 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 {
- WAIT_SECS((short)1, "wait_secs");
-
- 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: // WAIT_SECS
- return WAIT_SECS;
- 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 __WAIT_SECS_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.WAIT_SECS};
- 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.WAIT_SECS, new org.apache.thrift.meta_data.FieldMetaData("wait_secs", 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(KillOptions.class, metaDataMap);
- }
-
- public KillOptions() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public KillOptions(KillOptions other) {
- __isset_bitfield = other.__isset_bitfield;
- this.wait_secs = other.wait_secs;
- }
-
- public KillOptions deepCopy() {
- return new KillOptions(this);
- }
-
- @Override
- public void clear() {
- set_wait_secs_isSet(false);
- this.wait_secs = 0;
- }
-
- public int get_wait_secs() {
- return this.wait_secs;
- }
-
- public void set_wait_secs(int wait_secs) {
- this.wait_secs = wait_secs;
- set_wait_secs_isSet(true);
- }
-
- public void unset_wait_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WAIT_SECS_ISSET_ID);
- }
-
- /** Returns true if field wait_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_wait_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __WAIT_SECS_ISSET_ID);
- }
-
- public void set_wait_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WAIT_SECS_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case WAIT_SECS:
- if (value == null) {
- unset_wait_secs();
- } else {
- set_wait_secs((Integer)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case WAIT_SECS:
- return get_wait_secs();
-
- }
- 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 WAIT_SECS:
- return is_set_wait_secs();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof KillOptions)
- return this.equals((KillOptions)that);
- return false;
- }
-
- public boolean equals(KillOptions that) {
- if (that == null)
- return false;
-
- boolean this_present_wait_secs = true && this.is_set_wait_secs();
- boolean that_present_wait_secs = true && that.is_set_wait_secs();
- if (this_present_wait_secs || that_present_wait_secs) {
- if (!(this_present_wait_secs && that_present_wait_secs))
- return false;
- if (this.wait_secs != that.wait_secs)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_wait_secs = true && (is_set_wait_secs());
- list.add(present_wait_secs);
- if (present_wait_secs)
- list.add(wait_secs);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(KillOptions other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_wait_secs()).compareTo(other.is_set_wait_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_wait_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wait_secs, other.wait_secs);
- 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("KillOptions(");
- boolean first = true;
-
- if (is_set_wait_secs()) {
- sb.append("wait_secs:");
- sb.append(this.wait_secs);
- 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 KillOptionsStandardSchemeFactory implements SchemeFactory {
- public KillOptionsStandardScheme getScheme() {
- return new KillOptionsStandardScheme();
- }
- }
-
- private static class KillOptionsStandardScheme extends StandardScheme<KillOptions> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, KillOptions 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: // WAIT_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.wait_secs = iprot.readI32();
- struct.set_wait_secs_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, KillOptions struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.is_set_wait_secs()) {
- oprot.writeFieldBegin(WAIT_SECS_FIELD_DESC);
- oprot.writeI32(struct.wait_secs);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class KillOptionsTupleSchemeFactory implements SchemeFactory {
- public KillOptionsTupleScheme getScheme() {
- return new KillOptionsTupleScheme();
- }
- }
-
- private static class KillOptionsTupleScheme extends TupleScheme<KillOptions> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, KillOptions struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_wait_secs()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_wait_secs()) {
- oprot.writeI32(struct.wait_secs);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, KillOptions struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.wait_secs = iprot.readI32();
- struct.set_wait_secs_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LSApprovedWorkers.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/LSApprovedWorkers.java b/storm-core/src/jvm/backtype/storm/generated/LSApprovedWorkers.java
deleted file mode 100644
index b4795a5..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/LSApprovedWorkers.java
+++ /dev/null
@@ -1,458 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class LSApprovedWorkers implements org.apache.thrift.TBase<LSApprovedWorkers, LSApprovedWorkers._Fields>, java.io.Serializable, Cloneable, Comparable<LSApprovedWorkers> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LSApprovedWorkers");
-
- private static final org.apache.thrift.protocol.TField APPROVED_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("approved_workers", org.apache.thrift.protocol.TType.MAP, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new LSApprovedWorkersStandardSchemeFactory());
- schemes.put(TupleScheme.class, new LSApprovedWorkersTupleSchemeFactory());
- }
-
- private Map<String,Integer> approved_workers; // 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 {
- APPROVED_WORKERS((short)1, "approved_workers");
-
- 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: // APPROVED_WORKERS
- return APPROVED_WORKERS;
- 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.APPROVED_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("approved_workers", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LSApprovedWorkers.class, metaDataMap);
- }
-
- public LSApprovedWorkers() {
- }
-
- public LSApprovedWorkers(
- Map<String,Integer> approved_workers)
- {
- this();
- this.approved_workers = approved_workers;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public LSApprovedWorkers(LSApprovedWorkers other) {
- if (other.is_set_approved_workers()) {
- Map<String,Integer> __this__approved_workers = new HashMap<String,Integer>(other.approved_workers);
- this.approved_workers = __this__approved_workers;
- }
- }
-
- public LSApprovedWorkers deepCopy() {
- return new LSApprovedWorkers(this);
- }
-
- @Override
- public void clear() {
- this.approved_workers = null;
- }
-
- public int get_approved_workers_size() {
- return (this.approved_workers == null) ? 0 : this.approved_workers.size();
- }
-
- public void put_to_approved_workers(String key, int val) {
- if (this.approved_workers == null) {
- this.approved_workers = new HashMap<String,Integer>();
- }
- this.approved_workers.put(key, val);
- }
-
- public Map<String,Integer> get_approved_workers() {
- return this.approved_workers;
- }
-
- public void set_approved_workers(Map<String,Integer> approved_workers) {
- this.approved_workers = approved_workers;
- }
-
- public void unset_approved_workers() {
- this.approved_workers = null;
- }
-
- /** Returns true if field approved_workers is set (has been assigned a value) and false otherwise */
- public boolean is_set_approved_workers() {
- return this.approved_workers != null;
- }
-
- public void set_approved_workers_isSet(boolean value) {
- if (!value) {
- this.approved_workers = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case APPROVED_WORKERS:
- if (value == null) {
- unset_approved_workers();
- } else {
- set_approved_workers((Map<String,Integer>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case APPROVED_WORKERS:
- return get_approved_workers();
-
- }
- 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 APPROVED_WORKERS:
- return is_set_approved_workers();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof LSApprovedWorkers)
- return this.equals((LSApprovedWorkers)that);
- return false;
- }
-
- public boolean equals(LSApprovedWorkers that) {
- if (that == null)
- return false;
-
- boolean this_present_approved_workers = true && this.is_set_approved_workers();
- boolean that_present_approved_workers = true && that.is_set_approved_workers();
- if (this_present_approved_workers || that_present_approved_workers) {
- if (!(this_present_approved_workers && that_present_approved_workers))
- return false;
- if (!this.approved_workers.equals(that.approved_workers))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_approved_workers = true && (is_set_approved_workers());
- list.add(present_approved_workers);
- if (present_approved_workers)
- list.add(approved_workers);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(LSApprovedWorkers other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_approved_workers()).compareTo(other.is_set_approved_workers());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_approved_workers()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.approved_workers, other.approved_workers);
- 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("LSApprovedWorkers(");
- boolean first = true;
-
- sb.append("approved_workers:");
- if (this.approved_workers == null) {
- sb.append("null");
- } else {
- sb.append(this.approved_workers);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_approved_workers()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'approved_workers' 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 LSApprovedWorkersStandardSchemeFactory implements SchemeFactory {
- public LSApprovedWorkersStandardScheme getScheme() {
- return new LSApprovedWorkersStandardScheme();
- }
- }
-
- private static class LSApprovedWorkersStandardScheme extends StandardScheme<LSApprovedWorkers> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, LSApprovedWorkers 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: // APPROVED_WORKERS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map722 = iprot.readMapBegin();
- struct.approved_workers = new HashMap<String,Integer>(2*_map722.size);
- String _key723;
- int _val724;
- for (int _i725 = 0; _i725 < _map722.size; ++_i725)
- {
- _key723 = iprot.readString();
- _val724 = iprot.readI32();
- struct.approved_workers.put(_key723, _val724);
- }
- iprot.readMapEnd();
- }
- struct.set_approved_workers_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, LSApprovedWorkers struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.approved_workers != null) {
- oprot.writeFieldBegin(APPROVED_WORKERS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.approved_workers.size()));
- for (Map.Entry<String, Integer> _iter726 : struct.approved_workers.entrySet())
- {
- oprot.writeString(_iter726.getKey());
- oprot.writeI32(_iter726.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class LSApprovedWorkersTupleSchemeFactory implements SchemeFactory {
- public LSApprovedWorkersTupleScheme getScheme() {
- return new LSApprovedWorkersTupleScheme();
- }
- }
-
- private static class LSApprovedWorkersTupleScheme extends TupleScheme<LSApprovedWorkers> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, LSApprovedWorkers struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.approved_workers.size());
- for (Map.Entry<String, Integer> _iter727 : struct.approved_workers.entrySet())
- {
- oprot.writeString(_iter727.getKey());
- oprot.writeI32(_iter727.getValue());
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, LSApprovedWorkers struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TMap _map728 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32());
- struct.approved_workers = new HashMap<String,Integer>(2*_map728.size);
- String _key729;
- int _val730;
- for (int _i731 = 0; _i731 < _map728.size; ++_i731)
- {
- _key729 = iprot.readString();
- _val730 = iprot.readI32();
- struct.approved_workers.put(_key729, _val730);
- }
- }
- struct.set_approved_workers_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LSSupervisorAssignments.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/LSSupervisorAssignments.java b/storm-core/src/jvm/backtype/storm/generated/LSSupervisorAssignments.java
deleted file mode 100644
index b3194ad..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/LSSupervisorAssignments.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class LSSupervisorAssignments implements org.apache.thrift.TBase<LSSupervisorAssignments, LSSupervisorAssignments._Fields>, java.io.Serializable, Cloneable, Comparable<LSSupervisorAssignments> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LSSupervisorAssignments");
-
- private static final org.apache.thrift.protocol.TField ASSIGNMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("assignments", org.apache.thrift.protocol.TType.MAP, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new LSSupervisorAssignmentsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new LSSupervisorAssignmentsTupleSchemeFactory());
- }
-
- private Map<Integer,LocalAssignment> assignments; // 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 {
- ASSIGNMENTS((short)1, "assignments");
-
- 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: // ASSIGNMENTS
- return ASSIGNMENTS;
- 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.ASSIGNMENTS, new org.apache.thrift.meta_data.FieldMetaData("assignments", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.I32),
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LocalAssignment.class))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LSSupervisorAssignments.class, metaDataMap);
- }
-
- public LSSupervisorAssignments() {
- }
-
- public LSSupervisorAssignments(
- Map<Integer,LocalAssignment> assignments)
- {
- this();
- this.assignments = assignments;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public LSSupervisorAssignments(LSSupervisorAssignments other) {
- if (other.is_set_assignments()) {
- Map<Integer,LocalAssignment> __this__assignments = new HashMap<Integer,LocalAssignment>(other.assignments.size());
- for (Map.Entry<Integer, LocalAssignment> other_element : other.assignments.entrySet()) {
-
- Integer other_element_key = other_element.getKey();
- LocalAssignment other_element_value = other_element.getValue();
-
- Integer __this__assignments_copy_key = other_element_key;
-
- LocalAssignment __this__assignments_copy_value = new LocalAssignment(other_element_value);
-
- __this__assignments.put(__this__assignments_copy_key, __this__assignments_copy_value);
- }
- this.assignments = __this__assignments;
- }
- }
-
- public LSSupervisorAssignments deepCopy() {
- return new LSSupervisorAssignments(this);
- }
-
- @Override
- public void clear() {
- this.assignments = null;
- }
-
- public int get_assignments_size() {
- return (this.assignments == null) ? 0 : this.assignments.size();
- }
-
- public void put_to_assignments(int key, LocalAssignment val) {
- if (this.assignments == null) {
- this.assignments = new HashMap<Integer,LocalAssignment>();
- }
- this.assignments.put(key, val);
- }
-
- public Map<Integer,LocalAssignment> get_assignments() {
- return this.assignments;
- }
-
- public void set_assignments(Map<Integer,LocalAssignment> assignments) {
- this.assignments = assignments;
- }
-
- public void unset_assignments() {
- this.assignments = null;
- }
-
- /** Returns true if field assignments is set (has been assigned a value) and false otherwise */
- public boolean is_set_assignments() {
- return this.assignments != null;
- }
-
- public void set_assignments_isSet(boolean value) {
- if (!value) {
- this.assignments = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ASSIGNMENTS:
- if (value == null) {
- unset_assignments();
- } else {
- set_assignments((Map<Integer,LocalAssignment>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ASSIGNMENTS:
- return get_assignments();
-
- }
- 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 ASSIGNMENTS:
- return is_set_assignments();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof LSSupervisorAssignments)
- return this.equals((LSSupervisorAssignments)that);
- return false;
- }
-
- public boolean equals(LSSupervisorAssignments that) {
- if (that == null)
- return false;
-
- boolean this_present_assignments = true && this.is_set_assignments();
- boolean that_present_assignments = true && that.is_set_assignments();
- if (this_present_assignments || that_present_assignments) {
- if (!(this_present_assignments && that_present_assignments))
- return false;
- if (!this.assignments.equals(that.assignments))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_assignments = true && (is_set_assignments());
- list.add(present_assignments);
- if (present_assignments)
- list.add(assignments);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(LSSupervisorAssignments other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_assignments()).compareTo(other.is_set_assignments());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assignments()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assignments, other.assignments);
- 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("LSSupervisorAssignments(");
- boolean first = true;
-
- sb.append("assignments:");
- if (this.assignments == null) {
- sb.append("null");
- } else {
- sb.append(this.assignments);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_assignments()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'assignments' 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 LSSupervisorAssignmentsStandardSchemeFactory implements SchemeFactory {
- public LSSupervisorAssignmentsStandardScheme getScheme() {
- return new LSSupervisorAssignmentsStandardScheme();
- }
- }
-
- private static class LSSupervisorAssignmentsStandardScheme extends StandardScheme<LSSupervisorAssignments> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, LSSupervisorAssignments 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: // ASSIGNMENTS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map732 = iprot.readMapBegin();
- struct.assignments = new HashMap<Integer,LocalAssignment>(2*_map732.size);
- int _key733;
- LocalAssignment _val734;
- for (int _i735 = 0; _i735 < _map732.size; ++_i735)
- {
- _key733 = iprot.readI32();
- _val734 = new LocalAssignment();
- _val734.read(iprot);
- struct.assignments.put(_key733, _val734);
- }
- iprot.readMapEnd();
- }
- struct.set_assignments_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, LSSupervisorAssignments struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.assignments != null) {
- oprot.writeFieldBegin(ASSIGNMENTS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.assignments.size()));
- for (Map.Entry<Integer, LocalAssignment> _iter736 : struct.assignments.entrySet())
- {
- oprot.writeI32(_iter736.getKey());
- _iter736.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class LSSupervisorAssignmentsTupleSchemeFactory implements SchemeFactory {
- public LSSupervisorAssignmentsTupleScheme getScheme() {
- return new LSSupervisorAssignmentsTupleScheme();
- }
- }
-
- private static class LSSupervisorAssignmentsTupleScheme extends TupleScheme<LSSupervisorAssignments> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, LSSupervisorAssignments struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.assignments.size());
- for (Map.Entry<Integer, LocalAssignment> _iter737 : struct.assignments.entrySet())
- {
- oprot.writeI32(_iter737.getKey());
- _iter737.getValue().write(oprot);
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, LSSupervisorAssignments struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TMap _map738 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.assignments = new HashMap<Integer,LocalAssignment>(2*_map738.size);
- int _key739;
- LocalAssignment _val740;
- for (int _i741 = 0; _i741 < _map738.size; ++_i741)
- {
- _key739 = iprot.readI32();
- _val740 = new LocalAssignment();
- _val740.read(iprot);
- struct.assignments.put(_key739, _val740);
- }
- }
- struct.set_assignments_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LSSupervisorId.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/LSSupervisorId.java b/storm-core/src/jvm/backtype/storm/generated/LSSupervisorId.java
deleted file mode 100644
index 605b9b1..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/LSSupervisorId.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class LSSupervisorId implements org.apache.thrift.TBase<LSSupervisorId, LSSupervisorId._Fields>, java.io.Serializable, Cloneable, Comparable<LSSupervisorId> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LSSupervisorId");
-
- private static final org.apache.thrift.protocol.TField SUPERVISOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisor_id", org.apache.thrift.protocol.TType.STRING, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new LSSupervisorIdStandardSchemeFactory());
- schemes.put(TupleScheme.class, new LSSupervisorIdTupleSchemeFactory());
- }
-
- private String supervisor_id; // 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 {
- SUPERVISOR_ID((short)1, "supervisor_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: // SUPERVISOR_ID
- return SUPERVISOR_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
- 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.SUPERVISOR_ID, new org.apache.thrift.meta_data.FieldMetaData("supervisor_id", 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(LSSupervisorId.class, metaDataMap);
- }
-
- public LSSupervisorId() {
- }
-
- public LSSupervisorId(
- String supervisor_id)
- {
- this();
- this.supervisor_id = supervisor_id;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public LSSupervisorId(LSSupervisorId other) {
- if (other.is_set_supervisor_id()) {
- this.supervisor_id = other.supervisor_id;
- }
- }
-
- public LSSupervisorId deepCopy() {
- return new LSSupervisorId(this);
- }
-
- @Override
- public void clear() {
- this.supervisor_id = null;
- }
-
- public String get_supervisor_id() {
- return this.supervisor_id;
- }
-
- public void set_supervisor_id(String supervisor_id) {
- this.supervisor_id = supervisor_id;
- }
-
- public void unset_supervisor_id() {
- this.supervisor_id = null;
- }
-
- /** Returns true if field supervisor_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_supervisor_id() {
- return this.supervisor_id != null;
- }
-
- public void set_supervisor_id_isSet(boolean value) {
- if (!value) {
- this.supervisor_id = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SUPERVISOR_ID:
- if (value == null) {
- unset_supervisor_id();
- } else {
- set_supervisor_id((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SUPERVISOR_ID:
- return get_supervisor_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 SUPERVISOR_ID:
- return is_set_supervisor_id();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof LSSupervisorId)
- return this.equals((LSSupervisorId)that);
- return false;
- }
-
- public boolean equals(LSSupervisorId that) {
- if (that == null)
- return false;
-
- boolean this_present_supervisor_id = true && this.is_set_supervisor_id();
- boolean that_present_supervisor_id = true && that.is_set_supervisor_id();
- if (this_present_supervisor_id || that_present_supervisor_id) {
- if (!(this_present_supervisor_id && that_present_supervisor_id))
- return false;
- if (!this.supervisor_id.equals(that.supervisor_id))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_supervisor_id = true && (is_set_supervisor_id());
- list.add(present_supervisor_id);
- if (present_supervisor_id)
- list.add(supervisor_id);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(LSSupervisorId other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_supervisor_id()).compareTo(other.is_set_supervisor_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_supervisor_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supervisor_id, other.supervisor_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("LSSupervisorId(");
- boolean first = true;
-
- sb.append("supervisor_id:");
- if (this.supervisor_id == null) {
- sb.append("null");
- } else {
- sb.append(this.supervisor_id);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_supervisor_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'supervisor_id' 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 LSSupervisorIdStandardSchemeFactory implements SchemeFactory {
- public LSSupervisorIdStandardScheme getScheme() {
- return new LSSupervisorIdStandardScheme();
- }
- }
-
- private static class LSSupervisorIdStandardScheme extends StandardScheme<LSSupervisorId> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, LSSupervisorId 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: // SUPERVISOR_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.supervisor_id = iprot.readString();
- struct.set_supervisor_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, LSSupervisorId struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.supervisor_id != null) {
- oprot.writeFieldBegin(SUPERVISOR_ID_FIELD_DESC);
- oprot.writeString(struct.supervisor_id);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class LSSupervisorIdTupleSchemeFactory implements SchemeFactory {
- public LSSupervisorIdTupleScheme getScheme() {
- return new LSSupervisorIdTupleScheme();
- }
- }
-
- private static class LSSupervisorIdTupleScheme extends TupleScheme<LSSupervisorId> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, LSSupervisorId struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.supervisor_id);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, LSSupervisorId struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.supervisor_id = iprot.readString();
- struct.set_supervisor_id_isSet(true);
- }
- }
-
-}
-
[33/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/AuthorizationException.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/AuthorizationException.java b/storm-core/src/jvm/backtype/storm/generated/AuthorizationException.java
deleted file mode 100644
index 7358535..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/AuthorizationException.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class AuthorizationException extends TException implements org.apache.thrift.TBase<AuthorizationException, AuthorizationException._Fields>, java.io.Serializable, Cloneable, Comparable<AuthorizationException> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthorizationException");
-
- private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("msg", org.apache.thrift.protocol.TType.STRING, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new AuthorizationExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new AuthorizationExceptionTupleSchemeFactory());
- }
-
- private String msg; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- MSG((short)1, "msg");
-
- private static final Map<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(AuthorizationException.class, metaDataMap);
- }
-
- public AuthorizationException() {
- }
-
- public AuthorizationException(
- String msg)
- {
- this();
- this.msg = msg;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public AuthorizationException(AuthorizationException other) {
- if (other.is_set_msg()) {
- this.msg = other.msg;
- }
- }
-
- public AuthorizationException deepCopy() {
- return new AuthorizationException(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 AuthorizationException)
- return this.equals((AuthorizationException)that);
- return false;
- }
-
- public boolean equals(AuthorizationException 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(AuthorizationException 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("AuthorizationException(");
- 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 AuthorizationExceptionStandardSchemeFactory implements SchemeFactory {
- public AuthorizationExceptionStandardScheme getScheme() {
- return new AuthorizationExceptionStandardScheme();
- }
- }
-
- private static class AuthorizationExceptionStandardScheme extends StandardScheme<AuthorizationException> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, AuthorizationException 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, AuthorizationException 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 AuthorizationExceptionTupleSchemeFactory implements SchemeFactory {
- public AuthorizationExceptionTupleScheme getScheme() {
- return new AuthorizationExceptionTupleScheme();
- }
- }
-
- private static class AuthorizationExceptionTupleScheme extends TupleScheme<AuthorizationException> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, AuthorizationException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.msg);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, AuthorizationException 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/a6171bd6/storm-core/src/jvm/backtype/storm/generated/BeginDownloadResult.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/BeginDownloadResult.java b/storm-core/src/jvm/backtype/storm/generated/BeginDownloadResult.java
deleted file mode 100644
index 925f00b..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/BeginDownloadResult.java
+++ /dev/null
@@ -1,608 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class BeginDownloadResult implements org.apache.thrift.TBase<BeginDownloadResult, BeginDownloadResult._Fields>, java.io.Serializable, Cloneable, Comparable<BeginDownloadResult> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BeginDownloadResult");
-
- private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I64, (short)1);
- private static final org.apache.thrift.protocol.TField SESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("session", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField DATA_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("data_size", org.apache.thrift.protocol.TType.I64, (short)3);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new BeginDownloadResultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new BeginDownloadResultTupleSchemeFactory());
- }
-
- private long version; // required
- private String session; // required
- private long data_size; // 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 {
- VERSION((short)1, "version"),
- SESSION((short)2, "session"),
- DATA_SIZE((short)3, "data_size");
-
- 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: // VERSION
- return VERSION;
- case 2: // SESSION
- return SESSION;
- case 3: // DATA_SIZE
- return DATA_SIZE;
- 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 __VERSION_ISSET_ID = 0;
- private static final int __DATA_SIZE_ISSET_ID = 1;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.DATA_SIZE};
- 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.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.SESSION, new org.apache.thrift.meta_data.FieldMetaData("session", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.DATA_SIZE, new org.apache.thrift.meta_data.FieldMetaData("data_size", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BeginDownloadResult.class, metaDataMap);
- }
-
- public BeginDownloadResult() {
- }
-
- public BeginDownloadResult(
- long version,
- String session)
- {
- this();
- this.version = version;
- set_version_isSet(true);
- this.session = session;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public BeginDownloadResult(BeginDownloadResult other) {
- __isset_bitfield = other.__isset_bitfield;
- this.version = other.version;
- if (other.is_set_session()) {
- this.session = other.session;
- }
- this.data_size = other.data_size;
- }
-
- public BeginDownloadResult deepCopy() {
- return new BeginDownloadResult(this);
- }
-
- @Override
- public void clear() {
- set_version_isSet(false);
- this.version = 0;
- this.session = null;
- set_data_size_isSet(false);
- this.data_size = 0;
- }
-
- public long get_version() {
- return this.version;
- }
-
- public void set_version(long version) {
- this.version = version;
- set_version_isSet(true);
- }
-
- public void unset_version() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VERSION_ISSET_ID);
- }
-
- /** Returns true if field version is set (has been assigned a value) and false otherwise */
- public boolean is_set_version() {
- return EncodingUtils.testBit(__isset_bitfield, __VERSION_ISSET_ID);
- }
-
- public void set_version_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VERSION_ISSET_ID, value);
- }
-
- public String get_session() {
- return this.session;
- }
-
- public void set_session(String session) {
- this.session = session;
- }
-
- public void unset_session() {
- this.session = null;
- }
-
- /** Returns true if field session is set (has been assigned a value) and false otherwise */
- public boolean is_set_session() {
- return this.session != null;
- }
-
- public void set_session_isSet(boolean value) {
- if (!value) {
- this.session = null;
- }
- }
-
- public long get_data_size() {
- return this.data_size;
- }
-
- public void set_data_size(long data_size) {
- this.data_size = data_size;
- set_data_size_isSet(true);
- }
-
- public void unset_data_size() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DATA_SIZE_ISSET_ID);
- }
-
- /** Returns true if field data_size is set (has been assigned a value) and false otherwise */
- public boolean is_set_data_size() {
- return EncodingUtils.testBit(__isset_bitfield, __DATA_SIZE_ISSET_ID);
- }
-
- public void set_data_size_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DATA_SIZE_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case VERSION:
- if (value == null) {
- unset_version();
- } else {
- set_version((Long)value);
- }
- break;
-
- case SESSION:
- if (value == null) {
- unset_session();
- } else {
- set_session((String)value);
- }
- break;
-
- case DATA_SIZE:
- if (value == null) {
- unset_data_size();
- } else {
- set_data_size((Long)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case VERSION:
- return get_version();
-
- case SESSION:
- return get_session();
-
- case DATA_SIZE:
- return get_data_size();
-
- }
- 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 VERSION:
- return is_set_version();
- case SESSION:
- return is_set_session();
- case DATA_SIZE:
- return is_set_data_size();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof BeginDownloadResult)
- return this.equals((BeginDownloadResult)that);
- return false;
- }
-
- public boolean equals(BeginDownloadResult that) {
- if (that == null)
- return false;
-
- boolean this_present_version = true;
- boolean that_present_version = true;
- if (this_present_version || that_present_version) {
- if (!(this_present_version && that_present_version))
- return false;
- if (this.version != that.version)
- return false;
- }
-
- boolean this_present_session = true && this.is_set_session();
- boolean that_present_session = true && that.is_set_session();
- if (this_present_session || that_present_session) {
- if (!(this_present_session && that_present_session))
- return false;
- if (!this.session.equals(that.session))
- return false;
- }
-
- boolean this_present_data_size = true && this.is_set_data_size();
- boolean that_present_data_size = true && that.is_set_data_size();
- if (this_present_data_size || that_present_data_size) {
- if (!(this_present_data_size && that_present_data_size))
- return false;
- if (this.data_size != that.data_size)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_version = true;
- list.add(present_version);
- if (present_version)
- list.add(version);
-
- boolean present_session = true && (is_set_session());
- list.add(present_session);
- if (present_session)
- list.add(session);
-
- boolean present_data_size = true && (is_set_data_size());
- list.add(present_data_size);
- if (present_data_size)
- list.add(data_size);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(BeginDownloadResult other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_version()).compareTo(other.is_set_version());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_version()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_session()).compareTo(other.is_set_session());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_session()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.session, other.session);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_data_size()).compareTo(other.is_set_data_size());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_data_size()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data_size, other.data_size);
- 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("BeginDownloadResult(");
- boolean first = true;
-
- sb.append("version:");
- sb.append(this.version);
- first = false;
- if (!first) sb.append(", ");
- sb.append("session:");
- if (this.session == null) {
- sb.append("null");
- } else {
- sb.append(this.session);
- }
- first = false;
- if (is_set_data_size()) {
- if (!first) sb.append(", ");
- sb.append("data_size:");
- sb.append(this.data_size);
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_version()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'version' is unset! Struct:" + toString());
- }
-
- if (!is_set_session()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'session' 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 BeginDownloadResultStandardSchemeFactory implements SchemeFactory {
- public BeginDownloadResultStandardScheme getScheme() {
- return new BeginDownloadResultStandardScheme();
- }
- }
-
- private static class BeginDownloadResultStandardScheme extends StandardScheme<BeginDownloadResult> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, BeginDownloadResult 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: // VERSION
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.version = iprot.readI64();
- struct.set_version_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // SESSION
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.session = iprot.readString();
- struct.set_session_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // DATA_SIZE
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.data_size = iprot.readI64();
- struct.set_data_size_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, BeginDownloadResult struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldBegin(VERSION_FIELD_DESC);
- oprot.writeI64(struct.version);
- oprot.writeFieldEnd();
- if (struct.session != null) {
- oprot.writeFieldBegin(SESSION_FIELD_DESC);
- oprot.writeString(struct.session);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_data_size()) {
- oprot.writeFieldBegin(DATA_SIZE_FIELD_DESC);
- oprot.writeI64(struct.data_size);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class BeginDownloadResultTupleSchemeFactory implements SchemeFactory {
- public BeginDownloadResultTupleScheme getScheme() {
- return new BeginDownloadResultTupleScheme();
- }
- }
-
- private static class BeginDownloadResultTupleScheme extends TupleScheme<BeginDownloadResult> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, BeginDownloadResult struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeI64(struct.version);
- oprot.writeString(struct.session);
- BitSet optionals = new BitSet();
- if (struct.is_set_data_size()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_data_size()) {
- oprot.writeI64(struct.data_size);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, BeginDownloadResult struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.version = iprot.readI64();
- struct.set_version_isSet(true);
- struct.session = iprot.readString();
- struct.set_session_isSet(true);
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.data_size = iprot.readI64();
- struct.set_data_size_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/Bolt.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/Bolt.java b/storm-core/src/jvm/backtype/storm/generated/Bolt.java
deleted file mode 100644
index 878ebde..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/Bolt.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class Bolt implements org.apache.thrift.TBase<Bolt, Bolt._Fields>, java.io.Serializable, Cloneable, Comparable<Bolt> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Bolt");
-
- private static final org.apache.thrift.protocol.TField BOLT_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("bolt_object", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField COMMON_FIELD_DESC = new org.apache.thrift.protocol.TField("common", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new BoltStandardSchemeFactory());
- schemes.put(TupleScheme.class, new BoltTupleSchemeFactory());
- }
-
- private ComponentObject bolt_object; // required
- private ComponentCommon common; // 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 {
- BOLT_OBJECT((short)1, "bolt_object"),
- COMMON((short)2, "common");
-
- 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: // BOLT_OBJECT
- return BOLT_OBJECT;
- case 2: // COMMON
- return COMMON;
- 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.BOLT_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("bolt_object", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentObject.class)));
- tmpMap.put(_Fields.COMMON, new org.apache.thrift.meta_data.FieldMetaData("common", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentCommon.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Bolt.class, metaDataMap);
- }
-
- public Bolt() {
- }
-
- public Bolt(
- ComponentObject bolt_object,
- ComponentCommon common)
- {
- this();
- this.bolt_object = bolt_object;
- this.common = common;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public Bolt(Bolt other) {
- if (other.is_set_bolt_object()) {
- this.bolt_object = new ComponentObject(other.bolt_object);
- }
- if (other.is_set_common()) {
- this.common = new ComponentCommon(other.common);
- }
- }
-
- public Bolt deepCopy() {
- return new Bolt(this);
- }
-
- @Override
- public void clear() {
- this.bolt_object = null;
- this.common = null;
- }
-
- public ComponentObject get_bolt_object() {
- return this.bolt_object;
- }
-
- public void set_bolt_object(ComponentObject bolt_object) {
- this.bolt_object = bolt_object;
- }
-
- public void unset_bolt_object() {
- this.bolt_object = null;
- }
-
- /** Returns true if field bolt_object is set (has been assigned a value) and false otherwise */
- public boolean is_set_bolt_object() {
- return this.bolt_object != null;
- }
-
- public void set_bolt_object_isSet(boolean value) {
- if (!value) {
- this.bolt_object = null;
- }
- }
-
- public ComponentCommon get_common() {
- return this.common;
- }
-
- public void set_common(ComponentCommon common) {
- this.common = common;
- }
-
- public void unset_common() {
- this.common = null;
- }
-
- /** Returns true if field common is set (has been assigned a value) and false otherwise */
- public boolean is_set_common() {
- return this.common != null;
- }
-
- public void set_common_isSet(boolean value) {
- if (!value) {
- this.common = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case BOLT_OBJECT:
- if (value == null) {
- unset_bolt_object();
- } else {
- set_bolt_object((ComponentObject)value);
- }
- break;
-
- case COMMON:
- if (value == null) {
- unset_common();
- } else {
- set_common((ComponentCommon)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case BOLT_OBJECT:
- return get_bolt_object();
-
- case COMMON:
- return get_common();
-
- }
- 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 BOLT_OBJECT:
- return is_set_bolt_object();
- case COMMON:
- return is_set_common();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof Bolt)
- return this.equals((Bolt)that);
- return false;
- }
-
- public boolean equals(Bolt that) {
- if (that == null)
- return false;
-
- boolean this_present_bolt_object = true && this.is_set_bolt_object();
- boolean that_present_bolt_object = true && that.is_set_bolt_object();
- if (this_present_bolt_object || that_present_bolt_object) {
- if (!(this_present_bolt_object && that_present_bolt_object))
- return false;
- if (!this.bolt_object.equals(that.bolt_object))
- return false;
- }
-
- boolean this_present_common = true && this.is_set_common();
- boolean that_present_common = true && that.is_set_common();
- if (this_present_common || that_present_common) {
- if (!(this_present_common && that_present_common))
- return false;
- if (!this.common.equals(that.common))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_bolt_object = true && (is_set_bolt_object());
- list.add(present_bolt_object);
- if (present_bolt_object)
- list.add(bolt_object);
-
- boolean present_common = true && (is_set_common());
- list.add(present_common);
- if (present_common)
- list.add(common);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(Bolt other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_bolt_object()).compareTo(other.is_set_bolt_object());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_bolt_object()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bolt_object, other.bolt_object);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_common()).compareTo(other.is_set_common());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_common()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.common, other.common);
- 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("Bolt(");
- boolean first = true;
-
- sb.append("bolt_object:");
- if (this.bolt_object == null) {
- sb.append("null");
- } else {
- sb.append(this.bolt_object);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("common:");
- if (this.common == null) {
- sb.append("null");
- } else {
- sb.append(this.common);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_bolt_object()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'bolt_object' is unset! Struct:" + toString());
- }
-
- if (!is_set_common()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'common' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- if (common != null) {
- common.validate();
- }
- }
-
- 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 BoltStandardSchemeFactory implements SchemeFactory {
- public BoltStandardScheme getScheme() {
- return new BoltStandardScheme();
- }
- }
-
- private static class BoltStandardScheme extends StandardScheme<Bolt> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, Bolt 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: // BOLT_OBJECT
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.bolt_object = new ComponentObject();
- struct.bolt_object.read(iprot);
- struct.set_bolt_object_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // COMMON
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.common = new ComponentCommon();
- struct.common.read(iprot);
- struct.set_common_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, Bolt struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.bolt_object != null) {
- oprot.writeFieldBegin(BOLT_OBJECT_FIELD_DESC);
- struct.bolt_object.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.common != null) {
- oprot.writeFieldBegin(COMMON_FIELD_DESC);
- struct.common.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class BoltTupleSchemeFactory implements SchemeFactory {
- public BoltTupleScheme getScheme() {
- return new BoltTupleScheme();
- }
- }
-
- private static class BoltTupleScheme extends TupleScheme<Bolt> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, Bolt struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- struct.bolt_object.write(oprot);
- struct.common.write(oprot);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, Bolt struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.bolt_object = new ComponentObject();
- struct.bolt_object.read(iprot);
- struct.set_bolt_object_isSet(true);
- struct.common = new ComponentCommon();
- struct.common.read(iprot);
- struct.set_common_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/BoltAggregateStats.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/BoltAggregateStats.java b/storm-core/src/jvm/backtype/storm/generated/BoltAggregateStats.java
deleted file mode 100644
index c5e6bf9..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/BoltAggregateStats.java
+++ /dev/null
@@ -1,704 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class BoltAggregateStats implements org.apache.thrift.TBase<BoltAggregateStats, BoltAggregateStats._Fields>, java.io.Serializable, Cloneable, Comparable<BoltAggregateStats> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BoltAggregateStats");
-
- private static final org.apache.thrift.protocol.TField EXECUTE_LATENCY_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("execute_latency_ms", org.apache.thrift.protocol.TType.DOUBLE, (short)1);
- private static final org.apache.thrift.protocol.TField PROCESS_LATENCY_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("process_latency_ms", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
- private static final org.apache.thrift.protocol.TField EXECUTED_FIELD_DESC = new org.apache.thrift.protocol.TField("executed", org.apache.thrift.protocol.TType.I64, (short)3);
- private static final org.apache.thrift.protocol.TField CAPACITY_FIELD_DESC = new org.apache.thrift.protocol.TField("capacity", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new BoltAggregateStatsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new BoltAggregateStatsTupleSchemeFactory());
- }
-
- private double execute_latency_ms; // optional
- private double process_latency_ms; // optional
- private long executed; // optional
- private double capacity; // 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 {
- EXECUTE_LATENCY_MS((short)1, "execute_latency_ms"),
- PROCESS_LATENCY_MS((short)2, "process_latency_ms"),
- EXECUTED((short)3, "executed"),
- CAPACITY((short)4, "capacity");
-
- 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: // EXECUTE_LATENCY_MS
- return EXECUTE_LATENCY_MS;
- case 2: // PROCESS_LATENCY_MS
- return PROCESS_LATENCY_MS;
- case 3: // EXECUTED
- return EXECUTED;
- case 4: // CAPACITY
- return CAPACITY;
- 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 __EXECUTE_LATENCY_MS_ISSET_ID = 0;
- private static final int __PROCESS_LATENCY_MS_ISSET_ID = 1;
- private static final int __EXECUTED_ISSET_ID = 2;
- private static final int __CAPACITY_ISSET_ID = 3;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.EXECUTE_LATENCY_MS,_Fields.PROCESS_LATENCY_MS,_Fields.EXECUTED,_Fields.CAPACITY};
- 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.EXECUTE_LATENCY_MS, new org.apache.thrift.meta_data.FieldMetaData("execute_latency_ms", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.PROCESS_LATENCY_MS, new org.apache.thrift.meta_data.FieldMetaData("process_latency_ms", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.EXECUTED, new org.apache.thrift.meta_data.FieldMetaData("executed", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.CAPACITY, new org.apache.thrift.meta_data.FieldMetaData("capacity", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BoltAggregateStats.class, metaDataMap);
- }
-
- public BoltAggregateStats() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public BoltAggregateStats(BoltAggregateStats other) {
- __isset_bitfield = other.__isset_bitfield;
- this.execute_latency_ms = other.execute_latency_ms;
- this.process_latency_ms = other.process_latency_ms;
- this.executed = other.executed;
- this.capacity = other.capacity;
- }
-
- public BoltAggregateStats deepCopy() {
- return new BoltAggregateStats(this);
- }
-
- @Override
- public void clear() {
- set_execute_latency_ms_isSet(false);
- this.execute_latency_ms = 0.0;
- set_process_latency_ms_isSet(false);
- this.process_latency_ms = 0.0;
- set_executed_isSet(false);
- this.executed = 0;
- set_capacity_isSet(false);
- this.capacity = 0.0;
- }
-
- public double get_execute_latency_ms() {
- return this.execute_latency_ms;
- }
-
- public void set_execute_latency_ms(double execute_latency_ms) {
- this.execute_latency_ms = execute_latency_ms;
- set_execute_latency_ms_isSet(true);
- }
-
- public void unset_execute_latency_ms() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXECUTE_LATENCY_MS_ISSET_ID);
- }
-
- /** Returns true if field execute_latency_ms is set (has been assigned a value) and false otherwise */
- public boolean is_set_execute_latency_ms() {
- return EncodingUtils.testBit(__isset_bitfield, __EXECUTE_LATENCY_MS_ISSET_ID);
- }
-
- public void set_execute_latency_ms_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXECUTE_LATENCY_MS_ISSET_ID, value);
- }
-
- public double get_process_latency_ms() {
- return this.process_latency_ms;
- }
-
- public void set_process_latency_ms(double process_latency_ms) {
- this.process_latency_ms = process_latency_ms;
- set_process_latency_ms_isSet(true);
- }
-
- public void unset_process_latency_ms() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROCESS_LATENCY_MS_ISSET_ID);
- }
-
- /** Returns true if field process_latency_ms is set (has been assigned a value) and false otherwise */
- public boolean is_set_process_latency_ms() {
- return EncodingUtils.testBit(__isset_bitfield, __PROCESS_LATENCY_MS_ISSET_ID);
- }
-
- public void set_process_latency_ms_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROCESS_LATENCY_MS_ISSET_ID, value);
- }
-
- public long get_executed() {
- return this.executed;
- }
-
- public void set_executed(long executed) {
- this.executed = executed;
- set_executed_isSet(true);
- }
-
- public void unset_executed() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXECUTED_ISSET_ID);
- }
-
- /** Returns true if field executed is set (has been assigned a value) and false otherwise */
- public boolean is_set_executed() {
- return EncodingUtils.testBit(__isset_bitfield, __EXECUTED_ISSET_ID);
- }
-
- public void set_executed_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXECUTED_ISSET_ID, value);
- }
-
- public double get_capacity() {
- return this.capacity;
- }
-
- public void set_capacity(double capacity) {
- this.capacity = capacity;
- set_capacity_isSet(true);
- }
-
- public void unset_capacity() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CAPACITY_ISSET_ID);
- }
-
- /** Returns true if field capacity is set (has been assigned a value) and false otherwise */
- public boolean is_set_capacity() {
- return EncodingUtils.testBit(__isset_bitfield, __CAPACITY_ISSET_ID);
- }
-
- public void set_capacity_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CAPACITY_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case EXECUTE_LATENCY_MS:
- if (value == null) {
- unset_execute_latency_ms();
- } else {
- set_execute_latency_ms((Double)value);
- }
- break;
-
- case PROCESS_LATENCY_MS:
- if (value == null) {
- unset_process_latency_ms();
- } else {
- set_process_latency_ms((Double)value);
- }
- break;
-
- case EXECUTED:
- if (value == null) {
- unset_executed();
- } else {
- set_executed((Long)value);
- }
- break;
-
- case CAPACITY:
- if (value == null) {
- unset_capacity();
- } else {
- set_capacity((Double)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case EXECUTE_LATENCY_MS:
- return get_execute_latency_ms();
-
- case PROCESS_LATENCY_MS:
- return get_process_latency_ms();
-
- case EXECUTED:
- return get_executed();
-
- case CAPACITY:
- return get_capacity();
-
- }
- 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 EXECUTE_LATENCY_MS:
- return is_set_execute_latency_ms();
- case PROCESS_LATENCY_MS:
- return is_set_process_latency_ms();
- case EXECUTED:
- return is_set_executed();
- case CAPACITY:
- return is_set_capacity();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof BoltAggregateStats)
- return this.equals((BoltAggregateStats)that);
- return false;
- }
-
- public boolean equals(BoltAggregateStats that) {
- if (that == null)
- return false;
-
- boolean this_present_execute_latency_ms = true && this.is_set_execute_latency_ms();
- boolean that_present_execute_latency_ms = true && that.is_set_execute_latency_ms();
- if (this_present_execute_latency_ms || that_present_execute_latency_ms) {
- if (!(this_present_execute_latency_ms && that_present_execute_latency_ms))
- return false;
- if (this.execute_latency_ms != that.execute_latency_ms)
- return false;
- }
-
- boolean this_present_process_latency_ms = true && this.is_set_process_latency_ms();
- boolean that_present_process_latency_ms = true && that.is_set_process_latency_ms();
- if (this_present_process_latency_ms || that_present_process_latency_ms) {
- if (!(this_present_process_latency_ms && that_present_process_latency_ms))
- return false;
- if (this.process_latency_ms != that.process_latency_ms)
- return false;
- }
-
- boolean this_present_executed = true && this.is_set_executed();
- boolean that_present_executed = true && that.is_set_executed();
- if (this_present_executed || that_present_executed) {
- if (!(this_present_executed && that_present_executed))
- return false;
- if (this.executed != that.executed)
- return false;
- }
-
- boolean this_present_capacity = true && this.is_set_capacity();
- boolean that_present_capacity = true && that.is_set_capacity();
- if (this_present_capacity || that_present_capacity) {
- if (!(this_present_capacity && that_present_capacity))
- return false;
- if (this.capacity != that.capacity)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_execute_latency_ms = true && (is_set_execute_latency_ms());
- list.add(present_execute_latency_ms);
- if (present_execute_latency_ms)
- list.add(execute_latency_ms);
-
- boolean present_process_latency_ms = true && (is_set_process_latency_ms());
- list.add(present_process_latency_ms);
- if (present_process_latency_ms)
- list.add(process_latency_ms);
-
- boolean present_executed = true && (is_set_executed());
- list.add(present_executed);
- if (present_executed)
- list.add(executed);
-
- boolean present_capacity = true && (is_set_capacity());
- list.add(present_capacity);
- if (present_capacity)
- list.add(capacity);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(BoltAggregateStats other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_execute_latency_ms()).compareTo(other.is_set_execute_latency_ms());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_execute_latency_ms()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.execute_latency_ms, other.execute_latency_ms);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_process_latency_ms()).compareTo(other.is_set_process_latency_ms());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_process_latency_ms()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.process_latency_ms, other.process_latency_ms);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_executed()).compareTo(other.is_set_executed());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_executed()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executed, other.executed);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_capacity()).compareTo(other.is_set_capacity());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_capacity()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.capacity, other.capacity);
- 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("BoltAggregateStats(");
- boolean first = true;
-
- if (is_set_execute_latency_ms()) {
- sb.append("execute_latency_ms:");
- sb.append(this.execute_latency_ms);
- first = false;
- }
- if (is_set_process_latency_ms()) {
- if (!first) sb.append(", ");
- sb.append("process_latency_ms:");
- sb.append(this.process_latency_ms);
- first = false;
- }
- if (is_set_executed()) {
- if (!first) sb.append(", ");
- sb.append("executed:");
- sb.append(this.executed);
- first = false;
- }
- if (is_set_capacity()) {
- if (!first) sb.append(", ");
- sb.append("capacity:");
- sb.append(this.capacity);
- 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 BoltAggregateStatsStandardSchemeFactory implements SchemeFactory {
- public BoltAggregateStatsStandardScheme getScheme() {
- return new BoltAggregateStatsStandardScheme();
- }
- }
-
- private static class BoltAggregateStatsStandardScheme extends StandardScheme<BoltAggregateStats> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, BoltAggregateStats 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: // EXECUTE_LATENCY_MS
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.execute_latency_ms = iprot.readDouble();
- struct.set_execute_latency_ms_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // PROCESS_LATENCY_MS
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.process_latency_ms = iprot.readDouble();
- struct.set_process_latency_ms_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // EXECUTED
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.executed = iprot.readI64();
- struct.set_executed_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // CAPACITY
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.capacity = iprot.readDouble();
- struct.set_capacity_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, BoltAggregateStats struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.is_set_execute_latency_ms()) {
- oprot.writeFieldBegin(EXECUTE_LATENCY_MS_FIELD_DESC);
- oprot.writeDouble(struct.execute_latency_ms);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_process_latency_ms()) {
- oprot.writeFieldBegin(PROCESS_LATENCY_MS_FIELD_DESC);
- oprot.writeDouble(struct.process_latency_ms);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_executed()) {
- oprot.writeFieldBegin(EXECUTED_FIELD_DESC);
- oprot.writeI64(struct.executed);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_capacity()) {
- oprot.writeFieldBegin(CAPACITY_FIELD_DESC);
- oprot.writeDouble(struct.capacity);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class BoltAggregateStatsTupleSchemeFactory implements SchemeFactory {
- public BoltAggregateStatsTupleScheme getScheme() {
- return new BoltAggregateStatsTupleScheme();
- }
- }
-
- private static class BoltAggregateStatsTupleScheme extends TupleScheme<BoltAggregateStats> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, BoltAggregateStats struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_execute_latency_ms()) {
- optionals.set(0);
- }
- if (struct.is_set_process_latency_ms()) {
- optionals.set(1);
- }
- if (struct.is_set_executed()) {
- optionals.set(2);
- }
- if (struct.is_set_capacity()) {
- optionals.set(3);
- }
- oprot.writeBitSet(optionals, 4);
- if (struct.is_set_execute_latency_ms()) {
- oprot.writeDouble(struct.execute_latency_ms);
- }
- if (struct.is_set_process_latency_ms()) {
- oprot.writeDouble(struct.process_latency_ms);
- }
- if (struct.is_set_executed()) {
- oprot.writeI64(struct.executed);
- }
- if (struct.is_set_capacity()) {
- oprot.writeDouble(struct.capacity);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, BoltAggregateStats struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(4);
- if (incoming.get(0)) {
- struct.execute_latency_ms = iprot.readDouble();
- struct.set_execute_latency_ms_isSet(true);
- }
- if (incoming.get(1)) {
- struct.process_latency_ms = iprot.readDouble();
- struct.set_process_latency_ms_isSet(true);
- }
- if (incoming.get(2)) {
- struct.executed = iprot.readI64();
- struct.set_executed_isSet(true);
- }
- if (incoming.get(3)) {
- struct.capacity = iprot.readDouble();
- struct.set_capacity_isSet(true);
- }
- }
- }
-
-}
-
[31/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ClusterWorkerHeartbeat.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ClusterWorkerHeartbeat.java b/storm-core/src/jvm/backtype/storm/generated/ClusterWorkerHeartbeat.java
deleted file mode 100644
index d974f1d..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ClusterWorkerHeartbeat.java
+++ /dev/null
@@ -1,768 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWorkerHeartbeat, ClusterWorkerHeartbeat._Fields>, java.io.Serializable, Cloneable, Comparable<ClusterWorkerHeartbeat> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ClusterWorkerHeartbeat");
-
- private static final org.apache.thrift.protocol.TField STORM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("storm_id", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField EXECUTOR_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("executor_stats", org.apache.thrift.protocol.TType.MAP, (short)2);
- private static final org.apache.thrift.protocol.TField TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("time_secs", org.apache.thrift.protocol.TType.I32, (short)3);
- private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)4);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ClusterWorkerHeartbeatStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ClusterWorkerHeartbeatTupleSchemeFactory());
- }
-
- private String storm_id; // required
- private Map<ExecutorInfo,ExecutorStats> executor_stats; // required
- private int time_secs; // required
- private int uptime_secs; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- STORM_ID((short)1, "storm_id"),
- EXECUTOR_STATS((short)2, "executor_stats"),
- TIME_SECS((short)3, "time_secs"),
- UPTIME_SECS((short)4, "uptime_secs");
-
- private static final Map<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: // STORM_ID
- return STORM_ID;
- case 2: // EXECUTOR_STATS
- return EXECUTOR_STATS;
- case 3: // TIME_SECS
- return TIME_SECS;
- case 4: // UPTIME_SECS
- return UPTIME_SECS;
- 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 __TIME_SECS_ISSET_ID = 0;
- private static final int __UPTIME_SECS_ISSET_ID = 1;
- private byte __isset_bitfield = 0;
- 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.STORM_ID, new org.apache.thrift.meta_data.FieldMetaData("storm_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.EXECUTOR_STATS, new org.apache.thrift.meta_data.FieldMetaData("executor_stats", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ExecutorInfo.class),
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ExecutorStats.class))));
- tmpMap.put(_Fields.TIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("time_secs", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", 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(ClusterWorkerHeartbeat.class, metaDataMap);
- }
-
- public ClusterWorkerHeartbeat() {
- }
-
- public ClusterWorkerHeartbeat(
- String storm_id,
- Map<ExecutorInfo,ExecutorStats> executor_stats,
- int time_secs,
- int uptime_secs)
- {
- this();
- this.storm_id = storm_id;
- this.executor_stats = executor_stats;
- this.time_secs = time_secs;
- set_time_secs_isSet(true);
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ClusterWorkerHeartbeat(ClusterWorkerHeartbeat other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_storm_id()) {
- this.storm_id = other.storm_id;
- }
- if (other.is_set_executor_stats()) {
- Map<ExecutorInfo,ExecutorStats> __this__executor_stats = new HashMap<ExecutorInfo,ExecutorStats>(other.executor_stats.size());
- for (Map.Entry<ExecutorInfo, ExecutorStats> other_element : other.executor_stats.entrySet()) {
-
- ExecutorInfo other_element_key = other_element.getKey();
- ExecutorStats other_element_value = other_element.getValue();
-
- ExecutorInfo __this__executor_stats_copy_key = new ExecutorInfo(other_element_key);
-
- ExecutorStats __this__executor_stats_copy_value = new ExecutorStats(other_element_value);
-
- __this__executor_stats.put(__this__executor_stats_copy_key, __this__executor_stats_copy_value);
- }
- this.executor_stats = __this__executor_stats;
- }
- this.time_secs = other.time_secs;
- this.uptime_secs = other.uptime_secs;
- }
-
- public ClusterWorkerHeartbeat deepCopy() {
- return new ClusterWorkerHeartbeat(this);
- }
-
- @Override
- public void clear() {
- this.storm_id = null;
- this.executor_stats = null;
- set_time_secs_isSet(false);
- this.time_secs = 0;
- set_uptime_secs_isSet(false);
- this.uptime_secs = 0;
- }
-
- public String get_storm_id() {
- return this.storm_id;
- }
-
- public void set_storm_id(String storm_id) {
- this.storm_id = storm_id;
- }
-
- public void unset_storm_id() {
- this.storm_id = null;
- }
-
- /** Returns true if field storm_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_storm_id() {
- return this.storm_id != null;
- }
-
- public void set_storm_id_isSet(boolean value) {
- if (!value) {
- this.storm_id = null;
- }
- }
-
- public int get_executor_stats_size() {
- return (this.executor_stats == null) ? 0 : this.executor_stats.size();
- }
-
- public void put_to_executor_stats(ExecutorInfo key, ExecutorStats val) {
- if (this.executor_stats == null) {
- this.executor_stats = new HashMap<ExecutorInfo,ExecutorStats>();
- }
- this.executor_stats.put(key, val);
- }
-
- public Map<ExecutorInfo,ExecutorStats> get_executor_stats() {
- return this.executor_stats;
- }
-
- public void set_executor_stats(Map<ExecutorInfo,ExecutorStats> executor_stats) {
- this.executor_stats = executor_stats;
- }
-
- public void unset_executor_stats() {
- this.executor_stats = null;
- }
-
- /** Returns true if field executor_stats is set (has been assigned a value) and false otherwise */
- public boolean is_set_executor_stats() {
- return this.executor_stats != null;
- }
-
- public void set_executor_stats_isSet(boolean value) {
- if (!value) {
- this.executor_stats = null;
- }
- }
-
- public int get_time_secs() {
- return this.time_secs;
- }
-
- public void set_time_secs(int time_secs) {
- this.time_secs = time_secs;
- set_time_secs_isSet(true);
- }
-
- public void unset_time_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field time_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_time_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __TIME_SECS_ISSET_ID);
- }
-
- public void set_time_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIME_SECS_ISSET_ID, value);
- }
-
- public int get_uptime_secs() {
- return this.uptime_secs;
- }
-
- public void set_uptime_secs(int uptime_secs) {
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- }
-
- public void unset_uptime_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_uptime_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- public void set_uptime_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case STORM_ID:
- if (value == null) {
- unset_storm_id();
- } else {
- set_storm_id((String)value);
- }
- break;
-
- case EXECUTOR_STATS:
- if (value == null) {
- unset_executor_stats();
- } else {
- set_executor_stats((Map<ExecutorInfo,ExecutorStats>)value);
- }
- break;
-
- case TIME_SECS:
- if (value == null) {
- unset_time_secs();
- } else {
- set_time_secs((Integer)value);
- }
- break;
-
- case UPTIME_SECS:
- if (value == null) {
- unset_uptime_secs();
- } else {
- set_uptime_secs((Integer)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case STORM_ID:
- return get_storm_id();
-
- case EXECUTOR_STATS:
- return get_executor_stats();
-
- case TIME_SECS:
- return get_time_secs();
-
- case UPTIME_SECS:
- return get_uptime_secs();
-
- }
- 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 STORM_ID:
- return is_set_storm_id();
- case EXECUTOR_STATS:
- return is_set_executor_stats();
- case TIME_SECS:
- return is_set_time_secs();
- case UPTIME_SECS:
- return is_set_uptime_secs();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ClusterWorkerHeartbeat)
- return this.equals((ClusterWorkerHeartbeat)that);
- return false;
- }
-
- public boolean equals(ClusterWorkerHeartbeat that) {
- if (that == null)
- return false;
-
- boolean this_present_storm_id = true && this.is_set_storm_id();
- boolean that_present_storm_id = true && that.is_set_storm_id();
- if (this_present_storm_id || that_present_storm_id) {
- if (!(this_present_storm_id && that_present_storm_id))
- return false;
- if (!this.storm_id.equals(that.storm_id))
- return false;
- }
-
- boolean this_present_executor_stats = true && this.is_set_executor_stats();
- boolean that_present_executor_stats = true && that.is_set_executor_stats();
- if (this_present_executor_stats || that_present_executor_stats) {
- if (!(this_present_executor_stats && that_present_executor_stats))
- return false;
- if (!this.executor_stats.equals(that.executor_stats))
- return false;
- }
-
- boolean this_present_time_secs = true;
- boolean that_present_time_secs = true;
- if (this_present_time_secs || that_present_time_secs) {
- if (!(this_present_time_secs && that_present_time_secs))
- return false;
- if (this.time_secs != that.time_secs)
- return false;
- }
-
- boolean this_present_uptime_secs = true;
- boolean that_present_uptime_secs = true;
- if (this_present_uptime_secs || that_present_uptime_secs) {
- if (!(this_present_uptime_secs && that_present_uptime_secs))
- return false;
- if (this.uptime_secs != that.uptime_secs)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_storm_id = true && (is_set_storm_id());
- list.add(present_storm_id);
- if (present_storm_id)
- list.add(storm_id);
-
- boolean present_executor_stats = true && (is_set_executor_stats());
- list.add(present_executor_stats);
- if (present_executor_stats)
- list.add(executor_stats);
-
- boolean present_time_secs = true;
- list.add(present_time_secs);
- if (present_time_secs)
- list.add(time_secs);
-
- boolean present_uptime_secs = true;
- list.add(present_uptime_secs);
- if (present_uptime_secs)
- list.add(uptime_secs);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ClusterWorkerHeartbeat other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_storm_id()).compareTo(other.is_set_storm_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_storm_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.storm_id, other.storm_id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_executor_stats()).compareTo(other.is_set_executor_stats());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_executor_stats()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executor_stats, other.executor_stats);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_time_secs()).compareTo(other.is_set_time_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_time_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.time_secs, other.time_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(other.is_set_uptime_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_uptime_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, other.uptime_secs);
- 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("ClusterWorkerHeartbeat(");
- boolean first = true;
-
- sb.append("storm_id:");
- if (this.storm_id == null) {
- sb.append("null");
- } else {
- sb.append(this.storm_id);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("executor_stats:");
- if (this.executor_stats == null) {
- sb.append("null");
- } else {
- sb.append(this.executor_stats);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("time_secs:");
- sb.append(this.time_secs);
- first = false;
- if (!first) sb.append(", ");
- sb.append("uptime_secs:");
- sb.append(this.uptime_secs);
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_storm_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'storm_id' is unset! Struct:" + toString());
- }
-
- if (!is_set_executor_stats()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'executor_stats' is unset! Struct:" + toString());
- }
-
- if (!is_set_time_secs()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'time_secs' is unset! Struct:" + toString());
- }
-
- if (!is_set_uptime_secs()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' 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 ClusterWorkerHeartbeatStandardSchemeFactory implements SchemeFactory {
- public ClusterWorkerHeartbeatStandardScheme getScheme() {
- return new ClusterWorkerHeartbeatStandardScheme();
- }
- }
-
- private static class ClusterWorkerHeartbeatStandardScheme extends StandardScheme<ClusterWorkerHeartbeat> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ClusterWorkerHeartbeat 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: // STORM_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.storm_id = iprot.readString();
- struct.set_storm_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // EXECUTOR_STATS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map694 = iprot.readMapBegin();
- struct.executor_stats = new HashMap<ExecutorInfo,ExecutorStats>(2*_map694.size);
- ExecutorInfo _key695;
- ExecutorStats _val696;
- for (int _i697 = 0; _i697 < _map694.size; ++_i697)
- {
- _key695 = new ExecutorInfo();
- _key695.read(iprot);
- _val696 = new ExecutorStats();
- _val696.read(iprot);
- struct.executor_stats.put(_key695, _val696);
- }
- iprot.readMapEnd();
- }
- struct.set_executor_stats_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // TIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.time_secs = iprot.readI32();
- struct.set_time_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // UPTIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_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, ClusterWorkerHeartbeat struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.storm_id != null) {
- oprot.writeFieldBegin(STORM_ID_FIELD_DESC);
- oprot.writeString(struct.storm_id);
- oprot.writeFieldEnd();
- }
- if (struct.executor_stats != null) {
- oprot.writeFieldBegin(EXECUTOR_STATS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, struct.executor_stats.size()));
- for (Map.Entry<ExecutorInfo, ExecutorStats> _iter698 : struct.executor_stats.entrySet())
- {
- _iter698.getKey().write(oprot);
- _iter698.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(TIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.time_secs);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.uptime_secs);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ClusterWorkerHeartbeatTupleSchemeFactory implements SchemeFactory {
- public ClusterWorkerHeartbeatTupleScheme getScheme() {
- return new ClusterWorkerHeartbeatTupleScheme();
- }
- }
-
- private static class ClusterWorkerHeartbeatTupleScheme extends TupleScheme<ClusterWorkerHeartbeat> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ClusterWorkerHeartbeat struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.storm_id);
- {
- oprot.writeI32(struct.executor_stats.size());
- for (Map.Entry<ExecutorInfo, ExecutorStats> _iter699 : struct.executor_stats.entrySet())
- {
- _iter699.getKey().write(oprot);
- _iter699.getValue().write(oprot);
- }
- }
- oprot.writeI32(struct.time_secs);
- oprot.writeI32(struct.uptime_secs);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ClusterWorkerHeartbeat struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.storm_id = iprot.readString();
- struct.set_storm_id_isSet(true);
- {
- org.apache.thrift.protocol.TMap _map700 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.executor_stats = new HashMap<ExecutorInfo,ExecutorStats>(2*_map700.size);
- ExecutorInfo _key701;
- ExecutorStats _val702;
- for (int _i703 = 0; _i703 < _map700.size; ++_i703)
- {
- _key701 = new ExecutorInfo();
- _key701.read(iprot);
- _val702 = new ExecutorStats();
- _val702.read(iprot);
- struct.executor_stats.put(_key701, _val702);
- }
- }
- struct.set_executor_stats_isSet(true);
- struct.time_secs = iprot.readI32();
- struct.set_time_secs_isSet(true);
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/CommonAggregateStats.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/CommonAggregateStats.java b/storm-core/src/jvm/backtype/storm/generated/CommonAggregateStats.java
deleted file mode 100644
index ba35319..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/CommonAggregateStats.java
+++ /dev/null
@@ -1,1060 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggregateStats, CommonAggregateStats._Fields>, java.io.Serializable, Cloneable, Comparable<CommonAggregateStats> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CommonAggregateStats");
-
- private static final org.apache.thrift.protocol.TField NUM_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_executors", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField NUM_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_tasks", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField EMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("emitted", org.apache.thrift.protocol.TType.I64, (short)3);
- private static final org.apache.thrift.protocol.TField TRANSFERRED_FIELD_DESC = new org.apache.thrift.protocol.TField("transferred", org.apache.thrift.protocol.TType.I64, (short)4);
- private static final org.apache.thrift.protocol.TField ACKED_FIELD_DESC = new org.apache.thrift.protocol.TField("acked", org.apache.thrift.protocol.TType.I64, (short)5);
- private static final org.apache.thrift.protocol.TField FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("failed", org.apache.thrift.protocol.TType.I64, (short)6);
- private static final org.apache.thrift.protocol.TField RESOURCES_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("resources_map", org.apache.thrift.protocol.TType.MAP, (short)7);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new CommonAggregateStatsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new CommonAggregateStatsTupleSchemeFactory());
- }
-
- private int num_executors; // optional
- private int num_tasks; // optional
- private long emitted; // optional
- private long transferred; // optional
- private long acked; // optional
- private long failed; // optional
- private Map<String,Double> resources_map; // 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 {
- NUM_EXECUTORS((short)1, "num_executors"),
- NUM_TASKS((short)2, "num_tasks"),
- EMITTED((short)3, "emitted"),
- TRANSFERRED((short)4, "transferred"),
- ACKED((short)5, "acked"),
- FAILED((short)6, "failed"),
- RESOURCES_MAP((short)7, "resources_map");
-
- 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: // NUM_EXECUTORS
- return NUM_EXECUTORS;
- case 2: // NUM_TASKS
- return NUM_TASKS;
- case 3: // EMITTED
- return EMITTED;
- case 4: // TRANSFERRED
- return TRANSFERRED;
- case 5: // ACKED
- return ACKED;
- case 6: // FAILED
- return FAILED;
- case 7: // RESOURCES_MAP
- return RESOURCES_MAP;
- 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 __NUM_EXECUTORS_ISSET_ID = 0;
- private static final int __NUM_TASKS_ISSET_ID = 1;
- private static final int __EMITTED_ISSET_ID = 2;
- private static final int __TRANSFERRED_ISSET_ID = 3;
- private static final int __ACKED_ISSET_ID = 4;
- private static final int __FAILED_ISSET_ID = 5;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.NUM_EXECUTORS,_Fields.NUM_TASKS,_Fields.EMITTED,_Fields.TRANSFERRED,_Fields.ACKED,_Fields.FAILED,_Fields.RESOURCES_MAP};
- 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.NUM_EXECUTORS, new org.apache.thrift.meta_data.FieldMetaData("num_executors", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.NUM_TASKS, new org.apache.thrift.meta_data.FieldMetaData("num_tasks", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.EMITTED, new org.apache.thrift.meta_data.FieldMetaData("emitted", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.TRANSFERRED, new org.apache.thrift.meta_data.FieldMetaData("transferred", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.ACKED, new org.apache.thrift.meta_data.FieldMetaData("acked", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.FAILED, new org.apache.thrift.meta_data.FieldMetaData("failed", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.RESOURCES_MAP, new org.apache.thrift.meta_data.FieldMetaData("resources_map", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CommonAggregateStats.class, metaDataMap);
- }
-
- public CommonAggregateStats() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public CommonAggregateStats(CommonAggregateStats other) {
- __isset_bitfield = other.__isset_bitfield;
- this.num_executors = other.num_executors;
- this.num_tasks = other.num_tasks;
- this.emitted = other.emitted;
- this.transferred = other.transferred;
- this.acked = other.acked;
- this.failed = other.failed;
- if (other.is_set_resources_map()) {
- Map<String,Double> __this__resources_map = new HashMap<String,Double>(other.resources_map);
- this.resources_map = __this__resources_map;
- }
- }
-
- public CommonAggregateStats deepCopy() {
- return new CommonAggregateStats(this);
- }
-
- @Override
- public void clear() {
- set_num_executors_isSet(false);
- this.num_executors = 0;
- set_num_tasks_isSet(false);
- this.num_tasks = 0;
- set_emitted_isSet(false);
- this.emitted = 0;
- set_transferred_isSet(false);
- this.transferred = 0;
- set_acked_isSet(false);
- this.acked = 0;
- set_failed_isSet(false);
- this.failed = 0;
- this.resources_map = null;
- }
-
- public int get_num_executors() {
- return this.num_executors;
- }
-
- public void set_num_executors(int num_executors) {
- this.num_executors = num_executors;
- set_num_executors_isSet(true);
- }
-
- public void unset_num_executors() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID);
- }
-
- /** Returns true if field num_executors is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_executors() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID);
- }
-
- public void set_num_executors_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID, value);
- }
-
- public int get_num_tasks() {
- return this.num_tasks;
- }
-
- public void set_num_tasks(int num_tasks) {
- this.num_tasks = num_tasks;
- set_num_tasks_isSet(true);
- }
-
- public void unset_num_tasks() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_TASKS_ISSET_ID);
- }
-
- /** Returns true if field num_tasks is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_tasks() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_TASKS_ISSET_ID);
- }
-
- public void set_num_tasks_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_TASKS_ISSET_ID, value);
- }
-
- public long get_emitted() {
- return this.emitted;
- }
-
- public void set_emitted(long emitted) {
- this.emitted = emitted;
- set_emitted_isSet(true);
- }
-
- public void unset_emitted() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EMITTED_ISSET_ID);
- }
-
- /** Returns true if field emitted is set (has been assigned a value) and false otherwise */
- public boolean is_set_emitted() {
- return EncodingUtils.testBit(__isset_bitfield, __EMITTED_ISSET_ID);
- }
-
- public void set_emitted_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EMITTED_ISSET_ID, value);
- }
-
- public long get_transferred() {
- return this.transferred;
- }
-
- public void set_transferred(long transferred) {
- this.transferred = transferred;
- set_transferred_isSet(true);
- }
-
- public void unset_transferred() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TRANSFERRED_ISSET_ID);
- }
-
- /** Returns true if field transferred is set (has been assigned a value) and false otherwise */
- public boolean is_set_transferred() {
- return EncodingUtils.testBit(__isset_bitfield, __TRANSFERRED_ISSET_ID);
- }
-
- public void set_transferred_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TRANSFERRED_ISSET_ID, value);
- }
-
- public long get_acked() {
- return this.acked;
- }
-
- public void set_acked(long acked) {
- this.acked = acked;
- set_acked_isSet(true);
- }
-
- public void unset_acked() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ACKED_ISSET_ID);
- }
-
- /** Returns true if field acked is set (has been assigned a value) and false otherwise */
- public boolean is_set_acked() {
- return EncodingUtils.testBit(__isset_bitfield, __ACKED_ISSET_ID);
- }
-
- public void set_acked_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ACKED_ISSET_ID, value);
- }
-
- public long get_failed() {
- return this.failed;
- }
-
- public void set_failed(long failed) {
- this.failed = failed;
- set_failed_isSet(true);
- }
-
- public void unset_failed() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FAILED_ISSET_ID);
- }
-
- /** Returns true if field failed is set (has been assigned a value) and false otherwise */
- public boolean is_set_failed() {
- return EncodingUtils.testBit(__isset_bitfield, __FAILED_ISSET_ID);
- }
-
- public void set_failed_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FAILED_ISSET_ID, value);
- }
-
- public int get_resources_map_size() {
- return (this.resources_map == null) ? 0 : this.resources_map.size();
- }
-
- public void put_to_resources_map(String key, double val) {
- if (this.resources_map == null) {
- this.resources_map = new HashMap<String,Double>();
- }
- this.resources_map.put(key, val);
- }
-
- public Map<String,Double> get_resources_map() {
- return this.resources_map;
- }
-
- public void set_resources_map(Map<String,Double> resources_map) {
- this.resources_map = resources_map;
- }
-
- public void unset_resources_map() {
- this.resources_map = null;
- }
-
- /** Returns true if field resources_map is set (has been assigned a value) and false otherwise */
- public boolean is_set_resources_map() {
- return this.resources_map != null;
- }
-
- public void set_resources_map_isSet(boolean value) {
- if (!value) {
- this.resources_map = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case NUM_EXECUTORS:
- if (value == null) {
- unset_num_executors();
- } else {
- set_num_executors((Integer)value);
- }
- break;
-
- case NUM_TASKS:
- if (value == null) {
- unset_num_tasks();
- } else {
- set_num_tasks((Integer)value);
- }
- break;
-
- case EMITTED:
- if (value == null) {
- unset_emitted();
- } else {
- set_emitted((Long)value);
- }
- break;
-
- case TRANSFERRED:
- if (value == null) {
- unset_transferred();
- } else {
- set_transferred((Long)value);
- }
- break;
-
- case ACKED:
- if (value == null) {
- unset_acked();
- } else {
- set_acked((Long)value);
- }
- break;
-
- case FAILED:
- if (value == null) {
- unset_failed();
- } else {
- set_failed((Long)value);
- }
- break;
-
- case RESOURCES_MAP:
- if (value == null) {
- unset_resources_map();
- } else {
- set_resources_map((Map<String,Double>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case NUM_EXECUTORS:
- return get_num_executors();
-
- case NUM_TASKS:
- return get_num_tasks();
-
- case EMITTED:
- return get_emitted();
-
- case TRANSFERRED:
- return get_transferred();
-
- case ACKED:
- return get_acked();
-
- case FAILED:
- return get_failed();
-
- case RESOURCES_MAP:
- return get_resources_map();
-
- }
- 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 NUM_EXECUTORS:
- return is_set_num_executors();
- case NUM_TASKS:
- return is_set_num_tasks();
- case EMITTED:
- return is_set_emitted();
- case TRANSFERRED:
- return is_set_transferred();
- case ACKED:
- return is_set_acked();
- case FAILED:
- return is_set_failed();
- case RESOURCES_MAP:
- return is_set_resources_map();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof CommonAggregateStats)
- return this.equals((CommonAggregateStats)that);
- return false;
- }
-
- public boolean equals(CommonAggregateStats that) {
- if (that == null)
- return false;
-
- boolean this_present_num_executors = true && this.is_set_num_executors();
- boolean that_present_num_executors = true && that.is_set_num_executors();
- if (this_present_num_executors || that_present_num_executors) {
- if (!(this_present_num_executors && that_present_num_executors))
- return false;
- if (this.num_executors != that.num_executors)
- return false;
- }
-
- boolean this_present_num_tasks = true && this.is_set_num_tasks();
- boolean that_present_num_tasks = true && that.is_set_num_tasks();
- if (this_present_num_tasks || that_present_num_tasks) {
- if (!(this_present_num_tasks && that_present_num_tasks))
- return false;
- if (this.num_tasks != that.num_tasks)
- return false;
- }
-
- boolean this_present_emitted = true && this.is_set_emitted();
- boolean that_present_emitted = true && that.is_set_emitted();
- if (this_present_emitted || that_present_emitted) {
- if (!(this_present_emitted && that_present_emitted))
- return false;
- if (this.emitted != that.emitted)
- return false;
- }
-
- boolean this_present_transferred = true && this.is_set_transferred();
- boolean that_present_transferred = true && that.is_set_transferred();
- if (this_present_transferred || that_present_transferred) {
- if (!(this_present_transferred && that_present_transferred))
- return false;
- if (this.transferred != that.transferred)
- return false;
- }
-
- boolean this_present_acked = true && this.is_set_acked();
- boolean that_present_acked = true && that.is_set_acked();
- if (this_present_acked || that_present_acked) {
- if (!(this_present_acked && that_present_acked))
- return false;
- if (this.acked != that.acked)
- return false;
- }
-
- boolean this_present_failed = true && this.is_set_failed();
- boolean that_present_failed = true && that.is_set_failed();
- if (this_present_failed || that_present_failed) {
- if (!(this_present_failed && that_present_failed))
- return false;
- if (this.failed != that.failed)
- return false;
- }
-
- boolean this_present_resources_map = true && this.is_set_resources_map();
- boolean that_present_resources_map = true && that.is_set_resources_map();
- if (this_present_resources_map || that_present_resources_map) {
- if (!(this_present_resources_map && that_present_resources_map))
- return false;
- if (!this.resources_map.equals(that.resources_map))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_num_executors = true && (is_set_num_executors());
- list.add(present_num_executors);
- if (present_num_executors)
- list.add(num_executors);
-
- boolean present_num_tasks = true && (is_set_num_tasks());
- list.add(present_num_tasks);
- if (present_num_tasks)
- list.add(num_tasks);
-
- boolean present_emitted = true && (is_set_emitted());
- list.add(present_emitted);
- if (present_emitted)
- list.add(emitted);
-
- boolean present_transferred = true && (is_set_transferred());
- list.add(present_transferred);
- if (present_transferred)
- list.add(transferred);
-
- boolean present_acked = true && (is_set_acked());
- list.add(present_acked);
- if (present_acked)
- list.add(acked);
-
- boolean present_failed = true && (is_set_failed());
- list.add(present_failed);
- if (present_failed)
- list.add(failed);
-
- boolean present_resources_map = true && (is_set_resources_map());
- list.add(present_resources_map);
- if (present_resources_map)
- list.add(resources_map);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(CommonAggregateStats other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_num_executors()).compareTo(other.is_set_num_executors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_executors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_executors, other.num_executors);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_tasks()).compareTo(other.is_set_num_tasks());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_tasks()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_tasks, other.num_tasks);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_emitted()).compareTo(other.is_set_emitted());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_emitted()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.emitted, other.emitted);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_transferred()).compareTo(other.is_set_transferred());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_transferred()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transferred, other.transferred);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_acked()).compareTo(other.is_set_acked());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_acked()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acked, other.acked);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_failed()).compareTo(other.is_set_failed());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_failed()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failed, other.failed);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_resources_map()).compareTo(other.is_set_resources_map());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_resources_map()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resources_map, other.resources_map);
- 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("CommonAggregateStats(");
- boolean first = true;
-
- if (is_set_num_executors()) {
- sb.append("num_executors:");
- sb.append(this.num_executors);
- first = false;
- }
- if (is_set_num_tasks()) {
- if (!first) sb.append(", ");
- sb.append("num_tasks:");
- sb.append(this.num_tasks);
- first = false;
- }
- if (is_set_emitted()) {
- if (!first) sb.append(", ");
- sb.append("emitted:");
- sb.append(this.emitted);
- first = false;
- }
- if (is_set_transferred()) {
- if (!first) sb.append(", ");
- sb.append("transferred:");
- sb.append(this.transferred);
- first = false;
- }
- if (is_set_acked()) {
- if (!first) sb.append(", ");
- sb.append("acked:");
- sb.append(this.acked);
- first = false;
- }
- if (is_set_failed()) {
- if (!first) sb.append(", ");
- sb.append("failed:");
- sb.append(this.failed);
- first = false;
- }
- if (is_set_resources_map()) {
- if (!first) sb.append(", ");
- sb.append("resources_map:");
- if (this.resources_map == null) {
- sb.append("null");
- } else {
- sb.append(this.resources_map);
- }
- 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 CommonAggregateStatsStandardSchemeFactory implements SchemeFactory {
- public CommonAggregateStatsStandardScheme getScheme() {
- return new CommonAggregateStatsStandardScheme();
- }
- }
-
- private static class CommonAggregateStatsStandardScheme extends StandardScheme<CommonAggregateStats> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, CommonAggregateStats 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: // NUM_EXECUTORS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_executors = iprot.readI32();
- struct.set_num_executors_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // NUM_TASKS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_tasks = iprot.readI32();
- struct.set_num_tasks_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // EMITTED
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.emitted = iprot.readI64();
- struct.set_emitted_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // TRANSFERRED
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.transferred = iprot.readI64();
- struct.set_transferred_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // ACKED
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.acked = iprot.readI64();
- struct.set_acked_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // FAILED
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.failed = iprot.readI64();
- struct.set_failed_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // RESOURCES_MAP
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map368 = iprot.readMapBegin();
- struct.resources_map = new HashMap<String,Double>(2*_map368.size);
- String _key369;
- double _val370;
- for (int _i371 = 0; _i371 < _map368.size; ++_i371)
- {
- _key369 = iprot.readString();
- _val370 = iprot.readDouble();
- struct.resources_map.put(_key369, _val370);
- }
- iprot.readMapEnd();
- }
- struct.set_resources_map_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, CommonAggregateStats struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.is_set_num_executors()) {
- oprot.writeFieldBegin(NUM_EXECUTORS_FIELD_DESC);
- oprot.writeI32(struct.num_executors);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_num_tasks()) {
- oprot.writeFieldBegin(NUM_TASKS_FIELD_DESC);
- oprot.writeI32(struct.num_tasks);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_emitted()) {
- oprot.writeFieldBegin(EMITTED_FIELD_DESC);
- oprot.writeI64(struct.emitted);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_transferred()) {
- oprot.writeFieldBegin(TRANSFERRED_FIELD_DESC);
- oprot.writeI64(struct.transferred);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_acked()) {
- oprot.writeFieldBegin(ACKED_FIELD_DESC);
- oprot.writeI64(struct.acked);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_failed()) {
- oprot.writeFieldBegin(FAILED_FIELD_DESC);
- oprot.writeI64(struct.failed);
- oprot.writeFieldEnd();
- }
- if (struct.resources_map != null) {
- if (struct.is_set_resources_map()) {
- oprot.writeFieldBegin(RESOURCES_MAP_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, struct.resources_map.size()));
- for (Map.Entry<String, Double> _iter372 : struct.resources_map.entrySet())
- {
- oprot.writeString(_iter372.getKey());
- oprot.writeDouble(_iter372.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class CommonAggregateStatsTupleSchemeFactory implements SchemeFactory {
- public CommonAggregateStatsTupleScheme getScheme() {
- return new CommonAggregateStatsTupleScheme();
- }
- }
-
- private static class CommonAggregateStatsTupleScheme extends TupleScheme<CommonAggregateStats> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, CommonAggregateStats struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_num_executors()) {
- optionals.set(0);
- }
- if (struct.is_set_num_tasks()) {
- optionals.set(1);
- }
- if (struct.is_set_emitted()) {
- optionals.set(2);
- }
- if (struct.is_set_transferred()) {
- optionals.set(3);
- }
- if (struct.is_set_acked()) {
- optionals.set(4);
- }
- if (struct.is_set_failed()) {
- optionals.set(5);
- }
- if (struct.is_set_resources_map()) {
- optionals.set(6);
- }
- oprot.writeBitSet(optionals, 7);
- if (struct.is_set_num_executors()) {
- oprot.writeI32(struct.num_executors);
- }
- if (struct.is_set_num_tasks()) {
- oprot.writeI32(struct.num_tasks);
- }
- if (struct.is_set_emitted()) {
- oprot.writeI64(struct.emitted);
- }
- if (struct.is_set_transferred()) {
- oprot.writeI64(struct.transferred);
- }
- if (struct.is_set_acked()) {
- oprot.writeI64(struct.acked);
- }
- if (struct.is_set_failed()) {
- oprot.writeI64(struct.failed);
- }
- if (struct.is_set_resources_map()) {
- {
- oprot.writeI32(struct.resources_map.size());
- for (Map.Entry<String, Double> _iter373 : struct.resources_map.entrySet())
- {
- oprot.writeString(_iter373.getKey());
- oprot.writeDouble(_iter373.getValue());
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, CommonAggregateStats struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(7);
- if (incoming.get(0)) {
- struct.num_executors = iprot.readI32();
- struct.set_num_executors_isSet(true);
- }
- if (incoming.get(1)) {
- struct.num_tasks = iprot.readI32();
- struct.set_num_tasks_isSet(true);
- }
- if (incoming.get(2)) {
- struct.emitted = iprot.readI64();
- struct.set_emitted_isSet(true);
- }
- if (incoming.get(3)) {
- struct.transferred = iprot.readI64();
- struct.set_transferred_isSet(true);
- }
- if (incoming.get(4)) {
- struct.acked = iprot.readI64();
- struct.set_acked_isSet(true);
- }
- if (incoming.get(5)) {
- struct.failed = iprot.readI64();
- struct.set_failed_isSet(true);
- }
- if (incoming.get(6)) {
- {
- org.apache.thrift.protocol.TMap _map374 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32());
- struct.resources_map = new HashMap<String,Double>(2*_map374.size);
- String _key375;
- double _val376;
- for (int _i377 = 0; _i377 < _map374.size; ++_i377)
- {
- _key375 = iprot.readString();
- _val376 = iprot.readDouble();
- struct.resources_map.put(_key375, _val376);
- }
- }
- struct.set_resources_map_isSet(true);
- }
- }
- }
-
-}
-
[32/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/BoltStats.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/BoltStats.java b/storm-core/src/jvm/backtype/storm/generated/BoltStats.java
deleted file mode 100644
index cd5a497..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/BoltStats.java
+++ /dev/null
@@ -1,1390 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class BoltStats implements org.apache.thrift.TBase<BoltStats, BoltStats._Fields>, java.io.Serializable, Cloneable, Comparable<BoltStats> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BoltStats");
-
- private static final org.apache.thrift.protocol.TField ACKED_FIELD_DESC = new org.apache.thrift.protocol.TField("acked", org.apache.thrift.protocol.TType.MAP, (short)1);
- private static final org.apache.thrift.protocol.TField FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("failed", org.apache.thrift.protocol.TType.MAP, (short)2);
- private static final org.apache.thrift.protocol.TField PROCESS_MS_AVG_FIELD_DESC = new org.apache.thrift.protocol.TField("process_ms_avg", org.apache.thrift.protocol.TType.MAP, (short)3);
- private static final org.apache.thrift.protocol.TField EXECUTED_FIELD_DESC = new org.apache.thrift.protocol.TField("executed", org.apache.thrift.protocol.TType.MAP, (short)4);
- private static final org.apache.thrift.protocol.TField EXECUTE_MS_AVG_FIELD_DESC = new org.apache.thrift.protocol.TField("execute_ms_avg", org.apache.thrift.protocol.TType.MAP, (short)5);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new BoltStatsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new BoltStatsTupleSchemeFactory());
- }
-
- private Map<String,Map<GlobalStreamId,Long>> acked; // required
- private Map<String,Map<GlobalStreamId,Long>> failed; // required
- private Map<String,Map<GlobalStreamId,Double>> process_ms_avg; // required
- private Map<String,Map<GlobalStreamId,Long>> executed; // required
- private Map<String,Map<GlobalStreamId,Double>> execute_ms_avg; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- ACKED((short)1, "acked"),
- FAILED((short)2, "failed"),
- PROCESS_MS_AVG((short)3, "process_ms_avg"),
- EXECUTED((short)4, "executed"),
- EXECUTE_MS_AVG((short)5, "execute_ms_avg");
-
- private static final Map<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: // ACKED
- return ACKED;
- case 2: // FAILED
- return FAILED;
- case 3: // PROCESS_MS_AVG
- return PROCESS_MS_AVG;
- case 4: // EXECUTED
- return EXECUTED;
- case 5: // EXECUTE_MS_AVG
- return EXECUTE_MS_AVG;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant 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.ACKED, new org.apache.thrift.meta_data.FieldMetaData("acked", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class),
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))));
- tmpMap.put(_Fields.FAILED, new org.apache.thrift.meta_data.FieldMetaData("failed", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class),
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))));
- tmpMap.put(_Fields.PROCESS_MS_AVG, new org.apache.thrift.meta_data.FieldMetaData("process_ms_avg", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class),
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))));
- tmpMap.put(_Fields.EXECUTED, new org.apache.thrift.meta_data.FieldMetaData("executed", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class),
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))));
- tmpMap.put(_Fields.EXECUTE_MS_AVG, new org.apache.thrift.meta_data.FieldMetaData("execute_ms_avg", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class),
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BoltStats.class, metaDataMap);
- }
-
- public BoltStats() {
- }
-
- public BoltStats(
- Map<String,Map<GlobalStreamId,Long>> acked,
- Map<String,Map<GlobalStreamId,Long>> failed,
- Map<String,Map<GlobalStreamId,Double>> process_ms_avg,
- Map<String,Map<GlobalStreamId,Long>> executed,
- Map<String,Map<GlobalStreamId,Double>> execute_ms_avg)
- {
- this();
- this.acked = acked;
- this.failed = failed;
- this.process_ms_avg = process_ms_avg;
- this.executed = executed;
- this.execute_ms_avg = execute_ms_avg;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public BoltStats(BoltStats other) {
- if (other.is_set_acked()) {
- Map<String,Map<GlobalStreamId,Long>> __this__acked = new HashMap<String,Map<GlobalStreamId,Long>>(other.acked.size());
- for (Map.Entry<String, Map<GlobalStreamId,Long>> other_element : other.acked.entrySet()) {
-
- String other_element_key = other_element.getKey();
- Map<GlobalStreamId,Long> other_element_value = other_element.getValue();
-
- String __this__acked_copy_key = other_element_key;
-
- Map<GlobalStreamId,Long> __this__acked_copy_value = new HashMap<GlobalStreamId,Long>(other_element_value.size());
- for (Map.Entry<GlobalStreamId, Long> other_element_value_element : other_element_value.entrySet()) {
-
- GlobalStreamId other_element_value_element_key = other_element_value_element.getKey();
- Long other_element_value_element_value = other_element_value_element.getValue();
-
- GlobalStreamId __this__acked_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key);
-
- Long __this__acked_copy_value_copy_value = other_element_value_element_value;
-
- __this__acked_copy_value.put(__this__acked_copy_value_copy_key, __this__acked_copy_value_copy_value);
- }
-
- __this__acked.put(__this__acked_copy_key, __this__acked_copy_value);
- }
- this.acked = __this__acked;
- }
- if (other.is_set_failed()) {
- Map<String,Map<GlobalStreamId,Long>> __this__failed = new HashMap<String,Map<GlobalStreamId,Long>>(other.failed.size());
- for (Map.Entry<String, Map<GlobalStreamId,Long>> other_element : other.failed.entrySet()) {
-
- String other_element_key = other_element.getKey();
- Map<GlobalStreamId,Long> other_element_value = other_element.getValue();
-
- String __this__failed_copy_key = other_element_key;
-
- Map<GlobalStreamId,Long> __this__failed_copy_value = new HashMap<GlobalStreamId,Long>(other_element_value.size());
- for (Map.Entry<GlobalStreamId, Long> other_element_value_element : other_element_value.entrySet()) {
-
- GlobalStreamId other_element_value_element_key = other_element_value_element.getKey();
- Long other_element_value_element_value = other_element_value_element.getValue();
-
- GlobalStreamId __this__failed_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key);
-
- Long __this__failed_copy_value_copy_value = other_element_value_element_value;
-
- __this__failed_copy_value.put(__this__failed_copy_value_copy_key, __this__failed_copy_value_copy_value);
- }
-
- __this__failed.put(__this__failed_copy_key, __this__failed_copy_value);
- }
- this.failed = __this__failed;
- }
- if (other.is_set_process_ms_avg()) {
- Map<String,Map<GlobalStreamId,Double>> __this__process_ms_avg = new HashMap<String,Map<GlobalStreamId,Double>>(other.process_ms_avg.size());
- for (Map.Entry<String, Map<GlobalStreamId,Double>> other_element : other.process_ms_avg.entrySet()) {
-
- String other_element_key = other_element.getKey();
- Map<GlobalStreamId,Double> other_element_value = other_element.getValue();
-
- String __this__process_ms_avg_copy_key = other_element_key;
-
- Map<GlobalStreamId,Double> __this__process_ms_avg_copy_value = new HashMap<GlobalStreamId,Double>(other_element_value.size());
- for (Map.Entry<GlobalStreamId, Double> other_element_value_element : other_element_value.entrySet()) {
-
- GlobalStreamId other_element_value_element_key = other_element_value_element.getKey();
- Double other_element_value_element_value = other_element_value_element.getValue();
-
- GlobalStreamId __this__process_ms_avg_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key);
-
- Double __this__process_ms_avg_copy_value_copy_value = other_element_value_element_value;
-
- __this__process_ms_avg_copy_value.put(__this__process_ms_avg_copy_value_copy_key, __this__process_ms_avg_copy_value_copy_value);
- }
-
- __this__process_ms_avg.put(__this__process_ms_avg_copy_key, __this__process_ms_avg_copy_value);
- }
- this.process_ms_avg = __this__process_ms_avg;
- }
- if (other.is_set_executed()) {
- Map<String,Map<GlobalStreamId,Long>> __this__executed = new HashMap<String,Map<GlobalStreamId,Long>>(other.executed.size());
- for (Map.Entry<String, Map<GlobalStreamId,Long>> other_element : other.executed.entrySet()) {
-
- String other_element_key = other_element.getKey();
- Map<GlobalStreamId,Long> other_element_value = other_element.getValue();
-
- String __this__executed_copy_key = other_element_key;
-
- Map<GlobalStreamId,Long> __this__executed_copy_value = new HashMap<GlobalStreamId,Long>(other_element_value.size());
- for (Map.Entry<GlobalStreamId, Long> other_element_value_element : other_element_value.entrySet()) {
-
- GlobalStreamId other_element_value_element_key = other_element_value_element.getKey();
- Long other_element_value_element_value = other_element_value_element.getValue();
-
- GlobalStreamId __this__executed_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key);
-
- Long __this__executed_copy_value_copy_value = other_element_value_element_value;
-
- __this__executed_copy_value.put(__this__executed_copy_value_copy_key, __this__executed_copy_value_copy_value);
- }
-
- __this__executed.put(__this__executed_copy_key, __this__executed_copy_value);
- }
- this.executed = __this__executed;
- }
- if (other.is_set_execute_ms_avg()) {
- Map<String,Map<GlobalStreamId,Double>> __this__execute_ms_avg = new HashMap<String,Map<GlobalStreamId,Double>>(other.execute_ms_avg.size());
- for (Map.Entry<String, Map<GlobalStreamId,Double>> other_element : other.execute_ms_avg.entrySet()) {
-
- String other_element_key = other_element.getKey();
- Map<GlobalStreamId,Double> other_element_value = other_element.getValue();
-
- String __this__execute_ms_avg_copy_key = other_element_key;
-
- Map<GlobalStreamId,Double> __this__execute_ms_avg_copy_value = new HashMap<GlobalStreamId,Double>(other_element_value.size());
- for (Map.Entry<GlobalStreamId, Double> other_element_value_element : other_element_value.entrySet()) {
-
- GlobalStreamId other_element_value_element_key = other_element_value_element.getKey();
- Double other_element_value_element_value = other_element_value_element.getValue();
-
- GlobalStreamId __this__execute_ms_avg_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key);
-
- Double __this__execute_ms_avg_copy_value_copy_value = other_element_value_element_value;
-
- __this__execute_ms_avg_copy_value.put(__this__execute_ms_avg_copy_value_copy_key, __this__execute_ms_avg_copy_value_copy_value);
- }
-
- __this__execute_ms_avg.put(__this__execute_ms_avg_copy_key, __this__execute_ms_avg_copy_value);
- }
- this.execute_ms_avg = __this__execute_ms_avg;
- }
- }
-
- public BoltStats deepCopy() {
- return new BoltStats(this);
- }
-
- @Override
- public void clear() {
- this.acked = null;
- this.failed = null;
- this.process_ms_avg = null;
- this.executed = null;
- this.execute_ms_avg = null;
- }
-
- public int get_acked_size() {
- return (this.acked == null) ? 0 : this.acked.size();
- }
-
- public void put_to_acked(String key, Map<GlobalStreamId,Long> val) {
- if (this.acked == null) {
- this.acked = new HashMap<String,Map<GlobalStreamId,Long>>();
- }
- this.acked.put(key, val);
- }
-
- public Map<String,Map<GlobalStreamId,Long>> get_acked() {
- return this.acked;
- }
-
- public void set_acked(Map<String,Map<GlobalStreamId,Long>> acked) {
- this.acked = acked;
- }
-
- public void unset_acked() {
- this.acked = null;
- }
-
- /** Returns true if field acked is set (has been assigned a value) and false otherwise */
- public boolean is_set_acked() {
- return this.acked != null;
- }
-
- public void set_acked_isSet(boolean value) {
- if (!value) {
- this.acked = null;
- }
- }
-
- public int get_failed_size() {
- return (this.failed == null) ? 0 : this.failed.size();
- }
-
- public void put_to_failed(String key, Map<GlobalStreamId,Long> val) {
- if (this.failed == null) {
- this.failed = new HashMap<String,Map<GlobalStreamId,Long>>();
- }
- this.failed.put(key, val);
- }
-
- public Map<String,Map<GlobalStreamId,Long>> get_failed() {
- return this.failed;
- }
-
- public void set_failed(Map<String,Map<GlobalStreamId,Long>> failed) {
- this.failed = failed;
- }
-
- public void unset_failed() {
- this.failed = null;
- }
-
- /** Returns true if field failed is set (has been assigned a value) and false otherwise */
- public boolean is_set_failed() {
- return this.failed != null;
- }
-
- public void set_failed_isSet(boolean value) {
- if (!value) {
- this.failed = null;
- }
- }
-
- public int get_process_ms_avg_size() {
- return (this.process_ms_avg == null) ? 0 : this.process_ms_avg.size();
- }
-
- public void put_to_process_ms_avg(String key, Map<GlobalStreamId,Double> val) {
- if (this.process_ms_avg == null) {
- this.process_ms_avg = new HashMap<String,Map<GlobalStreamId,Double>>();
- }
- this.process_ms_avg.put(key, val);
- }
-
- public Map<String,Map<GlobalStreamId,Double>> get_process_ms_avg() {
- return this.process_ms_avg;
- }
-
- public void set_process_ms_avg(Map<String,Map<GlobalStreamId,Double>> process_ms_avg) {
- this.process_ms_avg = process_ms_avg;
- }
-
- public void unset_process_ms_avg() {
- this.process_ms_avg = null;
- }
-
- /** Returns true if field process_ms_avg is set (has been assigned a value) and false otherwise */
- public boolean is_set_process_ms_avg() {
- return this.process_ms_avg != null;
- }
-
- public void set_process_ms_avg_isSet(boolean value) {
- if (!value) {
- this.process_ms_avg = null;
- }
- }
-
- public int get_executed_size() {
- return (this.executed == null) ? 0 : this.executed.size();
- }
-
- public void put_to_executed(String key, Map<GlobalStreamId,Long> val) {
- if (this.executed == null) {
- this.executed = new HashMap<String,Map<GlobalStreamId,Long>>();
- }
- this.executed.put(key, val);
- }
-
- public Map<String,Map<GlobalStreamId,Long>> get_executed() {
- return this.executed;
- }
-
- public void set_executed(Map<String,Map<GlobalStreamId,Long>> executed) {
- this.executed = executed;
- }
-
- public void unset_executed() {
- this.executed = null;
- }
-
- /** Returns true if field executed is set (has been assigned a value) and false otherwise */
- public boolean is_set_executed() {
- return this.executed != null;
- }
-
- public void set_executed_isSet(boolean value) {
- if (!value) {
- this.executed = null;
- }
- }
-
- public int get_execute_ms_avg_size() {
- return (this.execute_ms_avg == null) ? 0 : this.execute_ms_avg.size();
- }
-
- public void put_to_execute_ms_avg(String key, Map<GlobalStreamId,Double> val) {
- if (this.execute_ms_avg == null) {
- this.execute_ms_avg = new HashMap<String,Map<GlobalStreamId,Double>>();
- }
- this.execute_ms_avg.put(key, val);
- }
-
- public Map<String,Map<GlobalStreamId,Double>> get_execute_ms_avg() {
- return this.execute_ms_avg;
- }
-
- public void set_execute_ms_avg(Map<String,Map<GlobalStreamId,Double>> execute_ms_avg) {
- this.execute_ms_avg = execute_ms_avg;
- }
-
- public void unset_execute_ms_avg() {
- this.execute_ms_avg = null;
- }
-
- /** Returns true if field execute_ms_avg is set (has been assigned a value) and false otherwise */
- public boolean is_set_execute_ms_avg() {
- return this.execute_ms_avg != null;
- }
-
- public void set_execute_ms_avg_isSet(boolean value) {
- if (!value) {
- this.execute_ms_avg = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ACKED:
- if (value == null) {
- unset_acked();
- } else {
- set_acked((Map<String,Map<GlobalStreamId,Long>>)value);
- }
- break;
-
- case FAILED:
- if (value == null) {
- unset_failed();
- } else {
- set_failed((Map<String,Map<GlobalStreamId,Long>>)value);
- }
- break;
-
- case PROCESS_MS_AVG:
- if (value == null) {
- unset_process_ms_avg();
- } else {
- set_process_ms_avg((Map<String,Map<GlobalStreamId,Double>>)value);
- }
- break;
-
- case EXECUTED:
- if (value == null) {
- unset_executed();
- } else {
- set_executed((Map<String,Map<GlobalStreamId,Long>>)value);
- }
- break;
-
- case EXECUTE_MS_AVG:
- if (value == null) {
- unset_execute_ms_avg();
- } else {
- set_execute_ms_avg((Map<String,Map<GlobalStreamId,Double>>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ACKED:
- return get_acked();
-
- case FAILED:
- return get_failed();
-
- case PROCESS_MS_AVG:
- return get_process_ms_avg();
-
- case EXECUTED:
- return get_executed();
-
- case EXECUTE_MS_AVG:
- return get_execute_ms_avg();
-
- }
- 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 ACKED:
- return is_set_acked();
- case FAILED:
- return is_set_failed();
- case PROCESS_MS_AVG:
- return is_set_process_ms_avg();
- case EXECUTED:
- return is_set_executed();
- case EXECUTE_MS_AVG:
- return is_set_execute_ms_avg();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof BoltStats)
- return this.equals((BoltStats)that);
- return false;
- }
-
- public boolean equals(BoltStats that) {
- if (that == null)
- return false;
-
- boolean this_present_acked = true && this.is_set_acked();
- boolean that_present_acked = true && that.is_set_acked();
- if (this_present_acked || that_present_acked) {
- if (!(this_present_acked && that_present_acked))
- return false;
- if (!this.acked.equals(that.acked))
- return false;
- }
-
- boolean this_present_failed = true && this.is_set_failed();
- boolean that_present_failed = true && that.is_set_failed();
- if (this_present_failed || that_present_failed) {
- if (!(this_present_failed && that_present_failed))
- return false;
- if (!this.failed.equals(that.failed))
- return false;
- }
-
- boolean this_present_process_ms_avg = true && this.is_set_process_ms_avg();
- boolean that_present_process_ms_avg = true && that.is_set_process_ms_avg();
- if (this_present_process_ms_avg || that_present_process_ms_avg) {
- if (!(this_present_process_ms_avg && that_present_process_ms_avg))
- return false;
- if (!this.process_ms_avg.equals(that.process_ms_avg))
- return false;
- }
-
- boolean this_present_executed = true && this.is_set_executed();
- boolean that_present_executed = true && that.is_set_executed();
- if (this_present_executed || that_present_executed) {
- if (!(this_present_executed && that_present_executed))
- return false;
- if (!this.executed.equals(that.executed))
- return false;
- }
-
- boolean this_present_execute_ms_avg = true && this.is_set_execute_ms_avg();
- boolean that_present_execute_ms_avg = true && that.is_set_execute_ms_avg();
- if (this_present_execute_ms_avg || that_present_execute_ms_avg) {
- if (!(this_present_execute_ms_avg && that_present_execute_ms_avg))
- return false;
- if (!this.execute_ms_avg.equals(that.execute_ms_avg))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_acked = true && (is_set_acked());
- list.add(present_acked);
- if (present_acked)
- list.add(acked);
-
- boolean present_failed = true && (is_set_failed());
- list.add(present_failed);
- if (present_failed)
- list.add(failed);
-
- boolean present_process_ms_avg = true && (is_set_process_ms_avg());
- list.add(present_process_ms_avg);
- if (present_process_ms_avg)
- list.add(process_ms_avg);
-
- boolean present_executed = true && (is_set_executed());
- list.add(present_executed);
- if (present_executed)
- list.add(executed);
-
- boolean present_execute_ms_avg = true && (is_set_execute_ms_avg());
- list.add(present_execute_ms_avg);
- if (present_execute_ms_avg)
- list.add(execute_ms_avg);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(BoltStats other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_acked()).compareTo(other.is_set_acked());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_acked()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acked, other.acked);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_failed()).compareTo(other.is_set_failed());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_failed()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failed, other.failed);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_process_ms_avg()).compareTo(other.is_set_process_ms_avg());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_process_ms_avg()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.process_ms_avg, other.process_ms_avg);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_executed()).compareTo(other.is_set_executed());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_executed()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executed, other.executed);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_execute_ms_avg()).compareTo(other.is_set_execute_ms_avg());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_execute_ms_avg()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.execute_ms_avg, other.execute_ms_avg);
- 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("BoltStats(");
- boolean first = true;
-
- sb.append("acked:");
- if (this.acked == null) {
- sb.append("null");
- } else {
- sb.append(this.acked);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("failed:");
- if (this.failed == null) {
- sb.append("null");
- } else {
- sb.append(this.failed);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("process_ms_avg:");
- if (this.process_ms_avg == null) {
- sb.append("null");
- } else {
- sb.append(this.process_ms_avg);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("executed:");
- if (this.executed == null) {
- sb.append("null");
- } else {
- sb.append(this.executed);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("execute_ms_avg:");
- if (this.execute_ms_avg == null) {
- sb.append("null");
- } else {
- sb.append(this.execute_ms_avg);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_acked()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'acked' is unset! Struct:" + toString());
- }
-
- if (!is_set_failed()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'failed' is unset! Struct:" + toString());
- }
-
- if (!is_set_process_ms_avg()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'process_ms_avg' is unset! Struct:" + toString());
- }
-
- if (!is_set_executed()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'executed' is unset! Struct:" + toString());
- }
-
- if (!is_set_execute_ms_avg()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'execute_ms_avg' 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 BoltStatsStandardSchemeFactory implements SchemeFactory {
- public BoltStatsStandardScheme getScheme() {
- return new BoltStatsStandardScheme();
- }
- }
-
- private static class BoltStatsStandardScheme extends StandardScheme<BoltStats> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, BoltStats 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: // ACKED
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map132 = iprot.readMapBegin();
- struct.acked = new HashMap<String,Map<GlobalStreamId,Long>>(2*_map132.size);
- String _key133;
- Map<GlobalStreamId,Long> _val134;
- for (int _i135 = 0; _i135 < _map132.size; ++_i135)
- {
- _key133 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map136 = iprot.readMapBegin();
- _val134 = new HashMap<GlobalStreamId,Long>(2*_map136.size);
- GlobalStreamId _key137;
- long _val138;
- for (int _i139 = 0; _i139 < _map136.size; ++_i139)
- {
- _key137 = new GlobalStreamId();
- _key137.read(iprot);
- _val138 = iprot.readI64();
- _val134.put(_key137, _val138);
- }
- iprot.readMapEnd();
- }
- struct.acked.put(_key133, _val134);
- }
- iprot.readMapEnd();
- }
- struct.set_acked_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // FAILED
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map140 = iprot.readMapBegin();
- struct.failed = new HashMap<String,Map<GlobalStreamId,Long>>(2*_map140.size);
- String _key141;
- Map<GlobalStreamId,Long> _val142;
- for (int _i143 = 0; _i143 < _map140.size; ++_i143)
- {
- _key141 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map144 = iprot.readMapBegin();
- _val142 = new HashMap<GlobalStreamId,Long>(2*_map144.size);
- GlobalStreamId _key145;
- long _val146;
- for (int _i147 = 0; _i147 < _map144.size; ++_i147)
- {
- _key145 = new GlobalStreamId();
- _key145.read(iprot);
- _val146 = iprot.readI64();
- _val142.put(_key145, _val146);
- }
- iprot.readMapEnd();
- }
- struct.failed.put(_key141, _val142);
- }
- iprot.readMapEnd();
- }
- struct.set_failed_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // PROCESS_MS_AVG
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map148 = iprot.readMapBegin();
- struct.process_ms_avg = new HashMap<String,Map<GlobalStreamId,Double>>(2*_map148.size);
- String _key149;
- Map<GlobalStreamId,Double> _val150;
- for (int _i151 = 0; _i151 < _map148.size; ++_i151)
- {
- _key149 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map152 = iprot.readMapBegin();
- _val150 = new HashMap<GlobalStreamId,Double>(2*_map152.size);
- GlobalStreamId _key153;
- double _val154;
- for (int _i155 = 0; _i155 < _map152.size; ++_i155)
- {
- _key153 = new GlobalStreamId();
- _key153.read(iprot);
- _val154 = iprot.readDouble();
- _val150.put(_key153, _val154);
- }
- iprot.readMapEnd();
- }
- struct.process_ms_avg.put(_key149, _val150);
- }
- iprot.readMapEnd();
- }
- struct.set_process_ms_avg_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // EXECUTED
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map156 = iprot.readMapBegin();
- struct.executed = new HashMap<String,Map<GlobalStreamId,Long>>(2*_map156.size);
- String _key157;
- Map<GlobalStreamId,Long> _val158;
- for (int _i159 = 0; _i159 < _map156.size; ++_i159)
- {
- _key157 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map160 = iprot.readMapBegin();
- _val158 = new HashMap<GlobalStreamId,Long>(2*_map160.size);
- GlobalStreamId _key161;
- long _val162;
- for (int _i163 = 0; _i163 < _map160.size; ++_i163)
- {
- _key161 = new GlobalStreamId();
- _key161.read(iprot);
- _val162 = iprot.readI64();
- _val158.put(_key161, _val162);
- }
- iprot.readMapEnd();
- }
- struct.executed.put(_key157, _val158);
- }
- iprot.readMapEnd();
- }
- struct.set_executed_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // EXECUTE_MS_AVG
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map164 = iprot.readMapBegin();
- struct.execute_ms_avg = new HashMap<String,Map<GlobalStreamId,Double>>(2*_map164.size);
- String _key165;
- Map<GlobalStreamId,Double> _val166;
- for (int _i167 = 0; _i167 < _map164.size; ++_i167)
- {
- _key165 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map168 = iprot.readMapBegin();
- _val166 = new HashMap<GlobalStreamId,Double>(2*_map168.size);
- GlobalStreamId _key169;
- double _val170;
- for (int _i171 = 0; _i171 < _map168.size; ++_i171)
- {
- _key169 = new GlobalStreamId();
- _key169.read(iprot);
- _val170 = iprot.readDouble();
- _val166.put(_key169, _val170);
- }
- iprot.readMapEnd();
- }
- struct.execute_ms_avg.put(_key165, _val166);
- }
- iprot.readMapEnd();
- }
- struct.set_execute_ms_avg_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, BoltStats struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.acked != null) {
- oprot.writeFieldBegin(ACKED_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.acked.size()));
- for (Map.Entry<String, Map<GlobalStreamId,Long>> _iter172 : struct.acked.entrySet())
- {
- oprot.writeString(_iter172.getKey());
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, _iter172.getValue().size()));
- for (Map.Entry<GlobalStreamId, Long> _iter173 : _iter172.getValue().entrySet())
- {
- _iter173.getKey().write(oprot);
- oprot.writeI64(_iter173.getValue());
- }
- oprot.writeMapEnd();
- }
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.failed != null) {
- oprot.writeFieldBegin(FAILED_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.failed.size()));
- for (Map.Entry<String, Map<GlobalStreamId,Long>> _iter174 : struct.failed.entrySet())
- {
- oprot.writeString(_iter174.getKey());
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, _iter174.getValue().size()));
- for (Map.Entry<GlobalStreamId, Long> _iter175 : _iter174.getValue().entrySet())
- {
- _iter175.getKey().write(oprot);
- oprot.writeI64(_iter175.getValue());
- }
- oprot.writeMapEnd();
- }
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.process_ms_avg != null) {
- oprot.writeFieldBegin(PROCESS_MS_AVG_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.process_ms_avg.size()));
- for (Map.Entry<String, Map<GlobalStreamId,Double>> _iter176 : struct.process_ms_avg.entrySet())
- {
- oprot.writeString(_iter176.getKey());
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.DOUBLE, _iter176.getValue().size()));
- for (Map.Entry<GlobalStreamId, Double> _iter177 : _iter176.getValue().entrySet())
- {
- _iter177.getKey().write(oprot);
- oprot.writeDouble(_iter177.getValue());
- }
- oprot.writeMapEnd();
- }
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.executed != null) {
- oprot.writeFieldBegin(EXECUTED_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.executed.size()));
- for (Map.Entry<String, Map<GlobalStreamId,Long>> _iter178 : struct.executed.entrySet())
- {
- oprot.writeString(_iter178.getKey());
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, _iter178.getValue().size()));
- for (Map.Entry<GlobalStreamId, Long> _iter179 : _iter178.getValue().entrySet())
- {
- _iter179.getKey().write(oprot);
- oprot.writeI64(_iter179.getValue());
- }
- oprot.writeMapEnd();
- }
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.execute_ms_avg != null) {
- oprot.writeFieldBegin(EXECUTE_MS_AVG_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.execute_ms_avg.size()));
- for (Map.Entry<String, Map<GlobalStreamId,Double>> _iter180 : struct.execute_ms_avg.entrySet())
- {
- oprot.writeString(_iter180.getKey());
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.DOUBLE, _iter180.getValue().size()));
- for (Map.Entry<GlobalStreamId, Double> _iter181 : _iter180.getValue().entrySet())
- {
- _iter181.getKey().write(oprot);
- oprot.writeDouble(_iter181.getValue());
- }
- oprot.writeMapEnd();
- }
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class BoltStatsTupleSchemeFactory implements SchemeFactory {
- public BoltStatsTupleScheme getScheme() {
- return new BoltStatsTupleScheme();
- }
- }
-
- private static class BoltStatsTupleScheme extends TupleScheme<BoltStats> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, BoltStats struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.acked.size());
- for (Map.Entry<String, Map<GlobalStreamId,Long>> _iter182 : struct.acked.entrySet())
- {
- oprot.writeString(_iter182.getKey());
- {
- oprot.writeI32(_iter182.getValue().size());
- for (Map.Entry<GlobalStreamId, Long> _iter183 : _iter182.getValue().entrySet())
- {
- _iter183.getKey().write(oprot);
- oprot.writeI64(_iter183.getValue());
- }
- }
- }
- }
- {
- oprot.writeI32(struct.failed.size());
- for (Map.Entry<String, Map<GlobalStreamId,Long>> _iter184 : struct.failed.entrySet())
- {
- oprot.writeString(_iter184.getKey());
- {
- oprot.writeI32(_iter184.getValue().size());
- for (Map.Entry<GlobalStreamId, Long> _iter185 : _iter184.getValue().entrySet())
- {
- _iter185.getKey().write(oprot);
- oprot.writeI64(_iter185.getValue());
- }
- }
- }
- }
- {
- oprot.writeI32(struct.process_ms_avg.size());
- for (Map.Entry<String, Map<GlobalStreamId,Double>> _iter186 : struct.process_ms_avg.entrySet())
- {
- oprot.writeString(_iter186.getKey());
- {
- oprot.writeI32(_iter186.getValue().size());
- for (Map.Entry<GlobalStreamId, Double> _iter187 : _iter186.getValue().entrySet())
- {
- _iter187.getKey().write(oprot);
- oprot.writeDouble(_iter187.getValue());
- }
- }
- }
- }
- {
- oprot.writeI32(struct.executed.size());
- for (Map.Entry<String, Map<GlobalStreamId,Long>> _iter188 : struct.executed.entrySet())
- {
- oprot.writeString(_iter188.getKey());
- {
- oprot.writeI32(_iter188.getValue().size());
- for (Map.Entry<GlobalStreamId, Long> _iter189 : _iter188.getValue().entrySet())
- {
- _iter189.getKey().write(oprot);
- oprot.writeI64(_iter189.getValue());
- }
- }
- }
- }
- {
- oprot.writeI32(struct.execute_ms_avg.size());
- for (Map.Entry<String, Map<GlobalStreamId,Double>> _iter190 : struct.execute_ms_avg.entrySet())
- {
- oprot.writeString(_iter190.getKey());
- {
- oprot.writeI32(_iter190.getValue().size());
- for (Map.Entry<GlobalStreamId, Double> _iter191 : _iter190.getValue().entrySet())
- {
- _iter191.getKey().write(oprot);
- oprot.writeDouble(_iter191.getValue());
- }
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, BoltStats struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TMap _map192 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32());
- struct.acked = new HashMap<String,Map<GlobalStreamId,Long>>(2*_map192.size);
- String _key193;
- Map<GlobalStreamId,Long> _val194;
- for (int _i195 = 0; _i195 < _map192.size; ++_i195)
- {
- _key193 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map196 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- _val194 = new HashMap<GlobalStreamId,Long>(2*_map196.size);
- GlobalStreamId _key197;
- long _val198;
- for (int _i199 = 0; _i199 < _map196.size; ++_i199)
- {
- _key197 = new GlobalStreamId();
- _key197.read(iprot);
- _val198 = iprot.readI64();
- _val194.put(_key197, _val198);
- }
- }
- struct.acked.put(_key193, _val194);
- }
- }
- struct.set_acked_isSet(true);
- {
- org.apache.thrift.protocol.TMap _map200 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32());
- struct.failed = new HashMap<String,Map<GlobalStreamId,Long>>(2*_map200.size);
- String _key201;
- Map<GlobalStreamId,Long> _val202;
- for (int _i203 = 0; _i203 < _map200.size; ++_i203)
- {
- _key201 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map204 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- _val202 = new HashMap<GlobalStreamId,Long>(2*_map204.size);
- GlobalStreamId _key205;
- long _val206;
- for (int _i207 = 0; _i207 < _map204.size; ++_i207)
- {
- _key205 = new GlobalStreamId();
- _key205.read(iprot);
- _val206 = iprot.readI64();
- _val202.put(_key205, _val206);
- }
- }
- struct.failed.put(_key201, _val202);
- }
- }
- struct.set_failed_isSet(true);
- {
- org.apache.thrift.protocol.TMap _map208 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32());
- struct.process_ms_avg = new HashMap<String,Map<GlobalStreamId,Double>>(2*_map208.size);
- String _key209;
- Map<GlobalStreamId,Double> _val210;
- for (int _i211 = 0; _i211 < _map208.size; ++_i211)
- {
- _key209 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map212 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32());
- _val210 = new HashMap<GlobalStreamId,Double>(2*_map212.size);
- GlobalStreamId _key213;
- double _val214;
- for (int _i215 = 0; _i215 < _map212.size; ++_i215)
- {
- _key213 = new GlobalStreamId();
- _key213.read(iprot);
- _val214 = iprot.readDouble();
- _val210.put(_key213, _val214);
- }
- }
- struct.process_ms_avg.put(_key209, _val210);
- }
- }
- struct.set_process_ms_avg_isSet(true);
- {
- org.apache.thrift.protocol.TMap _map216 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32());
- struct.executed = new HashMap<String,Map<GlobalStreamId,Long>>(2*_map216.size);
- String _key217;
- Map<GlobalStreamId,Long> _val218;
- for (int _i219 = 0; _i219 < _map216.size; ++_i219)
- {
- _key217 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map220 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- _val218 = new HashMap<GlobalStreamId,Long>(2*_map220.size);
- GlobalStreamId _key221;
- long _val222;
- for (int _i223 = 0; _i223 < _map220.size; ++_i223)
- {
- _key221 = new GlobalStreamId();
- _key221.read(iprot);
- _val222 = iprot.readI64();
- _val218.put(_key221, _val222);
- }
- }
- struct.executed.put(_key217, _val218);
- }
- }
- struct.set_executed_isSet(true);
- {
- org.apache.thrift.protocol.TMap _map224 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32());
- struct.execute_ms_avg = new HashMap<String,Map<GlobalStreamId,Double>>(2*_map224.size);
- String _key225;
- Map<GlobalStreamId,Double> _val226;
- for (int _i227 = 0; _i227 < _map224.size; ++_i227)
- {
- _key225 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map228 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32());
- _val226 = new HashMap<GlobalStreamId,Double>(2*_map228.size);
- GlobalStreamId _key229;
- double _val230;
- for (int _i231 = 0; _i231 < _map228.size; ++_i231)
- {
- _key229 = new GlobalStreamId();
- _key229.read(iprot);
- _val230 = iprot.readDouble();
- _val226.put(_key229, _val230);
- }
- }
- struct.execute_ms_avg.put(_key225, _val226);
- }
- }
- struct.set_execute_ms_avg_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ClusterSummary.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ClusterSummary.java b/storm-core/src/jvm/backtype/storm/generated/ClusterSummary.java
deleted file mode 100644
index 8adc3f5..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ClusterSummary.java
+++ /dev/null
@@ -1,879 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ClusterSummary implements org.apache.thrift.TBase<ClusterSummary, ClusterSummary._Fields>, java.io.Serializable, Cloneable, Comparable<ClusterSummary> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ClusterSummary");
-
- private static final org.apache.thrift.protocol.TField SUPERVISORS_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisors", org.apache.thrift.protocol.TType.LIST, (short)1);
- private static final org.apache.thrift.protocol.TField NIMBUS_UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("nimbus_uptime_secs", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField TOPOLOGIES_FIELD_DESC = new org.apache.thrift.protocol.TField("topologies", org.apache.thrift.protocol.TType.LIST, (short)3);
- private static final org.apache.thrift.protocol.TField NIMBUSES_FIELD_DESC = new org.apache.thrift.protocol.TField("nimbuses", org.apache.thrift.protocol.TType.LIST, (short)4);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ClusterSummaryStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ClusterSummaryTupleSchemeFactory());
- }
-
- private List<SupervisorSummary> supervisors; // required
- private int nimbus_uptime_secs; // optional
- private List<TopologySummary> topologies; // required
- private List<NimbusSummary> nimbuses; // 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 {
- SUPERVISORS((short)1, "supervisors"),
- NIMBUS_UPTIME_SECS((short)2, "nimbus_uptime_secs"),
- TOPOLOGIES((short)3, "topologies"),
- NIMBUSES((short)4, "nimbuses");
-
- 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: // SUPERVISORS
- return SUPERVISORS;
- case 2: // NIMBUS_UPTIME_SECS
- return NIMBUS_UPTIME_SECS;
- case 3: // TOPOLOGIES
- return TOPOLOGIES;
- case 4: // NIMBUSES
- return NIMBUSES;
- 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 __NIMBUS_UPTIME_SECS_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.NIMBUS_UPTIME_SECS};
- 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.SUPERVISORS, new org.apache.thrift.meta_data.FieldMetaData("supervisors", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SupervisorSummary.class))));
- tmpMap.put(_Fields.NIMBUS_UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("nimbus_uptime_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.TOPOLOGIES, new org.apache.thrift.meta_data.FieldMetaData("topologies", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TopologySummary.class))));
- tmpMap.put(_Fields.NIMBUSES, new org.apache.thrift.meta_data.FieldMetaData("nimbuses", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NimbusSummary.class))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ClusterSummary.class, metaDataMap);
- }
-
- public ClusterSummary() {
- this.nimbus_uptime_secs = 0;
-
- }
-
- public ClusterSummary(
- List<SupervisorSummary> supervisors,
- List<TopologySummary> topologies,
- List<NimbusSummary> nimbuses)
- {
- this();
- this.supervisors = supervisors;
- this.topologies = topologies;
- this.nimbuses = nimbuses;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ClusterSummary(ClusterSummary other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_supervisors()) {
- List<SupervisorSummary> __this__supervisors = new ArrayList<SupervisorSummary>(other.supervisors.size());
- for (SupervisorSummary other_element : other.supervisors) {
- __this__supervisors.add(new SupervisorSummary(other_element));
- }
- this.supervisors = __this__supervisors;
- }
- this.nimbus_uptime_secs = other.nimbus_uptime_secs;
- if (other.is_set_topologies()) {
- List<TopologySummary> __this__topologies = new ArrayList<TopologySummary>(other.topologies.size());
- for (TopologySummary other_element : other.topologies) {
- __this__topologies.add(new TopologySummary(other_element));
- }
- this.topologies = __this__topologies;
- }
- if (other.is_set_nimbuses()) {
- List<NimbusSummary> __this__nimbuses = new ArrayList<NimbusSummary>(other.nimbuses.size());
- for (NimbusSummary other_element : other.nimbuses) {
- __this__nimbuses.add(new NimbusSummary(other_element));
- }
- this.nimbuses = __this__nimbuses;
- }
- }
-
- public ClusterSummary deepCopy() {
- return new ClusterSummary(this);
- }
-
- @Override
- public void clear() {
- this.supervisors = null;
- this.nimbus_uptime_secs = 0;
-
- this.topologies = null;
- this.nimbuses = null;
- }
-
- public int get_supervisors_size() {
- return (this.supervisors == null) ? 0 : this.supervisors.size();
- }
-
- public java.util.Iterator<SupervisorSummary> get_supervisors_iterator() {
- return (this.supervisors == null) ? null : this.supervisors.iterator();
- }
-
- public void add_to_supervisors(SupervisorSummary elem) {
- if (this.supervisors == null) {
- this.supervisors = new ArrayList<SupervisorSummary>();
- }
- this.supervisors.add(elem);
- }
-
- public List<SupervisorSummary> get_supervisors() {
- return this.supervisors;
- }
-
- public void set_supervisors(List<SupervisorSummary> supervisors) {
- this.supervisors = supervisors;
- }
-
- public void unset_supervisors() {
- this.supervisors = null;
- }
-
- /** Returns true if field supervisors is set (has been assigned a value) and false otherwise */
- public boolean is_set_supervisors() {
- return this.supervisors != null;
- }
-
- public void set_supervisors_isSet(boolean value) {
- if (!value) {
- this.supervisors = null;
- }
- }
-
- public int get_nimbus_uptime_secs() {
- return this.nimbus_uptime_secs;
- }
-
- public void set_nimbus_uptime_secs(int nimbus_uptime_secs) {
- this.nimbus_uptime_secs = nimbus_uptime_secs;
- set_nimbus_uptime_secs_isSet(true);
- }
-
- public void unset_nimbus_uptime_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NIMBUS_UPTIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field nimbus_uptime_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_nimbus_uptime_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __NIMBUS_UPTIME_SECS_ISSET_ID);
- }
-
- public void set_nimbus_uptime_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NIMBUS_UPTIME_SECS_ISSET_ID, value);
- }
-
- public int get_topologies_size() {
- return (this.topologies == null) ? 0 : this.topologies.size();
- }
-
- public java.util.Iterator<TopologySummary> get_topologies_iterator() {
- return (this.topologies == null) ? null : this.topologies.iterator();
- }
-
- public void add_to_topologies(TopologySummary elem) {
- if (this.topologies == null) {
- this.topologies = new ArrayList<TopologySummary>();
- }
- this.topologies.add(elem);
- }
-
- public List<TopologySummary> get_topologies() {
- return this.topologies;
- }
-
- public void set_topologies(List<TopologySummary> topologies) {
- this.topologies = topologies;
- }
-
- public void unset_topologies() {
- this.topologies = null;
- }
-
- /** Returns true if field topologies is set (has been assigned a value) and false otherwise */
- public boolean is_set_topologies() {
- return this.topologies != null;
- }
-
- public void set_topologies_isSet(boolean value) {
- if (!value) {
- this.topologies = null;
- }
- }
-
- public int get_nimbuses_size() {
- return (this.nimbuses == null) ? 0 : this.nimbuses.size();
- }
-
- public java.util.Iterator<NimbusSummary> get_nimbuses_iterator() {
- return (this.nimbuses == null) ? null : this.nimbuses.iterator();
- }
-
- public void add_to_nimbuses(NimbusSummary elem) {
- if (this.nimbuses == null) {
- this.nimbuses = new ArrayList<NimbusSummary>();
- }
- this.nimbuses.add(elem);
- }
-
- public List<NimbusSummary> get_nimbuses() {
- return this.nimbuses;
- }
-
- public void set_nimbuses(List<NimbusSummary> nimbuses) {
- this.nimbuses = nimbuses;
- }
-
- public void unset_nimbuses() {
- this.nimbuses = null;
- }
-
- /** Returns true if field nimbuses is set (has been assigned a value) and false otherwise */
- public boolean is_set_nimbuses() {
- return this.nimbuses != null;
- }
-
- public void set_nimbuses_isSet(boolean value) {
- if (!value) {
- this.nimbuses = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SUPERVISORS:
- if (value == null) {
- unset_supervisors();
- } else {
- set_supervisors((List<SupervisorSummary>)value);
- }
- break;
-
- case NIMBUS_UPTIME_SECS:
- if (value == null) {
- unset_nimbus_uptime_secs();
- } else {
- set_nimbus_uptime_secs((Integer)value);
- }
- break;
-
- case TOPOLOGIES:
- if (value == null) {
- unset_topologies();
- } else {
- set_topologies((List<TopologySummary>)value);
- }
- break;
-
- case NIMBUSES:
- if (value == null) {
- unset_nimbuses();
- } else {
- set_nimbuses((List<NimbusSummary>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SUPERVISORS:
- return get_supervisors();
-
- case NIMBUS_UPTIME_SECS:
- return get_nimbus_uptime_secs();
-
- case TOPOLOGIES:
- return get_topologies();
-
- case NIMBUSES:
- return get_nimbuses();
-
- }
- 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 SUPERVISORS:
- return is_set_supervisors();
- case NIMBUS_UPTIME_SECS:
- return is_set_nimbus_uptime_secs();
- case TOPOLOGIES:
- return is_set_topologies();
- case NIMBUSES:
- return is_set_nimbuses();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ClusterSummary)
- return this.equals((ClusterSummary)that);
- return false;
- }
-
- public boolean equals(ClusterSummary that) {
- if (that == null)
- return false;
-
- boolean this_present_supervisors = true && this.is_set_supervisors();
- boolean that_present_supervisors = true && that.is_set_supervisors();
- if (this_present_supervisors || that_present_supervisors) {
- if (!(this_present_supervisors && that_present_supervisors))
- return false;
- if (!this.supervisors.equals(that.supervisors))
- return false;
- }
-
- boolean this_present_nimbus_uptime_secs = true && this.is_set_nimbus_uptime_secs();
- boolean that_present_nimbus_uptime_secs = true && that.is_set_nimbus_uptime_secs();
- if (this_present_nimbus_uptime_secs || that_present_nimbus_uptime_secs) {
- if (!(this_present_nimbus_uptime_secs && that_present_nimbus_uptime_secs))
- return false;
- if (this.nimbus_uptime_secs != that.nimbus_uptime_secs)
- return false;
- }
-
- boolean this_present_topologies = true && this.is_set_topologies();
- boolean that_present_topologies = true && that.is_set_topologies();
- if (this_present_topologies || that_present_topologies) {
- if (!(this_present_topologies && that_present_topologies))
- return false;
- if (!this.topologies.equals(that.topologies))
- return false;
- }
-
- boolean this_present_nimbuses = true && this.is_set_nimbuses();
- boolean that_present_nimbuses = true && that.is_set_nimbuses();
- if (this_present_nimbuses || that_present_nimbuses) {
- if (!(this_present_nimbuses && that_present_nimbuses))
- return false;
- if (!this.nimbuses.equals(that.nimbuses))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_supervisors = true && (is_set_supervisors());
- list.add(present_supervisors);
- if (present_supervisors)
- list.add(supervisors);
-
- boolean present_nimbus_uptime_secs = true && (is_set_nimbus_uptime_secs());
- list.add(present_nimbus_uptime_secs);
- if (present_nimbus_uptime_secs)
- list.add(nimbus_uptime_secs);
-
- boolean present_topologies = true && (is_set_topologies());
- list.add(present_topologies);
- if (present_topologies)
- list.add(topologies);
-
- boolean present_nimbuses = true && (is_set_nimbuses());
- list.add(present_nimbuses);
- if (present_nimbuses)
- list.add(nimbuses);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ClusterSummary other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_supervisors()).compareTo(other.is_set_supervisors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_supervisors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supervisors, other.supervisors);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_nimbus_uptime_secs()).compareTo(other.is_set_nimbus_uptime_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_nimbus_uptime_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nimbus_uptime_secs, other.nimbus_uptime_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_topologies()).compareTo(other.is_set_topologies());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topologies()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topologies, other.topologies);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_nimbuses()).compareTo(other.is_set_nimbuses());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_nimbuses()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nimbuses, other.nimbuses);
- 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("ClusterSummary(");
- boolean first = true;
-
- sb.append("supervisors:");
- if (this.supervisors == null) {
- sb.append("null");
- } else {
- sb.append(this.supervisors);
- }
- first = false;
- if (is_set_nimbus_uptime_secs()) {
- if (!first) sb.append(", ");
- sb.append("nimbus_uptime_secs:");
- sb.append(this.nimbus_uptime_secs);
- first = false;
- }
- if (!first) sb.append(", ");
- sb.append("topologies:");
- if (this.topologies == null) {
- sb.append("null");
- } else {
- sb.append(this.topologies);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("nimbuses:");
- if (this.nimbuses == null) {
- sb.append("null");
- } else {
- sb.append(this.nimbuses);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_supervisors()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'supervisors' is unset! Struct:" + toString());
- }
-
- if (!is_set_topologies()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'topologies' is unset! Struct:" + toString());
- }
-
- if (!is_set_nimbuses()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'nimbuses' 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 ClusterSummaryStandardSchemeFactory implements SchemeFactory {
- public ClusterSummaryStandardScheme getScheme() {
- return new ClusterSummaryStandardScheme();
- }
- }
-
- private static class ClusterSummaryStandardScheme extends StandardScheme<ClusterSummary> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ClusterSummary 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: // SUPERVISORS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list108 = iprot.readListBegin();
- struct.supervisors = new ArrayList<SupervisorSummary>(_list108.size);
- SupervisorSummary _elem109;
- for (int _i110 = 0; _i110 < _list108.size; ++_i110)
- {
- _elem109 = new SupervisorSummary();
- _elem109.read(iprot);
- struct.supervisors.add(_elem109);
- }
- iprot.readListEnd();
- }
- struct.set_supervisors_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // NIMBUS_UPTIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.nimbus_uptime_secs = iprot.readI32();
- struct.set_nimbus_uptime_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // TOPOLOGIES
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list111 = iprot.readListBegin();
- struct.topologies = new ArrayList<TopologySummary>(_list111.size);
- TopologySummary _elem112;
- for (int _i113 = 0; _i113 < _list111.size; ++_i113)
- {
- _elem112 = new TopologySummary();
- _elem112.read(iprot);
- struct.topologies.add(_elem112);
- }
- iprot.readListEnd();
- }
- struct.set_topologies_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // NIMBUSES
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list114 = iprot.readListBegin();
- struct.nimbuses = new ArrayList<NimbusSummary>(_list114.size);
- NimbusSummary _elem115;
- for (int _i116 = 0; _i116 < _list114.size; ++_i116)
- {
- _elem115 = new NimbusSummary();
- _elem115.read(iprot);
- struct.nimbuses.add(_elem115);
- }
- iprot.readListEnd();
- }
- struct.set_nimbuses_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, ClusterSummary struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.supervisors != null) {
- oprot.writeFieldBegin(SUPERVISORS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.supervisors.size()));
- for (SupervisorSummary _iter117 : struct.supervisors)
- {
- _iter117.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.is_set_nimbus_uptime_secs()) {
- oprot.writeFieldBegin(NIMBUS_UPTIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.nimbus_uptime_secs);
- oprot.writeFieldEnd();
- }
- if (struct.topologies != null) {
- oprot.writeFieldBegin(TOPOLOGIES_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.topologies.size()));
- for (TopologySummary _iter118 : struct.topologies)
- {
- _iter118.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.nimbuses != null) {
- oprot.writeFieldBegin(NIMBUSES_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.nimbuses.size()));
- for (NimbusSummary _iter119 : struct.nimbuses)
- {
- _iter119.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ClusterSummaryTupleSchemeFactory implements SchemeFactory {
- public ClusterSummaryTupleScheme getScheme() {
- return new ClusterSummaryTupleScheme();
- }
- }
-
- private static class ClusterSummaryTupleScheme extends TupleScheme<ClusterSummary> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ClusterSummary struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.supervisors.size());
- for (SupervisorSummary _iter120 : struct.supervisors)
- {
- _iter120.write(oprot);
- }
- }
- {
- oprot.writeI32(struct.topologies.size());
- for (TopologySummary _iter121 : struct.topologies)
- {
- _iter121.write(oprot);
- }
- }
- {
- oprot.writeI32(struct.nimbuses.size());
- for (NimbusSummary _iter122 : struct.nimbuses)
- {
- _iter122.write(oprot);
- }
- }
- BitSet optionals = new BitSet();
- if (struct.is_set_nimbus_uptime_secs()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_nimbus_uptime_secs()) {
- oprot.writeI32(struct.nimbus_uptime_secs);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ClusterSummary struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TList _list123 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.supervisors = new ArrayList<SupervisorSummary>(_list123.size);
- SupervisorSummary _elem124;
- for (int _i125 = 0; _i125 < _list123.size; ++_i125)
- {
- _elem124 = new SupervisorSummary();
- _elem124.read(iprot);
- struct.supervisors.add(_elem124);
- }
- }
- struct.set_supervisors_isSet(true);
- {
- org.apache.thrift.protocol.TList _list126 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.topologies = new ArrayList<TopologySummary>(_list126.size);
- TopologySummary _elem127;
- for (int _i128 = 0; _i128 < _list126.size; ++_i128)
- {
- _elem127 = new TopologySummary();
- _elem127.read(iprot);
- struct.topologies.add(_elem127);
- }
- }
- struct.set_topologies_isSet(true);
- {
- org.apache.thrift.protocol.TList _list129 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.nimbuses = new ArrayList<NimbusSummary>(_list129.size);
- NimbusSummary _elem130;
- for (int _i131 = 0; _i131 < _list129.size; ++_i131)
- {
- _elem130 = new NimbusSummary();
- _elem130.read(iprot);
- struct.nimbuses.add(_elem130);
- }
- }
- struct.set_nimbuses_isSet(true);
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.nimbus_uptime_secs = iprot.readI32();
- struct.set_nimbus_uptime_secs_isSet(true);
- }
- }
- }
-
-}
-
[24/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ExecutorStats.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ExecutorStats.java b/storm-core/src/jvm/backtype/storm/generated/ExecutorStats.java
deleted file mode 100644
index bbb8e7a..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ExecutorStats.java
+++ /dev/null
@@ -1,915 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ExecutorStats implements org.apache.thrift.TBase<ExecutorStats, ExecutorStats._Fields>, java.io.Serializable, Cloneable, Comparable<ExecutorStats> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecutorStats");
-
- private static final org.apache.thrift.protocol.TField EMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("emitted", org.apache.thrift.protocol.TType.MAP, (short)1);
- private static final org.apache.thrift.protocol.TField TRANSFERRED_FIELD_DESC = new org.apache.thrift.protocol.TField("transferred", org.apache.thrift.protocol.TType.MAP, (short)2);
- private static final org.apache.thrift.protocol.TField SPECIFIC_FIELD_DESC = new org.apache.thrift.protocol.TField("specific", org.apache.thrift.protocol.TType.STRUCT, (short)3);
- private static final org.apache.thrift.protocol.TField RATE_FIELD_DESC = new org.apache.thrift.protocol.TField("rate", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ExecutorStatsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ExecutorStatsTupleSchemeFactory());
- }
-
- private Map<String,Map<String,Long>> emitted; // required
- private Map<String,Map<String,Long>> transferred; // required
- private ExecutorSpecificStats specific; // required
- private double rate; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- EMITTED((short)1, "emitted"),
- TRANSFERRED((short)2, "transferred"),
- SPECIFIC((short)3, "specific"),
- RATE((short)4, "rate");
-
- private static final Map<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: // EMITTED
- return EMITTED;
- case 2: // TRANSFERRED
- return TRANSFERRED;
- case 3: // SPECIFIC
- return SPECIFIC;
- case 4: // RATE
- return RATE;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an 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 __RATE_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- 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.EMITTED, new org.apache.thrift.meta_data.FieldMetaData("emitted", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.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.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))));
- tmpMap.put(_Fields.TRANSFERRED, new org.apache.thrift.meta_data.FieldMetaData("transferred", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.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.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))));
- tmpMap.put(_Fields.SPECIFIC, new org.apache.thrift.meta_data.FieldMetaData("specific", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ExecutorSpecificStats.class)));
- tmpMap.put(_Fields.RATE, new org.apache.thrift.meta_data.FieldMetaData("rate", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecutorStats.class, metaDataMap);
- }
-
- public ExecutorStats() {
- }
-
- public ExecutorStats(
- Map<String,Map<String,Long>> emitted,
- Map<String,Map<String,Long>> transferred,
- ExecutorSpecificStats specific,
- double rate)
- {
- this();
- this.emitted = emitted;
- this.transferred = transferred;
- this.specific = specific;
- this.rate = rate;
- set_rate_isSet(true);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ExecutorStats(ExecutorStats other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_emitted()) {
- Map<String,Map<String,Long>> __this__emitted = new HashMap<String,Map<String,Long>>(other.emitted.size());
- for (Map.Entry<String, Map<String,Long>> other_element : other.emitted.entrySet()) {
-
- String other_element_key = other_element.getKey();
- Map<String,Long> other_element_value = other_element.getValue();
-
- String __this__emitted_copy_key = other_element_key;
-
- Map<String,Long> __this__emitted_copy_value = new HashMap<String,Long>(other_element_value);
-
- __this__emitted.put(__this__emitted_copy_key, __this__emitted_copy_value);
- }
- this.emitted = __this__emitted;
- }
- if (other.is_set_transferred()) {
- Map<String,Map<String,Long>> __this__transferred = new HashMap<String,Map<String,Long>>(other.transferred.size());
- for (Map.Entry<String, Map<String,Long>> other_element : other.transferred.entrySet()) {
-
- String other_element_key = other_element.getKey();
- Map<String,Long> other_element_value = other_element.getValue();
-
- String __this__transferred_copy_key = other_element_key;
-
- Map<String,Long> __this__transferred_copy_value = new HashMap<String,Long>(other_element_value);
-
- __this__transferred.put(__this__transferred_copy_key, __this__transferred_copy_value);
- }
- this.transferred = __this__transferred;
- }
- if (other.is_set_specific()) {
- this.specific = new ExecutorSpecificStats(other.specific);
- }
- this.rate = other.rate;
- }
-
- public ExecutorStats deepCopy() {
- return new ExecutorStats(this);
- }
-
- @Override
- public void clear() {
- this.emitted = null;
- this.transferred = null;
- this.specific = null;
- set_rate_isSet(false);
- this.rate = 0.0;
- }
-
- public int get_emitted_size() {
- return (this.emitted == null) ? 0 : this.emitted.size();
- }
-
- public void put_to_emitted(String key, Map<String,Long> val) {
- if (this.emitted == null) {
- this.emitted = new HashMap<String,Map<String,Long>>();
- }
- this.emitted.put(key, val);
- }
-
- public Map<String,Map<String,Long>> get_emitted() {
- return this.emitted;
- }
-
- public void set_emitted(Map<String,Map<String,Long>> emitted) {
- this.emitted = emitted;
- }
-
- public void unset_emitted() {
- this.emitted = null;
- }
-
- /** Returns true if field emitted is set (has been assigned a value) and false otherwise */
- public boolean is_set_emitted() {
- return this.emitted != null;
- }
-
- public void set_emitted_isSet(boolean value) {
- if (!value) {
- this.emitted = null;
- }
- }
-
- public int get_transferred_size() {
- return (this.transferred == null) ? 0 : this.transferred.size();
- }
-
- public void put_to_transferred(String key, Map<String,Long> val) {
- if (this.transferred == null) {
- this.transferred = new HashMap<String,Map<String,Long>>();
- }
- this.transferred.put(key, val);
- }
-
- public Map<String,Map<String,Long>> get_transferred() {
- return this.transferred;
- }
-
- public void set_transferred(Map<String,Map<String,Long>> transferred) {
- this.transferred = transferred;
- }
-
- public void unset_transferred() {
- this.transferred = null;
- }
-
- /** Returns true if field transferred is set (has been assigned a value) and false otherwise */
- public boolean is_set_transferred() {
- return this.transferred != null;
- }
-
- public void set_transferred_isSet(boolean value) {
- if (!value) {
- this.transferred = null;
- }
- }
-
- public ExecutorSpecificStats get_specific() {
- return this.specific;
- }
-
- public void set_specific(ExecutorSpecificStats specific) {
- this.specific = specific;
- }
-
- public void unset_specific() {
- this.specific = null;
- }
-
- /** Returns true if field specific is set (has been assigned a value) and false otherwise */
- public boolean is_set_specific() {
- return this.specific != null;
- }
-
- public void set_specific_isSet(boolean value) {
- if (!value) {
- this.specific = null;
- }
- }
-
- public double get_rate() {
- return this.rate;
- }
-
- public void set_rate(double rate) {
- this.rate = rate;
- set_rate_isSet(true);
- }
-
- public void unset_rate() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RATE_ISSET_ID);
- }
-
- /** Returns true if field rate is set (has been assigned a value) and false otherwise */
- public boolean is_set_rate() {
- return EncodingUtils.testBit(__isset_bitfield, __RATE_ISSET_ID);
- }
-
- public void set_rate_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RATE_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case EMITTED:
- if (value == null) {
- unset_emitted();
- } else {
- set_emitted((Map<String,Map<String,Long>>)value);
- }
- break;
-
- case TRANSFERRED:
- if (value == null) {
- unset_transferred();
- } else {
- set_transferred((Map<String,Map<String,Long>>)value);
- }
- break;
-
- case SPECIFIC:
- if (value == null) {
- unset_specific();
- } else {
- set_specific((ExecutorSpecificStats)value);
- }
- break;
-
- case RATE:
- if (value == null) {
- unset_rate();
- } else {
- set_rate((Double)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case EMITTED:
- return get_emitted();
-
- case TRANSFERRED:
- return get_transferred();
-
- case SPECIFIC:
- return get_specific();
-
- case RATE:
- return get_rate();
-
- }
- 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 EMITTED:
- return is_set_emitted();
- case TRANSFERRED:
- return is_set_transferred();
- case SPECIFIC:
- return is_set_specific();
- case RATE:
- return is_set_rate();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ExecutorStats)
- return this.equals((ExecutorStats)that);
- return false;
- }
-
- public boolean equals(ExecutorStats that) {
- if (that == null)
- return false;
-
- boolean this_present_emitted = true && this.is_set_emitted();
- boolean that_present_emitted = true && that.is_set_emitted();
- if (this_present_emitted || that_present_emitted) {
- if (!(this_present_emitted && that_present_emitted))
- return false;
- if (!this.emitted.equals(that.emitted))
- return false;
- }
-
- boolean this_present_transferred = true && this.is_set_transferred();
- boolean that_present_transferred = true && that.is_set_transferred();
- if (this_present_transferred || that_present_transferred) {
- if (!(this_present_transferred && that_present_transferred))
- return false;
- if (!this.transferred.equals(that.transferred))
- return false;
- }
-
- boolean this_present_specific = true && this.is_set_specific();
- boolean that_present_specific = true && that.is_set_specific();
- if (this_present_specific || that_present_specific) {
- if (!(this_present_specific && that_present_specific))
- return false;
- if (!this.specific.equals(that.specific))
- return false;
- }
-
- boolean this_present_rate = true;
- boolean that_present_rate = true;
- if (this_present_rate || that_present_rate) {
- if (!(this_present_rate && that_present_rate))
- return false;
- if (this.rate != that.rate)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_emitted = true && (is_set_emitted());
- list.add(present_emitted);
- if (present_emitted)
- list.add(emitted);
-
- boolean present_transferred = true && (is_set_transferred());
- list.add(present_transferred);
- if (present_transferred)
- list.add(transferred);
-
- boolean present_specific = true && (is_set_specific());
- list.add(present_specific);
- if (present_specific)
- list.add(specific);
-
- boolean present_rate = true;
- list.add(present_rate);
- if (present_rate)
- list.add(rate);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ExecutorStats other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_emitted()).compareTo(other.is_set_emitted());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_emitted()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.emitted, other.emitted);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_transferred()).compareTo(other.is_set_transferred());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_transferred()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transferred, other.transferred);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_specific()).compareTo(other.is_set_specific());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_specific()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.specific, other.specific);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_rate()).compareTo(other.is_set_rate());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_rate()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rate, other.rate);
- 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("ExecutorStats(");
- boolean first = true;
-
- sb.append("emitted:");
- if (this.emitted == null) {
- sb.append("null");
- } else {
- sb.append(this.emitted);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("transferred:");
- if (this.transferred == null) {
- sb.append("null");
- } else {
- sb.append(this.transferred);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("specific:");
- if (this.specific == null) {
- sb.append("null");
- } else {
- sb.append(this.specific);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("rate:");
- sb.append(this.rate);
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_emitted()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'emitted' is unset! Struct:" + toString());
- }
-
- if (!is_set_transferred()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'transferred' is unset! Struct:" + toString());
- }
-
- if (!is_set_specific()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'specific' is unset! Struct:" + toString());
- }
-
- if (!is_set_rate()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'rate' 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 ExecutorStatsStandardSchemeFactory implements SchemeFactory {
- public ExecutorStatsStandardScheme getScheme() {
- return new ExecutorStatsStandardScheme();
- }
- }
-
- private static class ExecutorStatsStandardScheme extends StandardScheme<ExecutorStats> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ExecutorStats 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: // EMITTED
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map292 = iprot.readMapBegin();
- struct.emitted = new HashMap<String,Map<String,Long>>(2*_map292.size);
- String _key293;
- Map<String,Long> _val294;
- for (int _i295 = 0; _i295 < _map292.size; ++_i295)
- {
- _key293 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map296 = iprot.readMapBegin();
- _val294 = new HashMap<String,Long>(2*_map296.size);
- String _key297;
- long _val298;
- for (int _i299 = 0; _i299 < _map296.size; ++_i299)
- {
- _key297 = iprot.readString();
- _val298 = iprot.readI64();
- _val294.put(_key297, _val298);
- }
- iprot.readMapEnd();
- }
- struct.emitted.put(_key293, _val294);
- }
- iprot.readMapEnd();
- }
- struct.set_emitted_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // TRANSFERRED
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map300 = iprot.readMapBegin();
- struct.transferred = new HashMap<String,Map<String,Long>>(2*_map300.size);
- String _key301;
- Map<String,Long> _val302;
- for (int _i303 = 0; _i303 < _map300.size; ++_i303)
- {
- _key301 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map304 = iprot.readMapBegin();
- _val302 = new HashMap<String,Long>(2*_map304.size);
- String _key305;
- long _val306;
- for (int _i307 = 0; _i307 < _map304.size; ++_i307)
- {
- _key305 = iprot.readString();
- _val306 = iprot.readI64();
- _val302.put(_key305, _val306);
- }
- iprot.readMapEnd();
- }
- struct.transferred.put(_key301, _val302);
- }
- iprot.readMapEnd();
- }
- struct.set_transferred_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // SPECIFIC
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.specific = new ExecutorSpecificStats();
- struct.specific.read(iprot);
- struct.set_specific_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // RATE
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.rate = iprot.readDouble();
- struct.set_rate_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, ExecutorStats struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.emitted != null) {
- oprot.writeFieldBegin(EMITTED_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.emitted.size()));
- for (Map.Entry<String, Map<String,Long>> _iter308 : struct.emitted.entrySet())
- {
- oprot.writeString(_iter308.getKey());
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, _iter308.getValue().size()));
- for (Map.Entry<String, Long> _iter309 : _iter308.getValue().entrySet())
- {
- oprot.writeString(_iter309.getKey());
- oprot.writeI64(_iter309.getValue());
- }
- oprot.writeMapEnd();
- }
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.transferred != null) {
- oprot.writeFieldBegin(TRANSFERRED_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.transferred.size()));
- for (Map.Entry<String, Map<String,Long>> _iter310 : struct.transferred.entrySet())
- {
- oprot.writeString(_iter310.getKey());
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, _iter310.getValue().size()));
- for (Map.Entry<String, Long> _iter311 : _iter310.getValue().entrySet())
- {
- oprot.writeString(_iter311.getKey());
- oprot.writeI64(_iter311.getValue());
- }
- oprot.writeMapEnd();
- }
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.specific != null) {
- oprot.writeFieldBegin(SPECIFIC_FIELD_DESC);
- struct.specific.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(RATE_FIELD_DESC);
- oprot.writeDouble(struct.rate);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ExecutorStatsTupleSchemeFactory implements SchemeFactory {
- public ExecutorStatsTupleScheme getScheme() {
- return new ExecutorStatsTupleScheme();
- }
- }
-
- private static class ExecutorStatsTupleScheme extends TupleScheme<ExecutorStats> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ExecutorStats struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.emitted.size());
- for (Map.Entry<String, Map<String,Long>> _iter312 : struct.emitted.entrySet())
- {
- oprot.writeString(_iter312.getKey());
- {
- oprot.writeI32(_iter312.getValue().size());
- for (Map.Entry<String, Long> _iter313 : _iter312.getValue().entrySet())
- {
- oprot.writeString(_iter313.getKey());
- oprot.writeI64(_iter313.getValue());
- }
- }
- }
- }
- {
- oprot.writeI32(struct.transferred.size());
- for (Map.Entry<String, Map<String,Long>> _iter314 : struct.transferred.entrySet())
- {
- oprot.writeString(_iter314.getKey());
- {
- oprot.writeI32(_iter314.getValue().size());
- for (Map.Entry<String, Long> _iter315 : _iter314.getValue().entrySet())
- {
- oprot.writeString(_iter315.getKey());
- oprot.writeI64(_iter315.getValue());
- }
- }
- }
- }
- struct.specific.write(oprot);
- oprot.writeDouble(struct.rate);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ExecutorStats struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TMap _map316 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32());
- struct.emitted = new HashMap<String,Map<String,Long>>(2*_map316.size);
- String _key317;
- Map<String,Long> _val318;
- for (int _i319 = 0; _i319 < _map316.size; ++_i319)
- {
- _key317 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map320 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- _val318 = new HashMap<String,Long>(2*_map320.size);
- String _key321;
- long _val322;
- for (int _i323 = 0; _i323 < _map320.size; ++_i323)
- {
- _key321 = iprot.readString();
- _val322 = iprot.readI64();
- _val318.put(_key321, _val322);
- }
- }
- struct.emitted.put(_key317, _val318);
- }
- }
- struct.set_emitted_isSet(true);
- {
- org.apache.thrift.protocol.TMap _map324 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32());
- struct.transferred = new HashMap<String,Map<String,Long>>(2*_map324.size);
- String _key325;
- Map<String,Long> _val326;
- for (int _i327 = 0; _i327 < _map324.size; ++_i327)
- {
- _key325 = iprot.readString();
- {
- org.apache.thrift.protocol.TMap _map328 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- _val326 = new HashMap<String,Long>(2*_map328.size);
- String _key329;
- long _val330;
- for (int _i331 = 0; _i331 < _map328.size; ++_i331)
- {
- _key329 = iprot.readString();
- _val330 = iprot.readI64();
- _val326.put(_key329, _val330);
- }
- }
- struct.transferred.put(_key325, _val326);
- }
- }
- struct.set_transferred_isSet(true);
- struct.specific = new ExecutorSpecificStats();
- struct.specific.read(iprot);
- struct.set_specific_isSet(true);
- struct.rate = iprot.readDouble();
- struct.set_rate_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ExecutorSummary.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ExecutorSummary.java b/storm-core/src/jvm/backtype/storm/generated/ExecutorSummary.java
deleted file mode 100644
index ef8182e..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ExecutorSummary.java
+++ /dev/null
@@ -1,922 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ExecutorSummary implements org.apache.thrift.TBase<ExecutorSummary, ExecutorSummary._Fields>, java.io.Serializable, Cloneable, Comparable<ExecutorSummary> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecutorSummary");
-
- private static final org.apache.thrift.protocol.TField EXECUTOR_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("executor_info", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField COMPONENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("component_id", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)3);
- private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)4);
- private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)5);
- private static final org.apache.thrift.protocol.TField STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("stats", org.apache.thrift.protocol.TType.STRUCT, (short)7);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ExecutorSummaryStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ExecutorSummaryTupleSchemeFactory());
- }
-
- private ExecutorInfo executor_info; // required
- private String component_id; // required
- private String host; // required
- private int port; // required
- private int uptime_secs; // required
- private ExecutorStats stats; // 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 {
- EXECUTOR_INFO((short)1, "executor_info"),
- COMPONENT_ID((short)2, "component_id"),
- HOST((short)3, "host"),
- PORT((short)4, "port"),
- UPTIME_SECS((short)5, "uptime_secs"),
- STATS((short)7, "stats");
-
- 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: // EXECUTOR_INFO
- return EXECUTOR_INFO;
- case 2: // COMPONENT_ID
- return COMPONENT_ID;
- case 3: // HOST
- return HOST;
- case 4: // PORT
- return PORT;
- case 5: // UPTIME_SECS
- return UPTIME_SECS;
- case 7: // STATS
- return STATS;
- 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 __PORT_ISSET_ID = 0;
- private static final int __UPTIME_SECS_ISSET_ID = 1;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.STATS};
- 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.EXECUTOR_INFO, new org.apache.thrift.meta_data.FieldMetaData("executor_info", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ExecutorInfo.class)));
- tmpMap.put(_Fields.COMPONENT_ID, new org.apache.thrift.meta_data.FieldMetaData("component_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.STATS, new org.apache.thrift.meta_data.FieldMetaData("stats", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ExecutorStats.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecutorSummary.class, metaDataMap);
- }
-
- public ExecutorSummary() {
- }
-
- public ExecutorSummary(
- ExecutorInfo executor_info,
- String component_id,
- String host,
- int port,
- int uptime_secs)
- {
- this();
- this.executor_info = executor_info;
- this.component_id = component_id;
- this.host = host;
- this.port = port;
- set_port_isSet(true);
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ExecutorSummary(ExecutorSummary other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_executor_info()) {
- this.executor_info = new ExecutorInfo(other.executor_info);
- }
- if (other.is_set_component_id()) {
- this.component_id = other.component_id;
- }
- if (other.is_set_host()) {
- this.host = other.host;
- }
- this.port = other.port;
- this.uptime_secs = other.uptime_secs;
- if (other.is_set_stats()) {
- this.stats = new ExecutorStats(other.stats);
- }
- }
-
- public ExecutorSummary deepCopy() {
- return new ExecutorSummary(this);
- }
-
- @Override
- public void clear() {
- this.executor_info = null;
- this.component_id = null;
- this.host = null;
- set_port_isSet(false);
- this.port = 0;
- set_uptime_secs_isSet(false);
- this.uptime_secs = 0;
- this.stats = null;
- }
-
- public ExecutorInfo get_executor_info() {
- return this.executor_info;
- }
-
- public void set_executor_info(ExecutorInfo executor_info) {
- this.executor_info = executor_info;
- }
-
- public void unset_executor_info() {
- this.executor_info = null;
- }
-
- /** Returns true if field executor_info is set (has been assigned a value) and false otherwise */
- public boolean is_set_executor_info() {
- return this.executor_info != null;
- }
-
- public void set_executor_info_isSet(boolean value) {
- if (!value) {
- this.executor_info = null;
- }
- }
-
- public String get_component_id() {
- return this.component_id;
- }
-
- public void set_component_id(String component_id) {
- this.component_id = component_id;
- }
-
- public void unset_component_id() {
- this.component_id = null;
- }
-
- /** Returns true if field component_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_component_id() {
- return this.component_id != null;
- }
-
- public void set_component_id_isSet(boolean value) {
- if (!value) {
- this.component_id = null;
- }
- }
-
- public String get_host() {
- return this.host;
- }
-
- public void set_host(String host) {
- this.host = host;
- }
-
- public void unset_host() {
- this.host = null;
- }
-
- /** Returns true if field host is set (has been assigned a value) and false otherwise */
- public boolean is_set_host() {
- return this.host != null;
- }
-
- public void set_host_isSet(boolean value) {
- if (!value) {
- this.host = null;
- }
- }
-
- public int get_port() {
- return this.port;
- }
-
- public void set_port(int port) {
- this.port = port;
- set_port_isSet(true);
- }
-
- public void unset_port() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID);
- }
-
- /** Returns true if field port is set (has been assigned a value) and false otherwise */
- public boolean is_set_port() {
- return EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID);
- }
-
- public void set_port_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value);
- }
-
- public int get_uptime_secs() {
- return this.uptime_secs;
- }
-
- public void set_uptime_secs(int uptime_secs) {
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- }
-
- public void unset_uptime_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_uptime_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- public void set_uptime_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID, value);
- }
-
- public ExecutorStats get_stats() {
- return this.stats;
- }
-
- public void set_stats(ExecutorStats stats) {
- this.stats = stats;
- }
-
- public void unset_stats() {
- this.stats = null;
- }
-
- /** Returns true if field stats is set (has been assigned a value) and false otherwise */
- public boolean is_set_stats() {
- return this.stats != null;
- }
-
- public void set_stats_isSet(boolean value) {
- if (!value) {
- this.stats = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case EXECUTOR_INFO:
- if (value == null) {
- unset_executor_info();
- } else {
- set_executor_info((ExecutorInfo)value);
- }
- break;
-
- case COMPONENT_ID:
- if (value == null) {
- unset_component_id();
- } else {
- set_component_id((String)value);
- }
- break;
-
- case HOST:
- if (value == null) {
- unset_host();
- } else {
- set_host((String)value);
- }
- break;
-
- case PORT:
- if (value == null) {
- unset_port();
- } else {
- set_port((Integer)value);
- }
- break;
-
- case UPTIME_SECS:
- if (value == null) {
- unset_uptime_secs();
- } else {
- set_uptime_secs((Integer)value);
- }
- break;
-
- case STATS:
- if (value == null) {
- unset_stats();
- } else {
- set_stats((ExecutorStats)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case EXECUTOR_INFO:
- return get_executor_info();
-
- case COMPONENT_ID:
- return get_component_id();
-
- case HOST:
- return get_host();
-
- case PORT:
- return get_port();
-
- case UPTIME_SECS:
- return get_uptime_secs();
-
- case STATS:
- return get_stats();
-
- }
- 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 EXECUTOR_INFO:
- return is_set_executor_info();
- case COMPONENT_ID:
- return is_set_component_id();
- case HOST:
- return is_set_host();
- case PORT:
- return is_set_port();
- case UPTIME_SECS:
- return is_set_uptime_secs();
- case STATS:
- return is_set_stats();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ExecutorSummary)
- return this.equals((ExecutorSummary)that);
- return false;
- }
-
- public boolean equals(ExecutorSummary that) {
- if (that == null)
- return false;
-
- boolean this_present_executor_info = true && this.is_set_executor_info();
- boolean that_present_executor_info = true && that.is_set_executor_info();
- if (this_present_executor_info || that_present_executor_info) {
- if (!(this_present_executor_info && that_present_executor_info))
- return false;
- if (!this.executor_info.equals(that.executor_info))
- return false;
- }
-
- boolean this_present_component_id = true && this.is_set_component_id();
- boolean that_present_component_id = true && that.is_set_component_id();
- if (this_present_component_id || that_present_component_id) {
- if (!(this_present_component_id && that_present_component_id))
- return false;
- if (!this.component_id.equals(that.component_id))
- return false;
- }
-
- boolean this_present_host = true && this.is_set_host();
- boolean that_present_host = true && that.is_set_host();
- if (this_present_host || that_present_host) {
- if (!(this_present_host && that_present_host))
- return false;
- if (!this.host.equals(that.host))
- return false;
- }
-
- boolean this_present_port = true;
- boolean that_present_port = true;
- if (this_present_port || that_present_port) {
- if (!(this_present_port && that_present_port))
- return false;
- if (this.port != that.port)
- return false;
- }
-
- boolean this_present_uptime_secs = true;
- boolean that_present_uptime_secs = true;
- if (this_present_uptime_secs || that_present_uptime_secs) {
- if (!(this_present_uptime_secs && that_present_uptime_secs))
- return false;
- if (this.uptime_secs != that.uptime_secs)
- return false;
- }
-
- boolean this_present_stats = true && this.is_set_stats();
- boolean that_present_stats = true && that.is_set_stats();
- if (this_present_stats || that_present_stats) {
- if (!(this_present_stats && that_present_stats))
- return false;
- if (!this.stats.equals(that.stats))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_executor_info = true && (is_set_executor_info());
- list.add(present_executor_info);
- if (present_executor_info)
- list.add(executor_info);
-
- boolean present_component_id = true && (is_set_component_id());
- list.add(present_component_id);
- if (present_component_id)
- list.add(component_id);
-
- boolean present_host = true && (is_set_host());
- list.add(present_host);
- if (present_host)
- list.add(host);
-
- boolean present_port = true;
- list.add(present_port);
- if (present_port)
- list.add(port);
-
- boolean present_uptime_secs = true;
- list.add(present_uptime_secs);
- if (present_uptime_secs)
- list.add(uptime_secs);
-
- boolean present_stats = true && (is_set_stats());
- list.add(present_stats);
- if (present_stats)
- list.add(stats);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ExecutorSummary other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_executor_info()).compareTo(other.is_set_executor_info());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_executor_info()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executor_info, other.executor_info);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_component_id()).compareTo(other.is_set_component_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_component_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.component_id, other.component_id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_host()).compareTo(other.is_set_host());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_host()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, other.host);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_port()).compareTo(other.is_set_port());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_port()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(other.is_set_uptime_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_uptime_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, other.uptime_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_stats()).compareTo(other.is_set_stats());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_stats()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stats, other.stats);
- 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("ExecutorSummary(");
- boolean first = true;
-
- sb.append("executor_info:");
- if (this.executor_info == null) {
- sb.append("null");
- } else {
- sb.append(this.executor_info);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("component_id:");
- if (this.component_id == null) {
- sb.append("null");
- } else {
- sb.append(this.component_id);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("host:");
- if (this.host == null) {
- sb.append("null");
- } else {
- sb.append(this.host);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("port:");
- sb.append(this.port);
- first = false;
- if (!first) sb.append(", ");
- sb.append("uptime_secs:");
- sb.append(this.uptime_secs);
- first = false;
- if (is_set_stats()) {
- if (!first) sb.append(", ");
- sb.append("stats:");
- if (this.stats == null) {
- sb.append("null");
- } else {
- sb.append(this.stats);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_executor_info()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'executor_info' is unset! Struct:" + toString());
- }
-
- if (!is_set_component_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'component_id' is unset! Struct:" + toString());
- }
-
- if (!is_set_host()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'host' is unset! Struct:" + toString());
- }
-
- if (!is_set_port()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'port' is unset! Struct:" + toString());
- }
-
- if (!is_set_uptime_secs()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- if (executor_info != null) {
- executor_info.validate();
- }
- if (stats != null) {
- stats.validate();
- }
- }
-
- 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 ExecutorSummaryStandardSchemeFactory implements SchemeFactory {
- public ExecutorSummaryStandardScheme getScheme() {
- return new ExecutorSummaryStandardScheme();
- }
- }
-
- private static class ExecutorSummaryStandardScheme extends StandardScheme<ExecutorSummary> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ExecutorSummary 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: // EXECUTOR_INFO
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.executor_info = new ExecutorInfo();
- struct.executor_info.read(iprot);
- struct.set_executor_info_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // COMPONENT_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.component_id = iprot.readString();
- struct.set_component_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // HOST
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.host = iprot.readString();
- struct.set_host_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // PORT
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.port = iprot.readI32();
- struct.set_port_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // UPTIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // STATS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.stats = new ExecutorStats();
- struct.stats.read(iprot);
- struct.set_stats_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, ExecutorSummary struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.executor_info != null) {
- oprot.writeFieldBegin(EXECUTOR_INFO_FIELD_DESC);
- struct.executor_info.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.component_id != null) {
- oprot.writeFieldBegin(COMPONENT_ID_FIELD_DESC);
- oprot.writeString(struct.component_id);
- oprot.writeFieldEnd();
- }
- if (struct.host != null) {
- oprot.writeFieldBegin(HOST_FIELD_DESC);
- oprot.writeString(struct.host);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(PORT_FIELD_DESC);
- oprot.writeI32(struct.port);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.uptime_secs);
- oprot.writeFieldEnd();
- if (struct.stats != null) {
- if (struct.is_set_stats()) {
- oprot.writeFieldBegin(STATS_FIELD_DESC);
- struct.stats.write(oprot);
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ExecutorSummaryTupleSchemeFactory implements SchemeFactory {
- public ExecutorSummaryTupleScheme getScheme() {
- return new ExecutorSummaryTupleScheme();
- }
- }
-
- private static class ExecutorSummaryTupleScheme extends TupleScheme<ExecutorSummary> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ExecutorSummary struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- struct.executor_info.write(oprot);
- oprot.writeString(struct.component_id);
- oprot.writeString(struct.host);
- oprot.writeI32(struct.port);
- oprot.writeI32(struct.uptime_secs);
- BitSet optionals = new BitSet();
- if (struct.is_set_stats()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_stats()) {
- struct.stats.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ExecutorSummary struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.executor_info = new ExecutorInfo();
- struct.executor_info.read(iprot);
- struct.set_executor_info_isSet(true);
- struct.component_id = iprot.readString();
- struct.set_component_id_isSet(true);
- struct.host = iprot.readString();
- struct.set_host_isSet(true);
- struct.port = iprot.readI32();
- struct.set_port_isSet(true);
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.stats = new ExecutorStats();
- struct.stats.read(iprot);
- struct.set_stats_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/GetInfoOptions.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/GetInfoOptions.java b/storm-core/src/jvm/backtype/storm/generated/GetInfoOptions.java
deleted file mode 100644
index de91563..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/GetInfoOptions.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class GetInfoOptions implements org.apache.thrift.TBase<GetInfoOptions, GetInfoOptions._Fields>, java.io.Serializable, Cloneable, Comparable<GetInfoOptions> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfoOptions");
-
- private static final org.apache.thrift.protocol.TField NUM_ERR_CHOICE_FIELD_DESC = new org.apache.thrift.protocol.TField("num_err_choice", org.apache.thrift.protocol.TType.I32, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new GetInfoOptionsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new GetInfoOptionsTupleSchemeFactory());
- }
-
- private NumErrorsChoice num_err_choice; // 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 NumErrorsChoice
- */
- NUM_ERR_CHOICE((short)1, "num_err_choice");
-
- 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: // NUM_ERR_CHOICE
- return NUM_ERR_CHOICE;
- 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.NUM_ERR_CHOICE};
- 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.NUM_ERR_CHOICE, new org.apache.thrift.meta_data.FieldMetaData("num_err_choice", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, NumErrorsChoice.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfoOptions.class, metaDataMap);
- }
-
- public GetInfoOptions() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public GetInfoOptions(GetInfoOptions other) {
- if (other.is_set_num_err_choice()) {
- this.num_err_choice = other.num_err_choice;
- }
- }
-
- public GetInfoOptions deepCopy() {
- return new GetInfoOptions(this);
- }
-
- @Override
- public void clear() {
- this.num_err_choice = null;
- }
-
- /**
- *
- * @see NumErrorsChoice
- */
- public NumErrorsChoice get_num_err_choice() {
- return this.num_err_choice;
- }
-
- /**
- *
- * @see NumErrorsChoice
- */
- public void set_num_err_choice(NumErrorsChoice num_err_choice) {
- this.num_err_choice = num_err_choice;
- }
-
- public void unset_num_err_choice() {
- this.num_err_choice = null;
- }
-
- /** Returns true if field num_err_choice is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_err_choice() {
- return this.num_err_choice != null;
- }
-
- public void set_num_err_choice_isSet(boolean value) {
- if (!value) {
- this.num_err_choice = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case NUM_ERR_CHOICE:
- if (value == null) {
- unset_num_err_choice();
- } else {
- set_num_err_choice((NumErrorsChoice)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case NUM_ERR_CHOICE:
- return get_num_err_choice();
-
- }
- 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 NUM_ERR_CHOICE:
- return is_set_num_err_choice();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof GetInfoOptions)
- return this.equals((GetInfoOptions)that);
- return false;
- }
-
- public boolean equals(GetInfoOptions that) {
- if (that == null)
- return false;
-
- boolean this_present_num_err_choice = true && this.is_set_num_err_choice();
- boolean that_present_num_err_choice = true && that.is_set_num_err_choice();
- if (this_present_num_err_choice || that_present_num_err_choice) {
- if (!(this_present_num_err_choice && that_present_num_err_choice))
- return false;
- if (!this.num_err_choice.equals(that.num_err_choice))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_num_err_choice = true && (is_set_num_err_choice());
- list.add(present_num_err_choice);
- if (present_num_err_choice)
- list.add(num_err_choice.getValue());
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(GetInfoOptions other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_num_err_choice()).compareTo(other.is_set_num_err_choice());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_err_choice()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_err_choice, other.num_err_choice);
- 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("GetInfoOptions(");
- boolean first = true;
-
- if (is_set_num_err_choice()) {
- sb.append("num_err_choice:");
- if (this.num_err_choice == null) {
- sb.append("null");
- } else {
- sb.append(this.num_err_choice);
- }
- 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 {
- 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 GetInfoOptionsStandardSchemeFactory implements SchemeFactory {
- public GetInfoOptionsStandardScheme getScheme() {
- return new GetInfoOptionsStandardScheme();
- }
- }
-
- private static class GetInfoOptionsStandardScheme extends StandardScheme<GetInfoOptions> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfoOptions 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: // NUM_ERR_CHOICE
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_err_choice = org.apache.storm.generated.NumErrorsChoice.findByValue(iprot.readI32());
- struct.set_num_err_choice_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, GetInfoOptions struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.num_err_choice != null) {
- if (struct.is_set_num_err_choice()) {
- oprot.writeFieldBegin(NUM_ERR_CHOICE_FIELD_DESC);
- oprot.writeI32(struct.num_err_choice.getValue());
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class GetInfoOptionsTupleSchemeFactory implements SchemeFactory {
- public GetInfoOptionsTupleScheme getScheme() {
- return new GetInfoOptionsTupleScheme();
- }
- }
-
- private static class GetInfoOptionsTupleScheme extends TupleScheme<GetInfoOptions> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, GetInfoOptions struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_num_err_choice()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_num_err_choice()) {
- oprot.writeI32(struct.num_err_choice.getValue());
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, GetInfoOptions struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.num_err_choice = org.apache.storm.generated.NumErrorsChoice.findByValue(iprot.readI32());
- struct.set_num_err_choice_isSet(true);
- }
- }
- }
-
-}
-
[30/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ComponentAggregateStats.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ComponentAggregateStats.java b/storm-core/src/jvm/backtype/storm/generated/ComponentAggregateStats.java
deleted file mode 100644
index 2c68331..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ComponentAggregateStats.java
+++ /dev/null
@@ -1,752 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ComponentAggregateStats implements org.apache.thrift.TBase<ComponentAggregateStats, ComponentAggregateStats._Fields>, java.io.Serializable, Cloneable, Comparable<ComponentAggregateStats> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComponentAggregateStats");
-
- private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField COMMON_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("common_stats", org.apache.thrift.protocol.TType.STRUCT, (short)2);
- private static final org.apache.thrift.protocol.TField SPECIFIC_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("specific_stats", org.apache.thrift.protocol.TType.STRUCT, (short)3);
- private static final org.apache.thrift.protocol.TField LAST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("last_error", org.apache.thrift.protocol.TType.STRUCT, (short)4);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ComponentAggregateStatsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ComponentAggregateStatsTupleSchemeFactory());
- }
-
- private ComponentType type; // optional
- private CommonAggregateStats common_stats; // optional
- private SpecificAggregateStats specific_stats; // optional
- private ErrorInfo last_error; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- /**
- *
- * @see ComponentType
- */
- TYPE((short)1, "type"),
- COMMON_STATS((short)2, "common_stats"),
- SPECIFIC_STATS((short)3, "specific_stats"),
- LAST_ERROR((short)4, "last_error");
-
- private static final Map<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: // COMMON_STATS
- return COMMON_STATS;
- case 3: // SPECIFIC_STATS
- return SPECIFIC_STATS;
- case 4: // LAST_ERROR
- return LAST_ERROR;
- 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.TYPE,_Fields.COMMON_STATS,_Fields.SPECIFIC_STATS,_Fields.LAST_ERROR};
- 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.OPTIONAL,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ComponentType.class)));
- tmpMap.put(_Fields.COMMON_STATS, new org.apache.thrift.meta_data.FieldMetaData("common_stats", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CommonAggregateStats.class)));
- tmpMap.put(_Fields.SPECIFIC_STATS, new org.apache.thrift.meta_data.FieldMetaData("specific_stats", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SpecificAggregateStats.class)));
- tmpMap.put(_Fields.LAST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("last_error", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ErrorInfo.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ComponentAggregateStats.class, metaDataMap);
- }
-
- public ComponentAggregateStats() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ComponentAggregateStats(ComponentAggregateStats other) {
- if (other.is_set_type()) {
- this.type = other.type;
- }
- if (other.is_set_common_stats()) {
- this.common_stats = new CommonAggregateStats(other.common_stats);
- }
- if (other.is_set_specific_stats()) {
- this.specific_stats = new SpecificAggregateStats(other.specific_stats);
- }
- if (other.is_set_last_error()) {
- this.last_error = new ErrorInfo(other.last_error);
- }
- }
-
- public ComponentAggregateStats deepCopy() {
- return new ComponentAggregateStats(this);
- }
-
- @Override
- public void clear() {
- this.type = null;
- this.common_stats = null;
- this.specific_stats = null;
- this.last_error = null;
- }
-
- /**
- *
- * @see ComponentType
- */
- public ComponentType get_type() {
- return this.type;
- }
-
- /**
- *
- * @see ComponentType
- */
- public void set_type(ComponentType 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 CommonAggregateStats get_common_stats() {
- return this.common_stats;
- }
-
- public void set_common_stats(CommonAggregateStats common_stats) {
- this.common_stats = common_stats;
- }
-
- public void unset_common_stats() {
- this.common_stats = null;
- }
-
- /** Returns true if field common_stats is set (has been assigned a value) and false otherwise */
- public boolean is_set_common_stats() {
- return this.common_stats != null;
- }
-
- public void set_common_stats_isSet(boolean value) {
- if (!value) {
- this.common_stats = null;
- }
- }
-
- public SpecificAggregateStats get_specific_stats() {
- return this.specific_stats;
- }
-
- public void set_specific_stats(SpecificAggregateStats specific_stats) {
- this.specific_stats = specific_stats;
- }
-
- public void unset_specific_stats() {
- this.specific_stats = null;
- }
-
- /** Returns true if field specific_stats is set (has been assigned a value) and false otherwise */
- public boolean is_set_specific_stats() {
- return this.specific_stats != null;
- }
-
- public void set_specific_stats_isSet(boolean value) {
- if (!value) {
- this.specific_stats = null;
- }
- }
-
- public ErrorInfo get_last_error() {
- return this.last_error;
- }
-
- public void set_last_error(ErrorInfo last_error) {
- this.last_error = last_error;
- }
-
- public void unset_last_error() {
- this.last_error = null;
- }
-
- /** Returns true if field last_error is set (has been assigned a value) and false otherwise */
- public boolean is_set_last_error() {
- return this.last_error != null;
- }
-
- public void set_last_error_isSet(boolean value) {
- if (!value) {
- this.last_error = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TYPE:
- if (value == null) {
- unset_type();
- } else {
- set_type((ComponentType)value);
- }
- break;
-
- case COMMON_STATS:
- if (value == null) {
- unset_common_stats();
- } else {
- set_common_stats((CommonAggregateStats)value);
- }
- break;
-
- case SPECIFIC_STATS:
- if (value == null) {
- unset_specific_stats();
- } else {
- set_specific_stats((SpecificAggregateStats)value);
- }
- break;
-
- case LAST_ERROR:
- if (value == null) {
- unset_last_error();
- } else {
- set_last_error((ErrorInfo)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TYPE:
- return get_type();
-
- case COMMON_STATS:
- return get_common_stats();
-
- case SPECIFIC_STATS:
- return get_specific_stats();
-
- case LAST_ERROR:
- return get_last_error();
-
- }
- 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 COMMON_STATS:
- return is_set_common_stats();
- case SPECIFIC_STATS:
- return is_set_specific_stats();
- case LAST_ERROR:
- return is_set_last_error();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ComponentAggregateStats)
- return this.equals((ComponentAggregateStats)that);
- return false;
- }
-
- public boolean equals(ComponentAggregateStats 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_common_stats = true && this.is_set_common_stats();
- boolean that_present_common_stats = true && that.is_set_common_stats();
- if (this_present_common_stats || that_present_common_stats) {
- if (!(this_present_common_stats && that_present_common_stats))
- return false;
- if (!this.common_stats.equals(that.common_stats))
- return false;
- }
-
- boolean this_present_specific_stats = true && this.is_set_specific_stats();
- boolean that_present_specific_stats = true && that.is_set_specific_stats();
- if (this_present_specific_stats || that_present_specific_stats) {
- if (!(this_present_specific_stats && that_present_specific_stats))
- return false;
- if (!this.specific_stats.equals(that.specific_stats))
- return false;
- }
-
- boolean this_present_last_error = true && this.is_set_last_error();
- boolean that_present_last_error = true && that.is_set_last_error();
- if (this_present_last_error || that_present_last_error) {
- if (!(this_present_last_error && that_present_last_error))
- return false;
- if (!this.last_error.equals(that.last_error))
- 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_common_stats = true && (is_set_common_stats());
- list.add(present_common_stats);
- if (present_common_stats)
- list.add(common_stats);
-
- boolean present_specific_stats = true && (is_set_specific_stats());
- list.add(present_specific_stats);
- if (present_specific_stats)
- list.add(specific_stats);
-
- boolean present_last_error = true && (is_set_last_error());
- list.add(present_last_error);
- if (present_last_error)
- list.add(last_error);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ComponentAggregateStats 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_common_stats()).compareTo(other.is_set_common_stats());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_common_stats()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.common_stats, other.common_stats);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_specific_stats()).compareTo(other.is_set_specific_stats());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_specific_stats()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.specific_stats, other.specific_stats);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_last_error()).compareTo(other.is_set_last_error());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_last_error()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.last_error, other.last_error);
- 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("ComponentAggregateStats(");
- boolean first = true;
-
- if (is_set_type()) {
- sb.append("type:");
- if (this.type == null) {
- sb.append("null");
- } else {
- sb.append(this.type);
- }
- first = false;
- }
- if (is_set_common_stats()) {
- if (!first) sb.append(", ");
- sb.append("common_stats:");
- if (this.common_stats == null) {
- sb.append("null");
- } else {
- sb.append(this.common_stats);
- }
- first = false;
- }
- if (is_set_specific_stats()) {
- if (!first) sb.append(", ");
- sb.append("specific_stats:");
- if (this.specific_stats == null) {
- sb.append("null");
- } else {
- sb.append(this.specific_stats);
- }
- first = false;
- }
- if (is_set_last_error()) {
- if (!first) sb.append(", ");
- sb.append("last_error:");
- if (this.last_error == null) {
- sb.append("null");
- } else {
- sb.append(this.last_error);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- if (common_stats != null) {
- common_stats.validate();
- }
- if (last_error != null) {
- last_error.validate();
- }
- }
-
- 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 ComponentAggregateStatsStandardSchemeFactory implements SchemeFactory {
- public ComponentAggregateStatsStandardScheme getScheme() {
- return new ComponentAggregateStatsStandardScheme();
- }
- }
-
- private static class ComponentAggregateStatsStandardScheme extends StandardScheme<ComponentAggregateStats> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ComponentAggregateStats 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 = org.apache.storm.generated.ComponentType.findByValue(iprot.readI32());
- struct.set_type_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // COMMON_STATS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.common_stats = new CommonAggregateStats();
- struct.common_stats.read(iprot);
- struct.set_common_stats_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // SPECIFIC_STATS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.specific_stats = new SpecificAggregateStats();
- struct.specific_stats.read(iprot);
- struct.set_specific_stats_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // LAST_ERROR
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.last_error = new ErrorInfo();
- struct.last_error.read(iprot);
- struct.set_last_error_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, ComponentAggregateStats struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.type != null) {
- if (struct.is_set_type()) {
- oprot.writeFieldBegin(TYPE_FIELD_DESC);
- oprot.writeI32(struct.type.getValue());
- oprot.writeFieldEnd();
- }
- }
- if (struct.common_stats != null) {
- if (struct.is_set_common_stats()) {
- oprot.writeFieldBegin(COMMON_STATS_FIELD_DESC);
- struct.common_stats.write(oprot);
- oprot.writeFieldEnd();
- }
- }
- if (struct.specific_stats != null) {
- if (struct.is_set_specific_stats()) {
- oprot.writeFieldBegin(SPECIFIC_STATS_FIELD_DESC);
- struct.specific_stats.write(oprot);
- oprot.writeFieldEnd();
- }
- }
- if (struct.last_error != null) {
- if (struct.is_set_last_error()) {
- oprot.writeFieldBegin(LAST_ERROR_FIELD_DESC);
- struct.last_error.write(oprot);
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ComponentAggregateStatsTupleSchemeFactory implements SchemeFactory {
- public ComponentAggregateStatsTupleScheme getScheme() {
- return new ComponentAggregateStatsTupleScheme();
- }
- }
-
- private static class ComponentAggregateStatsTupleScheme extends TupleScheme<ComponentAggregateStats> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ComponentAggregateStats 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_common_stats()) {
- optionals.set(1);
- }
- if (struct.is_set_specific_stats()) {
- optionals.set(2);
- }
- if (struct.is_set_last_error()) {
- optionals.set(3);
- }
- oprot.writeBitSet(optionals, 4);
- if (struct.is_set_type()) {
- oprot.writeI32(struct.type.getValue());
- }
- if (struct.is_set_common_stats()) {
- struct.common_stats.write(oprot);
- }
- if (struct.is_set_specific_stats()) {
- struct.specific_stats.write(oprot);
- }
- if (struct.is_set_last_error()) {
- struct.last_error.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ComponentAggregateStats struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(4);
- if (incoming.get(0)) {
- struct.type = org.apache.storm.generated.ComponentType.findByValue(iprot.readI32());
- struct.set_type_isSet(true);
- }
- if (incoming.get(1)) {
- struct.common_stats = new CommonAggregateStats();
- struct.common_stats.read(iprot);
- struct.set_common_stats_isSet(true);
- }
- if (incoming.get(2)) {
- struct.specific_stats = new SpecificAggregateStats();
- struct.specific_stats.read(iprot);
- struct.set_specific_stats_isSet(true);
- }
- if (incoming.get(3)) {
- struct.last_error = new ErrorInfo();
- struct.last_error.read(iprot);
- struct.set_last_error_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ComponentCommon.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ComponentCommon.java b/storm-core/src/jvm/backtype/storm/generated/ComponentCommon.java
deleted file mode 100644
index 420ad60..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ComponentCommon.java
+++ /dev/null
@@ -1,852 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ComponentCommon implements org.apache.thrift.TBase<ComponentCommon, ComponentCommon._Fields>, java.io.Serializable, Cloneable, Comparable<ComponentCommon> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComponentCommon");
-
- private static final org.apache.thrift.protocol.TField INPUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("inputs", org.apache.thrift.protocol.TType.MAP, (short)1);
- private static final org.apache.thrift.protocol.TField STREAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("streams", org.apache.thrift.protocol.TType.MAP, (short)2);
- private static final org.apache.thrift.protocol.TField PARALLELISM_HINT_FIELD_DESC = new org.apache.thrift.protocol.TField("parallelism_hint", org.apache.thrift.protocol.TType.I32, (short)3);
- private static final org.apache.thrift.protocol.TField JSON_CONF_FIELD_DESC = new org.apache.thrift.protocol.TField("json_conf", org.apache.thrift.protocol.TType.STRING, (short)4);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ComponentCommonStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ComponentCommonTupleSchemeFactory());
- }
-
- private Map<GlobalStreamId,Grouping> inputs; // required
- private Map<String,StreamInfo> streams; // required
- private int parallelism_hint; // optional
- private String json_conf; // 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 {
- INPUTS((short)1, "inputs"),
- STREAMS((short)2, "streams"),
- PARALLELISM_HINT((short)3, "parallelism_hint"),
- JSON_CONF((short)4, "json_conf");
-
- 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: // INPUTS
- return INPUTS;
- case 2: // STREAMS
- return STREAMS;
- case 3: // PARALLELISM_HINT
- return PARALLELISM_HINT;
- case 4: // JSON_CONF
- return JSON_CONF;
- 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 __PARALLELISM_HINT_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.PARALLELISM_HINT,_Fields.JSON_CONF};
- 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.INPUTS, new org.apache.thrift.meta_data.FieldMetaData("inputs", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class),
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Grouping.class))));
- tmpMap.put(_Fields.STREAMS, new org.apache.thrift.meta_data.FieldMetaData("streams", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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, StreamInfo.class))));
- tmpMap.put(_Fields.PARALLELISM_HINT, new org.apache.thrift.meta_data.FieldMetaData("parallelism_hint", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.JSON_CONF, new org.apache.thrift.meta_data.FieldMetaData("json_conf", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ComponentCommon.class, metaDataMap);
- }
-
- public ComponentCommon() {
- }
-
- public ComponentCommon(
- Map<GlobalStreamId,Grouping> inputs,
- Map<String,StreamInfo> streams)
- {
- this();
- this.inputs = inputs;
- this.streams = streams;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ComponentCommon(ComponentCommon other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_inputs()) {
- Map<GlobalStreamId,Grouping> __this__inputs = new HashMap<GlobalStreamId,Grouping>(other.inputs.size());
- for (Map.Entry<GlobalStreamId, Grouping> other_element : other.inputs.entrySet()) {
-
- GlobalStreamId other_element_key = other_element.getKey();
- Grouping other_element_value = other_element.getValue();
-
- GlobalStreamId __this__inputs_copy_key = new GlobalStreamId(other_element_key);
-
- Grouping __this__inputs_copy_value = new Grouping(other_element_value);
-
- __this__inputs.put(__this__inputs_copy_key, __this__inputs_copy_value);
- }
- this.inputs = __this__inputs;
- }
- if (other.is_set_streams()) {
- Map<String,StreamInfo> __this__streams = new HashMap<String,StreamInfo>(other.streams.size());
- for (Map.Entry<String, StreamInfo> other_element : other.streams.entrySet()) {
-
- String other_element_key = other_element.getKey();
- StreamInfo other_element_value = other_element.getValue();
-
- String __this__streams_copy_key = other_element_key;
-
- StreamInfo __this__streams_copy_value = new StreamInfo(other_element_value);
-
- __this__streams.put(__this__streams_copy_key, __this__streams_copy_value);
- }
- this.streams = __this__streams;
- }
- this.parallelism_hint = other.parallelism_hint;
- if (other.is_set_json_conf()) {
- this.json_conf = other.json_conf;
- }
- }
-
- public ComponentCommon deepCopy() {
- return new ComponentCommon(this);
- }
-
- @Override
- public void clear() {
- this.inputs = null;
- this.streams = null;
- set_parallelism_hint_isSet(false);
- this.parallelism_hint = 0;
- this.json_conf = null;
- }
-
- public int get_inputs_size() {
- return (this.inputs == null) ? 0 : this.inputs.size();
- }
-
- public void put_to_inputs(GlobalStreamId key, Grouping val) {
- if (this.inputs == null) {
- this.inputs = new HashMap<GlobalStreamId,Grouping>();
- }
- this.inputs.put(key, val);
- }
-
- public Map<GlobalStreamId,Grouping> get_inputs() {
- return this.inputs;
- }
-
- public void set_inputs(Map<GlobalStreamId,Grouping> inputs) {
- this.inputs = inputs;
- }
-
- public void unset_inputs() {
- this.inputs = null;
- }
-
- /** Returns true if field inputs is set (has been assigned a value) and false otherwise */
- public boolean is_set_inputs() {
- return this.inputs != null;
- }
-
- public void set_inputs_isSet(boolean value) {
- if (!value) {
- this.inputs = null;
- }
- }
-
- public int get_streams_size() {
- return (this.streams == null) ? 0 : this.streams.size();
- }
-
- public void put_to_streams(String key, StreamInfo val) {
- if (this.streams == null) {
- this.streams = new HashMap<String,StreamInfo>();
- }
- this.streams.put(key, val);
- }
-
- public Map<String,StreamInfo> get_streams() {
- return this.streams;
- }
-
- public void set_streams(Map<String,StreamInfo> streams) {
- this.streams = streams;
- }
-
- public void unset_streams() {
- this.streams = null;
- }
-
- /** Returns true if field streams is set (has been assigned a value) and false otherwise */
- public boolean is_set_streams() {
- return this.streams != null;
- }
-
- public void set_streams_isSet(boolean value) {
- if (!value) {
- this.streams = null;
- }
- }
-
- public int get_parallelism_hint() {
- return this.parallelism_hint;
- }
-
- public void set_parallelism_hint(int parallelism_hint) {
- this.parallelism_hint = parallelism_hint;
- set_parallelism_hint_isSet(true);
- }
-
- public void unset_parallelism_hint() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PARALLELISM_HINT_ISSET_ID);
- }
-
- /** Returns true if field parallelism_hint is set (has been assigned a value) and false otherwise */
- public boolean is_set_parallelism_hint() {
- return EncodingUtils.testBit(__isset_bitfield, __PARALLELISM_HINT_ISSET_ID);
- }
-
- public void set_parallelism_hint_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PARALLELISM_HINT_ISSET_ID, value);
- }
-
- public String get_json_conf() {
- return this.json_conf;
- }
-
- public void set_json_conf(String json_conf) {
- this.json_conf = json_conf;
- }
-
- public void unset_json_conf() {
- this.json_conf = null;
- }
-
- /** Returns true if field json_conf is set (has been assigned a value) and false otherwise */
- public boolean is_set_json_conf() {
- return this.json_conf != null;
- }
-
- public void set_json_conf_isSet(boolean value) {
- if (!value) {
- this.json_conf = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case INPUTS:
- if (value == null) {
- unset_inputs();
- } else {
- set_inputs((Map<GlobalStreamId,Grouping>)value);
- }
- break;
-
- case STREAMS:
- if (value == null) {
- unset_streams();
- } else {
- set_streams((Map<String,StreamInfo>)value);
- }
- break;
-
- case PARALLELISM_HINT:
- if (value == null) {
- unset_parallelism_hint();
- } else {
- set_parallelism_hint((Integer)value);
- }
- break;
-
- case JSON_CONF:
- if (value == null) {
- unset_json_conf();
- } else {
- set_json_conf((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case INPUTS:
- return get_inputs();
-
- case STREAMS:
- return get_streams();
-
- case PARALLELISM_HINT:
- return get_parallelism_hint();
-
- case JSON_CONF:
- return get_json_conf();
-
- }
- 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 INPUTS:
- return is_set_inputs();
- case STREAMS:
- return is_set_streams();
- case PARALLELISM_HINT:
- return is_set_parallelism_hint();
- case JSON_CONF:
- return is_set_json_conf();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ComponentCommon)
- return this.equals((ComponentCommon)that);
- return false;
- }
-
- public boolean equals(ComponentCommon that) {
- if (that == null)
- return false;
-
- boolean this_present_inputs = true && this.is_set_inputs();
- boolean that_present_inputs = true && that.is_set_inputs();
- if (this_present_inputs || that_present_inputs) {
- if (!(this_present_inputs && that_present_inputs))
- return false;
- if (!this.inputs.equals(that.inputs))
- return false;
- }
-
- boolean this_present_streams = true && this.is_set_streams();
- boolean that_present_streams = true && that.is_set_streams();
- if (this_present_streams || that_present_streams) {
- if (!(this_present_streams && that_present_streams))
- return false;
- if (!this.streams.equals(that.streams))
- return false;
- }
-
- boolean this_present_parallelism_hint = true && this.is_set_parallelism_hint();
- boolean that_present_parallelism_hint = true && that.is_set_parallelism_hint();
- if (this_present_parallelism_hint || that_present_parallelism_hint) {
- if (!(this_present_parallelism_hint && that_present_parallelism_hint))
- return false;
- if (this.parallelism_hint != that.parallelism_hint)
- return false;
- }
-
- boolean this_present_json_conf = true && this.is_set_json_conf();
- boolean that_present_json_conf = true && that.is_set_json_conf();
- if (this_present_json_conf || that_present_json_conf) {
- if (!(this_present_json_conf && that_present_json_conf))
- return false;
- if (!this.json_conf.equals(that.json_conf))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_inputs = true && (is_set_inputs());
- list.add(present_inputs);
- if (present_inputs)
- list.add(inputs);
-
- boolean present_streams = true && (is_set_streams());
- list.add(present_streams);
- if (present_streams)
- list.add(streams);
-
- boolean present_parallelism_hint = true && (is_set_parallelism_hint());
- list.add(present_parallelism_hint);
- if (present_parallelism_hint)
- list.add(parallelism_hint);
-
- boolean present_json_conf = true && (is_set_json_conf());
- list.add(present_json_conf);
- if (present_json_conf)
- list.add(json_conf);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ComponentCommon other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_inputs()).compareTo(other.is_set_inputs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_inputs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inputs, other.inputs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_streams()).compareTo(other.is_set_streams());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_streams()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streams, other.streams);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_parallelism_hint()).compareTo(other.is_set_parallelism_hint());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_parallelism_hint()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parallelism_hint, other.parallelism_hint);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_json_conf()).compareTo(other.is_set_json_conf());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_json_conf()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.json_conf, other.json_conf);
- 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("ComponentCommon(");
- boolean first = true;
-
- sb.append("inputs:");
- if (this.inputs == null) {
- sb.append("null");
- } else {
- sb.append(this.inputs);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("streams:");
- if (this.streams == null) {
- sb.append("null");
- } else {
- sb.append(this.streams);
- }
- first = false;
- if (is_set_parallelism_hint()) {
- if (!first) sb.append(", ");
- sb.append("parallelism_hint:");
- sb.append(this.parallelism_hint);
- first = false;
- }
- if (is_set_json_conf()) {
- if (!first) sb.append(", ");
- sb.append("json_conf:");
- if (this.json_conf == null) {
- sb.append("null");
- } else {
- sb.append(this.json_conf);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_inputs()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'inputs' is unset! Struct:" + toString());
- }
-
- if (!is_set_streams()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'streams' 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 ComponentCommonStandardSchemeFactory implements SchemeFactory {
- public ComponentCommonStandardScheme getScheme() {
- return new ComponentCommonStandardScheme();
- }
- }
-
- private static class ComponentCommonStandardScheme extends StandardScheme<ComponentCommon> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ComponentCommon 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: // INPUTS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map24 = iprot.readMapBegin();
- struct.inputs = new HashMap<GlobalStreamId,Grouping>(2*_map24.size);
- GlobalStreamId _key25;
- Grouping _val26;
- for (int _i27 = 0; _i27 < _map24.size; ++_i27)
- {
- _key25 = new GlobalStreamId();
- _key25.read(iprot);
- _val26 = new Grouping();
- _val26.read(iprot);
- struct.inputs.put(_key25, _val26);
- }
- iprot.readMapEnd();
- }
- struct.set_inputs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // STREAMS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map28 = iprot.readMapBegin();
- struct.streams = new HashMap<String,StreamInfo>(2*_map28.size);
- String _key29;
- StreamInfo _val30;
- for (int _i31 = 0; _i31 < _map28.size; ++_i31)
- {
- _key29 = iprot.readString();
- _val30 = new StreamInfo();
- _val30.read(iprot);
- struct.streams.put(_key29, _val30);
- }
- iprot.readMapEnd();
- }
- struct.set_streams_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // PARALLELISM_HINT
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.parallelism_hint = iprot.readI32();
- struct.set_parallelism_hint_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // JSON_CONF
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.json_conf = iprot.readString();
- struct.set_json_conf_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, ComponentCommon struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.inputs != null) {
- oprot.writeFieldBegin(INPUTS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, struct.inputs.size()));
- for (Map.Entry<GlobalStreamId, Grouping> _iter32 : struct.inputs.entrySet())
- {
- _iter32.getKey().write(oprot);
- _iter32.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.streams != null) {
- oprot.writeFieldBegin(STREAMS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.streams.size()));
- for (Map.Entry<String, StreamInfo> _iter33 : struct.streams.entrySet())
- {
- oprot.writeString(_iter33.getKey());
- _iter33.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.is_set_parallelism_hint()) {
- oprot.writeFieldBegin(PARALLELISM_HINT_FIELD_DESC);
- oprot.writeI32(struct.parallelism_hint);
- oprot.writeFieldEnd();
- }
- if (struct.json_conf != null) {
- if (struct.is_set_json_conf()) {
- oprot.writeFieldBegin(JSON_CONF_FIELD_DESC);
- oprot.writeString(struct.json_conf);
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ComponentCommonTupleSchemeFactory implements SchemeFactory {
- public ComponentCommonTupleScheme getScheme() {
- return new ComponentCommonTupleScheme();
- }
- }
-
- private static class ComponentCommonTupleScheme extends TupleScheme<ComponentCommon> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ComponentCommon struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.inputs.size());
- for (Map.Entry<GlobalStreamId, Grouping> _iter34 : struct.inputs.entrySet())
- {
- _iter34.getKey().write(oprot);
- _iter34.getValue().write(oprot);
- }
- }
- {
- oprot.writeI32(struct.streams.size());
- for (Map.Entry<String, StreamInfo> _iter35 : struct.streams.entrySet())
- {
- oprot.writeString(_iter35.getKey());
- _iter35.getValue().write(oprot);
- }
- }
- BitSet optionals = new BitSet();
- if (struct.is_set_parallelism_hint()) {
- optionals.set(0);
- }
- if (struct.is_set_json_conf()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.is_set_parallelism_hint()) {
- oprot.writeI32(struct.parallelism_hint);
- }
- if (struct.is_set_json_conf()) {
- oprot.writeString(struct.json_conf);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ComponentCommon struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TMap _map36 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.inputs = new HashMap<GlobalStreamId,Grouping>(2*_map36.size);
- GlobalStreamId _key37;
- Grouping _val38;
- for (int _i39 = 0; _i39 < _map36.size; ++_i39)
- {
- _key37 = new GlobalStreamId();
- _key37.read(iprot);
- _val38 = new Grouping();
- _val38.read(iprot);
- struct.inputs.put(_key37, _val38);
- }
- }
- struct.set_inputs_isSet(true);
- {
- org.apache.thrift.protocol.TMap _map40 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.streams = new HashMap<String,StreamInfo>(2*_map40.size);
- String _key41;
- StreamInfo _val42;
- for (int _i43 = 0; _i43 < _map40.size; ++_i43)
- {
- _key41 = iprot.readString();
- _val42 = new StreamInfo();
- _val42.read(iprot);
- struct.streams.put(_key41, _val42);
- }
- }
- struct.set_streams_isSet(true);
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.parallelism_hint = iprot.readI32();
- struct.set_parallelism_hint_isSet(true);
- }
- if (incoming.get(1)) {
- struct.json_conf = iprot.readString();
- struct.set_json_conf_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ComponentObject.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ComponentObject.java b/storm-core/src/jvm/backtype/storm/generated/ComponentObject.java
deleted file mode 100644
index 94560a0..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ComponentObject.java
+++ /dev/null
@@ -1,462 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-public class ComponentObject extends org.apache.thrift.TUnion<ComponentObject, ComponentObject._Fields> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComponentObject");
- private static final org.apache.thrift.protocol.TField SERIALIZED_JAVA_FIELD_DESC = new org.apache.thrift.protocol.TField("serialized_java", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField SHELL_FIELD_DESC = new org.apache.thrift.protocol.TField("shell", org.apache.thrift.protocol.TType.STRUCT, (short)2);
- private static final org.apache.thrift.protocol.TField JAVA_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("java_object", org.apache.thrift.protocol.TType.STRUCT, (short)3);
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SERIALIZED_JAVA((short)1, "serialized_java"),
- SHELL((short)2, "shell"),
- JAVA_OBJECT((short)3, "java_object");
-
- 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: // SERIALIZED_JAVA
- return SERIALIZED_JAVA;
- case 2: // SHELL
- return SHELL;
- case 3: // JAVA_OBJECT
- return JAVA_OBJECT;
- 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;
- }
- }
-
- 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.SERIALIZED_JAVA, new org.apache.thrift.meta_data.FieldMetaData("serialized_java", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
- tmpMap.put(_Fields.SHELL, new org.apache.thrift.meta_data.FieldMetaData("shell", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ShellComponent.class)));
- tmpMap.put(_Fields.JAVA_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("java_object", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JavaObject.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ComponentObject.class, metaDataMap);
- }
-
- public ComponentObject() {
- super();
- }
-
- public ComponentObject(_Fields setField, Object value) {
- super(setField, value);
- }
-
- public ComponentObject(ComponentObject other) {
- super(other);
- }
- public ComponentObject deepCopy() {
- return new ComponentObject(this);
- }
-
- public static ComponentObject serialized_java(ByteBuffer value) {
- ComponentObject x = new ComponentObject();
- x.set_serialized_java(value);
- return x;
- }
-
- public static ComponentObject serialized_java(byte[] value) {
- ComponentObject x = new ComponentObject();
- x.set_serialized_java(ByteBuffer.wrap(Arrays.copyOf(value, value.length)));
- return x;
- }
-
- public static ComponentObject shell(ShellComponent value) {
- ComponentObject x = new ComponentObject();
- x.set_shell(value);
- return x;
- }
-
- public static ComponentObject java_object(JavaObject value) {
- ComponentObject x = new ComponentObject();
- x.set_java_object(value);
- return x;
- }
-
-
- @Override
- protected void checkType(_Fields setField, Object value) throws ClassCastException {
- switch (setField) {
- case SERIALIZED_JAVA:
- if (value instanceof ByteBuffer) {
- break;
- }
- throw new ClassCastException("Was expecting value of type ByteBuffer for field 'serialized_java', but got " + value.getClass().getSimpleName());
- case SHELL:
- if (value instanceof ShellComponent) {
- break;
- }
- throw new ClassCastException("Was expecting value of type ShellComponent for field 'shell', but got " + value.getClass().getSimpleName());
- case JAVA_OBJECT:
- if (value instanceof JavaObject) {
- break;
- }
- throw new ClassCastException("Was expecting value of type JavaObject for field 'java_object', but got " + value.getClass().getSimpleName());
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(field.id);
- if (setField != null) {
- switch (setField) {
- case SERIALIZED_JAVA:
- if (field.type == SERIALIZED_JAVA_FIELD_DESC.type) {
- ByteBuffer serialized_java;
- serialized_java = iprot.readBinary();
- return serialized_java;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case SHELL:
- if (field.type == SHELL_FIELD_DESC.type) {
- ShellComponent shell;
- shell = new ShellComponent();
- shell.read(iprot);
- return shell;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case JAVA_OBJECT:
- if (field.type == JAVA_OBJECT_FIELD_DESC.type) {
- JavaObject java_object;
- java_object = new JavaObject();
- java_object.read(iprot);
- return java_object;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- }
-
- @Override
- protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case SERIALIZED_JAVA:
- ByteBuffer serialized_java = (ByteBuffer)value_;
- oprot.writeBinary(serialized_java);
- return;
- case SHELL:
- ShellComponent shell = (ShellComponent)value_;
- shell.write(oprot);
- return;
- case JAVA_OBJECT:
- JavaObject java_object = (JavaObject)value_;
- java_object.write(oprot);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(fieldID);
- if (setField != null) {
- switch (setField) {
- case SERIALIZED_JAVA:
- ByteBuffer serialized_java;
- serialized_java = iprot.readBinary();
- return serialized_java;
- case SHELL:
- ShellComponent shell;
- shell = new ShellComponent();
- shell.read(iprot);
- return shell;
- case JAVA_OBJECT:
- JavaObject java_object;
- java_object = new JavaObject();
- java_object.read(iprot);
- return java_object;
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- throw new TProtocolException("Couldn't find a field with field id " + fieldID);
- }
- }
-
- @Override
- protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case SERIALIZED_JAVA:
- ByteBuffer serialized_java = (ByteBuffer)value_;
- oprot.writeBinary(serialized_java);
- return;
- case SHELL:
- ShellComponent shell = (ShellComponent)value_;
- shell.write(oprot);
- return;
- case JAVA_OBJECT:
- JavaObject java_object = (JavaObject)value_;
- java_object.write(oprot);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) {
- switch (setField) {
- case SERIALIZED_JAVA:
- return SERIALIZED_JAVA_FIELD_DESC;
- case SHELL:
- return SHELL_FIELD_DESC;
- case JAVA_OBJECT:
- return JAVA_OBJECT_FIELD_DESC;
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TStruct getStructDesc() {
- return STRUCT_DESC;
- }
-
- @Override
- protected _Fields enumForId(short id) {
- return _Fields.findByThriftIdOrThrow(id);
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
-
- public byte[] get_serialized_java() {
- set_serialized_java(org.apache.thrift.TBaseHelper.rightSize(buffer_for_serialized_java()));
- ByteBuffer b = buffer_for_serialized_java();
- return b == null ? null : b.array();
- }
-
- public ByteBuffer buffer_for_serialized_java() {
- if (getSetField() == _Fields.SERIALIZED_JAVA) {
- return org.apache.thrift.TBaseHelper.copyBinary((ByteBuffer)getFieldValue());
- } else {
- throw new RuntimeException("Cannot get field 'serialized_java' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_serialized_java(byte[] value) {
- set_serialized_java(ByteBuffer.wrap(Arrays.copyOf(value, value.length)));
- }
-
- public void set_serialized_java(ByteBuffer value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.SERIALIZED_JAVA;
- value_ = value;
- }
-
- public ShellComponent get_shell() {
- if (getSetField() == _Fields.SHELL) {
- return (ShellComponent)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'shell' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_shell(ShellComponent value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.SHELL;
- value_ = value;
- }
-
- public JavaObject get_java_object() {
- if (getSetField() == _Fields.JAVA_OBJECT) {
- return (JavaObject)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'java_object' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_java_object(JavaObject value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.JAVA_OBJECT;
- value_ = value;
- }
-
- public boolean is_set_serialized_java() {
- return setField_ == _Fields.SERIALIZED_JAVA;
- }
-
-
- public boolean is_set_shell() {
- return setField_ == _Fields.SHELL;
- }
-
-
- public boolean is_set_java_object() {
- return setField_ == _Fields.JAVA_OBJECT;
- }
-
-
- public boolean equals(Object other) {
- if (other instanceof ComponentObject) {
- return equals((ComponentObject)other);
- } else {
- return false;
- }
- }
-
- public boolean equals(ComponentObject other) {
- return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue());
- }
-
- @Override
- public int compareTo(ComponentObject other) {
- int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField());
- if (lastComparison == 0) {
- return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue());
- }
- return lastComparison;
- }
-
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
- list.add(this.getClass().getName());
- org.apache.thrift.TFieldIdEnum setField = getSetField();
- if (setField != null) {
- list.add(setField.getThriftFieldId());
- Object value = getFieldValue();
- if (value instanceof org.apache.thrift.TEnum) {
- list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
- } else {
- list.add(value);
- }
- }
- return list.hashCode();
- }
- 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);
- }
- }
-
-
-}
[59/59] [abbrv] storm git commit: add STORM-1546 to CHANGELOG
Posted by ka...@apache.org.
add STORM-1546 to CHANGELOG
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/cdcfaefd
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/cdcfaefd
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/cdcfaefd
Branch: refs/heads/1.x-branch
Commit: cdcfaefd9ef5756214809dca9c776bddcc7011e3
Parents: 8b0f897
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Wed Oct 12 08:50:21 2016 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Wed Oct 12 08:50:21 2016 +0900
----------------------------------------------------------------------
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/cdcfaefd/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c907b89..2149ff9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
## 1.1.0
+ * STORM-1546: Adding Read and Write Aggregations for Pacemaker to make it HA compatible
* STORM-1444: Support EXPLAIN statement in StormSQL
* STORM-2099: Introduce new sql external module: storm-sql-redis
* STORM-2097: Improve logging in trident core and examples
[27/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/DistributedRPC.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/DistributedRPC.java b/storm-core/src/jvm/backtype/storm/generated/DistributedRPC.java
deleted file mode 100644
index 6ef2559..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/DistributedRPC.java
+++ /dev/null
@@ -1,1328 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class DistributedRPC {
-
- public interface Iface {
-
- public String execute(String functionName, String funcArgs) throws DRPCExecutionException, AuthorizationException, org.apache.thrift.TException;
-
- }
-
- public interface AsyncIface {
-
- public void execute(String functionName, String funcArgs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- }
-
- public static class Client extends org.apache.thrift.TServiceClient implements Iface {
- public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
- public Factory() {}
- public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
- return new Client(prot);
- }
- public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
- return new Client(iprot, oprot);
- }
- }
-
- public Client(org.apache.thrift.protocol.TProtocol prot)
- {
- super(prot, prot);
- }
-
- public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
- super(iprot, oprot);
- }
-
- public String execute(String functionName, String funcArgs) throws DRPCExecutionException, AuthorizationException, org.apache.thrift.TException
- {
- send_execute(functionName, funcArgs);
- return recv_execute();
- }
-
- public void send_execute(String functionName, String funcArgs) throws org.apache.thrift.TException
- {
- execute_args args = new execute_args();
- args.set_functionName(functionName);
- args.set_funcArgs(funcArgs);
- sendBase("execute", args);
- }
-
- public String recv_execute() throws DRPCExecutionException, AuthorizationException, org.apache.thrift.TException
- {
- execute_result result = new execute_result();
- receiveBase(result, "execute");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "execute failed: unknown result");
- }
-
- }
- public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
- public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
- private org.apache.thrift.async.TAsyncClientManager clientManager;
- private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
- public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
- this.clientManager = clientManager;
- this.protocolFactory = protocolFactory;
- }
- public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
- return new AsyncClient(protocolFactory, clientManager, transport);
- }
- }
-
- public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
- super(protocolFactory, clientManager, transport);
- }
-
- public void execute(String functionName, String funcArgs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- execute_call method_call = new execute_call(functionName, funcArgs, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class execute_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String functionName;
- private String funcArgs;
- public execute_call(String functionName, String funcArgs, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.functionName = functionName;
- this.funcArgs = funcArgs;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("execute", org.apache.thrift.protocol.TMessageType.CALL, 0));
- execute_args args = new execute_args();
- args.set_functionName(functionName);
- args.set_funcArgs(funcArgs);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public String getResult() throws DRPCExecutionException, AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_execute();
- }
- }
-
- }
-
- public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
- private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
- public Processor(I iface) {
- super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
- }
-
- protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
- super(iface, getProcessMap(processMap));
- }
-
- private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
- processMap.put("execute", new execute());
- return processMap;
- }
-
- public static class execute<I extends Iface> extends org.apache.thrift.ProcessFunction<I, execute_args> {
- public execute() {
- super("execute");
- }
-
- public execute_args getEmptyArgsInstance() {
- return new execute_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public execute_result getResult(I iface, execute_args args) throws org.apache.thrift.TException {
- execute_result result = new execute_result();
- try {
- result.success = iface.execute(args.functionName, args.funcArgs);
- } catch (DRPCExecutionException e) {
- result.e = e;
- } catch (AuthorizationException aze) {
- result.aze = aze;
- }
- return result;
- }
- }
-
- }
-
- public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
- private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
- public AsyncProcessor(I iface) {
- super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
- }
-
- protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
- super(iface, getProcessMap(processMap));
- }
-
- private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
- processMap.put("execute", new execute());
- return processMap;
- }
-
- public static class execute<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, execute_args, String> {
- public execute() {
- super("execute");
- }
-
- public execute_args getEmptyArgsInstance() {
- return new execute_args();
- }
-
- public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<String>() {
- public void onComplete(String o) {
- execute_result result = new execute_result();
- result.success = o;
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- execute_result result = new execute_result();
- if (e instanceof DRPCExecutionException) {
- result.e = (DRPCExecutionException) e;
- result.set_e_isSet(true);
- msg = result;
- }
- else if (e instanceof AuthorizationException) {
- result.aze = (AuthorizationException) e;
- result.set_aze_isSet(true);
- msg = result;
- }
- else
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, execute_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
- iface.execute(args.functionName, args.funcArgs,resultHandler);
- }
- }
-
- }
-
- public static class execute_args implements org.apache.thrift.TBase<execute_args, execute_args._Fields>, java.io.Serializable, Cloneable, Comparable<execute_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("execute_args");
-
- private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("functionName", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField FUNC_ARGS_FIELD_DESC = new org.apache.thrift.protocol.TField("funcArgs", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new execute_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new execute_argsTupleSchemeFactory());
- }
-
- private String functionName; // required
- private String funcArgs; // 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 {
- FUNCTION_NAME((short)1, "functionName"),
- FUNC_ARGS((short)2, "funcArgs");
-
- 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: // FUNCTION_NAME
- return FUNCTION_NAME;
- case 2: // FUNC_ARGS
- return FUNC_ARGS;
- 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.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.FUNC_ARGS, new org.apache.thrift.meta_data.FieldMetaData("funcArgs", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execute_args.class, metaDataMap);
- }
-
- public execute_args() {
- }
-
- public execute_args(
- String functionName,
- String funcArgs)
- {
- this();
- this.functionName = functionName;
- this.funcArgs = funcArgs;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public execute_args(execute_args other) {
- if (other.is_set_functionName()) {
- this.functionName = other.functionName;
- }
- if (other.is_set_funcArgs()) {
- this.funcArgs = other.funcArgs;
- }
- }
-
- public execute_args deepCopy() {
- return new execute_args(this);
- }
-
- @Override
- public void clear() {
- this.functionName = null;
- this.funcArgs = null;
- }
-
- public String get_functionName() {
- return this.functionName;
- }
-
- public void set_functionName(String functionName) {
- this.functionName = functionName;
- }
-
- public void unset_functionName() {
- this.functionName = null;
- }
-
- /** Returns true if field functionName is set (has been assigned a value) and false otherwise */
- public boolean is_set_functionName() {
- return this.functionName != null;
- }
-
- public void set_functionName_isSet(boolean value) {
- if (!value) {
- this.functionName = null;
- }
- }
-
- public String get_funcArgs() {
- return this.funcArgs;
- }
-
- public void set_funcArgs(String funcArgs) {
- this.funcArgs = funcArgs;
- }
-
- public void unset_funcArgs() {
- this.funcArgs = null;
- }
-
- /** Returns true if field funcArgs is set (has been assigned a value) and false otherwise */
- public boolean is_set_funcArgs() {
- return this.funcArgs != null;
- }
-
- public void set_funcArgs_isSet(boolean value) {
- if (!value) {
- this.funcArgs = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case FUNCTION_NAME:
- if (value == null) {
- unset_functionName();
- } else {
- set_functionName((String)value);
- }
- break;
-
- case FUNC_ARGS:
- if (value == null) {
- unset_funcArgs();
- } else {
- set_funcArgs((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case FUNCTION_NAME:
- return get_functionName();
-
- case FUNC_ARGS:
- return get_funcArgs();
-
- }
- 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 FUNCTION_NAME:
- return is_set_functionName();
- case FUNC_ARGS:
- return is_set_funcArgs();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof execute_args)
- return this.equals((execute_args)that);
- return false;
- }
-
- public boolean equals(execute_args that) {
- if (that == null)
- return false;
-
- boolean this_present_functionName = true && this.is_set_functionName();
- boolean that_present_functionName = true && that.is_set_functionName();
- if (this_present_functionName || that_present_functionName) {
- if (!(this_present_functionName && that_present_functionName))
- return false;
- if (!this.functionName.equals(that.functionName))
- return false;
- }
-
- boolean this_present_funcArgs = true && this.is_set_funcArgs();
- boolean that_present_funcArgs = true && that.is_set_funcArgs();
- if (this_present_funcArgs || that_present_funcArgs) {
- if (!(this_present_funcArgs && that_present_funcArgs))
- return false;
- if (!this.funcArgs.equals(that.funcArgs))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_functionName = true && (is_set_functionName());
- list.add(present_functionName);
- if (present_functionName)
- list.add(functionName);
-
- boolean present_funcArgs = true && (is_set_funcArgs());
- list.add(present_funcArgs);
- if (present_funcArgs)
- list.add(funcArgs);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(execute_args other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_functionName()).compareTo(other.is_set_functionName());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_functionName()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.functionName, other.functionName);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_funcArgs()).compareTo(other.is_set_funcArgs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_funcArgs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.funcArgs, other.funcArgs);
- 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("execute_args(");
- boolean first = true;
-
- sb.append("functionName:");
- if (this.functionName == null) {
- sb.append("null");
- } else {
- sb.append(this.functionName);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("funcArgs:");
- if (this.funcArgs == null) {
- sb.append("null");
- } else {
- sb.append(this.funcArgs);
- }
- 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 {
- 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 execute_argsStandardSchemeFactory implements SchemeFactory {
- public execute_argsStandardScheme getScheme() {
- return new execute_argsStandardScheme();
- }
- }
-
- private static class execute_argsStandardScheme extends StandardScheme<execute_args> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, execute_args 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: // FUNCTION_NAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.functionName = iprot.readString();
- struct.set_functionName_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // FUNC_ARGS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.funcArgs = iprot.readString();
- struct.set_funcArgs_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, execute_args struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.functionName != null) {
- oprot.writeFieldBegin(FUNCTION_NAME_FIELD_DESC);
- oprot.writeString(struct.functionName);
- oprot.writeFieldEnd();
- }
- if (struct.funcArgs != null) {
- oprot.writeFieldBegin(FUNC_ARGS_FIELD_DESC);
- oprot.writeString(struct.funcArgs);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class execute_argsTupleSchemeFactory implements SchemeFactory {
- public execute_argsTupleScheme getScheme() {
- return new execute_argsTupleScheme();
- }
- }
-
- private static class execute_argsTupleScheme extends TupleScheme<execute_args> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, execute_args struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_functionName()) {
- optionals.set(0);
- }
- if (struct.is_set_funcArgs()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.is_set_functionName()) {
- oprot.writeString(struct.functionName);
- }
- if (struct.is_set_funcArgs()) {
- oprot.writeString(struct.funcArgs);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, execute_args struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.functionName = iprot.readString();
- struct.set_functionName_isSet(true);
- }
- if (incoming.get(1)) {
- struct.funcArgs = iprot.readString();
- struct.set_funcArgs_isSet(true);
- }
- }
- }
-
- }
-
- public static class execute_result implements org.apache.thrift.TBase<execute_result, execute_result._Fields>, java.io.Serializable, Cloneable, Comparable<execute_result> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("execute_result");
-
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
- private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField AZE_FIELD_DESC = new org.apache.thrift.protocol.TField("aze", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new execute_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new execute_resultTupleSchemeFactory());
- }
-
- private String success; // required
- private DRPCExecutionException e; // required
- private AuthorizationException aze; // 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 {
- SUCCESS((short)0, "success"),
- E((short)1, "e"),
- AZE((short)2, "aze");
-
- 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 0: // SUCCESS
- return SUCCESS;
- case 1: // E
- return E;
- case 2: // AZE
- return AZE;
- 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
- tmpMap.put(_Fields.AZE, new org.apache.thrift.meta_data.FieldMetaData("aze", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execute_result.class, metaDataMap);
- }
-
- public execute_result() {
- }
-
- public execute_result(
- String success,
- DRPCExecutionException e,
- AuthorizationException aze)
- {
- this();
- this.success = success;
- this.e = e;
- this.aze = aze;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public execute_result(execute_result other) {
- if (other.is_set_success()) {
- this.success = other.success;
- }
- if (other.is_set_e()) {
- this.e = new DRPCExecutionException(other.e);
- }
- if (other.is_set_aze()) {
- this.aze = new AuthorizationException(other.aze);
- }
- }
-
- public execute_result deepCopy() {
- return new execute_result(this);
- }
-
- @Override
- public void clear() {
- this.success = null;
- this.e = null;
- this.aze = null;
- }
-
- public String get_success() {
- return this.success;
- }
-
- public void set_success(String success) {
- this.success = success;
- }
-
- public void unset_success() {
- this.success = null;
- }
-
- /** Returns true if field success is set (has been assigned a value) and false otherwise */
- public boolean is_set_success() {
- return this.success != null;
- }
-
- public void set_success_isSet(boolean value) {
- if (!value) {
- this.success = null;
- }
- }
-
- public DRPCExecutionException get_e() {
- return this.e;
- }
-
- public void set_e(DRPCExecutionException e) {
- this.e = e;
- }
-
- public void unset_e() {
- this.e = null;
- }
-
- /** Returns true if field e is set (has been assigned a value) and false otherwise */
- public boolean is_set_e() {
- return this.e != null;
- }
-
- public void set_e_isSet(boolean value) {
- if (!value) {
- this.e = null;
- }
- }
-
- public AuthorizationException get_aze() {
- return this.aze;
- }
-
- public void set_aze(AuthorizationException aze) {
- this.aze = aze;
- }
-
- public void unset_aze() {
- this.aze = null;
- }
-
- /** Returns true if field aze is set (has been assigned a value) and false otherwise */
- public boolean is_set_aze() {
- return this.aze != null;
- }
-
- public void set_aze_isSet(boolean value) {
- if (!value) {
- this.aze = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SUCCESS:
- if (value == null) {
- unset_success();
- } else {
- set_success((String)value);
- }
- break;
-
- case E:
- if (value == null) {
- unset_e();
- } else {
- set_e((DRPCExecutionException)value);
- }
- break;
-
- case AZE:
- if (value == null) {
- unset_aze();
- } else {
- set_aze((AuthorizationException)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SUCCESS:
- return get_success();
-
- case E:
- return get_e();
-
- case AZE:
- return get_aze();
-
- }
- 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 SUCCESS:
- return is_set_success();
- case E:
- return is_set_e();
- case AZE:
- return is_set_aze();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof execute_result)
- return this.equals((execute_result)that);
- return false;
- }
-
- public boolean equals(execute_result that) {
- if (that == null)
- return false;
-
- boolean this_present_success = true && this.is_set_success();
- boolean that_present_success = true && that.is_set_success();
- if (this_present_success || that_present_success) {
- if (!(this_present_success && that_present_success))
- return false;
- if (!this.success.equals(that.success))
- return false;
- }
-
- boolean this_present_e = true && this.is_set_e();
- boolean that_present_e = true && that.is_set_e();
- if (this_present_e || that_present_e) {
- if (!(this_present_e && that_present_e))
- return false;
- if (!this.e.equals(that.e))
- return false;
- }
-
- boolean this_present_aze = true && this.is_set_aze();
- boolean that_present_aze = true && that.is_set_aze();
- if (this_present_aze || that_present_aze) {
- if (!(this_present_aze && that_present_aze))
- return false;
- if (!this.aze.equals(that.aze))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_success = true && (is_set_success());
- list.add(present_success);
- if (present_success)
- list.add(success);
-
- boolean present_e = true && (is_set_e());
- list.add(present_e);
- if (present_e)
- list.add(e);
-
- boolean present_aze = true && (is_set_aze());
- list.add(present_aze);
- if (present_aze)
- list.add(aze);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(execute_result other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_success()).compareTo(other.is_set_success());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_success()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_e()).compareTo(other.is_set_e());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_e()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_aze()).compareTo(other.is_set_aze());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_aze()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aze, other.aze);
- 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("execute_result(");
- boolean first = true;
-
- sb.append("success:");
- if (this.success == null) {
- sb.append("null");
- } else {
- sb.append(this.success);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("e:");
- if (this.e == null) {
- sb.append("null");
- } else {
- sb.append(this.e);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("aze:");
- if (this.aze == null) {
- sb.append("null");
- } else {
- sb.append(this.aze);
- }
- 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 {
- 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 execute_resultStandardSchemeFactory implements SchemeFactory {
- public execute_resultStandardScheme getScheme() {
- return new execute_resultStandardScheme();
- }
- }
-
- private static class execute_resultStandardScheme extends StandardScheme<execute_result> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, execute_result 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 0: // SUCCESS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.success = iprot.readString();
- struct.set_success_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 1: // E
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.e = new DRPCExecutionException();
- struct.e.read(iprot);
- struct.set_e_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // AZE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.aze = new AuthorizationException();
- struct.aze.read(iprot);
- struct.set_aze_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, execute_result struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.success != null) {
- oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
- oprot.writeString(struct.success);
- oprot.writeFieldEnd();
- }
- if (struct.e != null) {
- oprot.writeFieldBegin(E_FIELD_DESC);
- struct.e.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.aze != null) {
- oprot.writeFieldBegin(AZE_FIELD_DESC);
- struct.aze.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class execute_resultTupleSchemeFactory implements SchemeFactory {
- public execute_resultTupleScheme getScheme() {
- return new execute_resultTupleScheme();
- }
- }
-
- private static class execute_resultTupleScheme extends TupleScheme<execute_result> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, execute_result struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_success()) {
- optionals.set(0);
- }
- if (struct.is_set_e()) {
- optionals.set(1);
- }
- if (struct.is_set_aze()) {
- optionals.set(2);
- }
- oprot.writeBitSet(optionals, 3);
- if (struct.is_set_success()) {
- oprot.writeString(struct.success);
- }
- if (struct.is_set_e()) {
- struct.e.write(oprot);
- }
- if (struct.is_set_aze()) {
- struct.aze.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, execute_result struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(3);
- if (incoming.get(0)) {
- struct.success = iprot.readString();
- struct.set_success_isSet(true);
- }
- if (incoming.get(1)) {
- struct.e = new DRPCExecutionException();
- struct.e.read(iprot);
- struct.set_e_isSet(true);
- }
- if (incoming.get(2)) {
- struct.aze = new AuthorizationException();
- struct.aze.read(iprot);
- struct.set_aze_isSet(true);
- }
- }
- }
-
- }
-
-}
[34/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/AccessControl.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/AccessControl.java b/storm-core/src/jvm/backtype/storm/generated/AccessControl.java
deleted file mode 100644
index c1c072a..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.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class AccessControl implements org.apache.thrift.TBase<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 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 = org.apache.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 = org.apache.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/a6171bd6/storm-core/src/jvm/backtype/storm/generated/AccessControlType.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/AccessControlType.java b/storm-core/src/jvm/backtype/storm/generated/AccessControlType.java
deleted file mode 100644
index cb75b9b..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/AccessControlType.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum AccessControlType implements org.apache.thrift.TEnum {
- OTHER(1),
- USER(2);
-
- private final int value;
-
- private AccessControlType(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static AccessControlType findByValue(int value) {
- switch (value) {
- case 1:
- return OTHER;
- case 2:
- return USER;
- default:
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/AlreadyAliveException.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/AlreadyAliveException.java b/storm-core/src/jvm/backtype/storm/generated/AlreadyAliveException.java
deleted file mode 100644
index 4e635fb..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/AlreadyAliveException.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class AlreadyAliveException extends TException implements org.apache.thrift.TBase<AlreadyAliveException, AlreadyAliveException._Fields>, java.io.Serializable, Cloneable, Comparable<AlreadyAliveException> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AlreadyAliveException");
-
- 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 AlreadyAliveExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new AlreadyAliveExceptionTupleSchemeFactory());
- }
-
- 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(AlreadyAliveException.class, metaDataMap);
- }
-
- public AlreadyAliveException() {
- }
-
- public AlreadyAliveException(
- String msg)
- {
- this();
- this.msg = msg;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public AlreadyAliveException(AlreadyAliveException other) {
- if (other.is_set_msg()) {
- this.msg = other.msg;
- }
- }
-
- public AlreadyAliveException deepCopy() {
- return new AlreadyAliveException(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 AlreadyAliveException)
- return this.equals((AlreadyAliveException)that);
- return false;
- }
-
- public boolean equals(AlreadyAliveException 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(AlreadyAliveException 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("AlreadyAliveException(");
- 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 AlreadyAliveExceptionStandardSchemeFactory implements SchemeFactory {
- public AlreadyAliveExceptionStandardScheme getScheme() {
- return new AlreadyAliveExceptionStandardScheme();
- }
- }
-
- private static class AlreadyAliveExceptionStandardScheme extends StandardScheme<AlreadyAliveException> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, AlreadyAliveException 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, AlreadyAliveException 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 AlreadyAliveExceptionTupleSchemeFactory implements SchemeFactory {
- public AlreadyAliveExceptionTupleScheme getScheme() {
- return new AlreadyAliveExceptionTupleScheme();
- }
- }
-
- private static class AlreadyAliveExceptionTupleScheme extends TupleScheme<AlreadyAliveException> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, AlreadyAliveException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.msg);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, AlreadyAliveException 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/a6171bd6/storm-core/src/jvm/backtype/storm/generated/Assignment.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/Assignment.java b/storm-core/src/jvm/backtype/storm/generated/Assignment.java
deleted file mode 100644
index 4c973d5..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/Assignment.java
+++ /dev/null
@@ -1,1159 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class Assignment implements org.apache.thrift.TBase<Assignment, Assignment._Fields>, java.io.Serializable, Cloneable, Comparable<Assignment> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Assignment");
-
- private static final org.apache.thrift.protocol.TField MASTER_CODE_DIR_FIELD_DESC = new org.apache.thrift.protocol.TField("master_code_dir", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField NODE_HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("node_host", org.apache.thrift.protocol.TType.MAP, (short)2);
- private static final org.apache.thrift.protocol.TField EXECUTOR_NODE_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("executor_node_port", org.apache.thrift.protocol.TType.MAP, (short)3);
- private static final org.apache.thrift.protocol.TField EXECUTOR_START_TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("executor_start_time_secs", org.apache.thrift.protocol.TType.MAP, (short)4);
- private static final org.apache.thrift.protocol.TField WORKER_RESOURCES_FIELD_DESC = new org.apache.thrift.protocol.TField("worker_resources", org.apache.thrift.protocol.TType.MAP, (short)5);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new AssignmentStandardSchemeFactory());
- schemes.put(TupleScheme.class, new AssignmentTupleSchemeFactory());
- }
-
- private String master_code_dir; // required
- private Map<String,String> node_host; // optional
- private Map<List<Long>,NodeInfo> executor_node_port; // optional
- private Map<List<Long>,Long> executor_start_time_secs; // optional
- private Map<NodeInfo,WorkerResources> worker_resources; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- MASTER_CODE_DIR((short)1, "master_code_dir"),
- NODE_HOST((short)2, "node_host"),
- EXECUTOR_NODE_PORT((short)3, "executor_node_port"),
- EXECUTOR_START_TIME_SECS((short)4, "executor_start_time_secs"),
- WORKER_RESOURCES((short)5, "worker_resources");
-
- 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: // MASTER_CODE_DIR
- return MASTER_CODE_DIR;
- case 2: // NODE_HOST
- return NODE_HOST;
- case 3: // EXECUTOR_NODE_PORT
- return EXECUTOR_NODE_PORT;
- case 4: // EXECUTOR_START_TIME_SECS
- return EXECUTOR_START_TIME_SECS;
- case 5: // WORKER_RESOURCES
- return WORKER_RESOURCES;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't 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.NODE_HOST,_Fields.EXECUTOR_NODE_PORT,_Fields.EXECUTOR_START_TIME_SECS,_Fields.WORKER_RESOURCES};
- 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.MASTER_CODE_DIR, new org.apache.thrift.meta_data.FieldMetaData("master_code_dir", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.NODE_HOST, new org.apache.thrift.meta_data.FieldMetaData("node_host", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- tmpMap.put(_Fields.EXECUTOR_NODE_PORT, new org.apache.thrift.meta_data.FieldMetaData("executor_node_port", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)),
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NodeInfo.class))));
- tmpMap.put(_Fields.EXECUTOR_START_TIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("executor_start_time_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)),
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
- tmpMap.put(_Fields.WORKER_RESOURCES, new org.apache.thrift.meta_data.FieldMetaData("worker_resources", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NodeInfo.class),
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkerResources.class))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Assignment.class, metaDataMap);
- }
-
- public Assignment() {
- this.node_host = new HashMap<String,String>();
-
- this.executor_node_port = new HashMap<List<Long>,NodeInfo>();
-
- this.executor_start_time_secs = new HashMap<List<Long>,Long>();
-
- this.worker_resources = new HashMap<NodeInfo,WorkerResources>();
-
- }
-
- public Assignment(
- String master_code_dir)
- {
- this();
- this.master_code_dir = master_code_dir;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public Assignment(Assignment other) {
- if (other.is_set_master_code_dir()) {
- this.master_code_dir = other.master_code_dir;
- }
- if (other.is_set_node_host()) {
- Map<String,String> __this__node_host = new HashMap<String,String>(other.node_host);
- this.node_host = __this__node_host;
- }
- if (other.is_set_executor_node_port()) {
- Map<List<Long>,NodeInfo> __this__executor_node_port = new HashMap<List<Long>,NodeInfo>(other.executor_node_port.size());
- for (Map.Entry<List<Long>, NodeInfo> other_element : other.executor_node_port.entrySet()) {
-
- List<Long> other_element_key = other_element.getKey();
- NodeInfo other_element_value = other_element.getValue();
-
- List<Long> __this__executor_node_port_copy_key = new ArrayList<Long>(other_element_key);
-
- NodeInfo __this__executor_node_port_copy_value = new NodeInfo(other_element_value);
-
- __this__executor_node_port.put(__this__executor_node_port_copy_key, __this__executor_node_port_copy_value);
- }
- this.executor_node_port = __this__executor_node_port;
- }
- if (other.is_set_executor_start_time_secs()) {
- Map<List<Long>,Long> __this__executor_start_time_secs = new HashMap<List<Long>,Long>(other.executor_start_time_secs.size());
- for (Map.Entry<List<Long>, Long> other_element : other.executor_start_time_secs.entrySet()) {
-
- List<Long> other_element_key = other_element.getKey();
- Long other_element_value = other_element.getValue();
-
- List<Long> __this__executor_start_time_secs_copy_key = new ArrayList<Long>(other_element_key);
-
- Long __this__executor_start_time_secs_copy_value = other_element_value;
-
- __this__executor_start_time_secs.put(__this__executor_start_time_secs_copy_key, __this__executor_start_time_secs_copy_value);
- }
- this.executor_start_time_secs = __this__executor_start_time_secs;
- }
- if (other.is_set_worker_resources()) {
- Map<NodeInfo,WorkerResources> __this__worker_resources = new HashMap<NodeInfo,WorkerResources>(other.worker_resources.size());
- for (Map.Entry<NodeInfo, WorkerResources> other_element : other.worker_resources.entrySet()) {
-
- NodeInfo other_element_key = other_element.getKey();
- WorkerResources other_element_value = other_element.getValue();
-
- NodeInfo __this__worker_resources_copy_key = new NodeInfo(other_element_key);
-
- WorkerResources __this__worker_resources_copy_value = new WorkerResources(other_element_value);
-
- __this__worker_resources.put(__this__worker_resources_copy_key, __this__worker_resources_copy_value);
- }
- this.worker_resources = __this__worker_resources;
- }
- }
-
- public Assignment deepCopy() {
- return new Assignment(this);
- }
-
- @Override
- public void clear() {
- this.master_code_dir = null;
- this.node_host = new HashMap<String,String>();
-
- this.executor_node_port = new HashMap<List<Long>,NodeInfo>();
-
- this.executor_start_time_secs = new HashMap<List<Long>,Long>();
-
- this.worker_resources = new HashMap<NodeInfo,WorkerResources>();
-
- }
-
- public String get_master_code_dir() {
- return this.master_code_dir;
- }
-
- public void set_master_code_dir(String master_code_dir) {
- this.master_code_dir = master_code_dir;
- }
-
- public void unset_master_code_dir() {
- this.master_code_dir = null;
- }
-
- /** Returns true if field master_code_dir is set (has been assigned a value) and false otherwise */
- public boolean is_set_master_code_dir() {
- return this.master_code_dir != null;
- }
-
- public void set_master_code_dir_isSet(boolean value) {
- if (!value) {
- this.master_code_dir = null;
- }
- }
-
- public int get_node_host_size() {
- return (this.node_host == null) ? 0 : this.node_host.size();
- }
-
- public void put_to_node_host(String key, String val) {
- if (this.node_host == null) {
- this.node_host = new HashMap<String,String>();
- }
- this.node_host.put(key, val);
- }
-
- public Map<String,String> get_node_host() {
- return this.node_host;
- }
-
- public void set_node_host(Map<String,String> node_host) {
- this.node_host = node_host;
- }
-
- public void unset_node_host() {
- this.node_host = null;
- }
-
- /** Returns true if field node_host is set (has been assigned a value) and false otherwise */
- public boolean is_set_node_host() {
- return this.node_host != null;
- }
-
- public void set_node_host_isSet(boolean value) {
- if (!value) {
- this.node_host = null;
- }
- }
-
- public int get_executor_node_port_size() {
- return (this.executor_node_port == null) ? 0 : this.executor_node_port.size();
- }
-
- public void put_to_executor_node_port(List<Long> key, NodeInfo val) {
- if (this.executor_node_port == null) {
- this.executor_node_port = new HashMap<List<Long>,NodeInfo>();
- }
- this.executor_node_port.put(key, val);
- }
-
- public Map<List<Long>,NodeInfo> get_executor_node_port() {
- return this.executor_node_port;
- }
-
- public void set_executor_node_port(Map<List<Long>,NodeInfo> executor_node_port) {
- this.executor_node_port = executor_node_port;
- }
-
- public void unset_executor_node_port() {
- this.executor_node_port = null;
- }
-
- /** Returns true if field executor_node_port is set (has been assigned a value) and false otherwise */
- public boolean is_set_executor_node_port() {
- return this.executor_node_port != null;
- }
-
- public void set_executor_node_port_isSet(boolean value) {
- if (!value) {
- this.executor_node_port = null;
- }
- }
-
- public int get_executor_start_time_secs_size() {
- return (this.executor_start_time_secs == null) ? 0 : this.executor_start_time_secs.size();
- }
-
- public void put_to_executor_start_time_secs(List<Long> key, long val) {
- if (this.executor_start_time_secs == null) {
- this.executor_start_time_secs = new HashMap<List<Long>,Long>();
- }
- this.executor_start_time_secs.put(key, val);
- }
-
- public Map<List<Long>,Long> get_executor_start_time_secs() {
- return this.executor_start_time_secs;
- }
-
- public void set_executor_start_time_secs(Map<List<Long>,Long> executor_start_time_secs) {
- this.executor_start_time_secs = executor_start_time_secs;
- }
-
- public void unset_executor_start_time_secs() {
- this.executor_start_time_secs = null;
- }
-
- /** Returns true if field executor_start_time_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_executor_start_time_secs() {
- return this.executor_start_time_secs != null;
- }
-
- public void set_executor_start_time_secs_isSet(boolean value) {
- if (!value) {
- this.executor_start_time_secs = null;
- }
- }
-
- public int get_worker_resources_size() {
- return (this.worker_resources == null) ? 0 : this.worker_resources.size();
- }
-
- public void put_to_worker_resources(NodeInfo key, WorkerResources val) {
- if (this.worker_resources == null) {
- this.worker_resources = new HashMap<NodeInfo,WorkerResources>();
- }
- this.worker_resources.put(key, val);
- }
-
- public Map<NodeInfo,WorkerResources> get_worker_resources() {
- return this.worker_resources;
- }
-
- public void set_worker_resources(Map<NodeInfo,WorkerResources> worker_resources) {
- this.worker_resources = worker_resources;
- }
-
- public void unset_worker_resources() {
- this.worker_resources = null;
- }
-
- /** Returns true if field worker_resources is set (has been assigned a value) and false otherwise */
- public boolean is_set_worker_resources() {
- return this.worker_resources != null;
- }
-
- public void set_worker_resources_isSet(boolean value) {
- if (!value) {
- this.worker_resources = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case MASTER_CODE_DIR:
- if (value == null) {
- unset_master_code_dir();
- } else {
- set_master_code_dir((String)value);
- }
- break;
-
- case NODE_HOST:
- if (value == null) {
- unset_node_host();
- } else {
- set_node_host((Map<String,String>)value);
- }
- break;
-
- case EXECUTOR_NODE_PORT:
- if (value == null) {
- unset_executor_node_port();
- } else {
- set_executor_node_port((Map<List<Long>,NodeInfo>)value);
- }
- break;
-
- case EXECUTOR_START_TIME_SECS:
- if (value == null) {
- unset_executor_start_time_secs();
- } else {
- set_executor_start_time_secs((Map<List<Long>,Long>)value);
- }
- break;
-
- case WORKER_RESOURCES:
- if (value == null) {
- unset_worker_resources();
- } else {
- set_worker_resources((Map<NodeInfo,WorkerResources>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case MASTER_CODE_DIR:
- return get_master_code_dir();
-
- case NODE_HOST:
- return get_node_host();
-
- case EXECUTOR_NODE_PORT:
- return get_executor_node_port();
-
- case EXECUTOR_START_TIME_SECS:
- return get_executor_start_time_secs();
-
- case WORKER_RESOURCES:
- return get_worker_resources();
-
- }
- 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 MASTER_CODE_DIR:
- return is_set_master_code_dir();
- case NODE_HOST:
- return is_set_node_host();
- case EXECUTOR_NODE_PORT:
- return is_set_executor_node_port();
- case EXECUTOR_START_TIME_SECS:
- return is_set_executor_start_time_secs();
- case WORKER_RESOURCES:
- return is_set_worker_resources();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof Assignment)
- return this.equals((Assignment)that);
- return false;
- }
-
- public boolean equals(Assignment that) {
- if (that == null)
- return false;
-
- boolean this_present_master_code_dir = true && this.is_set_master_code_dir();
- boolean that_present_master_code_dir = true && that.is_set_master_code_dir();
- if (this_present_master_code_dir || that_present_master_code_dir) {
- if (!(this_present_master_code_dir && that_present_master_code_dir))
- return false;
- if (!this.master_code_dir.equals(that.master_code_dir))
- return false;
- }
-
- boolean this_present_node_host = true && this.is_set_node_host();
- boolean that_present_node_host = true && that.is_set_node_host();
- if (this_present_node_host || that_present_node_host) {
- if (!(this_present_node_host && that_present_node_host))
- return false;
- if (!this.node_host.equals(that.node_host))
- return false;
- }
-
- boolean this_present_executor_node_port = true && this.is_set_executor_node_port();
- boolean that_present_executor_node_port = true && that.is_set_executor_node_port();
- if (this_present_executor_node_port || that_present_executor_node_port) {
- if (!(this_present_executor_node_port && that_present_executor_node_port))
- return false;
- if (!this.executor_node_port.equals(that.executor_node_port))
- return false;
- }
-
- boolean this_present_executor_start_time_secs = true && this.is_set_executor_start_time_secs();
- boolean that_present_executor_start_time_secs = true && that.is_set_executor_start_time_secs();
- if (this_present_executor_start_time_secs || that_present_executor_start_time_secs) {
- if (!(this_present_executor_start_time_secs && that_present_executor_start_time_secs))
- return false;
- if (!this.executor_start_time_secs.equals(that.executor_start_time_secs))
- return false;
- }
-
- boolean this_present_worker_resources = true && this.is_set_worker_resources();
- boolean that_present_worker_resources = true && that.is_set_worker_resources();
- if (this_present_worker_resources || that_present_worker_resources) {
- if (!(this_present_worker_resources && that_present_worker_resources))
- return false;
- if (!this.worker_resources.equals(that.worker_resources))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_master_code_dir = true && (is_set_master_code_dir());
- list.add(present_master_code_dir);
- if (present_master_code_dir)
- list.add(master_code_dir);
-
- boolean present_node_host = true && (is_set_node_host());
- list.add(present_node_host);
- if (present_node_host)
- list.add(node_host);
-
- boolean present_executor_node_port = true && (is_set_executor_node_port());
- list.add(present_executor_node_port);
- if (present_executor_node_port)
- list.add(executor_node_port);
-
- boolean present_executor_start_time_secs = true && (is_set_executor_start_time_secs());
- list.add(present_executor_start_time_secs);
- if (present_executor_start_time_secs)
- list.add(executor_start_time_secs);
-
- boolean present_worker_resources = true && (is_set_worker_resources());
- list.add(present_worker_resources);
- if (present_worker_resources)
- list.add(worker_resources);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(Assignment other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_master_code_dir()).compareTo(other.is_set_master_code_dir());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_master_code_dir()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.master_code_dir, other.master_code_dir);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_node_host()).compareTo(other.is_set_node_host());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_node_host()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.node_host, other.node_host);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_executor_node_port()).compareTo(other.is_set_executor_node_port());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_executor_node_port()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executor_node_port, other.executor_node_port);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_executor_start_time_secs()).compareTo(other.is_set_executor_start_time_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_executor_start_time_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executor_start_time_secs, other.executor_start_time_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_worker_resources()).compareTo(other.is_set_worker_resources());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_worker_resources()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.worker_resources, other.worker_resources);
- 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("Assignment(");
- boolean first = true;
-
- sb.append("master_code_dir:");
- if (this.master_code_dir == null) {
- sb.append("null");
- } else {
- sb.append(this.master_code_dir);
- }
- first = false;
- if (is_set_node_host()) {
- if (!first) sb.append(", ");
- sb.append("node_host:");
- if (this.node_host == null) {
- sb.append("null");
- } else {
- sb.append(this.node_host);
- }
- first = false;
- }
- if (is_set_executor_node_port()) {
- if (!first) sb.append(", ");
- sb.append("executor_node_port:");
- if (this.executor_node_port == null) {
- sb.append("null");
- } else {
- sb.append(this.executor_node_port);
- }
- first = false;
- }
- if (is_set_executor_start_time_secs()) {
- if (!first) sb.append(", ");
- sb.append("executor_start_time_secs:");
- if (this.executor_start_time_secs == null) {
- sb.append("null");
- } else {
- sb.append(this.executor_start_time_secs);
- }
- first = false;
- }
- if (is_set_worker_resources()) {
- if (!first) sb.append(", ");
- sb.append("worker_resources:");
- if (this.worker_resources == null) {
- sb.append("null");
- } else {
- sb.append(this.worker_resources);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_master_code_dir()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'master_code_dir' 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 AssignmentStandardSchemeFactory implements SchemeFactory {
- public AssignmentStandardScheme getScheme() {
- return new AssignmentStandardScheme();
- }
- }
-
- private static class AssignmentStandardScheme extends StandardScheme<Assignment> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, Assignment 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: // MASTER_CODE_DIR
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.master_code_dir = iprot.readString();
- struct.set_master_code_dir_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // NODE_HOST
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map618 = iprot.readMapBegin();
- struct.node_host = new HashMap<String,String>(2*_map618.size);
- String _key619;
- String _val620;
- for (int _i621 = 0; _i621 < _map618.size; ++_i621)
- {
- _key619 = iprot.readString();
- _val620 = iprot.readString();
- struct.node_host.put(_key619, _val620);
- }
- iprot.readMapEnd();
- }
- struct.set_node_host_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // EXECUTOR_NODE_PORT
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map622 = iprot.readMapBegin();
- struct.executor_node_port = new HashMap<List<Long>,NodeInfo>(2*_map622.size);
- List<Long> _key623;
- NodeInfo _val624;
- for (int _i625 = 0; _i625 < _map622.size; ++_i625)
- {
- {
- org.apache.thrift.protocol.TList _list626 = iprot.readListBegin();
- _key623 = new ArrayList<Long>(_list626.size);
- long _elem627;
- for (int _i628 = 0; _i628 < _list626.size; ++_i628)
- {
- _elem627 = iprot.readI64();
- _key623.add(_elem627);
- }
- iprot.readListEnd();
- }
- _val624 = new NodeInfo();
- _val624.read(iprot);
- struct.executor_node_port.put(_key623, _val624);
- }
- iprot.readMapEnd();
- }
- struct.set_executor_node_port_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // EXECUTOR_START_TIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map629 = iprot.readMapBegin();
- struct.executor_start_time_secs = new HashMap<List<Long>,Long>(2*_map629.size);
- List<Long> _key630;
- long _val631;
- for (int _i632 = 0; _i632 < _map629.size; ++_i632)
- {
- {
- org.apache.thrift.protocol.TList _list633 = iprot.readListBegin();
- _key630 = new ArrayList<Long>(_list633.size);
- long _elem634;
- for (int _i635 = 0; _i635 < _list633.size; ++_i635)
- {
- _elem634 = iprot.readI64();
- _key630.add(_elem634);
- }
- iprot.readListEnd();
- }
- _val631 = iprot.readI64();
- struct.executor_start_time_secs.put(_key630, _val631);
- }
- iprot.readMapEnd();
- }
- struct.set_executor_start_time_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // WORKER_RESOURCES
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map636 = iprot.readMapBegin();
- struct.worker_resources = new HashMap<NodeInfo,WorkerResources>(2*_map636.size);
- NodeInfo _key637;
- WorkerResources _val638;
- for (int _i639 = 0; _i639 < _map636.size; ++_i639)
- {
- _key637 = new NodeInfo();
- _key637.read(iprot);
- _val638 = new WorkerResources();
- _val638.read(iprot);
- struct.worker_resources.put(_key637, _val638);
- }
- iprot.readMapEnd();
- }
- struct.set_worker_resources_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, Assignment struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.master_code_dir != null) {
- oprot.writeFieldBegin(MASTER_CODE_DIR_FIELD_DESC);
- oprot.writeString(struct.master_code_dir);
- oprot.writeFieldEnd();
- }
- if (struct.node_host != null) {
- if (struct.is_set_node_host()) {
- oprot.writeFieldBegin(NODE_HOST_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.node_host.size()));
- for (Map.Entry<String, String> _iter640 : struct.node_host.entrySet())
- {
- oprot.writeString(_iter640.getKey());
- oprot.writeString(_iter640.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.executor_node_port != null) {
- if (struct.is_set_executor_node_port()) {
- oprot.writeFieldBegin(EXECUTOR_NODE_PORT_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.LIST, org.apache.thrift.protocol.TType.STRUCT, struct.executor_node_port.size()));
- for (Map.Entry<List<Long>, NodeInfo> _iter641 : struct.executor_node_port.entrySet())
- {
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, _iter641.getKey().size()));
- for (long _iter642 : _iter641.getKey())
- {
- oprot.writeI64(_iter642);
- }
- oprot.writeListEnd();
- }
- _iter641.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.executor_start_time_secs != null) {
- if (struct.is_set_executor_start_time_secs()) {
- oprot.writeFieldBegin(EXECUTOR_START_TIME_SECS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.LIST, org.apache.thrift.protocol.TType.I64, struct.executor_start_time_secs.size()));
- for (Map.Entry<List<Long>, Long> _iter643 : struct.executor_start_time_secs.entrySet())
- {
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, _iter643.getKey().size()));
- for (long _iter644 : _iter643.getKey())
- {
- oprot.writeI64(_iter644);
- }
- oprot.writeListEnd();
- }
- oprot.writeI64(_iter643.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.worker_resources != null) {
- if (struct.is_set_worker_resources()) {
- oprot.writeFieldBegin(WORKER_RESOURCES_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, struct.worker_resources.size()));
- for (Map.Entry<NodeInfo, WorkerResources> _iter645 : struct.worker_resources.entrySet())
- {
- _iter645.getKey().write(oprot);
- _iter645.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class AssignmentTupleSchemeFactory implements SchemeFactory {
- public AssignmentTupleScheme getScheme() {
- return new AssignmentTupleScheme();
- }
- }
-
- private static class AssignmentTupleScheme extends TupleScheme<Assignment> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, Assignment struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.master_code_dir);
- BitSet optionals = new BitSet();
- if (struct.is_set_node_host()) {
- optionals.set(0);
- }
- if (struct.is_set_executor_node_port()) {
- optionals.set(1);
- }
- if (struct.is_set_executor_start_time_secs()) {
- optionals.set(2);
- }
- if (struct.is_set_worker_resources()) {
- optionals.set(3);
- }
- oprot.writeBitSet(optionals, 4);
- if (struct.is_set_node_host()) {
- {
- oprot.writeI32(struct.node_host.size());
- for (Map.Entry<String, String> _iter646 : struct.node_host.entrySet())
- {
- oprot.writeString(_iter646.getKey());
- oprot.writeString(_iter646.getValue());
- }
- }
- }
- if (struct.is_set_executor_node_port()) {
- {
- oprot.writeI32(struct.executor_node_port.size());
- for (Map.Entry<List<Long>, NodeInfo> _iter647 : struct.executor_node_port.entrySet())
- {
- {
- oprot.writeI32(_iter647.getKey().size());
- for (long _iter648 : _iter647.getKey())
- {
- oprot.writeI64(_iter648);
- }
- }
- _iter647.getValue().write(oprot);
- }
- }
- }
- if (struct.is_set_executor_start_time_secs()) {
- {
- oprot.writeI32(struct.executor_start_time_secs.size());
- for (Map.Entry<List<Long>, Long> _iter649 : struct.executor_start_time_secs.entrySet())
- {
- {
- oprot.writeI32(_iter649.getKey().size());
- for (long _iter650 : _iter649.getKey())
- {
- oprot.writeI64(_iter650);
- }
- }
- oprot.writeI64(_iter649.getValue());
- }
- }
- }
- if (struct.is_set_worker_resources()) {
- {
- oprot.writeI32(struct.worker_resources.size());
- for (Map.Entry<NodeInfo, WorkerResources> _iter651 : struct.worker_resources.entrySet())
- {
- _iter651.getKey().write(oprot);
- _iter651.getValue().write(oprot);
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, Assignment struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.master_code_dir = iprot.readString();
- struct.set_master_code_dir_isSet(true);
- BitSet incoming = iprot.readBitSet(4);
- if (incoming.get(0)) {
- {
- org.apache.thrift.protocol.TMap _map652 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.node_host = new HashMap<String,String>(2*_map652.size);
- String _key653;
- String _val654;
- for (int _i655 = 0; _i655 < _map652.size; ++_i655)
- {
- _key653 = iprot.readString();
- _val654 = iprot.readString();
- struct.node_host.put(_key653, _val654);
- }
- }
- struct.set_node_host_isSet(true);
- }
- if (incoming.get(1)) {
- {
- org.apache.thrift.protocol.TMap _map656 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.LIST, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.executor_node_port = new HashMap<List<Long>,NodeInfo>(2*_map656.size);
- List<Long> _key657;
- NodeInfo _val658;
- for (int _i659 = 0; _i659 < _map656.size; ++_i659)
- {
- {
- org.apache.thrift.protocol.TList _list660 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32());
- _key657 = new ArrayList<Long>(_list660.size);
- long _elem661;
- for (int _i662 = 0; _i662 < _list660.size; ++_i662)
- {
- _elem661 = iprot.readI64();
- _key657.add(_elem661);
- }
- }
- _val658 = new NodeInfo();
- _val658.read(iprot);
- struct.executor_node_port.put(_key657, _val658);
- }
- }
- struct.set_executor_node_port_isSet(true);
- }
- if (incoming.get(2)) {
- {
- org.apache.thrift.protocol.TMap _map663 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.LIST, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- struct.executor_start_time_secs = new HashMap<List<Long>,Long>(2*_map663.size);
- List<Long> _key664;
- long _val665;
- for (int _i666 = 0; _i666 < _map663.size; ++_i666)
- {
- {
- org.apache.thrift.protocol.TList _list667 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32());
- _key664 = new ArrayList<Long>(_list667.size);
- long _elem668;
- for (int _i669 = 0; _i669 < _list667.size; ++_i669)
- {
- _elem668 = iprot.readI64();
- _key664.add(_elem668);
- }
- }
- _val665 = iprot.readI64();
- struct.executor_start_time_secs.put(_key664, _val665);
- }
- }
- struct.set_executor_start_time_secs_isSet(true);
- }
- if (incoming.get(3)) {
- {
- org.apache.thrift.protocol.TMap _map670 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.worker_resources = new HashMap<NodeInfo,WorkerResources>(2*_map670.size);
- NodeInfo _key671;
- WorkerResources _val672;
- for (int _i673 = 0; _i673 < _map670.size; ++_i673)
- {
- _key671 = new NodeInfo();
- _key671.read(iprot);
- _val672 = new WorkerResources();
- _val672.read(iprot);
- struct.worker_resources.put(_key671, _val672);
- }
- }
- struct.set_worker_resources_isSet(true);
- }
- }
- }
-
-}
-
[35/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/daemon/metrics/MetricsUtils.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/daemon/metrics/MetricsUtils.java b/storm-core/src/jvm/backtype/storm/daemon/metrics/MetricsUtils.java
deleted file mode 100644
index 56b920b..0000000
--- a/storm-core/src/jvm/backtype/storm/daemon/metrics/MetricsUtils.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.daemon.metrics;
-
-import org.apache.storm.Config;
-import org.apache.storm.daemon.metrics.reporters.JmxPreparableReporter;
-import org.apache.storm.daemon.metrics.reporters.PreparableReporter;
-import org.apache.storm.utils.Utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-public class MetricsUtils {
- private final static Logger LOG = LoggerFactory.getLogger(MetricsUtils.class);
-
- public static List<PreparableReporter> getPreparableReporters(Map stormConf) {
- List<String> clazzes = (List<String>) stormConf.get(Config.STORM_DAEMON_METRICS_REPORTER_PLUGINS);
- List<PreparableReporter> reporterList = new ArrayList<>();
-
- if (clazzes != null) {
- for (String clazz : clazzes) {
- reporterList.add(getPreparableReporter(clazz));
- }
- }
- if (reporterList.isEmpty()) {
- reporterList.add(new JmxPreparableReporter());
- }
- return reporterList;
- }
-
- private static PreparableReporter getPreparableReporter(String clazz) {
- PreparableReporter reporter = null;
- LOG.info("Using statistics reporter plugin:" + clazz);
- if (clazz != null) {
- reporter = (PreparableReporter) Utils.newInstance(clazz);
- }
- return reporter;
- }
-
- public static Locale getMetricsReporterLocale(Map stormConf) {
- String languageTag = Utils.getString(stormConf.get(Config.STORM_DAEMON_METRICS_REPORTER_PLUGIN_LOCALE), null);
- if (languageTag != null) {
- return Locale.forLanguageTag(languageTag);
- }
- return null;
- }
-
- public static TimeUnit getMetricsRateUnit(Map stormConf) {
- return getTimeUnitForCofig(stormConf, Config.STORM_DAEMON_METRICS_REPORTER_PLUGIN_RATE_UNIT);
- }
-
- public static TimeUnit getMetricsDurationUnit(Map stormConf) {
- return getTimeUnitForCofig(stormConf, Config.STORM_DAEMON_METRICS_REPORTER_PLUGIN_DURATION_UNIT);
- }
-
- private static TimeUnit getTimeUnitForCofig(Map stormConf, String configName) {
- String rateUnitString = Utils.getString(stormConf.get(configName), null);
- if (rateUnitString != null) {
- return TimeUnit.valueOf(rateUnitString);
- }
- return null;
- }
-
- public static File getCsvLogDir(Map stormConf) {
- String csvMetricsLogDirectory = Utils.getString(stormConf.get(Config.STORM_DAEMON_METRICS_REPORTER_CSV_LOG_DIR), null);
- if (csvMetricsLogDirectory == null) {
- csvMetricsLogDirectory = absoluteStormLocalDir(stormConf);
- csvMetricsLogDirectory = csvMetricsLogDirectory + File.separator + "csvmetrics";
- }
- File csvMetricsDir = new File(csvMetricsLogDirectory);
- validateCreateOutputDir(csvMetricsDir);
- return csvMetricsDir;
- }
-
- private static void validateCreateOutputDir(File dir) {
- if (!dir.exists()) {
- dir.mkdirs();
- }
- if (!dir.canWrite()) {
- throw new IllegalStateException(dir.getName() + " does not have write permissions.");
- }
- if (!dir.isDirectory()) {
- throw new IllegalStateException(dir.getName() + " is not a directory.");
- }
- }
-
- public static String absoluteStormLocalDir(Map conf) {
- String stormHome = System.getProperty("storm.home");
- String localDir = (String) conf.get(Config.STORM_LOCAL_DIR);
- if (localDir == null) {
- return (stormHome + File.separator + "storm-local");
- } else {
- if (new File(localDir).isAbsolute()) {
- return localDir;
- } else {
- return (stormHome + File.separator + localDir);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/ConsolePreparableReporter.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/ConsolePreparableReporter.java b/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/ConsolePreparableReporter.java
deleted file mode 100644
index 1eacb63..0000000
--- a/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/ConsolePreparableReporter.java
+++ /dev/null
@@ -1,76 +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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.daemon.metrics.reporters;
-
-import com.codahale.metrics.ConsoleReporter;
-import com.codahale.metrics.MetricRegistry;
-import org.apache.storm.daemon.metrics.MetricsUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Locale;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-public class ConsolePreparableReporter implements PreparableReporter<ConsoleReporter> {
- private final static Logger LOG = LoggerFactory.getLogger(ConsolePreparableReporter.class);
- ConsoleReporter reporter = null;
-
- @Override
- public void prepare(MetricRegistry metricsRegistry, Map stormConf) {
- LOG.debug("Preparing...");
- ConsoleReporter.Builder builder = ConsoleReporter.forRegistry(metricsRegistry);
-
- builder.outputTo(System.out);
- Locale locale = MetricsUtils.getMetricsReporterLocale(stormConf);
- if (locale != null) {
- builder.formattedFor(locale);
- }
-
- TimeUnit rateUnit = MetricsUtils.getMetricsRateUnit(stormConf);
- if (rateUnit != null) {
- builder.convertRatesTo(rateUnit);
- }
-
- TimeUnit durationUnit = MetricsUtils.getMetricsDurationUnit(stormConf);
- if (durationUnit != null) {
- builder.convertDurationsTo(durationUnit);
- }
- reporter = builder.build();
- }
-
- @Override
- public void start() {
- if (reporter != null) {
- LOG.debug("Starting...");
- reporter.start(10, TimeUnit.SECONDS);
- } else {
- throw new IllegalStateException("Attempt to start without preparing " + getClass().getSimpleName());
- }
- }
-
- @Override
- public void stop() {
- if (reporter != null) {
- LOG.debug("Stopping...");
- reporter.stop();
- } else {
- throw new IllegalStateException("Attempt to stop without preparing " + getClass().getSimpleName());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/CsvPreparableReporter.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/CsvPreparableReporter.java b/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/CsvPreparableReporter.java
deleted file mode 100644
index 605f389..0000000
--- a/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/CsvPreparableReporter.java
+++ /dev/null
@@ -1,80 +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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.daemon.metrics.reporters;
-
-import com.codahale.metrics.CsvReporter;
-import com.codahale.metrics.MetricRegistry;
-import org.apache.storm.daemon.metrics.MetricsUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.util.Locale;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-public class CsvPreparableReporter implements PreparableReporter<CsvReporter> {
- private final static Logger LOG = LoggerFactory.getLogger(CsvPreparableReporter.class);
- CsvReporter reporter = null;
-
- @Override
- public void prepare(MetricRegistry metricsRegistry, Map stormConf) {
- LOG.debug("Preparing...");
- CsvReporter.Builder builder = CsvReporter.forRegistry(metricsRegistry);
-
- Locale locale = MetricsUtils.getMetricsReporterLocale(stormConf);
- if (locale != null) {
- builder.formatFor(locale);
- }
-
- TimeUnit rateUnit = MetricsUtils.getMetricsRateUnit(stormConf);
- if (rateUnit != null) {
- builder.convertRatesTo(rateUnit);
- }
-
- TimeUnit durationUnit = MetricsUtils.getMetricsDurationUnit(stormConf);
- if (durationUnit != null) {
- builder.convertDurationsTo(durationUnit);
- }
-
- File csvMetricsDir = MetricsUtils.getCsvLogDir(stormConf);
- reporter = builder.build(csvMetricsDir);
- }
-
- @Override
- public void start() {
- if (reporter != null) {
- LOG.debug("Starting...");
- reporter.start(10, TimeUnit.SECONDS);
- } else {
- throw new IllegalStateException("Attempt to start without preparing " + getClass().getSimpleName());
- }
- }
-
- @Override
- public void stop() {
- if (reporter != null) {
- LOG.debug("Stopping...");
- reporter.stop();
- } else {
- throw new IllegalStateException("Attempt to stop without preparing " + getClass().getSimpleName());
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/JmxPreparableReporter.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/JmxPreparableReporter.java b/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/JmxPreparableReporter.java
deleted file mode 100644
index cf4aa1c..0000000
--- a/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/JmxPreparableReporter.java
+++ /dev/null
@@ -1,70 +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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.daemon.metrics.reporters;
-
-import com.codahale.metrics.JmxReporter;
-import com.codahale.metrics.MetricRegistry;
-import org.apache.storm.Config;
-import org.apache.storm.daemon.metrics.MetricsUtils;
-import org.apache.storm.utils.Utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-public class JmxPreparableReporter implements PreparableReporter<JmxReporter> {
- private final static Logger LOG = LoggerFactory.getLogger(JmxPreparableReporter.class);
- JmxReporter reporter = null;
-
- @Override
- public void prepare(MetricRegistry metricsRegistry, Map stormConf) {
- LOG.info("Preparing...");
- JmxReporter.Builder builder = JmxReporter.forRegistry(metricsRegistry);
- String domain = Utils.getString(stormConf.get(Config.STORM_DAEMON_METRICS_REPORTER_PLUGIN_DOMAIN), null);
- if (domain != null) {
- builder.inDomain(domain);
- }
- TimeUnit rateUnit = MetricsUtils.getMetricsRateUnit(stormConf);
- if (rateUnit != null) {
- builder.convertRatesTo(rateUnit);
- }
- reporter = builder.build();
-
- }
-
- @Override
- public void start() {
- if (reporter != null) {
- LOG.debug("Starting...");
- reporter.start();
- } else {
- throw new IllegalStateException("Attempt to start without preparing " + getClass().getSimpleName());
- }
- }
-
- @Override
- public void stop() {
- if (reporter != null) {
- LOG.debug("Stopping...");
- reporter.stop();
- } else {
- throw new IllegalStateException("Attempt to stop without preparing " + getClass().getSimpleName());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/PreparableReporter.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/PreparableReporter.java b/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/PreparableReporter.java
deleted file mode 100644
index 2968bfb..0000000
--- a/storm-core/src/jvm/backtype/storm/daemon/metrics/reporters/PreparableReporter.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.daemon.metrics.reporters;
-
-import com.codahale.metrics.MetricRegistry;
-import com.codahale.metrics.Reporter;
-
-import java.io.Closeable;
-import java.util.Map;
-
-
-public interface PreparableReporter<T extends Reporter & Closeable> {
- void prepare(MetricRegistry metricsRegistry, Map stormConf);
- void start();
- void stop();
-
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/dependency/DependencyPropertiesParser.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/dependency/DependencyPropertiesParser.java b/storm-core/src/jvm/backtype/storm/dependency/DependencyPropertiesParser.java
deleted file mode 100644
index d360ae0..0000000
--- a/storm-core/src/jvm/backtype/storm/dependency/DependencyPropertiesParser.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.dependency;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Lists;
-import org.json.simple.JSONValue;
-import org.json.simple.parser.ParseException;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-public class DependencyPropertiesParser {
- public List<File> parseJarsProperties(String prop) {
- if (prop.trim().isEmpty()) {
- // handle no input
- return Collections.emptyList();
- }
-
- List<String> dependencies = Arrays.asList(prop.split(","));
- return Lists.transform(dependencies, new Function<String, File>() {
- @Override
- public File apply(String filePath) {
- return new File(filePath);
- }
- });
- }
-
- public Map<String, File> parseArtifactsProperties(String prop) {
- try {
- Map<String, String> parsed = (Map<String, String>) JSONValue.parseWithException(prop);
- Map<String, File> packages = new LinkedHashMap<>(parsed.size());
- for (Map.Entry<String, String> artifactToFilePath : parsed.entrySet()) {
- packages.put(artifactToFilePath.getKey(), new File(artifactToFilePath.getValue()));
- }
-
- return packages;
- } catch (ParseException e) {
- throw new RuntimeException(e);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/dependency/DependencyUploader.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/dependency/DependencyUploader.java b/storm-core/src/jvm/backtype/storm/dependency/DependencyUploader.java
deleted file mode 100644
index 4f71f67..0000000
--- a/storm-core/src/jvm/backtype/storm/dependency/DependencyUploader.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.dependency;
-
-import com.google.common.annotations.VisibleForTesting;
-import org.apache.commons.lang.StringUtils;
-import org.apache.storm.blobstore.AtomicOutputStream;
-import org.apache.storm.blobstore.BlobStoreUtils;
-import org.apache.storm.blobstore.ClientBlobStore;
-import org.apache.storm.generated.AccessControl;
-import org.apache.storm.generated.AuthorizationException;
-import org.apache.storm.generated.KeyAlreadyExistsException;
-import org.apache.storm.generated.KeyNotFoundException;
-import org.apache.storm.generated.SettableBlobMeta;
-import org.apache.storm.utils.Utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-public class DependencyUploader {
- public static final Logger LOG = LoggerFactory.getLogger(DependencyUploader.class);
-
- private final Map<String, Object> conf;
- private ClientBlobStore blobStore;
-
- public DependencyUploader() {
- conf = Utils.readStormConfig();
- }
-
- public void init() {
- if (blobStore == null) {
- blobStore = Utils.getClientBlobStore(conf);
- }
- }
-
- public void shutdown() {
- if (blobStore != null) {
- blobStore.shutdown();
- }
- }
-
- @VisibleForTesting
- void setBlobStore(ClientBlobStore blobStore) {
- this.blobStore = blobStore;
- }
-
- @SuppressWarnings("unchecked")
- public List<String> uploadFiles(List<File> dependencies, boolean cleanupIfFails) throws IOException, AuthorizationException {
- checkFilesExist(dependencies);
-
- List<String> keys = new ArrayList<>(dependencies.size());
- try {
- for (File dependency : dependencies) {
- String fileName = dependency.getName();
- String key = BlobStoreUtils.generateDependencyBlobKey(BlobStoreUtils.applyUUIDToFileName(fileName));
-
- try {
- uploadDependencyToBlobStore(key, dependency);
- } catch (KeyAlreadyExistsException e) {
- // it should never happened since we apply UUID
- throw new RuntimeException(e);
- }
-
- keys.add(key);
- }
- } catch (Throwable e) {
- if (blobStore != null && cleanupIfFails) {
- deleteBlobs(keys);
- }
- throw new RuntimeException(e);
- }
-
- return keys;
- }
-
- public List<String> uploadArtifacts(Map<String, File> artifacts) {
- checkFilesExist(artifacts.values());
-
- List<String> keys = new ArrayList<>(artifacts.size());
- try {
- for (Map.Entry<String, File> artifactToFile : artifacts.entrySet()) {
- String artifact = artifactToFile.getKey();
- File dependency = artifactToFile.getValue();
-
- String key = BlobStoreUtils.generateDependencyBlobKey(convertArtifactToJarFileName(artifact));
- try {
- uploadDependencyToBlobStore(key, dependency);
- } catch (KeyAlreadyExistsException e) {
- // we lose the race, but it doesn't matter
- }
-
- keys.add(key);
- }
- } catch (Throwable e) {
- throw new RuntimeException(e);
- }
-
- return keys;
- }
-
- public void deleteBlobs(List<String> keys) {
- for (String key : keys) {
- try {
- blobStore.deleteBlob(key);
- } catch (Throwable e) {
- LOG.warn("blob delete failed - key: {} continue...", key);
- }
- }
- }
-
- private String convertArtifactToJarFileName(String artifact) {
- return artifact.replace(":", "-") + ".jar";
- }
-
- private boolean uploadDependencyToBlobStore(String key, File dependency)
- throws KeyAlreadyExistsException, AuthorizationException, IOException {
-
- boolean uploadNew = false;
- try {
- // FIXME: we can filter by listKeys() with local blobstore when STORM-1986 is going to be resolved
- // as a workaround, we call getBlobMeta() for all keys
- blobStore.getBlobMeta(key);
- } catch (KeyNotFoundException e) {
- // TODO: do we want to add ACL here?
- AtomicOutputStream blob = blobStore
- .createBlob(key, new SettableBlobMeta(new ArrayList<AccessControl>()));
- Files.copy(dependency.toPath(), blob);
- blob.close();
-
- uploadNew = true;
- }
-
- return uploadNew;
- }
-
- private void checkFilesExist(Collection<File> dependencies) {
- for (File dependency : dependencies) {
- if (!dependency.isFile() || !dependency.exists()) {
- throw new FileNotAvailableException(dependency.getAbsolutePath());
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/dependency/FileNotAvailableException.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/dependency/FileNotAvailableException.java b/storm-core/src/jvm/backtype/storm/dependency/FileNotAvailableException.java
deleted file mode 100644
index 874485b..0000000
--- a/storm-core/src/jvm/backtype/storm/dependency/FileNotAvailableException.java
+++ /dev/null
@@ -1,33 +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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.storm.dependency;
-
-public class FileNotAvailableException extends RuntimeException {
- public FileNotAvailableException(String fileName) {
- super(createMessage(fileName));
- }
-
- public FileNotAvailableException(String fileName, Throwable cause) {
- super(createMessage(fileName), cause);
- }
-
- private static String createMessage(String fileName) {
- return "This file is not available: " + fileName;
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/drpc/DRPCInvocationsClient.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/drpc/DRPCInvocationsClient.java b/storm-core/src/jvm/backtype/storm/drpc/DRPCInvocationsClient.java
deleted file mode 100644
index 9d01e81..0000000
--- a/storm-core/src/jvm/backtype/storm/drpc/DRPCInvocationsClient.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.drpc;
-
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.apache.storm.generated.DRPCRequest;
-import org.apache.storm.generated.DistributedRPCInvocations;
-import org.apache.storm.generated.AuthorizationException;
-import org.apache.storm.security.auth.ThriftClient;
-import org.apache.storm.security.auth.ThriftConnectionType;
-import org.apache.thrift.transport.TTransportException;
-import org.apache.thrift.TException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DRPCInvocationsClient extends ThriftClient implements DistributedRPCInvocations.Iface {
- public static final Logger LOG = LoggerFactory.getLogger(DRPCInvocationsClient.class);
- private final AtomicReference<DistributedRPCInvocations.Client> client = new AtomicReference<>();
- private String host;
- private int port;
-
- public DRPCInvocationsClient(Map conf, String host, int port) throws TTransportException {
- super(conf, ThriftConnectionType.DRPC_INVOCATIONS, host, port, null);
- this.host = host;
- this.port = port;
- client.set(new DistributedRPCInvocations.Client(_protocol));
- }
-
- public String getHost() {
- return host;
- }
-
- public int getPort() {
- return port;
- }
-
- public void reconnectClient() throws TException {
- if (client.get() == null) {
- reconnect();
- client.set(new DistributedRPCInvocations.Client(_protocol));
- }
- }
-
- public boolean isConnected() {
- return client.get() != null;
- }
-
- public void result(String id, String result) throws TException, AuthorizationException {
- DistributedRPCInvocations.Client c = client.get();
- try {
- if (c == null) {
- throw new TException("Client is not connected...");
- }
- c.result(id, result);
- } catch(AuthorizationException aze) {
- throw aze;
- } catch(TException e) {
- client.compareAndSet(c, null);
- throw e;
- }
- }
-
- public DRPCRequest fetchRequest(String func) throws TException, AuthorizationException {
- DistributedRPCInvocations.Client c = client.get();
- try {
- if (c == null) {
- throw new TException("Client is not connected...");
- }
- return c.fetchRequest(func);
- } catch(AuthorizationException aze) {
- throw aze;
- } catch(TException e) {
- client.compareAndSet(c, null);
- throw e;
- }
- }
-
- public void failRequest(String id) throws TException, AuthorizationException {
- DistributedRPCInvocations.Client c = client.get();
- try {
- if (c == null) {
- throw new TException("Client is not connected...");
- }
- c.failRequest(id);
- } catch(AuthorizationException aze) {
- throw aze;
- } catch(TException e) {
- client.compareAndSet(c, null);
- throw e;
- }
- }
-
- public DistributedRPCInvocations.Client getClient() {
- return client.get();
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/drpc/DRPCSpout.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/drpc/DRPCSpout.java b/storm-core/src/jvm/backtype/storm/drpc/DRPCSpout.java
deleted file mode 100644
index 791fc91..0000000
--- a/storm-core/src/jvm/backtype/storm/drpc/DRPCSpout.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.drpc;
-
-import org.apache.storm.Config;
-import org.apache.storm.ILocalDRPC;
-import org.apache.storm.generated.DRPCRequest;
-import org.apache.storm.generated.DistributedRPCInvocations;
-import org.apache.storm.generated.AuthorizationException;
-import org.apache.storm.spout.SpoutOutputCollector;
-import org.apache.storm.task.TopologyContext;
-import org.apache.storm.topology.OutputFieldsDeclarer;
-import org.apache.storm.topology.base.BaseRichSpout;
-import org.apache.storm.tuple.Fields;
-import org.apache.storm.tuple.Values;
-import org.apache.storm.utils.ExtendedThreadPoolExecutor;
-import org.apache.storm.utils.ServiceRegistry;
-import org.apache.storm.utils.Utils;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.Callable;
-import java.util.concurrent.SynchronousQueue;
-import java.util.concurrent.TimeUnit;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.thrift.TException;
-import org.json.simple.JSONValue;
-
-public class DRPCSpout extends BaseRichSpout {
- //ANY CHANGE TO THIS CODE MUST BE SERIALIZABLE COMPATIBLE OR THERE WILL BE PROBLEMS
- static final long serialVersionUID = 2387848310969237877L;
-
- public static final Logger LOG = LoggerFactory.getLogger(DRPCSpout.class);
-
- SpoutOutputCollector _collector;
- List<DRPCInvocationsClient> _clients = new ArrayList<>();
- transient LinkedList<Future<Void>> _futures = null;
- transient ExecutorService _backround = null;
- String _function;
- String _local_drpc_id = null;
-
- private static class DRPCMessageId {
- String id;
- int index;
-
- public DRPCMessageId(String id, int index) {
- this.id = id;
- this.index = index;
- }
- }
-
-
- public DRPCSpout(String function) {
- _function = function;
- }
-
- public DRPCSpout(String function, ILocalDRPC drpc) {
- _function = function;
- _local_drpc_id = drpc.getServiceId();
- }
-
- public String get_function() {
- return _function;
- }
-
- private class Adder implements Callable<Void> {
- private String server;
- private int port;
- private Map conf;
-
- public Adder(String server, int port, Map conf) {
- this.server = server;
- this.port = port;
- this.conf = conf;
- }
-
- @Override
- public Void call() throws Exception {
- DRPCInvocationsClient c = new DRPCInvocationsClient(conf, server, port);
- synchronized (_clients) {
- _clients.add(c);
- }
- return null;
- }
- }
-
- private void reconnect(final DRPCInvocationsClient c) {
- _futures.add(_backround.submit(new Callable<Void>() {
- @Override
- public Void call() throws Exception {
- c.reconnectClient();
- return null;
- }
- }));
- }
-
- private void checkFutures() {
- Iterator<Future<Void>> i = _futures.iterator();
- while (i.hasNext()) {
- Future<Void> f = i.next();
- if (f.isDone()) {
- i.remove();
- }
- try {
- f.get();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- @Override
- public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
- _collector = collector;
- if(_local_drpc_id==null) {
- _backround = new ExtendedThreadPoolExecutor(0, Integer.MAX_VALUE,
- 60L, TimeUnit.SECONDS,
- new SynchronousQueue<Runnable>());
- _futures = new LinkedList<>();
-
- int numTasks = context.getComponentTasks(context.getThisComponentId()).size();
- int index = context.getThisTaskIndex();
-
- int port = Utils.getInt(conf.get(Config.DRPC_INVOCATIONS_PORT));
- List<String> servers = (List<String>) conf.get(Config.DRPC_SERVERS);
- if(servers == null || servers.isEmpty()) {
- throw new RuntimeException("No DRPC servers configured for topology");
- }
-
- if (numTasks < servers.size()) {
- for (String s: servers) {
- _futures.add(_backround.submit(new Adder(s, port, conf)));
- }
- } else {
- int i = index % servers.size();
- _futures.add(_backround.submit(new Adder(servers.get(i), port, conf)));
- }
- }
-
- }
-
- @Override
- public void close() {
- for(DRPCInvocationsClient client: _clients) {
- client.close();
- }
- }
-
- @Override
- public void nextTuple() {
- boolean gotRequest = false;
- if(_local_drpc_id==null) {
- int size;
- synchronized (_clients) {
- size = _clients.size(); //This will only ever grow, so no need to worry about falling off the end
- }
- for(int i=0; i<size; i++) {
- DRPCInvocationsClient client;
- synchronized (_clients) {
- client = _clients.get(i);
- }
- if (!client.isConnected()) {
- LOG.warn("DRPCInvocationsClient [{}:{}] is not connected.", client.getHost(), client.getPort());
- reconnect(client);
- continue;
- }
- try {
- DRPCRequest req = client.fetchRequest(_function);
- if(req.get_request_id().length() > 0) {
- Map returnInfo = new HashMap();
- returnInfo.put("id", req.get_request_id());
- returnInfo.put("host", client.getHost());
- returnInfo.put("port", client.getPort());
- gotRequest = true;
- _collector.emit(new Values(req.get_func_args(), JSONValue.toJSONString(returnInfo)), new DRPCMessageId(req.get_request_id(), i));
- break;
- }
- } catch (AuthorizationException aze) {
- reconnect(client);
- LOG.error("Not authorized to fetch DRPC result from DRPC server", aze);
- } catch (TException e) {
- reconnect(client);
- LOG.error("Failed to fetch DRPC result from DRPC server", e);
- } catch (Exception e) {
- LOG.error("Failed to fetch DRPC result from DRPC server", e);
- }
- }
- checkFutures();
- } else {
- DistributedRPCInvocations.Iface drpc = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(_local_drpc_id);
- if(drpc!=null) { // can happen during shutdown of drpc while topology is still up
- try {
- DRPCRequest req = drpc.fetchRequest(_function);
- if(req.get_request_id().length() > 0) {
- Map returnInfo = new HashMap();
- returnInfo.put("id", req.get_request_id());
- returnInfo.put("host", _local_drpc_id);
- returnInfo.put("port", 0);
- gotRequest = true;
- _collector.emit(new Values(req.get_func_args(), JSONValue.toJSONString(returnInfo)), new DRPCMessageId(req.get_request_id(), 0));
- }
- } catch (AuthorizationException aze) {
- throw new RuntimeException(aze);
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
- }
- if(!gotRequest) {
- Utils.sleep(1);
- }
- }
-
- @Override
- public void ack(Object msgId) {
- }
-
- @Override
- public void fail(Object msgId) {
- DRPCMessageId did = (DRPCMessageId) msgId;
- DistributedRPCInvocations.Iface client;
-
- if(_local_drpc_id == null) {
- client = _clients.get(did.index);
- } else {
- client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(_local_drpc_id);
- }
- try {
- client.failRequest(did.id);
- } catch (AuthorizationException aze) {
- LOG.error("Not authorized to failREquest from DRPC server", aze);
- } catch (TException e) {
- LOG.error("Failed to fail request", e);
- }
- }
-
- @Override
- public void declareOutputFields(OutputFieldsDeclarer declarer) {
- declarer.declare(new Fields("args", "return-info"));
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/drpc/JoinResult.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/drpc/JoinResult.java b/storm-core/src/jvm/backtype/storm/drpc/JoinResult.java
deleted file mode 100644
index f57bbb1..0000000
--- a/storm-core/src/jvm/backtype/storm/drpc/JoinResult.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.drpc;
-
-import org.apache.storm.task.OutputCollector;
-import org.apache.storm.task.TopologyContext;
-import org.apache.storm.topology.OutputFieldsDeclarer;
-import org.apache.storm.topology.base.BaseRichBolt;
-import org.apache.storm.tuple.Fields;
-import org.apache.storm.tuple.Tuple;
-import org.apache.storm.tuple.Values;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class JoinResult extends BaseRichBolt {
- public static final Logger LOG = LoggerFactory.getLogger(JoinResult.class);
-
- String returnComponent;
- Map<Object, Tuple> returns = new HashMap<>();
- Map<Object, Tuple> results = new HashMap<>();
- OutputCollector _collector;
-
- public JoinResult(String returnComponent) {
- this.returnComponent = returnComponent;
- }
-
- public void prepare(Map map, TopologyContext context, OutputCollector collector) {
- _collector = collector;
- }
-
- public void execute(Tuple tuple) {
- Object requestId = tuple.getValue(0);
- if(tuple.getSourceComponent().equals(returnComponent)) {
- returns.put(requestId, tuple);
- } else {
- results.put(requestId, tuple);
- }
-
- if(returns.containsKey(requestId) && results.containsKey(requestId)) {
- Tuple result = results.remove(requestId);
- Tuple returner = returns.remove(requestId);
- LOG.debug(result.getValue(1).toString());
- List<Tuple> anchors = new ArrayList<>();
- anchors.add(result);
- anchors.add(returner);
- _collector.emit(anchors, new Values(""+result.getValue(1), returner.getValue(1)));
- _collector.ack(result);
- _collector.ack(returner);
- }
- }
-
- public void declareOutputFields(OutputFieldsDeclarer declarer) {
- declarer.declare(new Fields("result", "return-info"));
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/drpc/KeyedFairBolt.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/drpc/KeyedFairBolt.java b/storm-core/src/jvm/backtype/storm/drpc/KeyedFairBolt.java
deleted file mode 100644
index 39860e6..0000000
--- a/storm-core/src/jvm/backtype/storm/drpc/KeyedFairBolt.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.drpc;
-
-import org.apache.storm.coordination.CoordinatedBolt.FinishedCallback;
-import org.apache.storm.task.OutputCollector;
-import org.apache.storm.task.TopologyContext;
-import org.apache.storm.topology.BasicBoltExecutor;
-import org.apache.storm.topology.IBasicBolt;
-import org.apache.storm.topology.IRichBolt;
-import org.apache.storm.topology.OutputFieldsDeclarer;
-import org.apache.storm.tuple.Tuple;
-import org.apache.storm.utils.KeyedRoundRobinQueue;
-import java.util.HashMap;
-import java.util.Map;
-
-
-public class KeyedFairBolt implements IRichBolt, FinishedCallback {
- IRichBolt _delegate;
- KeyedRoundRobinQueue<Tuple> _rrQueue;
- Thread _executor;
- FinishedCallback _callback;
-
- public KeyedFairBolt(IRichBolt delegate) {
- _delegate = delegate;
- }
-
- public KeyedFairBolt(IBasicBolt delegate) {
- this(new BasicBoltExecutor(delegate));
- }
-
-
- public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
- if(_delegate instanceof FinishedCallback) {
- _callback = (FinishedCallback) _delegate;
- }
- _delegate.prepare(stormConf, context, collector);
- _rrQueue = new KeyedRoundRobinQueue<Tuple>();
- _executor = new Thread(new Runnable() {
- public void run() {
- try {
- while(true) {
- _delegate.execute(_rrQueue.take());
- }
- } catch (InterruptedException e) {
-
- }
- }
- });
- _executor.setDaemon(true);
- _executor.start();
- }
-
- public void execute(Tuple input) {
- Object key = input.getValue(0);
- _rrQueue.add(key, input);
- }
-
- public void cleanup() {
- _executor.interrupt();
- _delegate.cleanup();
- }
-
- public void declareOutputFields(OutputFieldsDeclarer declarer) {
- _delegate.declareOutputFields(declarer);
- }
-
- public void finishedId(Object id) {
- if(_callback!=null) {
- _callback.finishedId(id);
- }
- }
-
- @Override
- public Map<String, Object> getComponentConfiguration() {
- return new HashMap<String, Object>();
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/drpc/LinearDRPCInputDeclarer.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/drpc/LinearDRPCInputDeclarer.java b/storm-core/src/jvm/backtype/storm/drpc/LinearDRPCInputDeclarer.java
deleted file mode 100644
index 6f82f80..0000000
--- a/storm-core/src/jvm/backtype/storm/drpc/LinearDRPCInputDeclarer.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.drpc;
-
-import org.apache.storm.grouping.CustomStreamGrouping;
-import org.apache.storm.topology.ComponentConfigurationDeclarer;
-import org.apache.storm.tuple.Fields;
-
-public interface LinearDRPCInputDeclarer extends ComponentConfigurationDeclarer<LinearDRPCInputDeclarer> {
- public LinearDRPCInputDeclarer fieldsGrouping(Fields fields);
- public LinearDRPCInputDeclarer fieldsGrouping(String streamId, Fields fields);
-
- public LinearDRPCInputDeclarer globalGrouping();
- public LinearDRPCInputDeclarer globalGrouping(String streamId);
-
- public LinearDRPCInputDeclarer shuffleGrouping();
- public LinearDRPCInputDeclarer shuffleGrouping(String streamId);
-
- public LinearDRPCInputDeclarer localOrShuffleGrouping();
- public LinearDRPCInputDeclarer localOrShuffleGrouping(String streamId);
-
- public LinearDRPCInputDeclarer noneGrouping();
- public LinearDRPCInputDeclarer noneGrouping(String streamId);
-
- public LinearDRPCInputDeclarer allGrouping();
- public LinearDRPCInputDeclarer allGrouping(String streamId);
-
- public LinearDRPCInputDeclarer directGrouping();
- public LinearDRPCInputDeclarer directGrouping(String streamId);
-
- public LinearDRPCInputDeclarer partialKeyGrouping(Fields fields);
- public LinearDRPCInputDeclarer partialKeyGrouping(String streamId, Fields fields);
-
- public LinearDRPCInputDeclarer customGrouping(CustomStreamGrouping grouping);
- public LinearDRPCInputDeclarer customGrouping(String streamId, CustomStreamGrouping grouping);
-
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/drpc/LinearDRPCTopologyBuilder.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/drpc/LinearDRPCTopologyBuilder.java b/storm-core/src/jvm/backtype/storm/drpc/LinearDRPCTopologyBuilder.java
deleted file mode 100644
index dc702a3..0000000
--- a/storm-core/src/jvm/backtype/storm/drpc/LinearDRPCTopologyBuilder.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.drpc;
-
-import org.apache.storm.Constants;
-import org.apache.storm.ILocalDRPC;
-import org.apache.storm.coordination.BatchBoltExecutor;
-import org.apache.storm.coordination.CoordinatedBolt;
-import org.apache.storm.coordination.CoordinatedBolt.FinishedCallback;
-import org.apache.storm.coordination.CoordinatedBolt.IdStreamSpec;
-import org.apache.storm.coordination.CoordinatedBolt.SourceArgs;
-import org.apache.storm.coordination.IBatchBolt;
-import org.apache.storm.generated.StormTopology;
-import org.apache.storm.generated.StreamInfo;
-import org.apache.storm.grouping.CustomStreamGrouping;
-import org.apache.storm.grouping.PartialKeyGrouping;
-import org.apache.storm.topology.BaseConfigurationDeclarer;
-import org.apache.storm.topology.BasicBoltExecutor;
-import org.apache.storm.topology.BoltDeclarer;
-import org.apache.storm.topology.IBasicBolt;
-import org.apache.storm.topology.IRichBolt;
-import org.apache.storm.topology.InputDeclarer;
-import org.apache.storm.topology.OutputFieldsGetter;
-import org.apache.storm.topology.TopologyBuilder;
-import org.apache.storm.tuple.Fields;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-
-// Trident subsumes the functionality provided by this class, so it's deprecated
-@Deprecated
-public class LinearDRPCTopologyBuilder {
- String _function;
- List<Component> _components = new ArrayList<Component>();
-
-
- public LinearDRPCTopologyBuilder(String function) {
- _function = function;
- }
-
- public LinearDRPCInputDeclarer addBolt(IBatchBolt bolt, Number parallelism) {
- return addBolt(new BatchBoltExecutor(bolt), parallelism);
- }
-
- public LinearDRPCInputDeclarer addBolt(IBatchBolt bolt) {
- return addBolt(bolt, 1);
- }
-
- @Deprecated
- public LinearDRPCInputDeclarer addBolt(IRichBolt bolt, Number parallelism) {
- if(parallelism==null) parallelism = 1;
- Component component = new Component(bolt, parallelism.intValue());
- _components.add(component);
- return new InputDeclarerImpl(component);
- }
-
- @Deprecated
- public LinearDRPCInputDeclarer addBolt(IRichBolt bolt) {
- return addBolt(bolt, null);
- }
-
- public LinearDRPCInputDeclarer addBolt(IBasicBolt bolt, Number parallelism) {
- return addBolt(new BasicBoltExecutor(bolt), parallelism);
- }
-
- public LinearDRPCInputDeclarer addBolt(IBasicBolt bolt) {
- return addBolt(bolt, null);
- }
-
- public StormTopology createLocalTopology(ILocalDRPC drpc) {
- return createTopology(new DRPCSpout(_function, drpc));
- }
-
- public StormTopology createRemoteTopology() {
- return createTopology(new DRPCSpout(_function));
- }
-
-
- private StormTopology createTopology(DRPCSpout spout) {
- final String SPOUT_ID = "spout";
- final String PREPARE_ID = "prepare-request";
-
- TopologyBuilder builder = new TopologyBuilder();
- builder.setSpout(SPOUT_ID, spout);
- builder.setBolt(PREPARE_ID, new PrepareRequest())
- .noneGrouping(SPOUT_ID);
- int i=0;
- for(; i<_components.size();i++) {
- Component component = _components.get(i);
-
- Map<String, SourceArgs> source = new HashMap<String, SourceArgs>();
- if (i==1) {
- source.put(boltId(i-1), SourceArgs.single());
- } else if (i>=2) {
- source.put(boltId(i-1), SourceArgs.all());
- }
- IdStreamSpec idSpec = null;
- if(i==_components.size()-1 && component.bolt instanceof FinishedCallback) {
- idSpec = IdStreamSpec.makeDetectSpec(PREPARE_ID, PrepareRequest.ID_STREAM);
- }
- BoltDeclarer declarer = builder.setBolt(
- boltId(i),
- new CoordinatedBolt(component.bolt, source, idSpec),
- component.parallelism);
-
- for(Map<String, Object> conf: component.componentConfs) {
- declarer.addConfigurations(conf);
- }
-
- if(idSpec!=null) {
- declarer.fieldsGrouping(idSpec.getGlobalStreamId().get_componentId(), PrepareRequest.ID_STREAM, new Fields("request"));
- }
- if(i==0 && component.declarations.isEmpty()) {
- declarer.noneGrouping(PREPARE_ID, PrepareRequest.ARGS_STREAM);
- } else {
- String prevId;
- if(i==0) {
- prevId = PREPARE_ID;
- } else {
- prevId = boltId(i-1);
- }
- for(InputDeclaration declaration: component.declarations) {
- declaration.declare(prevId, declarer);
- }
- }
- if(i>0) {
- declarer.directGrouping(boltId(i-1), Constants.COORDINATED_STREAM_ID);
- }
- }
-
- IRichBolt lastBolt = _components.get(_components.size()-1).bolt;
- OutputFieldsGetter getter = new OutputFieldsGetter();
- lastBolt.declareOutputFields(getter);
- Map<String, StreamInfo> streams = getter.getFieldsDeclaration();
- if(streams.size()!=1) {
- throw new RuntimeException("Must declare exactly one stream from last bolt in LinearDRPCTopology");
- }
- String outputStream = streams.keySet().iterator().next();
- List<String> fields = streams.get(outputStream).get_output_fields();
- if(fields.size()!=2) {
- throw new RuntimeException("Output stream of last component in LinearDRPCTopology must contain exactly two fields. The first should be the request id, and the second should be the result.");
- }
-
- builder.setBolt(boltId(i), new JoinResult(PREPARE_ID))
- .fieldsGrouping(boltId(i-1), outputStream, new Fields(fields.get(0)))
- .fieldsGrouping(PREPARE_ID, PrepareRequest.RETURN_STREAM, new Fields("request"));
- i++;
- builder.setBolt(boltId(i), new ReturnResults())
- .noneGrouping(boltId(i-1));
- return builder.createTopology();
- }
-
- private static String boltId(int index) {
- return "bolt" + index;
- }
-
- private static class Component {
- public IRichBolt bolt;
- public int parallelism;
- public List<Map<String, Object>> componentConfs = new ArrayList<>();
- public List<InputDeclaration> declarations = new ArrayList<InputDeclaration>();
-
- public Component(IRichBolt bolt, int parallelism) {
- this.bolt = bolt;
- this.parallelism = parallelism;
- }
- }
-
- private static interface InputDeclaration {
- public void declare(String prevComponent, InputDeclarer declarer);
- }
-
- private static class InputDeclarerImpl extends BaseConfigurationDeclarer<LinearDRPCInputDeclarer> implements LinearDRPCInputDeclarer {
- Component _component;
-
- public InputDeclarerImpl(Component component) {
- _component = component;
- }
-
- @Override
- public LinearDRPCInputDeclarer fieldsGrouping(final Fields fields) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.fieldsGrouping(prevComponent, fields);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer fieldsGrouping(final String streamId, final Fields fields) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.fieldsGrouping(prevComponent, streamId, fields);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer globalGrouping() {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.globalGrouping(prevComponent);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer globalGrouping(final String streamId) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.globalGrouping(prevComponent, streamId);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer shuffleGrouping() {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.shuffleGrouping(prevComponent);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer shuffleGrouping(final String streamId) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.shuffleGrouping(prevComponent, streamId);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer localOrShuffleGrouping() {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.localOrShuffleGrouping(prevComponent);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer localOrShuffleGrouping(final String streamId) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.localOrShuffleGrouping(prevComponent, streamId);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer noneGrouping() {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.noneGrouping(prevComponent);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer noneGrouping(final String streamId) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.noneGrouping(prevComponent, streamId);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer allGrouping() {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.allGrouping(prevComponent);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer allGrouping(final String streamId) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.allGrouping(prevComponent, streamId);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer directGrouping() {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.directGrouping(prevComponent);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer directGrouping(final String streamId) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.directGrouping(prevComponent, streamId);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer partialKeyGrouping(Fields fields) {
- return customGrouping(new PartialKeyGrouping(fields));
- }
-
- @Override
- public LinearDRPCInputDeclarer partialKeyGrouping(String streamId, Fields fields) {
- return customGrouping(streamId, new PartialKeyGrouping(fields));
- }
-
- @Override
- public LinearDRPCInputDeclarer customGrouping(final CustomStreamGrouping grouping) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.customGrouping(prevComponent, grouping);
- }
- });
- return this;
- }
-
- @Override
- public LinearDRPCInputDeclarer customGrouping(final String streamId, final CustomStreamGrouping grouping) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(String prevComponent, InputDeclarer declarer) {
- declarer.customGrouping(prevComponent, streamId, grouping);
- }
- });
- return this;
- }
-
- private void addDeclaration(InputDeclaration declaration) {
- _component.declarations.add(declaration);
- }
-
- @Override
- public LinearDRPCInputDeclarer addConfigurations(Map<String, Object> conf) {
- _component.componentConfs.add(conf);
- return this;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/drpc/PrepareRequest.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/drpc/PrepareRequest.java b/storm-core/src/jvm/backtype/storm/drpc/PrepareRequest.java
deleted file mode 100644
index 15a3320..0000000
--- a/storm-core/src/jvm/backtype/storm/drpc/PrepareRequest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.drpc;
-
-import org.apache.storm.task.TopologyContext;
-import org.apache.storm.topology.BasicOutputCollector;
-import org.apache.storm.topology.OutputFieldsDeclarer;
-import org.apache.storm.topology.base.BaseBasicBolt;
-import org.apache.storm.tuple.Fields;
-import org.apache.storm.tuple.Tuple;
-import org.apache.storm.tuple.Values;
-import java.util.Map;
-import java.util.Random;
-import org.apache.storm.utils.Utils;
-
-
-public class PrepareRequest extends BaseBasicBolt {
- public static final String ARGS_STREAM = Utils.DEFAULT_STREAM_ID;
- public static final String RETURN_STREAM = "ret";
- public static final String ID_STREAM = "id";
-
- Random rand;
-
- @Override
- public void prepare(Map map, TopologyContext context) {
- rand = new Random();
- }
-
- @Override
- public void execute(Tuple tuple, BasicOutputCollector collector) {
- String args = tuple.getString(0);
- String returnInfo = tuple.getString(1);
- long requestId = rand.nextLong();
- collector.emit(ARGS_STREAM, new Values(requestId, args));
- collector.emit(RETURN_STREAM, new Values(requestId, returnInfo));
- collector.emit(ID_STREAM, new Values(requestId));
- }
-
- public void declareOutputFields(OutputFieldsDeclarer declarer) {
- declarer.declareStream(ARGS_STREAM, new Fields("request", "args"));
- declarer.declareStream(RETURN_STREAM, new Fields("request", "return"));
- declarer.declareStream(ID_STREAM, new Fields("request"));
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/drpc/ReturnResults.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/drpc/ReturnResults.java b/storm-core/src/jvm/backtype/storm/drpc/ReturnResults.java
deleted file mode 100644
index a9a5aa1..0000000
--- a/storm-core/src/jvm/backtype/storm/drpc/ReturnResults.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.drpc;
-
-import org.apache.storm.Config;
-import org.apache.storm.generated.DistributedRPCInvocations;
-import org.apache.storm.generated.AuthorizationException;
-import org.apache.storm.task.OutputCollector;
-import org.apache.storm.task.TopologyContext;
-import org.apache.storm.topology.OutputFieldsDeclarer;
-import org.apache.storm.topology.base.BaseRichBolt;
-import org.apache.storm.tuple.Tuple;
-import org.apache.storm.utils.ServiceRegistry;
-import org.apache.storm.utils.Utils;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.thrift.TException;
-import org.apache.thrift.transport.TTransportException;
-import org.json.simple.JSONValue;
-
-
-public class ReturnResults extends BaseRichBolt {
- //ANY CHANGE TO THIS CODE MUST BE SERIALIZABLE COMPATIBLE OR THERE WILL BE PROBLEMS
- static final long serialVersionUID = -774882142710631591L;
-
- public static final Logger LOG = LoggerFactory.getLogger(ReturnResults.class);
- OutputCollector _collector;
- boolean local;
- Map _conf;
- Map<List, DRPCInvocationsClient> _clients = new HashMap<List, DRPCInvocationsClient>();
-
- @Override
- public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
- _conf = stormConf;
- _collector = collector;
- local = stormConf.get(Config.STORM_CLUSTER_MODE).equals("local");
- }
-
- @Override
- public void execute(Tuple input) {
- String result = (String) input.getValue(0);
- String returnInfo = (String) input.getValue(1);
- if(returnInfo!=null) {
- Map retMap = (Map) JSONValue.parse(returnInfo);
- final String host = (String) retMap.get("host");
- final int port = Utils.getInt(retMap.get("port"));
- String id = (String) retMap.get("id");
- DistributedRPCInvocations.Iface client;
- if(local) {
- client = (DistributedRPCInvocations.Iface) ServiceRegistry.getService(host);
- } else {
- List server = new ArrayList() {{
- add(host);
- add(port);
- }};
-
- if(!_clients.containsKey(server)) {
- try {
- _clients.put(server, new DRPCInvocationsClient(_conf, host, port));
- } catch (TTransportException ex) {
- throw new RuntimeException(ex);
- }
- }
- client = _clients.get(server);
- }
-
-
- int retryCnt = 0;
- int maxRetries = 3;
- while (retryCnt < maxRetries) {
- retryCnt++;
- try {
- client.result(id, result);
- _collector.ack(input);
- break;
- } catch (AuthorizationException aze) {
- LOG.error("Not authorized to return results to DRPC server", aze);
- _collector.fail(input);
- throw new RuntimeException(aze);
- } catch (TException tex) {
- if (retryCnt >= maxRetries) {
- LOG.error("Failed to return results to DRPC server", tex);
- _collector.fail(input);
- }
- reconnectClient((DRPCInvocationsClient) client);
- }
- }
- }
- }
-
- private void reconnectClient(DRPCInvocationsClient client) {
- if (client instanceof DRPCInvocationsClient) {
- try {
- LOG.info("reconnecting... ");
- client.reconnectClient(); //Blocking call
- } catch (TException e2) {
- LOG.error("Failed to connect to DRPC server", e2);
- }
- }
- }
- @Override
- public void cleanup() {
- for(DRPCInvocationsClient c: _clients.values()) {
- c.close();
- }
- }
-
- public void declareOutputFields(OutputFieldsDeclarer declarer) {
- }
-}
[21/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/HBRecords.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/HBRecords.java b/storm-core/src/jvm/backtype/storm/generated/HBRecords.java
deleted file mode 100644
index 6a6d4f2..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/HBRecords.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class HBRecords implements org.apache.thrift.TBase<HBRecords, HBRecords._Fields>, java.io.Serializable, Cloneable, Comparable<HBRecords> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HBRecords");
-
- private static final org.apache.thrift.protocol.TField PULSES_FIELD_DESC = new org.apache.thrift.protocol.TField("pulses", org.apache.thrift.protocol.TType.LIST, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new HBRecordsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new HBRecordsTupleSchemeFactory());
- }
-
- private List<HBPulse> pulses; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- PULSES((short)1, "pulses");
-
- private static final Map<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: // PULSES
- return PULSES;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.PULSES, new org.apache.thrift.meta_data.FieldMetaData("pulses", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HBPulse.class))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HBRecords.class, metaDataMap);
- }
-
- public HBRecords() {
- }
-
- public HBRecords(
- List<HBPulse> pulses)
- {
- this();
- this.pulses = pulses;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public HBRecords(HBRecords other) {
- if (other.is_set_pulses()) {
- List<HBPulse> __this__pulses = new ArrayList<HBPulse>(other.pulses.size());
- for (HBPulse other_element : other.pulses) {
- __this__pulses.add(new HBPulse(other_element));
- }
- this.pulses = __this__pulses;
- }
- }
-
- public HBRecords deepCopy() {
- return new HBRecords(this);
- }
-
- @Override
- public void clear() {
- this.pulses = null;
- }
-
- public int get_pulses_size() {
- return (this.pulses == null) ? 0 : this.pulses.size();
- }
-
- public java.util.Iterator<HBPulse> get_pulses_iterator() {
- return (this.pulses == null) ? null : this.pulses.iterator();
- }
-
- public void add_to_pulses(HBPulse elem) {
- if (this.pulses == null) {
- this.pulses = new ArrayList<HBPulse>();
- }
- this.pulses.add(elem);
- }
-
- public List<HBPulse> get_pulses() {
- return this.pulses;
- }
-
- public void set_pulses(List<HBPulse> pulses) {
- this.pulses = pulses;
- }
-
- public void unset_pulses() {
- this.pulses = null;
- }
-
- /** Returns true if field pulses is set (has been assigned a value) and false otherwise */
- public boolean is_set_pulses() {
- return this.pulses != null;
- }
-
- public void set_pulses_isSet(boolean value) {
- if (!value) {
- this.pulses = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case PULSES:
- if (value == null) {
- unset_pulses();
- } else {
- set_pulses((List<HBPulse>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case PULSES:
- return get_pulses();
-
- }
- 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 PULSES:
- return is_set_pulses();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof HBRecords)
- return this.equals((HBRecords)that);
- return false;
- }
-
- public boolean equals(HBRecords that) {
- if (that == null)
- return false;
-
- boolean this_present_pulses = true && this.is_set_pulses();
- boolean that_present_pulses = true && that.is_set_pulses();
- if (this_present_pulses || that_present_pulses) {
- if (!(this_present_pulses && that_present_pulses))
- return false;
- if (!this.pulses.equals(that.pulses))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_pulses = true && (is_set_pulses());
- list.add(present_pulses);
- if (present_pulses)
- list.add(pulses);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(HBRecords other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_pulses()).compareTo(other.is_set_pulses());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_pulses()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pulses, other.pulses);
- 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("HBRecords(");
- boolean first = true;
-
- sb.append("pulses:");
- if (this.pulses == null) {
- sb.append("null");
- } else {
- sb.append(this.pulses);
- }
- 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 {
- 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 HBRecordsStandardSchemeFactory implements SchemeFactory {
- public HBRecordsStandardScheme getScheme() {
- return new HBRecordsStandardScheme();
- }
- }
-
- private static class HBRecordsStandardScheme extends StandardScheme<HBRecords> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, HBRecords 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: // PULSES
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list792 = iprot.readListBegin();
- struct.pulses = new ArrayList<HBPulse>(_list792.size);
- HBPulse _elem793;
- for (int _i794 = 0; _i794 < _list792.size; ++_i794)
- {
- _elem793 = new HBPulse();
- _elem793.read(iprot);
- struct.pulses.add(_elem793);
- }
- iprot.readListEnd();
- }
- struct.set_pulses_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, HBRecords struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.pulses != null) {
- oprot.writeFieldBegin(PULSES_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.pulses.size()));
- for (HBPulse _iter795 : struct.pulses)
- {
- _iter795.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class HBRecordsTupleSchemeFactory implements SchemeFactory {
- public HBRecordsTupleScheme getScheme() {
- return new HBRecordsTupleScheme();
- }
- }
-
- private static class HBRecordsTupleScheme extends TupleScheme<HBRecords> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, HBRecords struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_pulses()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_pulses()) {
- {
- oprot.writeI32(struct.pulses.size());
- for (HBPulse _iter796 : struct.pulses)
- {
- _iter796.write(oprot);
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, HBRecords struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- {
- org.apache.thrift.protocol.TList _list797 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.pulses = new ArrayList<HBPulse>(_list797.size);
- HBPulse _elem798;
- for (int _i799 = 0; _i799 < _list797.size; ++_i799)
- {
- _elem798 = new HBPulse();
- _elem798.read(iprot);
- struct.pulses.add(_elem798);
- }
- }
- struct.set_pulses_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/HBServerMessageType.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/HBServerMessageType.java b/storm-core/src/jvm/backtype/storm/generated/HBServerMessageType.java
deleted file mode 100644
index 81e0826..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/HBServerMessageType.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum HBServerMessageType implements org.apache.thrift.TEnum {
- CREATE_PATH(0),
- CREATE_PATH_RESPONSE(1),
- EXISTS(2),
- EXISTS_RESPONSE(3),
- SEND_PULSE(4),
- SEND_PULSE_RESPONSE(5),
- GET_ALL_PULSE_FOR_PATH(6),
- GET_ALL_PULSE_FOR_PATH_RESPONSE(7),
- GET_ALL_NODES_FOR_PATH(8),
- GET_ALL_NODES_FOR_PATH_RESPONSE(9),
- GET_PULSE(10),
- GET_PULSE_RESPONSE(11),
- DELETE_PATH(12),
- DELETE_PATH_RESPONSE(13),
- DELETE_PULSE_ID(14),
- DELETE_PULSE_ID_RESPONSE(15),
- CONTROL_MESSAGE(16),
- SASL_MESSAGE_TOKEN(17),
- NOT_AUTHORIZED(18);
-
- private final int value;
-
- private HBServerMessageType(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static HBServerMessageType findByValue(int value) {
- switch (value) {
- case 0:
- return CREATE_PATH;
- case 1:
- return CREATE_PATH_RESPONSE;
- case 2:
- return EXISTS;
- case 3:
- return EXISTS_RESPONSE;
- case 4:
- return SEND_PULSE;
- case 5:
- return SEND_PULSE_RESPONSE;
- case 6:
- return GET_ALL_PULSE_FOR_PATH;
- case 7:
- return GET_ALL_PULSE_FOR_PATH_RESPONSE;
- case 8:
- return GET_ALL_NODES_FOR_PATH;
- case 9:
- return GET_ALL_NODES_FOR_PATH_RESPONSE;
- case 10:
- return GET_PULSE;
- case 11:
- return GET_PULSE_RESPONSE;
- case 12:
- return DELETE_PATH;
- case 13:
- return DELETE_PATH_RESPONSE;
- case 14:
- return DELETE_PULSE_ID;
- case 15:
- return DELETE_PULSE_ID_RESPONSE;
- case 16:
- return CONTROL_MESSAGE;
- case 17:
- return SASL_MESSAGE_TOKEN;
- case 18:
- return NOT_AUTHORIZED;
- default:
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/InvalidTopologyException.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/InvalidTopologyException.java b/storm-core/src/jvm/backtype/storm/generated/InvalidTopologyException.java
deleted file mode 100644
index 9591412..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/InvalidTopologyException.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class InvalidTopologyException extends TException implements org.apache.thrift.TBase<InvalidTopologyException, InvalidTopologyException._Fields>, java.io.Serializable, Cloneable, Comparable<InvalidTopologyException> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InvalidTopologyException");
-
- 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 InvalidTopologyExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new InvalidTopologyExceptionTupleSchemeFactory());
- }
-
- 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(InvalidTopologyException.class, metaDataMap);
- }
-
- public InvalidTopologyException() {
- }
-
- public InvalidTopologyException(
- String msg)
- {
- this();
- this.msg = msg;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public InvalidTopologyException(InvalidTopologyException other) {
- if (other.is_set_msg()) {
- this.msg = other.msg;
- }
- }
-
- public InvalidTopologyException deepCopy() {
- return new InvalidTopologyException(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 InvalidTopologyException)
- return this.equals((InvalidTopologyException)that);
- return false;
- }
-
- public boolean equals(InvalidTopologyException 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(InvalidTopologyException 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("InvalidTopologyException(");
- 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 InvalidTopologyExceptionStandardSchemeFactory implements SchemeFactory {
- public InvalidTopologyExceptionStandardScheme getScheme() {
- return new InvalidTopologyExceptionStandardScheme();
- }
- }
-
- private static class InvalidTopologyExceptionStandardScheme extends StandardScheme<InvalidTopologyException> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, InvalidTopologyException 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, InvalidTopologyException 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 InvalidTopologyExceptionTupleSchemeFactory implements SchemeFactory {
- public InvalidTopologyExceptionTupleScheme getScheme() {
- return new InvalidTopologyExceptionTupleScheme();
- }
- }
-
- private static class InvalidTopologyExceptionTupleScheme extends TupleScheme<InvalidTopologyException> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, InvalidTopologyException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.msg);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, InvalidTopologyException 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/a6171bd6/storm-core/src/jvm/backtype/storm/generated/JavaObject.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/JavaObject.java b/storm-core/src/jvm/backtype/storm/generated/JavaObject.java
deleted file mode 100644
index 4d7af9d..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/JavaObject.java
+++ /dev/null
@@ -1,561 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class JavaObject implements org.apache.thrift.TBase<JavaObject, JavaObject._Fields>, java.io.Serializable, Cloneable, Comparable<JavaObject> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JavaObject");
-
- private static final org.apache.thrift.protocol.TField FULL_CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("full_class_name", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField ARGS_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("args_list", org.apache.thrift.protocol.TType.LIST, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new JavaObjectStandardSchemeFactory());
- schemes.put(TupleScheme.class, new JavaObjectTupleSchemeFactory());
- }
-
- private String full_class_name; // required
- private List<JavaObjectArg> args_list; // 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 {
- FULL_CLASS_NAME((short)1, "full_class_name"),
- ARGS_LIST((short)2, "args_list");
-
- 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: // FULL_CLASS_NAME
- return FULL_CLASS_NAME;
- case 2: // ARGS_LIST
- return ARGS_LIST;
- 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.FULL_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("full_class_name", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.ARGS_LIST, new org.apache.thrift.meta_data.FieldMetaData("args_list", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JavaObjectArg.class))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JavaObject.class, metaDataMap);
- }
-
- public JavaObject() {
- }
-
- public JavaObject(
- String full_class_name,
- List<JavaObjectArg> args_list)
- {
- this();
- this.full_class_name = full_class_name;
- this.args_list = args_list;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public JavaObject(JavaObject other) {
- if (other.is_set_full_class_name()) {
- this.full_class_name = other.full_class_name;
- }
- if (other.is_set_args_list()) {
- List<JavaObjectArg> __this__args_list = new ArrayList<JavaObjectArg>(other.args_list.size());
- for (JavaObjectArg other_element : other.args_list) {
- __this__args_list.add(new JavaObjectArg(other_element));
- }
- this.args_list = __this__args_list;
- }
- }
-
- public JavaObject deepCopy() {
- return new JavaObject(this);
- }
-
- @Override
- public void clear() {
- this.full_class_name = null;
- this.args_list = null;
- }
-
- public String get_full_class_name() {
- return this.full_class_name;
- }
-
- public void set_full_class_name(String full_class_name) {
- this.full_class_name = full_class_name;
- }
-
- public void unset_full_class_name() {
- this.full_class_name = null;
- }
-
- /** Returns true if field full_class_name is set (has been assigned a value) and false otherwise */
- public boolean is_set_full_class_name() {
- return this.full_class_name != null;
- }
-
- public void set_full_class_name_isSet(boolean value) {
- if (!value) {
- this.full_class_name = null;
- }
- }
-
- public int get_args_list_size() {
- return (this.args_list == null) ? 0 : this.args_list.size();
- }
-
- public java.util.Iterator<JavaObjectArg> get_args_list_iterator() {
- return (this.args_list == null) ? null : this.args_list.iterator();
- }
-
- public void add_to_args_list(JavaObjectArg elem) {
- if (this.args_list == null) {
- this.args_list = new ArrayList<JavaObjectArg>();
- }
- this.args_list.add(elem);
- }
-
- public List<JavaObjectArg> get_args_list() {
- return this.args_list;
- }
-
- public void set_args_list(List<JavaObjectArg> args_list) {
- this.args_list = args_list;
- }
-
- public void unset_args_list() {
- this.args_list = null;
- }
-
- /** Returns true if field args_list is set (has been assigned a value) and false otherwise */
- public boolean is_set_args_list() {
- return this.args_list != null;
- }
-
- public void set_args_list_isSet(boolean value) {
- if (!value) {
- this.args_list = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case FULL_CLASS_NAME:
- if (value == null) {
- unset_full_class_name();
- } else {
- set_full_class_name((String)value);
- }
- break;
-
- case ARGS_LIST:
- if (value == null) {
- unset_args_list();
- } else {
- set_args_list((List<JavaObjectArg>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case FULL_CLASS_NAME:
- return get_full_class_name();
-
- case ARGS_LIST:
- return get_args_list();
-
- }
- 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 FULL_CLASS_NAME:
- return is_set_full_class_name();
- case ARGS_LIST:
- return is_set_args_list();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof JavaObject)
- return this.equals((JavaObject)that);
- return false;
- }
-
- public boolean equals(JavaObject that) {
- if (that == null)
- return false;
-
- boolean this_present_full_class_name = true && this.is_set_full_class_name();
- boolean that_present_full_class_name = true && that.is_set_full_class_name();
- if (this_present_full_class_name || that_present_full_class_name) {
- if (!(this_present_full_class_name && that_present_full_class_name))
- return false;
- if (!this.full_class_name.equals(that.full_class_name))
- return false;
- }
-
- boolean this_present_args_list = true && this.is_set_args_list();
- boolean that_present_args_list = true && that.is_set_args_list();
- if (this_present_args_list || that_present_args_list) {
- if (!(this_present_args_list && that_present_args_list))
- return false;
- if (!this.args_list.equals(that.args_list))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_full_class_name = true && (is_set_full_class_name());
- list.add(present_full_class_name);
- if (present_full_class_name)
- list.add(full_class_name);
-
- boolean present_args_list = true && (is_set_args_list());
- list.add(present_args_list);
- if (present_args_list)
- list.add(args_list);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(JavaObject other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_full_class_name()).compareTo(other.is_set_full_class_name());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_full_class_name()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.full_class_name, other.full_class_name);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_args_list()).compareTo(other.is_set_args_list());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_args_list()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.args_list, other.args_list);
- 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("JavaObject(");
- boolean first = true;
-
- sb.append("full_class_name:");
- if (this.full_class_name == null) {
- sb.append("null");
- } else {
- sb.append(this.full_class_name);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("args_list:");
- if (this.args_list == null) {
- sb.append("null");
- } else {
- sb.append(this.args_list);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_full_class_name()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'full_class_name' is unset! Struct:" + toString());
- }
-
- if (!is_set_args_list()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'args_list' 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 JavaObjectStandardSchemeFactory implements SchemeFactory {
- public JavaObjectStandardScheme getScheme() {
- return new JavaObjectStandardScheme();
- }
- }
-
- private static class JavaObjectStandardScheme extends StandardScheme<JavaObject> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, JavaObject 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: // FULL_CLASS_NAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.full_class_name = iprot.readString();
- struct.set_full_class_name_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // ARGS_LIST
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
- struct.args_list = new ArrayList<JavaObjectArg>(_list0.size);
- JavaObjectArg _elem1;
- for (int _i2 = 0; _i2 < _list0.size; ++_i2)
- {
- _elem1 = new JavaObjectArg();
- _elem1.read(iprot);
- struct.args_list.add(_elem1);
- }
- iprot.readListEnd();
- }
- struct.set_args_list_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, JavaObject struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.full_class_name != null) {
- oprot.writeFieldBegin(FULL_CLASS_NAME_FIELD_DESC);
- oprot.writeString(struct.full_class_name);
- oprot.writeFieldEnd();
- }
- if (struct.args_list != null) {
- oprot.writeFieldBegin(ARGS_LIST_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.args_list.size()));
- for (JavaObjectArg _iter3 : struct.args_list)
- {
- _iter3.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class JavaObjectTupleSchemeFactory implements SchemeFactory {
- public JavaObjectTupleScheme getScheme() {
- return new JavaObjectTupleScheme();
- }
- }
-
- private static class JavaObjectTupleScheme extends TupleScheme<JavaObject> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, JavaObject struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.full_class_name);
- {
- oprot.writeI32(struct.args_list.size());
- for (JavaObjectArg _iter4 : struct.args_list)
- {
- _iter4.write(oprot);
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, JavaObject struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.full_class_name = iprot.readString();
- struct.set_full_class_name_isSet(true);
- {
- org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.args_list = new ArrayList<JavaObjectArg>(_list5.size);
- JavaObjectArg _elem6;
- for (int _i7 = 0; _i7 < _list5.size; ++_i7)
- {
- _elem6 = new JavaObjectArg();
- _elem6.read(iprot);
- struct.args_list.add(_elem6);
- }
- }
- struct.set_args_list_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/JavaObjectArg.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/JavaObjectArg.java b/storm-core/src/jvm/backtype/storm/generated/JavaObjectArg.java
deleted file mode 100644
index bcb2596..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/JavaObjectArg.java
+++ /dev/null
@@ -1,631 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-public class JavaObjectArg extends org.apache.thrift.TUnion<JavaObjectArg, JavaObjectArg._Fields> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JavaObjectArg");
- private static final org.apache.thrift.protocol.TField INT_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("int_arg", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField LONG_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("long_arg", org.apache.thrift.protocol.TType.I64, (short)2);
- private static final org.apache.thrift.protocol.TField STRING_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("string_arg", org.apache.thrift.protocol.TType.STRING, (short)3);
- private static final org.apache.thrift.protocol.TField BOOL_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("bool_arg", org.apache.thrift.protocol.TType.BOOL, (short)4);
- private static final org.apache.thrift.protocol.TField BINARY_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("binary_arg", org.apache.thrift.protocol.TType.STRING, (short)5);
- private static final org.apache.thrift.protocol.TField DOUBLE_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("double_arg", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- INT_ARG((short)1, "int_arg"),
- LONG_ARG((short)2, "long_arg"),
- STRING_ARG((short)3, "string_arg"),
- BOOL_ARG((short)4, "bool_arg"),
- BINARY_ARG((short)5, "binary_arg"),
- DOUBLE_ARG((short)6, "double_arg");
-
- 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: // INT_ARG
- return INT_ARG;
- case 2: // LONG_ARG
- return LONG_ARG;
- case 3: // STRING_ARG
- return STRING_ARG;
- case 4: // BOOL_ARG
- return BOOL_ARG;
- case 5: // BINARY_ARG
- return BINARY_ARG;
- case 6: // DOUBLE_ARG
- return DOUBLE_ARG;
- 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;
- }
- }
-
- 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.INT_ARG, new org.apache.thrift.meta_data.FieldMetaData("int_arg", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.LONG_ARG, new org.apache.thrift.meta_data.FieldMetaData("long_arg", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.STRING_ARG, new org.apache.thrift.meta_data.FieldMetaData("string_arg", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.BOOL_ARG, new org.apache.thrift.meta_data.FieldMetaData("bool_arg", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
- tmpMap.put(_Fields.BINARY_ARG, new org.apache.thrift.meta_data.FieldMetaData("binary_arg", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
- tmpMap.put(_Fields.DOUBLE_ARG, new org.apache.thrift.meta_data.FieldMetaData("double_arg", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JavaObjectArg.class, metaDataMap);
- }
-
- public JavaObjectArg() {
- super();
- }
-
- public JavaObjectArg(_Fields setField, Object value) {
- super(setField, value);
- }
-
- public JavaObjectArg(JavaObjectArg other) {
- super(other);
- }
- public JavaObjectArg deepCopy() {
- return new JavaObjectArg(this);
- }
-
- public static JavaObjectArg int_arg(int value) {
- JavaObjectArg x = new JavaObjectArg();
- x.set_int_arg(value);
- return x;
- }
-
- public static JavaObjectArg long_arg(long value) {
- JavaObjectArg x = new JavaObjectArg();
- x.set_long_arg(value);
- return x;
- }
-
- public static JavaObjectArg string_arg(String value) {
- JavaObjectArg x = new JavaObjectArg();
- x.set_string_arg(value);
- return x;
- }
-
- public static JavaObjectArg bool_arg(boolean value) {
- JavaObjectArg x = new JavaObjectArg();
- x.set_bool_arg(value);
- return x;
- }
-
- public static JavaObjectArg binary_arg(ByteBuffer value) {
- JavaObjectArg x = new JavaObjectArg();
- x.set_binary_arg(value);
- return x;
- }
-
- public static JavaObjectArg binary_arg(byte[] value) {
- JavaObjectArg x = new JavaObjectArg();
- x.set_binary_arg(ByteBuffer.wrap(Arrays.copyOf(value, value.length)));
- return x;
- }
-
- public static JavaObjectArg double_arg(double value) {
- JavaObjectArg x = new JavaObjectArg();
- x.set_double_arg(value);
- return x;
- }
-
-
- @Override
- protected void checkType(_Fields setField, Object value) throws ClassCastException {
- switch (setField) {
- case INT_ARG:
- if (value instanceof Integer) {
- break;
- }
- throw new ClassCastException("Was expecting value of type Integer for field 'int_arg', but got " + value.getClass().getSimpleName());
- case LONG_ARG:
- if (value instanceof Long) {
- break;
- }
- throw new ClassCastException("Was expecting value of type Long for field 'long_arg', but got " + value.getClass().getSimpleName());
- case STRING_ARG:
- if (value instanceof String) {
- break;
- }
- throw new ClassCastException("Was expecting value of type String for field 'string_arg', but got " + value.getClass().getSimpleName());
- case BOOL_ARG:
- if (value instanceof Boolean) {
- break;
- }
- throw new ClassCastException("Was expecting value of type Boolean for field 'bool_arg', but got " + value.getClass().getSimpleName());
- case BINARY_ARG:
- if (value instanceof ByteBuffer) {
- break;
- }
- throw new ClassCastException("Was expecting value of type ByteBuffer for field 'binary_arg', but got " + value.getClass().getSimpleName());
- case DOUBLE_ARG:
- if (value instanceof Double) {
- break;
- }
- throw new ClassCastException("Was expecting value of type Double for field 'double_arg', but got " + value.getClass().getSimpleName());
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(field.id);
- if (setField != null) {
- switch (setField) {
- case INT_ARG:
- if (field.type == INT_ARG_FIELD_DESC.type) {
- Integer int_arg;
- int_arg = iprot.readI32();
- return int_arg;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case LONG_ARG:
- if (field.type == LONG_ARG_FIELD_DESC.type) {
- Long long_arg;
- long_arg = iprot.readI64();
- return long_arg;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case STRING_ARG:
- if (field.type == STRING_ARG_FIELD_DESC.type) {
- String string_arg;
- string_arg = iprot.readString();
- return string_arg;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case BOOL_ARG:
- if (field.type == BOOL_ARG_FIELD_DESC.type) {
- Boolean bool_arg;
- bool_arg = iprot.readBool();
- return bool_arg;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case BINARY_ARG:
- if (field.type == BINARY_ARG_FIELD_DESC.type) {
- ByteBuffer binary_arg;
- binary_arg = iprot.readBinary();
- return binary_arg;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case DOUBLE_ARG:
- if (field.type == DOUBLE_ARG_FIELD_DESC.type) {
- Double double_arg;
- double_arg = iprot.readDouble();
- return double_arg;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- }
-
- @Override
- protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case INT_ARG:
- Integer int_arg = (Integer)value_;
- oprot.writeI32(int_arg);
- return;
- case LONG_ARG:
- Long long_arg = (Long)value_;
- oprot.writeI64(long_arg);
- return;
- case STRING_ARG:
- String string_arg = (String)value_;
- oprot.writeString(string_arg);
- return;
- case BOOL_ARG:
- Boolean bool_arg = (Boolean)value_;
- oprot.writeBool(bool_arg);
- return;
- case BINARY_ARG:
- ByteBuffer binary_arg = (ByteBuffer)value_;
- oprot.writeBinary(binary_arg);
- return;
- case DOUBLE_ARG:
- Double double_arg = (Double)value_;
- oprot.writeDouble(double_arg);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(fieldID);
- if (setField != null) {
- switch (setField) {
- case INT_ARG:
- Integer int_arg;
- int_arg = iprot.readI32();
- return int_arg;
- case LONG_ARG:
- Long long_arg;
- long_arg = iprot.readI64();
- return long_arg;
- case STRING_ARG:
- String string_arg;
- string_arg = iprot.readString();
- return string_arg;
- case BOOL_ARG:
- Boolean bool_arg;
- bool_arg = iprot.readBool();
- return bool_arg;
- case BINARY_ARG:
- ByteBuffer binary_arg;
- binary_arg = iprot.readBinary();
- return binary_arg;
- case DOUBLE_ARG:
- Double double_arg;
- double_arg = iprot.readDouble();
- return double_arg;
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- throw new TProtocolException("Couldn't find a field with field id " + fieldID);
- }
- }
-
- @Override
- protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case INT_ARG:
- Integer int_arg = (Integer)value_;
- oprot.writeI32(int_arg);
- return;
- case LONG_ARG:
- Long long_arg = (Long)value_;
- oprot.writeI64(long_arg);
- return;
- case STRING_ARG:
- String string_arg = (String)value_;
- oprot.writeString(string_arg);
- return;
- case BOOL_ARG:
- Boolean bool_arg = (Boolean)value_;
- oprot.writeBool(bool_arg);
- return;
- case BINARY_ARG:
- ByteBuffer binary_arg = (ByteBuffer)value_;
- oprot.writeBinary(binary_arg);
- return;
- case DOUBLE_ARG:
- Double double_arg = (Double)value_;
- oprot.writeDouble(double_arg);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) {
- switch (setField) {
- case INT_ARG:
- return INT_ARG_FIELD_DESC;
- case LONG_ARG:
- return LONG_ARG_FIELD_DESC;
- case STRING_ARG:
- return STRING_ARG_FIELD_DESC;
- case BOOL_ARG:
- return BOOL_ARG_FIELD_DESC;
- case BINARY_ARG:
- return BINARY_ARG_FIELD_DESC;
- case DOUBLE_ARG:
- return DOUBLE_ARG_FIELD_DESC;
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TStruct getStructDesc() {
- return STRUCT_DESC;
- }
-
- @Override
- protected _Fields enumForId(short id) {
- return _Fields.findByThriftIdOrThrow(id);
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
-
- public int get_int_arg() {
- if (getSetField() == _Fields.INT_ARG) {
- return (Integer)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'int_arg' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_int_arg(int value) {
- setField_ = _Fields.INT_ARG;
- value_ = value;
- }
-
- public long get_long_arg() {
- if (getSetField() == _Fields.LONG_ARG) {
- return (Long)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'long_arg' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_long_arg(long value) {
- setField_ = _Fields.LONG_ARG;
- value_ = value;
- }
-
- public String get_string_arg() {
- if (getSetField() == _Fields.STRING_ARG) {
- return (String)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'string_arg' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_string_arg(String value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.STRING_ARG;
- value_ = value;
- }
-
- public boolean get_bool_arg() {
- if (getSetField() == _Fields.BOOL_ARG) {
- return (Boolean)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'bool_arg' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_bool_arg(boolean value) {
- setField_ = _Fields.BOOL_ARG;
- value_ = value;
- }
-
- public byte[] get_binary_arg() {
- set_binary_arg(org.apache.thrift.TBaseHelper.rightSize(buffer_for_binary_arg()));
- ByteBuffer b = buffer_for_binary_arg();
- return b == null ? null : b.array();
- }
-
- public ByteBuffer buffer_for_binary_arg() {
- if (getSetField() == _Fields.BINARY_ARG) {
- return org.apache.thrift.TBaseHelper.copyBinary((ByteBuffer)getFieldValue());
- } else {
- throw new RuntimeException("Cannot get field 'binary_arg' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_binary_arg(byte[] value) {
- set_binary_arg(ByteBuffer.wrap(Arrays.copyOf(value, value.length)));
- }
-
- public void set_binary_arg(ByteBuffer value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.BINARY_ARG;
- value_ = value;
- }
-
- public double get_double_arg() {
- if (getSetField() == _Fields.DOUBLE_ARG) {
- return (Double)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'double_arg' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_double_arg(double value) {
- setField_ = _Fields.DOUBLE_ARG;
- value_ = value;
- }
-
- public boolean is_set_int_arg() {
- return setField_ == _Fields.INT_ARG;
- }
-
-
- public boolean is_set_long_arg() {
- return setField_ == _Fields.LONG_ARG;
- }
-
-
- public boolean is_set_string_arg() {
- return setField_ == _Fields.STRING_ARG;
- }
-
-
- public boolean is_set_bool_arg() {
- return setField_ == _Fields.BOOL_ARG;
- }
-
-
- public boolean is_set_binary_arg() {
- return setField_ == _Fields.BINARY_ARG;
- }
-
-
- public boolean is_set_double_arg() {
- return setField_ == _Fields.DOUBLE_ARG;
- }
-
-
- public boolean equals(Object other) {
- if (other instanceof JavaObjectArg) {
- return equals((JavaObjectArg)other);
- } else {
- return false;
- }
- }
-
- public boolean equals(JavaObjectArg other) {
- return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue());
- }
-
- @Override
- public int compareTo(JavaObjectArg other) {
- int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField());
- if (lastComparison == 0) {
- return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue());
- }
- return lastComparison;
- }
-
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
- list.add(this.getClass().getName());
- org.apache.thrift.TFieldIdEnum setField = getSetField();
- if (setField != null) {
- list.add(setField.getThriftFieldId());
- Object value = getFieldValue();
- if (value instanceof org.apache.thrift.TEnum) {
- list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
- } else {
- list.add(value);
- }
- }
- return list.hashCode();
- }
- 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);
- }
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/KeyAlreadyExistsException.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/KeyAlreadyExistsException.java b/storm-core/src/jvm/backtype/storm/generated/KeyAlreadyExistsException.java
deleted file mode 100644
index 32b0a74..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/KeyAlreadyExistsException.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class KeyAlreadyExistsException extends TException implements org.apache.thrift.TBase<KeyAlreadyExistsException, KeyAlreadyExistsException._Fields>, java.io.Serializable, Cloneable, Comparable<KeyAlreadyExistsException> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("KeyAlreadyExistsException");
-
- 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 KeyAlreadyExistsExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new KeyAlreadyExistsExceptionTupleSchemeFactory());
- }
-
- 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(KeyAlreadyExistsException.class, metaDataMap);
- }
-
- public KeyAlreadyExistsException() {
- }
-
- public KeyAlreadyExistsException(
- String msg)
- {
- this();
- this.msg = msg;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public KeyAlreadyExistsException(KeyAlreadyExistsException other) {
- if (other.is_set_msg()) {
- this.msg = other.msg;
- }
- }
-
- public KeyAlreadyExistsException deepCopy() {
- return new KeyAlreadyExistsException(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 KeyAlreadyExistsException)
- return this.equals((KeyAlreadyExistsException)that);
- return false;
- }
-
- public boolean equals(KeyAlreadyExistsException 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(KeyAlreadyExistsException 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("KeyAlreadyExistsException(");
- 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 KeyAlreadyExistsExceptionStandardSchemeFactory implements SchemeFactory {
- public KeyAlreadyExistsExceptionStandardScheme getScheme() {
- return new KeyAlreadyExistsExceptionStandardScheme();
- }
- }
-
- private static class KeyAlreadyExistsExceptionStandardScheme extends StandardScheme<KeyAlreadyExistsException> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, KeyAlreadyExistsException 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, KeyAlreadyExistsException 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 KeyAlreadyExistsExceptionTupleSchemeFactory implements SchemeFactory {
- public KeyAlreadyExistsExceptionTupleScheme getScheme() {
- return new KeyAlreadyExistsExceptionTupleScheme();
- }
- }
-
- private static class KeyAlreadyExistsExceptionTupleScheme extends TupleScheme<KeyAlreadyExistsException> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, KeyAlreadyExistsException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.msg);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, KeyAlreadyExistsException struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.msg = iprot.readString();
- struct.set_msg_isSet(true);
- }
- }
-
-}
-
[04/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyStats.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyStats.java b/storm-core/src/jvm/backtype/storm/generated/TopologyStats.java
deleted file mode 100644
index e63c486..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/TopologyStats.java
+++ /dev/null
@@ -1,1094 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class TopologyStats implements org.apache.thrift.TBase<TopologyStats, TopologyStats._Fields>, java.io.Serializable, Cloneable, Comparable<TopologyStats> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyStats");
-
- private static final org.apache.thrift.protocol.TField WINDOW_TO_EMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_emitted", org.apache.thrift.protocol.TType.MAP, (short)1);
- private static final org.apache.thrift.protocol.TField WINDOW_TO_TRANSFERRED_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_transferred", org.apache.thrift.protocol.TType.MAP, (short)2);
- private static final org.apache.thrift.protocol.TField WINDOW_TO_COMPLETE_LATENCIES_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_complete_latencies_ms", org.apache.thrift.protocol.TType.MAP, (short)3);
- private static final org.apache.thrift.protocol.TField WINDOW_TO_ACKED_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_acked", org.apache.thrift.protocol.TType.MAP, (short)4);
- private static final org.apache.thrift.protocol.TField WINDOW_TO_FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_failed", org.apache.thrift.protocol.TType.MAP, (short)5);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new TopologyStatsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new TopologyStatsTupleSchemeFactory());
- }
-
- private Map<String,Long> window_to_emitted; // optional
- private Map<String,Long> window_to_transferred; // optional
- private Map<String,Double> window_to_complete_latencies_ms; // optional
- private Map<String,Long> window_to_acked; // optional
- private Map<String,Long> window_to_failed; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- WINDOW_TO_EMITTED((short)1, "window_to_emitted"),
- WINDOW_TO_TRANSFERRED((short)2, "window_to_transferred"),
- WINDOW_TO_COMPLETE_LATENCIES_MS((short)3, "window_to_complete_latencies_ms"),
- WINDOW_TO_ACKED((short)4, "window_to_acked"),
- WINDOW_TO_FAILED((short)5, "window_to_failed");
-
- private static final Map<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: // WINDOW_TO_EMITTED
- return WINDOW_TO_EMITTED;
- case 2: // WINDOW_TO_TRANSFERRED
- return WINDOW_TO_TRANSFERRED;
- case 3: // WINDOW_TO_COMPLETE_LATENCIES_MS
- return WINDOW_TO_COMPLETE_LATENCIES_MS;
- case 4: // WINDOW_TO_ACKED
- return WINDOW_TO_ACKED;
- case 5: // WINDOW_TO_FAILED
- return WINDOW_TO_FAILED;
- 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.WINDOW_TO_EMITTED,_Fields.WINDOW_TO_TRANSFERRED,_Fields.WINDOW_TO_COMPLETE_LATENCIES_MS,_Fields.WINDOW_TO_ACKED,_Fields.WINDOW_TO_FAILED};
- 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.WINDOW_TO_EMITTED, new org.apache.thrift.meta_data.FieldMetaData("window_to_emitted", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
- tmpMap.put(_Fields.WINDOW_TO_TRANSFERRED, new org.apache.thrift.meta_data.FieldMetaData("window_to_transferred", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
- tmpMap.put(_Fields.WINDOW_TO_COMPLETE_LATENCIES_MS, new org.apache.thrift.meta_data.FieldMetaData("window_to_complete_latencies_ms", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
- tmpMap.put(_Fields.WINDOW_TO_ACKED, new org.apache.thrift.meta_data.FieldMetaData("window_to_acked", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
- tmpMap.put(_Fields.WINDOW_TO_FAILED, new org.apache.thrift.meta_data.FieldMetaData("window_to_failed", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologyStats.class, metaDataMap);
- }
-
- public TopologyStats() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public TopologyStats(TopologyStats other) {
- if (other.is_set_window_to_emitted()) {
- Map<String,Long> __this__window_to_emitted = new HashMap<String,Long>(other.window_to_emitted);
- this.window_to_emitted = __this__window_to_emitted;
- }
- if (other.is_set_window_to_transferred()) {
- Map<String,Long> __this__window_to_transferred = new HashMap<String,Long>(other.window_to_transferred);
- this.window_to_transferred = __this__window_to_transferred;
- }
- if (other.is_set_window_to_complete_latencies_ms()) {
- Map<String,Double> __this__window_to_complete_latencies_ms = new HashMap<String,Double>(other.window_to_complete_latencies_ms);
- this.window_to_complete_latencies_ms = __this__window_to_complete_latencies_ms;
- }
- if (other.is_set_window_to_acked()) {
- Map<String,Long> __this__window_to_acked = new HashMap<String,Long>(other.window_to_acked);
- this.window_to_acked = __this__window_to_acked;
- }
- if (other.is_set_window_to_failed()) {
- Map<String,Long> __this__window_to_failed = new HashMap<String,Long>(other.window_to_failed);
- this.window_to_failed = __this__window_to_failed;
- }
- }
-
- public TopologyStats deepCopy() {
- return new TopologyStats(this);
- }
-
- @Override
- public void clear() {
- this.window_to_emitted = null;
- this.window_to_transferred = null;
- this.window_to_complete_latencies_ms = null;
- this.window_to_acked = null;
- this.window_to_failed = null;
- }
-
- public int get_window_to_emitted_size() {
- return (this.window_to_emitted == null) ? 0 : this.window_to_emitted.size();
- }
-
- public void put_to_window_to_emitted(String key, long val) {
- if (this.window_to_emitted == null) {
- this.window_to_emitted = new HashMap<String,Long>();
- }
- this.window_to_emitted.put(key, val);
- }
-
- public Map<String,Long> get_window_to_emitted() {
- return this.window_to_emitted;
- }
-
- public void set_window_to_emitted(Map<String,Long> window_to_emitted) {
- this.window_to_emitted = window_to_emitted;
- }
-
- public void unset_window_to_emitted() {
- this.window_to_emitted = null;
- }
-
- /** Returns true if field window_to_emitted is set (has been assigned a value) and false otherwise */
- public boolean is_set_window_to_emitted() {
- return this.window_to_emitted != null;
- }
-
- public void set_window_to_emitted_isSet(boolean value) {
- if (!value) {
- this.window_to_emitted = null;
- }
- }
-
- public int get_window_to_transferred_size() {
- return (this.window_to_transferred == null) ? 0 : this.window_to_transferred.size();
- }
-
- public void put_to_window_to_transferred(String key, long val) {
- if (this.window_to_transferred == null) {
- this.window_to_transferred = new HashMap<String,Long>();
- }
- this.window_to_transferred.put(key, val);
- }
-
- public Map<String,Long> get_window_to_transferred() {
- return this.window_to_transferred;
- }
-
- public void set_window_to_transferred(Map<String,Long> window_to_transferred) {
- this.window_to_transferred = window_to_transferred;
- }
-
- public void unset_window_to_transferred() {
- this.window_to_transferred = null;
- }
-
- /** Returns true if field window_to_transferred is set (has been assigned a value) and false otherwise */
- public boolean is_set_window_to_transferred() {
- return this.window_to_transferred != null;
- }
-
- public void set_window_to_transferred_isSet(boolean value) {
- if (!value) {
- this.window_to_transferred = null;
- }
- }
-
- public int get_window_to_complete_latencies_ms_size() {
- return (this.window_to_complete_latencies_ms == null) ? 0 : this.window_to_complete_latencies_ms.size();
- }
-
- public void put_to_window_to_complete_latencies_ms(String key, double val) {
- if (this.window_to_complete_latencies_ms == null) {
- this.window_to_complete_latencies_ms = new HashMap<String,Double>();
- }
- this.window_to_complete_latencies_ms.put(key, val);
- }
-
- public Map<String,Double> get_window_to_complete_latencies_ms() {
- return this.window_to_complete_latencies_ms;
- }
-
- public void set_window_to_complete_latencies_ms(Map<String,Double> window_to_complete_latencies_ms) {
- this.window_to_complete_latencies_ms = window_to_complete_latencies_ms;
- }
-
- public void unset_window_to_complete_latencies_ms() {
- this.window_to_complete_latencies_ms = null;
- }
-
- /** Returns true if field window_to_complete_latencies_ms is set (has been assigned a value) and false otherwise */
- public boolean is_set_window_to_complete_latencies_ms() {
- return this.window_to_complete_latencies_ms != null;
- }
-
- public void set_window_to_complete_latencies_ms_isSet(boolean value) {
- if (!value) {
- this.window_to_complete_latencies_ms = null;
- }
- }
-
- public int get_window_to_acked_size() {
- return (this.window_to_acked == null) ? 0 : this.window_to_acked.size();
- }
-
- public void put_to_window_to_acked(String key, long val) {
- if (this.window_to_acked == null) {
- this.window_to_acked = new HashMap<String,Long>();
- }
- this.window_to_acked.put(key, val);
- }
-
- public Map<String,Long> get_window_to_acked() {
- return this.window_to_acked;
- }
-
- public void set_window_to_acked(Map<String,Long> window_to_acked) {
- this.window_to_acked = window_to_acked;
- }
-
- public void unset_window_to_acked() {
- this.window_to_acked = null;
- }
-
- /** Returns true if field window_to_acked is set (has been assigned a value) and false otherwise */
- public boolean is_set_window_to_acked() {
- return this.window_to_acked != null;
- }
-
- public void set_window_to_acked_isSet(boolean value) {
- if (!value) {
- this.window_to_acked = null;
- }
- }
-
- public int get_window_to_failed_size() {
- return (this.window_to_failed == null) ? 0 : this.window_to_failed.size();
- }
-
- public void put_to_window_to_failed(String key, long val) {
- if (this.window_to_failed == null) {
- this.window_to_failed = new HashMap<String,Long>();
- }
- this.window_to_failed.put(key, val);
- }
-
- public Map<String,Long> get_window_to_failed() {
- return this.window_to_failed;
- }
-
- public void set_window_to_failed(Map<String,Long> window_to_failed) {
- this.window_to_failed = window_to_failed;
- }
-
- public void unset_window_to_failed() {
- this.window_to_failed = null;
- }
-
- /** Returns true if field window_to_failed is set (has been assigned a value) and false otherwise */
- public boolean is_set_window_to_failed() {
- return this.window_to_failed != null;
- }
-
- public void set_window_to_failed_isSet(boolean value) {
- if (!value) {
- this.window_to_failed = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case WINDOW_TO_EMITTED:
- if (value == null) {
- unset_window_to_emitted();
- } else {
- set_window_to_emitted((Map<String,Long>)value);
- }
- break;
-
- case WINDOW_TO_TRANSFERRED:
- if (value == null) {
- unset_window_to_transferred();
- } else {
- set_window_to_transferred((Map<String,Long>)value);
- }
- break;
-
- case WINDOW_TO_COMPLETE_LATENCIES_MS:
- if (value == null) {
- unset_window_to_complete_latencies_ms();
- } else {
- set_window_to_complete_latencies_ms((Map<String,Double>)value);
- }
- break;
-
- case WINDOW_TO_ACKED:
- if (value == null) {
- unset_window_to_acked();
- } else {
- set_window_to_acked((Map<String,Long>)value);
- }
- break;
-
- case WINDOW_TO_FAILED:
- if (value == null) {
- unset_window_to_failed();
- } else {
- set_window_to_failed((Map<String,Long>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case WINDOW_TO_EMITTED:
- return get_window_to_emitted();
-
- case WINDOW_TO_TRANSFERRED:
- return get_window_to_transferred();
-
- case WINDOW_TO_COMPLETE_LATENCIES_MS:
- return get_window_to_complete_latencies_ms();
-
- case WINDOW_TO_ACKED:
- return get_window_to_acked();
-
- case WINDOW_TO_FAILED:
- return get_window_to_failed();
-
- }
- 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 WINDOW_TO_EMITTED:
- return is_set_window_to_emitted();
- case WINDOW_TO_TRANSFERRED:
- return is_set_window_to_transferred();
- case WINDOW_TO_COMPLETE_LATENCIES_MS:
- return is_set_window_to_complete_latencies_ms();
- case WINDOW_TO_ACKED:
- return is_set_window_to_acked();
- case WINDOW_TO_FAILED:
- return is_set_window_to_failed();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof TopologyStats)
- return this.equals((TopologyStats)that);
- return false;
- }
-
- public boolean equals(TopologyStats that) {
- if (that == null)
- return false;
-
- boolean this_present_window_to_emitted = true && this.is_set_window_to_emitted();
- boolean that_present_window_to_emitted = true && that.is_set_window_to_emitted();
- if (this_present_window_to_emitted || that_present_window_to_emitted) {
- if (!(this_present_window_to_emitted && that_present_window_to_emitted))
- return false;
- if (!this.window_to_emitted.equals(that.window_to_emitted))
- return false;
- }
-
- boolean this_present_window_to_transferred = true && this.is_set_window_to_transferred();
- boolean that_present_window_to_transferred = true && that.is_set_window_to_transferred();
- if (this_present_window_to_transferred || that_present_window_to_transferred) {
- if (!(this_present_window_to_transferred && that_present_window_to_transferred))
- return false;
- if (!this.window_to_transferred.equals(that.window_to_transferred))
- return false;
- }
-
- boolean this_present_window_to_complete_latencies_ms = true && this.is_set_window_to_complete_latencies_ms();
- boolean that_present_window_to_complete_latencies_ms = true && that.is_set_window_to_complete_latencies_ms();
- if (this_present_window_to_complete_latencies_ms || that_present_window_to_complete_latencies_ms) {
- if (!(this_present_window_to_complete_latencies_ms && that_present_window_to_complete_latencies_ms))
- return false;
- if (!this.window_to_complete_latencies_ms.equals(that.window_to_complete_latencies_ms))
- return false;
- }
-
- boolean this_present_window_to_acked = true && this.is_set_window_to_acked();
- boolean that_present_window_to_acked = true && that.is_set_window_to_acked();
- if (this_present_window_to_acked || that_present_window_to_acked) {
- if (!(this_present_window_to_acked && that_present_window_to_acked))
- return false;
- if (!this.window_to_acked.equals(that.window_to_acked))
- return false;
- }
-
- boolean this_present_window_to_failed = true && this.is_set_window_to_failed();
- boolean that_present_window_to_failed = true && that.is_set_window_to_failed();
- if (this_present_window_to_failed || that_present_window_to_failed) {
- if (!(this_present_window_to_failed && that_present_window_to_failed))
- return false;
- if (!this.window_to_failed.equals(that.window_to_failed))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_window_to_emitted = true && (is_set_window_to_emitted());
- list.add(present_window_to_emitted);
- if (present_window_to_emitted)
- list.add(window_to_emitted);
-
- boolean present_window_to_transferred = true && (is_set_window_to_transferred());
- list.add(present_window_to_transferred);
- if (present_window_to_transferred)
- list.add(window_to_transferred);
-
- boolean present_window_to_complete_latencies_ms = true && (is_set_window_to_complete_latencies_ms());
- list.add(present_window_to_complete_latencies_ms);
- if (present_window_to_complete_latencies_ms)
- list.add(window_to_complete_latencies_ms);
-
- boolean present_window_to_acked = true && (is_set_window_to_acked());
- list.add(present_window_to_acked);
- if (present_window_to_acked)
- list.add(window_to_acked);
-
- boolean present_window_to_failed = true && (is_set_window_to_failed());
- list.add(present_window_to_failed);
- if (present_window_to_failed)
- list.add(window_to_failed);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(TopologyStats other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_window_to_emitted()).compareTo(other.is_set_window_to_emitted());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_window_to_emitted()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.window_to_emitted, other.window_to_emitted);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_window_to_transferred()).compareTo(other.is_set_window_to_transferred());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_window_to_transferred()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.window_to_transferred, other.window_to_transferred);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_window_to_complete_latencies_ms()).compareTo(other.is_set_window_to_complete_latencies_ms());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_window_to_complete_latencies_ms()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.window_to_complete_latencies_ms, other.window_to_complete_latencies_ms);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_window_to_acked()).compareTo(other.is_set_window_to_acked());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_window_to_acked()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.window_to_acked, other.window_to_acked);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_window_to_failed()).compareTo(other.is_set_window_to_failed());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_window_to_failed()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.window_to_failed, other.window_to_failed);
- 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("TopologyStats(");
- boolean first = true;
-
- if (is_set_window_to_emitted()) {
- sb.append("window_to_emitted:");
- if (this.window_to_emitted == null) {
- sb.append("null");
- } else {
- sb.append(this.window_to_emitted);
- }
- first = false;
- }
- if (is_set_window_to_transferred()) {
- if (!first) sb.append(", ");
- sb.append("window_to_transferred:");
- if (this.window_to_transferred == null) {
- sb.append("null");
- } else {
- sb.append(this.window_to_transferred);
- }
- first = false;
- }
- if (is_set_window_to_complete_latencies_ms()) {
- if (!first) sb.append(", ");
- sb.append("window_to_complete_latencies_ms:");
- if (this.window_to_complete_latencies_ms == null) {
- sb.append("null");
- } else {
- sb.append(this.window_to_complete_latencies_ms);
- }
- first = false;
- }
- if (is_set_window_to_acked()) {
- if (!first) sb.append(", ");
- sb.append("window_to_acked:");
- if (this.window_to_acked == null) {
- sb.append("null");
- } else {
- sb.append(this.window_to_acked);
- }
- first = false;
- }
- if (is_set_window_to_failed()) {
- if (!first) sb.append(", ");
- sb.append("window_to_failed:");
- if (this.window_to_failed == null) {
- sb.append("null");
- } else {
- sb.append(this.window_to_failed);
- }
- 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 {
- 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 TopologyStatsStandardSchemeFactory implements SchemeFactory {
- public TopologyStatsStandardScheme getScheme() {
- return new TopologyStatsStandardScheme();
- }
- }
-
- private static class TopologyStatsStandardScheme extends StandardScheme<TopologyStats> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, TopologyStats 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: // WINDOW_TO_EMITTED
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map378 = iprot.readMapBegin();
- struct.window_to_emitted = new HashMap<String,Long>(2*_map378.size);
- String _key379;
- long _val380;
- for (int _i381 = 0; _i381 < _map378.size; ++_i381)
- {
- _key379 = iprot.readString();
- _val380 = iprot.readI64();
- struct.window_to_emitted.put(_key379, _val380);
- }
- iprot.readMapEnd();
- }
- struct.set_window_to_emitted_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // WINDOW_TO_TRANSFERRED
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map382 = iprot.readMapBegin();
- struct.window_to_transferred = new HashMap<String,Long>(2*_map382.size);
- String _key383;
- long _val384;
- for (int _i385 = 0; _i385 < _map382.size; ++_i385)
- {
- _key383 = iprot.readString();
- _val384 = iprot.readI64();
- struct.window_to_transferred.put(_key383, _val384);
- }
- iprot.readMapEnd();
- }
- struct.set_window_to_transferred_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // WINDOW_TO_COMPLETE_LATENCIES_MS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map386 = iprot.readMapBegin();
- struct.window_to_complete_latencies_ms = new HashMap<String,Double>(2*_map386.size);
- String _key387;
- double _val388;
- for (int _i389 = 0; _i389 < _map386.size; ++_i389)
- {
- _key387 = iprot.readString();
- _val388 = iprot.readDouble();
- struct.window_to_complete_latencies_ms.put(_key387, _val388);
- }
- iprot.readMapEnd();
- }
- struct.set_window_to_complete_latencies_ms_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // WINDOW_TO_ACKED
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map390 = iprot.readMapBegin();
- struct.window_to_acked = new HashMap<String,Long>(2*_map390.size);
- String _key391;
- long _val392;
- for (int _i393 = 0; _i393 < _map390.size; ++_i393)
- {
- _key391 = iprot.readString();
- _val392 = iprot.readI64();
- struct.window_to_acked.put(_key391, _val392);
- }
- iprot.readMapEnd();
- }
- struct.set_window_to_acked_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // WINDOW_TO_FAILED
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map394 = iprot.readMapBegin();
- struct.window_to_failed = new HashMap<String,Long>(2*_map394.size);
- String _key395;
- long _val396;
- for (int _i397 = 0; _i397 < _map394.size; ++_i397)
- {
- _key395 = iprot.readString();
- _val396 = iprot.readI64();
- struct.window_to_failed.put(_key395, _val396);
- }
- iprot.readMapEnd();
- }
- struct.set_window_to_failed_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, TopologyStats struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.window_to_emitted != null) {
- if (struct.is_set_window_to_emitted()) {
- oprot.writeFieldBegin(WINDOW_TO_EMITTED_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, struct.window_to_emitted.size()));
- for (Map.Entry<String, Long> _iter398 : struct.window_to_emitted.entrySet())
- {
- oprot.writeString(_iter398.getKey());
- oprot.writeI64(_iter398.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.window_to_transferred != null) {
- if (struct.is_set_window_to_transferred()) {
- oprot.writeFieldBegin(WINDOW_TO_TRANSFERRED_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, struct.window_to_transferred.size()));
- for (Map.Entry<String, Long> _iter399 : struct.window_to_transferred.entrySet())
- {
- oprot.writeString(_iter399.getKey());
- oprot.writeI64(_iter399.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.window_to_complete_latencies_ms != null) {
- if (struct.is_set_window_to_complete_latencies_ms()) {
- oprot.writeFieldBegin(WINDOW_TO_COMPLETE_LATENCIES_MS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, struct.window_to_complete_latencies_ms.size()));
- for (Map.Entry<String, Double> _iter400 : struct.window_to_complete_latencies_ms.entrySet())
- {
- oprot.writeString(_iter400.getKey());
- oprot.writeDouble(_iter400.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.window_to_acked != null) {
- if (struct.is_set_window_to_acked()) {
- oprot.writeFieldBegin(WINDOW_TO_ACKED_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, struct.window_to_acked.size()));
- for (Map.Entry<String, Long> _iter401 : struct.window_to_acked.entrySet())
- {
- oprot.writeString(_iter401.getKey());
- oprot.writeI64(_iter401.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.window_to_failed != null) {
- if (struct.is_set_window_to_failed()) {
- oprot.writeFieldBegin(WINDOW_TO_FAILED_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, struct.window_to_failed.size()));
- for (Map.Entry<String, Long> _iter402 : struct.window_to_failed.entrySet())
- {
- oprot.writeString(_iter402.getKey());
- oprot.writeI64(_iter402.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class TopologyStatsTupleSchemeFactory implements SchemeFactory {
- public TopologyStatsTupleScheme getScheme() {
- return new TopologyStatsTupleScheme();
- }
- }
-
- private static class TopologyStatsTupleScheme extends TupleScheme<TopologyStats> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, TopologyStats struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_window_to_emitted()) {
- optionals.set(0);
- }
- if (struct.is_set_window_to_transferred()) {
- optionals.set(1);
- }
- if (struct.is_set_window_to_complete_latencies_ms()) {
- optionals.set(2);
- }
- if (struct.is_set_window_to_acked()) {
- optionals.set(3);
- }
- if (struct.is_set_window_to_failed()) {
- optionals.set(4);
- }
- oprot.writeBitSet(optionals, 5);
- if (struct.is_set_window_to_emitted()) {
- {
- oprot.writeI32(struct.window_to_emitted.size());
- for (Map.Entry<String, Long> _iter403 : struct.window_to_emitted.entrySet())
- {
- oprot.writeString(_iter403.getKey());
- oprot.writeI64(_iter403.getValue());
- }
- }
- }
- if (struct.is_set_window_to_transferred()) {
- {
- oprot.writeI32(struct.window_to_transferred.size());
- for (Map.Entry<String, Long> _iter404 : struct.window_to_transferred.entrySet())
- {
- oprot.writeString(_iter404.getKey());
- oprot.writeI64(_iter404.getValue());
- }
- }
- }
- if (struct.is_set_window_to_complete_latencies_ms()) {
- {
- oprot.writeI32(struct.window_to_complete_latencies_ms.size());
- for (Map.Entry<String, Double> _iter405 : struct.window_to_complete_latencies_ms.entrySet())
- {
- oprot.writeString(_iter405.getKey());
- oprot.writeDouble(_iter405.getValue());
- }
- }
- }
- if (struct.is_set_window_to_acked()) {
- {
- oprot.writeI32(struct.window_to_acked.size());
- for (Map.Entry<String, Long> _iter406 : struct.window_to_acked.entrySet())
- {
- oprot.writeString(_iter406.getKey());
- oprot.writeI64(_iter406.getValue());
- }
- }
- }
- if (struct.is_set_window_to_failed()) {
- {
- oprot.writeI32(struct.window_to_failed.size());
- for (Map.Entry<String, Long> _iter407 : struct.window_to_failed.entrySet())
- {
- oprot.writeString(_iter407.getKey());
- oprot.writeI64(_iter407.getValue());
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, TopologyStats struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(5);
- if (incoming.get(0)) {
- {
- org.apache.thrift.protocol.TMap _map408 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- struct.window_to_emitted = new HashMap<String,Long>(2*_map408.size);
- String _key409;
- long _val410;
- for (int _i411 = 0; _i411 < _map408.size; ++_i411)
- {
- _key409 = iprot.readString();
- _val410 = iprot.readI64();
- struct.window_to_emitted.put(_key409, _val410);
- }
- }
- struct.set_window_to_emitted_isSet(true);
- }
- if (incoming.get(1)) {
- {
- org.apache.thrift.protocol.TMap _map412 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- struct.window_to_transferred = new HashMap<String,Long>(2*_map412.size);
- String _key413;
- long _val414;
- for (int _i415 = 0; _i415 < _map412.size; ++_i415)
- {
- _key413 = iprot.readString();
- _val414 = iprot.readI64();
- struct.window_to_transferred.put(_key413, _val414);
- }
- }
- struct.set_window_to_transferred_isSet(true);
- }
- if (incoming.get(2)) {
- {
- org.apache.thrift.protocol.TMap _map416 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32());
- struct.window_to_complete_latencies_ms = new HashMap<String,Double>(2*_map416.size);
- String _key417;
- double _val418;
- for (int _i419 = 0; _i419 < _map416.size; ++_i419)
- {
- _key417 = iprot.readString();
- _val418 = iprot.readDouble();
- struct.window_to_complete_latencies_ms.put(_key417, _val418);
- }
- }
- struct.set_window_to_complete_latencies_ms_isSet(true);
- }
- if (incoming.get(3)) {
- {
- org.apache.thrift.protocol.TMap _map420 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- struct.window_to_acked = new HashMap<String,Long>(2*_map420.size);
- String _key421;
- long _val422;
- for (int _i423 = 0; _i423 < _map420.size; ++_i423)
- {
- _key421 = iprot.readString();
- _val422 = iprot.readI64();
- struct.window_to_acked.put(_key421, _val422);
- }
- }
- struct.set_window_to_acked_isSet(true);
- }
- if (incoming.get(4)) {
- {
- org.apache.thrift.protocol.TMap _map424 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32());
- struct.window_to_failed = new HashMap<String,Long>(2*_map424.size);
- String _key425;
- long _val426;
- for (int _i427 = 0; _i427 < _map424.size; ++_i427)
- {
- _key425 = iprot.readString();
- _val426 = iprot.readI64();
- struct.window_to_failed.put(_key425, _val426);
- }
- }
- struct.set_window_to_failed_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyStatus.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyStatus.java b/storm-core/src/jvm/backtype/storm/generated/TopologyStatus.java
deleted file mode 100644
index dd33d12..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/TopologyStatus.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum TopologyStatus implements org.apache.thrift.TEnum {
- ACTIVE(1),
- INACTIVE(2),
- REBALANCING(3),
- KILLED(4);
-
- private final int value;
-
- private TopologyStatus(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static TopologyStatus findByValue(int value) {
- switch (value) {
- case 1:
- return ACTIVE;
- case 2:
- return INACTIVE;
- case 3:
- return REBALANCING;
- case 4:
- return KILLED;
- default:
- return null;
- }
- }
-}
[26/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/DistributedRPCInvocations.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/DistributedRPCInvocations.java b/storm-core/src/jvm/backtype/storm/generated/DistributedRPCInvocations.java
deleted file mode 100644
index d51175d..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/DistributedRPCInvocations.java
+++ /dev/null
@@ -1,2935 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class DistributedRPCInvocations {
-
- public interface Iface {
-
- public void result(String id, String result) throws AuthorizationException, org.apache.thrift.TException;
-
- public DRPCRequest fetchRequest(String functionName) throws AuthorizationException, org.apache.thrift.TException;
-
- public void failRequest(String id) throws AuthorizationException, org.apache.thrift.TException;
-
- }
-
- public interface AsyncIface {
-
- public void result(String id, String result, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void fetchRequest(String functionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void failRequest(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- }
-
- public static class Client extends org.apache.thrift.TServiceClient implements Iface {
- public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
- public Factory() {}
- public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
- return new Client(prot);
- }
- public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
- return new Client(iprot, oprot);
- }
- }
-
- public Client(org.apache.thrift.protocol.TProtocol prot)
- {
- super(prot, prot);
- }
-
- public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
- super(iprot, oprot);
- }
-
- public void result(String id, String result) throws AuthorizationException, org.apache.thrift.TException
- {
- send_result(id, result);
- recv_result();
- }
-
- public void send_result(String id, String result) throws org.apache.thrift.TException
- {
- result_args args = new result_args();
- args.set_id(id);
- args.set_result(result);
- sendBase("result", args);
- }
-
- public void recv_result() throws AuthorizationException, org.apache.thrift.TException
- {
- result_result result = new result_result();
- receiveBase(result, "result");
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public DRPCRequest fetchRequest(String functionName) throws AuthorizationException, org.apache.thrift.TException
- {
- send_fetchRequest(functionName);
- return recv_fetchRequest();
- }
-
- public void send_fetchRequest(String functionName) throws org.apache.thrift.TException
- {
- fetchRequest_args args = new fetchRequest_args();
- args.set_functionName(functionName);
- sendBase("fetchRequest", args);
- }
-
- public DRPCRequest recv_fetchRequest() throws AuthorizationException, org.apache.thrift.TException
- {
- fetchRequest_result result = new fetchRequest_result();
- receiveBase(result, "fetchRequest");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchRequest failed: unknown result");
- }
-
- public void failRequest(String id) throws AuthorizationException, org.apache.thrift.TException
- {
- send_failRequest(id);
- recv_failRequest();
- }
-
- public void send_failRequest(String id) throws org.apache.thrift.TException
- {
- failRequest_args args = new failRequest_args();
- args.set_id(id);
- sendBase("failRequest", args);
- }
-
- public void recv_failRequest() throws AuthorizationException, org.apache.thrift.TException
- {
- failRequest_result result = new failRequest_result();
- receiveBase(result, "failRequest");
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- }
- public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
- public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
- private org.apache.thrift.async.TAsyncClientManager clientManager;
- private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
- public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
- this.clientManager = clientManager;
- this.protocolFactory = protocolFactory;
- }
- public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
- return new AsyncClient(protocolFactory, clientManager, transport);
- }
- }
-
- public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
- super(protocolFactory, clientManager, transport);
- }
-
- public void result(String id, String result, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- result_call method_call = new result_call(id, result, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class result_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String id;
- private String result;
- public result_call(String id, String result, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.id = id;
- this.result = result;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("result", org.apache.thrift.protocol.TMessageType.CALL, 0));
- result_args args = new result_args();
- args.set_id(id);
- args.set_result(result);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_result();
- }
- }
-
- public void fetchRequest(String functionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- fetchRequest_call method_call = new fetchRequest_call(functionName, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class fetchRequest_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String functionName;
- public fetchRequest_call(String functionName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.functionName = functionName;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("fetchRequest", org.apache.thrift.protocol.TMessageType.CALL, 0));
- fetchRequest_args args = new fetchRequest_args();
- args.set_functionName(functionName);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public DRPCRequest getResult() throws AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_fetchRequest();
- }
- }
-
- public void failRequest(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- failRequest_call method_call = new failRequest_call(id, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class failRequest_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String id;
- public failRequest_call(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.id = id;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("failRequest", org.apache.thrift.protocol.TMessageType.CALL, 0));
- failRequest_args args = new failRequest_args();
- args.set_id(id);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_failRequest();
- }
- }
-
- }
-
- public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
- private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
- public Processor(I iface) {
- super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
- }
-
- protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
- super(iface, getProcessMap(processMap));
- }
-
- private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
- processMap.put("result", new result());
- processMap.put("fetchRequest", new fetchRequest());
- processMap.put("failRequest", new failRequest());
- return processMap;
- }
-
- public static class result<I extends Iface> extends org.apache.thrift.ProcessFunction<I, result_args> {
- public result() {
- super("result");
- }
-
- public result_args getEmptyArgsInstance() {
- return new result_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public result_result getResult(I iface, result_args args) throws org.apache.thrift.TException {
- result_result result = new result_result();
- try {
- iface.result(args.id, args.result);
- } catch (AuthorizationException aze) {
- result.aze = aze;
- }
- return result;
- }
- }
-
- public static class fetchRequest<I extends Iface> extends org.apache.thrift.ProcessFunction<I, fetchRequest_args> {
- public fetchRequest() {
- super("fetchRequest");
- }
-
- public fetchRequest_args getEmptyArgsInstance() {
- return new fetchRequest_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public fetchRequest_result getResult(I iface, fetchRequest_args args) throws org.apache.thrift.TException {
- fetchRequest_result result = new fetchRequest_result();
- try {
- result.success = iface.fetchRequest(args.functionName);
- } catch (AuthorizationException aze) {
- result.aze = aze;
- }
- return result;
- }
- }
-
- public static class failRequest<I extends Iface> extends org.apache.thrift.ProcessFunction<I, failRequest_args> {
- public failRequest() {
- super("failRequest");
- }
-
- public failRequest_args getEmptyArgsInstance() {
- return new failRequest_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public failRequest_result getResult(I iface, failRequest_args args) throws org.apache.thrift.TException {
- failRequest_result result = new failRequest_result();
- try {
- iface.failRequest(args.id);
- } catch (AuthorizationException aze) {
- result.aze = aze;
- }
- return result;
- }
- }
-
- }
-
- public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
- private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
- public AsyncProcessor(I iface) {
- super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
- }
-
- protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
- super(iface, getProcessMap(processMap));
- }
-
- private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
- processMap.put("result", new result());
- processMap.put("fetchRequest", new fetchRequest());
- processMap.put("failRequest", new failRequest());
- return processMap;
- }
-
- public static class result<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, result_args, Void> {
- public result() {
- super("result");
- }
-
- public result_args getEmptyArgsInstance() {
- return new result_args();
- }
-
- public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Void>() {
- public void onComplete(Void o) {
- result_result result = new result_result();
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- result_result result = new result_result();
- if (e instanceof AuthorizationException) {
- result.aze = (AuthorizationException) e;
- result.set_aze_isSet(true);
- msg = result;
- }
- else
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, result_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
- iface.result(args.id, args.result,resultHandler);
- }
- }
-
- public static class fetchRequest<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, fetchRequest_args, DRPCRequest> {
- public fetchRequest() {
- super("fetchRequest");
- }
-
- public fetchRequest_args getEmptyArgsInstance() {
- return new fetchRequest_args();
- }
-
- public AsyncMethodCallback<DRPCRequest> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<DRPCRequest>() {
- public void onComplete(DRPCRequest o) {
- fetchRequest_result result = new fetchRequest_result();
- result.success = o;
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- fetchRequest_result result = new fetchRequest_result();
- if (e instanceof AuthorizationException) {
- result.aze = (AuthorizationException) e;
- result.set_aze_isSet(true);
- msg = result;
- }
- else
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, fetchRequest_args args, org.apache.thrift.async.AsyncMethodCallback<DRPCRequest> resultHandler) throws TException {
- iface.fetchRequest(args.functionName,resultHandler);
- }
- }
-
- public static class failRequest<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, failRequest_args, Void> {
- public failRequest() {
- super("failRequest");
- }
-
- public failRequest_args getEmptyArgsInstance() {
- return new failRequest_args();
- }
-
- public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Void>() {
- public void onComplete(Void o) {
- failRequest_result result = new failRequest_result();
- try {
- fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
- }
- fb.close();
- }
- public void onError(Exception e) {
- byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
- failRequest_result result = new failRequest_result();
- if (e instanceof AuthorizationException) {
- result.aze = (AuthorizationException) e;
- result.set_aze_isSet(true);
- msg = result;
- }
- else
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- try {
- fcall.sendResponse(fb,msg,msgType,seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
- }
- fb.close();
- }
- };
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public void start(I iface, failRequest_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
- iface.failRequest(args.id,resultHandler);
- }
- }
-
- }
-
- public static class result_args implements org.apache.thrift.TBase<result_args, result_args._Fields>, java.io.Serializable, Cloneable, Comparable<result_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("result_args");
-
- private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("result", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new result_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new result_argsTupleSchemeFactory());
- }
-
- private String id; // required
- private String result; // 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 {
- ID((short)1, "id"),
- RESULT((short)2, "result");
-
- 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: // ID
- return ID;
- case 2: // RESULT
- return RESULT;
- 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.RESULT, new org.apache.thrift.meta_data.FieldMetaData("result", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(result_args.class, metaDataMap);
- }
-
- public result_args() {
- }
-
- public result_args(
- String id,
- String result)
- {
- this();
- this.id = id;
- this.result = result;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public result_args(result_args other) {
- if (other.is_set_id()) {
- this.id = other.id;
- }
- if (other.is_set_result()) {
- this.result = other.result;
- }
- }
-
- public result_args deepCopy() {
- return new result_args(this);
- }
-
- @Override
- public void clear() {
- this.id = null;
- this.result = null;
- }
-
- public String get_id() {
- return this.id;
- }
-
- public void set_id(String id) {
- this.id = id;
- }
-
- public void unset_id() {
- this.id = null;
- }
-
- /** Returns true if field id is set (has been assigned a value) and false otherwise */
- public boolean is_set_id() {
- return this.id != null;
- }
-
- public void set_id_isSet(boolean value) {
- if (!value) {
- this.id = null;
- }
- }
-
- public String get_result() {
- return this.result;
- }
-
- public void set_result(String result) {
- this.result = result;
- }
-
- public void unset_result() {
- this.result = null;
- }
-
- /** Returns true if field result is set (has been assigned a value) and false otherwise */
- public boolean is_set_result() {
- return this.result != null;
- }
-
- public void set_result_isSet(boolean value) {
- if (!value) {
- this.result = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ID:
- if (value == null) {
- unset_id();
- } else {
- set_id((String)value);
- }
- break;
-
- case RESULT:
- if (value == null) {
- unset_result();
- } else {
- set_result((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ID:
- return get_id();
-
- case RESULT:
- return get_result();
-
- }
- 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 ID:
- return is_set_id();
- case RESULT:
- return is_set_result();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof result_args)
- return this.equals((result_args)that);
- return false;
- }
-
- public boolean equals(result_args that) {
- if (that == null)
- return false;
-
- boolean this_present_id = true && this.is_set_id();
- boolean that_present_id = true && that.is_set_id();
- if (this_present_id || that_present_id) {
- if (!(this_present_id && that_present_id))
- return false;
- if (!this.id.equals(that.id))
- return false;
- }
-
- boolean this_present_result = true && this.is_set_result();
- boolean that_present_result = true && that.is_set_result();
- if (this_present_result || that_present_result) {
- if (!(this_present_result && that_present_result))
- return false;
- if (!this.result.equals(that.result))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_id = true && (is_set_id());
- list.add(present_id);
- if (present_id)
- list.add(id);
-
- boolean present_result = true && (is_set_result());
- list.add(present_result);
- if (present_result)
- list.add(result);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(result_args other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_id()).compareTo(other.is_set_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_result()).compareTo(other.is_set_result());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_result()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.result, other.result);
- 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("result_args(");
- boolean first = true;
-
- sb.append("id:");
- if (this.id == null) {
- sb.append("null");
- } else {
- sb.append(this.id);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("result:");
- if (this.result == null) {
- sb.append("null");
- } else {
- sb.append(this.result);
- }
- 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 {
- 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 result_argsStandardSchemeFactory implements SchemeFactory {
- public result_argsStandardScheme getScheme() {
- return new result_argsStandardScheme();
- }
- }
-
- private static class result_argsStandardScheme extends StandardScheme<result_args> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, result_args 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: // ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.id = iprot.readString();
- struct.set_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // RESULT
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.result = iprot.readString();
- struct.set_result_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, result_args struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.id != null) {
- oprot.writeFieldBegin(ID_FIELD_DESC);
- oprot.writeString(struct.id);
- oprot.writeFieldEnd();
- }
- if (struct.result != null) {
- oprot.writeFieldBegin(RESULT_FIELD_DESC);
- oprot.writeString(struct.result);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class result_argsTupleSchemeFactory implements SchemeFactory {
- public result_argsTupleScheme getScheme() {
- return new result_argsTupleScheme();
- }
- }
-
- private static class result_argsTupleScheme extends TupleScheme<result_args> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, result_args struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_id()) {
- optionals.set(0);
- }
- if (struct.is_set_result()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.is_set_id()) {
- oprot.writeString(struct.id);
- }
- if (struct.is_set_result()) {
- oprot.writeString(struct.result);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, result_args struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.id = iprot.readString();
- struct.set_id_isSet(true);
- }
- if (incoming.get(1)) {
- struct.result = iprot.readString();
- struct.set_result_isSet(true);
- }
- }
- }
-
- }
-
- public static class result_result implements org.apache.thrift.TBase<result_result, result_result._Fields>, java.io.Serializable, Cloneable, Comparable<result_result> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("result_result");
-
- private static final org.apache.thrift.protocol.TField AZE_FIELD_DESC = new org.apache.thrift.protocol.TField("aze", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new result_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new result_resultTupleSchemeFactory());
- }
-
- private AuthorizationException aze; // 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 {
- AZE((short)1, "aze");
-
- 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: // AZE
- return AZE;
- 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.AZE, new org.apache.thrift.meta_data.FieldMetaData("aze", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(result_result.class, metaDataMap);
- }
-
- public result_result() {
- }
-
- public result_result(
- AuthorizationException aze)
- {
- this();
- this.aze = aze;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public result_result(result_result other) {
- if (other.is_set_aze()) {
- this.aze = new AuthorizationException(other.aze);
- }
- }
-
- public result_result deepCopy() {
- return new result_result(this);
- }
-
- @Override
- public void clear() {
- this.aze = null;
- }
-
- public AuthorizationException get_aze() {
- return this.aze;
- }
-
- public void set_aze(AuthorizationException aze) {
- this.aze = aze;
- }
-
- public void unset_aze() {
- this.aze = null;
- }
-
- /** Returns true if field aze is set (has been assigned a value) and false otherwise */
- public boolean is_set_aze() {
- return this.aze != null;
- }
-
- public void set_aze_isSet(boolean value) {
- if (!value) {
- this.aze = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case AZE:
- if (value == null) {
- unset_aze();
- } else {
- set_aze((AuthorizationException)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case AZE:
- return get_aze();
-
- }
- 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 AZE:
- return is_set_aze();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof result_result)
- return this.equals((result_result)that);
- return false;
- }
-
- public boolean equals(result_result that) {
- if (that == null)
- return false;
-
- boolean this_present_aze = true && this.is_set_aze();
- boolean that_present_aze = true && that.is_set_aze();
- if (this_present_aze || that_present_aze) {
- if (!(this_present_aze && that_present_aze))
- return false;
- if (!this.aze.equals(that.aze))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_aze = true && (is_set_aze());
- list.add(present_aze);
- if (present_aze)
- list.add(aze);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(result_result other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_aze()).compareTo(other.is_set_aze());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_aze()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aze, other.aze);
- 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("result_result(");
- boolean first = true;
-
- sb.append("aze:");
- if (this.aze == null) {
- sb.append("null");
- } else {
- sb.append(this.aze);
- }
- 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 {
- 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 result_resultStandardSchemeFactory implements SchemeFactory {
- public result_resultStandardScheme getScheme() {
- return new result_resultStandardScheme();
- }
- }
-
- private static class result_resultStandardScheme extends StandardScheme<result_result> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, result_result 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: // AZE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.aze = new AuthorizationException();
- struct.aze.read(iprot);
- struct.set_aze_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, result_result struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.aze != null) {
- oprot.writeFieldBegin(AZE_FIELD_DESC);
- struct.aze.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class result_resultTupleSchemeFactory implements SchemeFactory {
- public result_resultTupleScheme getScheme() {
- return new result_resultTupleScheme();
- }
- }
-
- private static class result_resultTupleScheme extends TupleScheme<result_result> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, result_result struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_aze()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_aze()) {
- struct.aze.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, result_result struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.aze = new AuthorizationException();
- struct.aze.read(iprot);
- struct.set_aze_isSet(true);
- }
- }
- }
-
- }
-
- public static class fetchRequest_args implements org.apache.thrift.TBase<fetchRequest_args, fetchRequest_args._Fields>, java.io.Serializable, Cloneable, Comparable<fetchRequest_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchRequest_args");
-
- private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("functionName", 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 fetchRequest_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new fetchRequest_argsTupleSchemeFactory());
- }
-
- private String functionName; // 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 {
- FUNCTION_NAME((short)1, "functionName");
-
- 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: // FUNCTION_NAME
- return FUNCTION_NAME;
- 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.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchRequest_args.class, metaDataMap);
- }
-
- public fetchRequest_args() {
- }
-
- public fetchRequest_args(
- String functionName)
- {
- this();
- this.functionName = functionName;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public fetchRequest_args(fetchRequest_args other) {
- if (other.is_set_functionName()) {
- this.functionName = other.functionName;
- }
- }
-
- public fetchRequest_args deepCopy() {
- return new fetchRequest_args(this);
- }
-
- @Override
- public void clear() {
- this.functionName = null;
- }
-
- public String get_functionName() {
- return this.functionName;
- }
-
- public void set_functionName(String functionName) {
- this.functionName = functionName;
- }
-
- public void unset_functionName() {
- this.functionName = null;
- }
-
- /** Returns true if field functionName is set (has been assigned a value) and false otherwise */
- public boolean is_set_functionName() {
- return this.functionName != null;
- }
-
- public void set_functionName_isSet(boolean value) {
- if (!value) {
- this.functionName = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case FUNCTION_NAME:
- if (value == null) {
- unset_functionName();
- } else {
- set_functionName((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case FUNCTION_NAME:
- return get_functionName();
-
- }
- 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 FUNCTION_NAME:
- return is_set_functionName();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof fetchRequest_args)
- return this.equals((fetchRequest_args)that);
- return false;
- }
-
- public boolean equals(fetchRequest_args that) {
- if (that == null)
- return false;
-
- boolean this_present_functionName = true && this.is_set_functionName();
- boolean that_present_functionName = true && that.is_set_functionName();
- if (this_present_functionName || that_present_functionName) {
- if (!(this_present_functionName && that_present_functionName))
- return false;
- if (!this.functionName.equals(that.functionName))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_functionName = true && (is_set_functionName());
- list.add(present_functionName);
- if (present_functionName)
- list.add(functionName);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(fetchRequest_args other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_functionName()).compareTo(other.is_set_functionName());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_functionName()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.functionName, other.functionName);
- 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("fetchRequest_args(");
- boolean first = true;
-
- sb.append("functionName:");
- if (this.functionName == null) {
- sb.append("null");
- } else {
- sb.append(this.functionName);
- }
- 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 {
- 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 fetchRequest_argsStandardSchemeFactory implements SchemeFactory {
- public fetchRequest_argsStandardScheme getScheme() {
- return new fetchRequest_argsStandardScheme();
- }
- }
-
- private static class fetchRequest_argsStandardScheme extends StandardScheme<fetchRequest_args> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, fetchRequest_args 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: // FUNCTION_NAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.functionName = iprot.readString();
- struct.set_functionName_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, fetchRequest_args struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.functionName != null) {
- oprot.writeFieldBegin(FUNCTION_NAME_FIELD_DESC);
- oprot.writeString(struct.functionName);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class fetchRequest_argsTupleSchemeFactory implements SchemeFactory {
- public fetchRequest_argsTupleScheme getScheme() {
- return new fetchRequest_argsTupleScheme();
- }
- }
-
- private static class fetchRequest_argsTupleScheme extends TupleScheme<fetchRequest_args> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, fetchRequest_args struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_functionName()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_functionName()) {
- oprot.writeString(struct.functionName);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, fetchRequest_args struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.functionName = iprot.readString();
- struct.set_functionName_isSet(true);
- }
- }
- }
-
- }
-
- public static class fetchRequest_result implements org.apache.thrift.TBase<fetchRequest_result, fetchRequest_result._Fields>, java.io.Serializable, Cloneable, Comparable<fetchRequest_result> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchRequest_result");
-
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
- private static final org.apache.thrift.protocol.TField AZE_FIELD_DESC = new org.apache.thrift.protocol.TField("aze", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new fetchRequest_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new fetchRequest_resultTupleSchemeFactory());
- }
-
- private DRPCRequest success; // required
- private AuthorizationException aze; // 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 {
- SUCCESS((short)0, "success"),
- AZE((short)1, "aze");
-
- 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 0: // SUCCESS
- return SUCCESS;
- case 1: // AZE
- return AZE;
- 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DRPCRequest.class)));
- tmpMap.put(_Fields.AZE, new org.apache.thrift.meta_data.FieldMetaData("aze", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchRequest_result.class, metaDataMap);
- }
-
- public fetchRequest_result() {
- }
-
- public fetchRequest_result(
- DRPCRequest success,
- AuthorizationException aze)
- {
- this();
- this.success = success;
- this.aze = aze;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public fetchRequest_result(fetchRequest_result other) {
- if (other.is_set_success()) {
- this.success = new DRPCRequest(other.success);
- }
- if (other.is_set_aze()) {
- this.aze = new AuthorizationException(other.aze);
- }
- }
-
- public fetchRequest_result deepCopy() {
- return new fetchRequest_result(this);
- }
-
- @Override
- public void clear() {
- this.success = null;
- this.aze = null;
- }
-
- public DRPCRequest get_success() {
- return this.success;
- }
-
- public void set_success(DRPCRequest success) {
- this.success = success;
- }
-
- public void unset_success() {
- this.success = null;
- }
-
- /** Returns true if field success is set (has been assigned a value) and false otherwise */
- public boolean is_set_success() {
- return this.success != null;
- }
-
- public void set_success_isSet(boolean value) {
- if (!value) {
- this.success = null;
- }
- }
-
- public AuthorizationException get_aze() {
- return this.aze;
- }
-
- public void set_aze(AuthorizationException aze) {
- this.aze = aze;
- }
-
- public void unset_aze() {
- this.aze = null;
- }
-
- /** Returns true if field aze is set (has been assigned a value) and false otherwise */
- public boolean is_set_aze() {
- return this.aze != null;
- }
-
- public void set_aze_isSet(boolean value) {
- if (!value) {
- this.aze = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SUCCESS:
- if (value == null) {
- unset_success();
- } else {
- set_success((DRPCRequest)value);
- }
- break;
-
- case AZE:
- if (value == null) {
- unset_aze();
- } else {
- set_aze((AuthorizationException)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SUCCESS:
- return get_success();
-
- case AZE:
- return get_aze();
-
- }
- 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 SUCCESS:
- return is_set_success();
- case AZE:
- return is_set_aze();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof fetchRequest_result)
- return this.equals((fetchRequest_result)that);
- return false;
- }
-
- public boolean equals(fetchRequest_result that) {
- if (that == null)
- return false;
-
- boolean this_present_success = true && this.is_set_success();
- boolean that_present_success = true && that.is_set_success();
- if (this_present_success || that_present_success) {
- if (!(this_present_success && that_present_success))
- return false;
- if (!this.success.equals(that.success))
- return false;
- }
-
- boolean this_present_aze = true && this.is_set_aze();
- boolean that_present_aze = true && that.is_set_aze();
- if (this_present_aze || that_present_aze) {
- if (!(this_present_aze && that_present_aze))
- return false;
- if (!this.aze.equals(that.aze))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_success = true && (is_set_success());
- list.add(present_success);
- if (present_success)
- list.add(success);
-
- boolean present_aze = true && (is_set_aze());
- list.add(present_aze);
- if (present_aze)
- list.add(aze);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(fetchRequest_result other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_success()).compareTo(other.is_set_success());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_success()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_aze()).compareTo(other.is_set_aze());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_aze()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aze, other.aze);
- 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("fetchRequest_result(");
- boolean first = true;
-
- sb.append("success:");
- if (this.success == null) {
- sb.append("null");
- } else {
- sb.append(this.success);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("aze:");
- if (this.aze == null) {
- sb.append("null");
- } else {
- sb.append(this.aze);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- if (success != null) {
- success.validate();
- }
- }
-
- 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 fetchRequest_resultStandardSchemeFactory implements SchemeFactory {
- public fetchRequest_resultStandardScheme getScheme() {
- return new fetchRequest_resultStandardScheme();
- }
- }
-
- private static class fetchRequest_resultStandardScheme extends StandardScheme<fetchRequest_result> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, fetchRequest_result 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 0: // SUCCESS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.success = new DRPCRequest();
- struct.success.read(iprot);
- struct.set_success_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 1: // AZE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.aze = new AuthorizationException();
- struct.aze.read(iprot);
- struct.set_aze_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, fetchRequest_result struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.success != null) {
- oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
- struct.success.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.aze != null) {
- oprot.writeFieldBegin(AZE_FIELD_DESC);
- struct.aze.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class fetchRequest_resultTupleSchemeFactory implements SchemeFactory {
- public fetchRequest_resultTupleScheme getScheme() {
- return new fetchRequest_resultTupleScheme();
- }
- }
-
- private static class fetchRequest_resultTupleScheme extends TupleScheme<fetchRequest_result> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, fetchRequest_result struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_success()) {
- optionals.set(0);
- }
- if (struct.is_set_aze()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.is_set_success()) {
- struct.success.write(oprot);
- }
- if (struct.is_set_aze()) {
- struct.aze.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, fetchRequest_result struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.success = new DRPCRequest();
- struct.success.read(iprot);
- struct.set_success_isSet(true);
- }
- if (incoming.get(1)) {
- struct.aze = new AuthorizationException();
- struct.aze.read(iprot);
- struct.set_aze_isSet(true);
- }
- }
- }
-
- }
-
- public static class failRequest_args implements org.apache.thrift.TBase<failRequest_args, failRequest_args._Fields>, java.io.Serializable, Cloneable, Comparable<failRequest_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("failRequest_args");
-
- private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new failRequest_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new failRequest_argsTupleSchemeFactory());
- }
-
- private String id; // 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 {
- ID((short)1, "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: // ID
- return 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
- 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(failRequest_args.class, metaDataMap);
- }
-
- public failRequest_args() {
- }
-
- public failRequest_args(
- String id)
- {
- this();
- this.id = id;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public failRequest_args(failRequest_args other) {
- if (other.is_set_id()) {
- this.id = other.id;
- }
- }
-
- public failRequest_args deepCopy() {
- return new failRequest_args(this);
- }
-
- @Override
- public void clear() {
- this.id = null;
- }
-
- public String get_id() {
- return this.id;
- }
-
- public void set_id(String id) {
- this.id = id;
- }
-
- public void unset_id() {
- this.id = null;
- }
-
- /** Returns true if field id is set (has been assigned a value) and false otherwise */
- public boolean is_set_id() {
- return this.id != null;
- }
-
- public void set_id_isSet(boolean value) {
- if (!value) {
- this.id = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ID:
- if (value == null) {
- unset_id();
- } else {
- set_id((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ID:
- return get_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 ID:
- return is_set_id();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof failRequest_args)
- return this.equals((failRequest_args)that);
- return false;
- }
-
- public boolean equals(failRequest_args that) {
- if (that == null)
- return false;
-
- boolean this_present_id = true && this.is_set_id();
- boolean that_present_id = true && that.is_set_id();
- if (this_present_id || that_present_id) {
- if (!(this_present_id && that_present_id))
- return false;
- if (!this.id.equals(that.id))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_id = true && (is_set_id());
- list.add(present_id);
- if (present_id)
- list.add(id);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(failRequest_args other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_id()).compareTo(other.is_set_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.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("failRequest_args(");
- boolean first = true;
-
- sb.append("id:");
- if (this.id == null) {
- sb.append("null");
- } else {
- sb.append(this.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 {
- 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 failRequest_argsStandardSchemeFactory implements SchemeFactory {
- public failRequest_argsStandardScheme getScheme() {
- return new failRequest_argsStandardScheme();
- }
- }
-
- private static class failRequest_argsStandardScheme extends StandardScheme<failRequest_args> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, failRequest_args 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: // ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.id = iprot.readString();
- struct.set_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, failRequest_args struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.id != null) {
- oprot.writeFieldBegin(ID_FIELD_DESC);
- oprot.writeString(struct.id);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class failRequest_argsTupleSchemeFactory implements SchemeFactory {
- public failRequest_argsTupleScheme getScheme() {
- return new failRequest_argsTupleScheme();
- }
- }
-
- private static class failRequest_argsTupleScheme extends TupleScheme<failRequest_args> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, failRequest_args struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_id()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_id()) {
- oprot.writeString(struct.id);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, failRequest_args struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming
<TRUNCATED>
[38/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/Constants.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/Constants.java b/storm-core/src/jvm/backtype/storm/Constants.java
deleted file mode 100644
index b2c642e..0000000
--- a/storm-core/src/jvm/backtype/storm/Constants.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm;
-
-import org.apache.storm.coordination.CoordinatedBolt;
-import clojure.lang.RT;
-
-
-public class Constants {
- public static final String COORDINATED_STREAM_ID = CoordinatedBolt.class.getName() + "/coord-stream";
-
- public static final long SYSTEM_TASK_ID = -1;
- public static final Object SYSTEM_EXECUTOR_ID = RT.readString("[-1 -1]");
- public static final String SYSTEM_COMPONENT_ID = "__system";
- public static final String SYSTEM_TICK_STREAM_ID = "__tick";
- public static final String METRICS_COMPONENT_ID_PREFIX = "__metrics";
- public static final String METRICS_STREAM_ID = "__metrics";
- public static final String METRICS_TICK_STREAM_ID = "__metrics_tick";
- public static final String CREDENTIALS_CHANGED_STREAM_ID = "__credentials";
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/ICredentialsListener.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/ICredentialsListener.java b/storm-core/src/jvm/backtype/storm/ICredentialsListener.java
deleted file mode 100644
index 5eed024..0000000
--- a/storm-core/src/jvm/backtype/storm/ICredentialsListener.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.storm;
-
-import java.util.Map;
-
-/**
- * Allows a bolt or a spout to be informed when the credentials of the topology have changed.
- */
-public interface ICredentialsListener {
- /**
- * Called when the credentials of a topology have changed.
- * @param credentials the new credentials, could be null.
- */
- public void setCredentials(Map<String,String> credentials);
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/ILocalCluster.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/ILocalCluster.java b/storm-core/src/jvm/backtype/storm/ILocalCluster.java
deleted file mode 100644
index 05b55e7..0000000
--- a/storm-core/src/jvm/backtype/storm/ILocalCluster.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm;
-
-import org.apache.storm.generated.AlreadyAliveException;
-import org.apache.storm.generated.ClusterSummary;
-import org.apache.storm.generated.InvalidTopologyException;
-import org.apache.storm.generated.KillOptions;
-import org.apache.storm.generated.SubmitOptions;
-import org.apache.storm.generated.NotAliveException;
-import org.apache.storm.generated.RebalanceOptions;
-import org.apache.storm.generated.StormTopology;
-import org.apache.storm.generated.TopologyInfo;
-import org.apache.storm.generated.Credentials;
-
-import java.util.Map;
-
-
-public interface ILocalCluster {
- void submitTopology(String topologyName, Map conf, StormTopology topology) throws AlreadyAliveException, InvalidTopologyException;
- void submitTopologyWithOpts(String topologyName, Map conf, StormTopology topology, SubmitOptions submitOpts) throws AlreadyAliveException, InvalidTopologyException;
- void uploadNewCredentials(String topologyName, Credentials creds);
- void killTopology(String topologyName) throws NotAliveException;
- void killTopologyWithOpts(String name, KillOptions options) throws NotAliveException;
- void activate(String topologyName) throws NotAliveException;
- void deactivate(String topologyName) throws NotAliveException;
- void rebalance(String name, RebalanceOptions options) throws NotAliveException;
- void shutdown();
- String getTopologyConf(String id);
- StormTopology getTopology(String id);
- ClusterSummary getClusterInfo();
- TopologyInfo getTopologyInfo(String id);
- Map getState();
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/ILocalDRPC.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/ILocalDRPC.java b/storm-core/src/jvm/backtype/storm/ILocalDRPC.java
deleted file mode 100644
index 8b0a9db..0000000
--- a/storm-core/src/jvm/backtype/storm/ILocalDRPC.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm;
-
-import org.apache.storm.daemon.Shutdownable;
-import org.apache.storm.generated.DistributedRPC;
-import org.apache.storm.generated.DistributedRPCInvocations;
-
-
-public interface ILocalDRPC extends DistributedRPC.Iface, DistributedRPCInvocations.Iface, Shutdownable {
- public String getServiceId();
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/ISubmitterHook.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/ISubmitterHook.java b/storm-core/src/jvm/backtype/storm/ISubmitterHook.java
deleted file mode 100644
index ac80788..0000000
--- a/storm-core/src/jvm/backtype/storm/ISubmitterHook.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm;
-
-import org.apache.storm.generated.StormTopology;
-import org.apache.storm.generated.TopologyInfo;
-
-import java.util.Map;
-
-/**
- * if FQCN of an implementation of this class is specified by setting the config storm.topology.submission.notifier.plugin.class,
- * that class's notify method will be invoked when a topology is successfully submitted via StormSubmitter class.
- */
-public interface ISubmitterHook {
- public void notify(TopologyInfo topologyInfo, Map stormConf, StormTopology topology) throws IllegalAccessException;
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/LogWriter.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/LogWriter.java b/storm-core/src/jvm/backtype/storm/LogWriter.java
deleted file mode 100644
index b9bcf80..0000000
--- a/storm-core/src/jvm/backtype/storm/LogWriter.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.InputStream;
-import java.io.IOException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * Launch a sub process and write files out to logs.
- */
-public class LogWriter extends Thread {
- private Logger logger;
- private BufferedReader in;
-
- public LogWriter(InputStream in, Logger logger) {
- this.in = new BufferedReader(new InputStreamReader(in));
- this.logger = logger;
- }
-
- public void run() {
- Logger logger = this.logger;
- BufferedReader in = this.in;
- String line;
- try {
- while ((line = in.readLine()) != null) {
- logger.info(line);
- }
- } catch (IOException e) {
- logger.error("Internal ERROR", e);
- } finally {
- try {
- in.close();
- } catch (IOException e) {
- logger.error("Internal ERROR", e);
- }
- }
- }
-
- public void close() throws Exception {
- this.join();
- }
-
- public static void main(String [] args) throws Exception {
- ProcessBuilder pb = new ProcessBuilder(args);
- Process p = pb.start();
- LogWriter err = null;
- LogWriter in = null;
- int ret = -1;
- try {
- Logger logger = LoggerFactory.getLogger("STDERR");
- err = new LogWriter(p.getErrorStream(), logger);
- err.start();
- in = new LogWriter(p.getInputStream(), logger);
- in.start();
- ret = p.waitFor();
- } finally {
- if (err != null) err.close();
- if (in != null) in.close();
- }
- System.exit(ret);
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/StormSubmitter.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/StormSubmitter.java b/storm-core/src/jvm/backtype/storm/StormSubmitter.java
deleted file mode 100644
index 53771fd..0000000
--- a/storm-core/src/jvm/backtype/storm/StormSubmitter.java
+++ /dev/null
@@ -1,586 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm;
-
-import java.io.File;
-import java.nio.ByteBuffer;
-import java.util.Collections;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.storm.dependency.DependencyPropertiesParser;
-import org.apache.storm.dependency.DependencyUploader;
-import org.apache.storm.hooks.SubmitterHookException;
-import org.apache.storm.scheduler.resource.ResourceUtils;
-import org.apache.storm.validation.ConfigValidation;
-import org.apache.commons.lang.StringUtils;
-import org.apache.thrift.TException;
-import org.json.simple.JSONValue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.storm.security.auth.IAutoCredentials;
-import org.apache.storm.security.auth.AuthUtils;
-import org.apache.storm.generated.*;
-import org.apache.storm.utils.BufferFileInputStream;
-import org.apache.storm.utils.NimbusClient;
-import org.apache.storm.utils.Utils;
-
-/**
- * Use this class to submit topologies to run on the Storm cluster. You should run your program
- * with the "storm jar" command from the command-line, and then use this class to
- * submit your topologies.
- */
-public class StormSubmitter {
- public static final Logger LOG = LoggerFactory.getLogger(StormSubmitter.class);
-
- private static final int THRIFT_CHUNK_SIZE_BYTES = 307200;
-
- private static ILocalCluster localNimbus = null;
-
- private static String generateZookeeperDigestSecretPayload() {
- return Utils.secureRandomLong() + ":" + Utils.secureRandomLong();
- }
-
- public static final Pattern zkDigestPattern = Pattern.compile("\\S+:\\S+");
-
- public static boolean validateZKDigestPayload(String payload) {
- if (payload != null) {
- Matcher m = zkDigestPattern.matcher(payload);
- return m.matches();
- }
- return false;
- }
-
- @SuppressWarnings("unchecked")
- public static Map prepareZookeeperAuthentication(Map conf) {
- Map toRet = new HashMap();
-
- // Is the topology ZooKeeper authentication configuration unset?
- if (! conf.containsKey(Config.STORM_ZOOKEEPER_TOPOLOGY_AUTH_PAYLOAD) ||
- conf.get(Config.STORM_ZOOKEEPER_TOPOLOGY_AUTH_PAYLOAD) == null ||
- ! validateZKDigestPayload((String)
- conf.get(Config.STORM_ZOOKEEPER_TOPOLOGY_AUTH_PAYLOAD))) {
-
- String secretPayload = generateZookeeperDigestSecretPayload();
- toRet.put(Config.STORM_ZOOKEEPER_TOPOLOGY_AUTH_PAYLOAD, secretPayload);
- LOG.info("Generated ZooKeeper secret payload for MD5-digest: " + secretPayload);
- }
-
- // This should always be set to digest.
- toRet.put(Config.STORM_ZOOKEEPER_TOPOLOGY_AUTH_SCHEME, "digest");
-
- return toRet;
- }
-
- private static Map<String,String> populateCredentials(Map conf, Map<String, String> creds) {
- Map<String,String> ret = new HashMap<>();
- for (IAutoCredentials autoCred: AuthUtils.GetAutoCredentials(conf)) {
- LOG.info("Running "+autoCred);
- autoCred.populateCredentials(ret);
- }
- if (creds != null) {
- ret.putAll(creds);
- }
- return ret;
- }
-
- /**
- * Push a new set of credentials to the running topology.
- * @param name the name of the topology to push credentials to.
- * @param stormConf the topology-specific configuration, if desired. See {@link Config}.
- * @param credentials the credentials to push.
- * @throws AuthorizationException if you are not authorized ot push credentials.
- * @throws NotAliveException if the topology is not alive
- * @throws InvalidTopologyException if any other error happens
- */
- public static void pushCredentials(String name, Map stormConf, Map<String, String> credentials)
- throws AuthorizationException, NotAliveException, InvalidTopologyException {
- stormConf = new HashMap(stormConf);
- stormConf.putAll(Utils.readCommandLineOpts());
- Map conf = Utils.readStormConfig();
- conf.putAll(stormConf);
- Map<String,String> fullCreds = populateCredentials(conf, credentials);
- if (fullCreds.isEmpty()) {
- LOG.warn("No credentials were found to push to " + name);
- return;
- }
- try {
- if(localNimbus!=null) {
- LOG.info("Pushing Credentials to topology " + name + " in local mode");
- localNimbus.uploadNewCredentials(name, new Credentials(fullCreds));
- } else {
- NimbusClient client = NimbusClient.getConfiguredClient(conf);
- try {
- LOG.info("Uploading new credentials to " + name);
- client.getClient().uploadNewCredentials(name, new Credentials(fullCreds));
- } finally {
- client.close();
- }
- }
- LOG.info("Finished submitting topology: " + name);
- } catch(TException e) {
- throw new RuntimeException(e);
- }
- }
-
-
- /**
- * Submits a topology to run on the cluster. A topology runs forever or until
- * explicitly killed.
- *
- *
- * @param name the name of the storm.
- * @param stormConf the topology-specific configuration. See {@link Config}.
- * @param topology the processing to execute.
- * @throws AlreadyAliveException if a topology with this name is already running
- * @throws InvalidTopologyException if an invalid topology was submitted
- * @throws AuthorizationException if authorization is failed
- * @thorws SubmitterHookException if any Exception occurs during initialization or invocation of registered {@link ISubmitterHook}
- */
- public static void submitTopology(String name, Map stormConf, StormTopology topology)
- throws AlreadyAliveException, InvalidTopologyException, AuthorizationException {
- submitTopology(name, stormConf, topology, null, null);
- }
-
- /**
- * Submits a topology to run on the cluster. A topology runs forever or until
- * explicitly killed.
- *
- * @param name the name of the storm.
- * @param stormConf the topology-specific configuration. See {@link Config}.
- * @param topology the processing to execute.
- * @param opts to manipulate the starting of the topology.
- * @throws AlreadyAliveException if a topology with this name is already running
- * @throws InvalidTopologyException if an invalid topology was submitted
- * @throws AuthorizationException if authorization is failed
- * @thorws SubmitterHookException if any Exception occurs during initialization or invocation of registered {@link ISubmitterHook}
- */
- public static void submitTopology(String name, Map stormConf, StormTopology topology, SubmitOptions opts)
- throws AlreadyAliveException, InvalidTopologyException, AuthorizationException {
- submitTopology(name, stormConf, topology, opts, null);
- }
-
- /**
- * Submits a topology to run on the cluster as a particular user. A topology runs forever or until
- * explicitly killed.
- *
- * @param name
- * @param stormConf
- * @param topology
- * @param opts
- * @param progressListener
- * @param asUser The user as which this topology should be submitted.
- * @throws AlreadyAliveException
- * @throws InvalidTopologyException
- * @throws AuthorizationException
- * @throws IllegalArgumentException thrown if configs will yield an unschedulable topology. validateConfs validates confs
- * @thorws SubmitterHookException if any Exception occurs during initialization or invocation of registered {@link ISubmitterHook}
- */
- public static void submitTopologyAs(String name, Map stormConf, StormTopology topology, SubmitOptions opts, ProgressListener progressListener, String asUser)
- throws AlreadyAliveException, InvalidTopologyException, AuthorizationException, IllegalArgumentException {
- if(!Utils.isValidConf(stormConf)) {
- throw new IllegalArgumentException("Storm conf is not valid. Must be json-serializable");
- }
- stormConf = new HashMap(stormConf);
- stormConf.putAll(Utils.readCommandLineOpts());
- Map conf = Utils.readStormConfig();
- conf.putAll(stormConf);
- stormConf.putAll(prepareZookeeperAuthentication(conf));
-
- validateConfs(conf, topology);
-
- Map<String,String> passedCreds = new HashMap<>();
- if (opts != null) {
- Credentials tmpCreds = opts.get_creds();
- if (tmpCreds != null) {
- passedCreds = tmpCreds.get_creds();
- }
- }
- Map<String,String> fullCreds = populateCredentials(conf, passedCreds);
- if (!fullCreds.isEmpty()) {
- if (opts == null) {
- opts = new SubmitOptions(TopologyInitialStatus.ACTIVE);
- }
- opts.set_creds(new Credentials(fullCreds));
- }
- try {
- if(localNimbus!=null) {
- LOG.info("Submitting topology " + name + " in local mode");
- if(opts!=null) {
- localNimbus.submitTopologyWithOpts(name, stormConf, topology, opts);
- } else {
- // this is for backwards compatibility
- localNimbus.submitTopology(name, stormConf, topology);
- }
- LOG.info("Finished submitting topology: " + name);
- } else {
- String serConf = JSONValue.toJSONString(stormConf);
- if(topologyNameExists(conf, name, asUser)) {
- throw new RuntimeException("Topology with name `" + name + "` already exists on cluster");
- }
-
- // Dependency uploading only makes sense for distributed mode
- List<String> jarsBlobKeys = Collections.emptyList();
- List<String> artifactsBlobKeys;
-
- DependencyUploader uploader = new DependencyUploader();
- try {
- uploader.init();
- jarsBlobKeys = uploadDependencyJarsToBlobStore(uploader);
- artifactsBlobKeys = uploadDependencyArtifactsToBlobStore(uploader);
- } catch (Throwable e) {
- // remove uploaded jars blobs, not artifacts since they're shared across the cluster
- uploader.deleteBlobs(jarsBlobKeys);
- uploader.shutdown();
- throw e;
- }
-
- try {
- setDependencyBlobsToTopology(topology, jarsBlobKeys, artifactsBlobKeys);
- submitTopologyInDistributeMode(name, topology, opts, progressListener, asUser, conf, serConf);
- } catch (AlreadyAliveException | InvalidTopologyException | AuthorizationException e) {
- // remove uploaded jars blobs, not artifacts since they're shared across the cluster
- // Note that we don't handle TException to delete jars blobs
- // because it's safer to leave some blobs instead of topology not running
- uploader.deleteBlobs(jarsBlobKeys);
- throw e;
- } finally {
- uploader.shutdown();
- }
- }
- } catch(TException e) {
- throw new RuntimeException(e);
- }
- invokeSubmitterHook(name, asUser, conf, topology);
-
- }
-
- private static List<String> uploadDependencyJarsToBlobStore(DependencyUploader uploader) {
- LOG.info("Uploading dependencies - jars...");
-
- DependencyPropertiesParser propertiesParser = new DependencyPropertiesParser();
-
- String depJarsProp = System.getProperty("storm.dependency.jars", "");
- List<File> depJars = propertiesParser.parseJarsProperties(depJarsProp);
-
- try {
- return uploader.uploadFiles(depJars, true);
- } catch (Throwable e) {
- throw new RuntimeException(e);
- }
- }
-
- private static List<String> uploadDependencyArtifactsToBlobStore(DependencyUploader uploader) {
- LOG.info("Uploading dependencies - artifacts...");
-
- DependencyPropertiesParser propertiesParser = new DependencyPropertiesParser();
-
- String depArtifactsProp = System.getProperty("storm.dependency.artifacts", "{}");
- Map<String, File> depArtifacts = propertiesParser.parseArtifactsProperties(depArtifactsProp);
-
- try {
- return uploader.uploadArtifacts(depArtifacts);
- } catch (Throwable e) {
- throw new RuntimeException(e);
- }
- }
-
- private static void setDependencyBlobsToTopology(StormTopology topology, List<String> jarsBlobKeys, List<String> artifactsBlobKeys) {
- LOG.info("Dependency Blob keys - jars : {} / artifacts : {}", jarsBlobKeys, artifactsBlobKeys);
- topology.set_dependency_jars(jarsBlobKeys);
- topology.set_dependency_artifacts(artifactsBlobKeys);
- }
-
- private static void submitTopologyInDistributeMode(String name, StormTopology topology, SubmitOptions opts,
- ProgressListener progressListener, String asUser, Map conf,
- String serConf) throws TException {
- String jar = submitJarAs(conf, System.getProperty("storm.jar"), progressListener, asUser);
- try (NimbusClient client = NimbusClient.getConfiguredClientAs(conf, asUser)){
- LOG.info("Submitting topology " + name + " in distributed mode with conf " + serConf);
- if (opts != null) {
- client.getClient().submitTopologyWithOpts(name, jar, serConf, topology, opts);
- } else {
- // this is for backwards compatibility
- client.getClient().submitTopology(name, jar, serConf, topology);
- }
- LOG.info("Finished submitting topology: " + name);
- } catch (InvalidTopologyException e) {
- LOG.warn("Topology submission exception: " + e.get_msg());
- throw e;
- } catch (AlreadyAliveException e) {
- LOG.warn("Topology already alive exception", e);
- throw e;
- }
- }
-
- /**
- *
- * @param name
- * @param asUser
- * @param stormConf
- * @param topology
- *
- * @thorws SubmitterHookException This is thrown when any Exception occurs during initialization or invocation of registered {@link ISubmitterHook}
- */
- private static void invokeSubmitterHook(String name, String asUser, Map stormConf, StormTopology topology) {
- String submissionNotifierClassName = null;
- try {
- if (stormConf.containsKey(Config.STORM_TOPOLOGY_SUBMISSION_NOTIFIER_PLUGIN)) {
- submissionNotifierClassName = stormConf.get(Config.STORM_TOPOLOGY_SUBMISSION_NOTIFIER_PLUGIN).toString();
- LOG.info("Initializing the registered ISubmitterHook [{}]", submissionNotifierClassName);
-
- if(submissionNotifierClassName == null || submissionNotifierClassName.isEmpty()) {
- throw new IllegalArgumentException(Config.STORM_TOPOLOGY_SUBMISSION_NOTIFIER_PLUGIN + " property must be a non empty string.");
- }
-
- ISubmitterHook submitterHook = (ISubmitterHook) Class.forName(submissionNotifierClassName).newInstance();
- TopologyInfo topologyInfo = Utils.getTopologyInfo(name, asUser, stormConf);
- LOG.info("Invoking the registered ISubmitterHook [{}]", submissionNotifierClassName);
- submitterHook.notify(topologyInfo, stormConf, topology);
- }
- } catch (Exception e) {
- LOG.warn("Error occurred in invoking submitter hook:[{}] ",submissionNotifierClassName, e);
- throw new SubmitterHookException(e);
- }
- }
-
- /**
- * Submits a topology to run on the cluster. A topology runs forever or until
- * explicitly killed.
- *
- *
- * @param name the name of the storm.
- * @param stormConf the topology-specific configuration. See {@link Config}.
- * @param topology the processing to execute.
- * @param opts to manipulate the starting of the topology
- * @param progressListener to track the progress of the jar upload process
- * @throws AlreadyAliveException if a topology with this name is already running
- * @throws InvalidTopologyException if an invalid topology was submitted
- * @throws AuthorizationException if authorization is failed
- * @thorws SubmitterHookException if any Exception occurs during initialization or invocation of registered {@link ISubmitterHook}
- */
- @SuppressWarnings("unchecked")
- public static void submitTopology(String name, Map stormConf, StormTopology topology, SubmitOptions opts,
- ProgressListener progressListener) throws AlreadyAliveException, InvalidTopologyException, AuthorizationException {
- submitTopologyAs(name, stormConf, topology, opts, progressListener, null);
- }
-
- /**
- * Submits a topology to run on the cluster with a progress bar. A topology runs forever or until
- * explicitly killed.
- *
- *
- * @param name the name of the storm.
- * @param stormConf the topology-specific configuration. See {@link Config}.
- * @param topology the processing to execute.
- * @throws AlreadyAliveException if a topology with this name is already running
- * @throws InvalidTopologyException if an invalid topology was submitted
- * @throws AuthorizationException if authorization is failed
- */
-
- public static void submitTopologyWithProgressBar(String name, Map stormConf, StormTopology topology) throws AlreadyAliveException, InvalidTopologyException, AuthorizationException {
- submitTopologyWithProgressBar(name, stormConf, topology, null);
- }
-
- /**
- * Submits a topology to run on the cluster with a progress bar. A topology runs forever or until
- * explicitly killed.
- *
- *
- * @param name the name of the storm.
- * @param stormConf the topology-specific configuration. See {@link Config}.
- * @param topology the processing to execute.
- * @param opts to manipulate the starting of the topology
- * @throws AlreadyAliveException if a topology with this name is already running
- * @throws InvalidTopologyException if an invalid topology was submitted
- * @throws AuthorizationException if authorization is failed
- * @thorws SubmitterHookException if any Exception occurs during initialization or invocation of registered {@link ISubmitterHook}
- */
- public static void submitTopologyWithProgressBar(String name, Map stormConf, StormTopology topology, SubmitOptions opts) throws AlreadyAliveException, InvalidTopologyException, AuthorizationException {
- // show a progress bar so we know we're not stuck (especially on slow connections)
- submitTopology(name, stormConf, topology, opts, new StormSubmitter.ProgressListener() {
- @Override
- public void onStart(String srcFile, String targetFile, long totalBytes) {
- System.out.printf("Start uploading file '%s' to '%s' (%d bytes)\n", srcFile, targetFile, totalBytes);
- }
-
- @Override
- public void onProgress(String srcFile, String targetFile, long bytesUploaded, long totalBytes) {
- int length = 50;
- int p = (int)((length * bytesUploaded) / totalBytes);
- String progress = StringUtils.repeat("=", p);
- String todo = StringUtils.repeat(" ", length - p);
-
- System.out.printf("\r[%s%s] %d / %d", progress, todo, bytesUploaded, totalBytes);
- }
-
- @Override
- public void onCompleted(String srcFile, String targetFile, long totalBytes) {
- System.out.printf("\nFile '%s' uploaded to '%s' (%d bytes)\n", srcFile, targetFile, totalBytes);
- }
- });
- }
-
- private static boolean topologyNameExists(Map conf, String name, String asUser) {
- try (NimbusClient client = NimbusClient.getConfiguredClientAs(conf, asUser)) {
- ClusterSummary summary = client.getClient().getClusterInfo();
- for(TopologySummary s : summary.get_topologies()) {
- if(s.get_name().equals(name)) {
- return true;
- }
- }
- return false;
-
- } catch(Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- private static String submitJar(Map conf, ProgressListener listener) {
- return submitJar(conf, System.getProperty("storm.jar"), listener);
- }
-
- /**
- * Submit jar file
- * @param conf the topology-specific configuration. See {@link Config}.
- * @param localJar file path of the jar file to submit
- * @return the remote location of the submitted jar
- */
- public static String submitJar(Map conf, String localJar) {
- return submitJar(conf, localJar, null);
- }
-
-
- public static String submitJarAs(Map conf, String localJar, ProgressListener listener, String asUser) {
- if (localJar == null) {
- throw new RuntimeException("Must submit topologies using the 'storm' client script so that StormSubmitter knows which jar to upload.");
- }
-
- try (NimbusClient client = NimbusClient.getConfiguredClientAs(conf, asUser)) {
- String uploadLocation = client.getClient().beginFileUpload();
- LOG.info("Uploading topology jar " + localJar + " to assigned location: " + uploadLocation);
- BufferFileInputStream is = new BufferFileInputStream(localJar, THRIFT_CHUNK_SIZE_BYTES);
-
- long totalSize = new File(localJar).length();
- if (listener != null) {
- listener.onStart(localJar, uploadLocation, totalSize);
- }
-
- long bytesUploaded = 0;
- while(true) {
- byte[] toSubmit = is.read();
- bytesUploaded += toSubmit.length;
- if (listener != null) {
- listener.onProgress(localJar, uploadLocation, bytesUploaded, totalSize);
- }
-
- if(toSubmit.length==0) break;
- client.getClient().uploadChunk(uploadLocation, ByteBuffer.wrap(toSubmit));
- }
- client.getClient().finishFileUpload(uploadLocation);
-
- if (listener != null) {
- listener.onCompleted(localJar, uploadLocation, totalSize);
- }
-
- LOG.info("Successfully uploaded topology jar to assigned location: " + uploadLocation);
- return uploadLocation;
- } catch(Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Submit jar file
- * @param conf the topology-specific configuration. See {@link Config}.
- * @param localJar file path of the jar file to submit
- * @param listener progress listener to track the jar file upload
- * @return the remote location of the submitted jar
- */
- public static String submitJar(Map conf, String localJar, ProgressListener listener) {
- return submitJarAs(conf,localJar, listener, null);
- }
-
- /**
- * Interface use to track progress of file upload
- */
- public interface ProgressListener {
- /**
- * called before file is uploaded
- * @param srcFile - jar file to be uploaded
- * @param targetFile - destination file
- * @param totalBytes - total number of bytes of the file
- */
- public void onStart(String srcFile, String targetFile, long totalBytes);
-
- /**
- * called whenever a chunk of bytes is uploaded
- * @param srcFile - jar file to be uploaded
- * @param targetFile - destination file
- * @param bytesUploaded - number of bytes transferred so far
- * @param totalBytes - total number of bytes of the file
- */
- public void onProgress(String srcFile, String targetFile, long bytesUploaded, long totalBytes);
-
- /**
- * called when the file is uploaded
- * @param srcFile - jar file to be uploaded
- * @param targetFile - destination file
- * @param totalBytes - total number of bytes of the file
- */
- public void onCompleted(String srcFile, String targetFile, long totalBytes);
- }
-
- private static void validateConfs(Map stormConf, StormTopology topology) throws IllegalArgumentException {
- ConfigValidation.validateFields(stormConf);
- validateTopologyWorkerMaxHeapSizeMBConfigs(stormConf, topology);
- }
-
- private static void validateTopologyWorkerMaxHeapSizeMBConfigs(Map stormConf, StormTopology topology) {
- double largestMemReq = getMaxExecutorMemoryUsageForTopo(topology, stormConf);
- Double topologyWorkerMaxHeapSize = Utils.getDouble(stormConf.get(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB));
- if(topologyWorkerMaxHeapSize < largestMemReq) {
- throw new IllegalArgumentException("Topology will not be able to be successfully scheduled: Config TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB="
- +Utils.getDouble(stormConf.get(Config.TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB)) + " < "
- + largestMemReq + " (Largest memory requirement of a component in the topology). Perhaps set TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB to a larger amount");
- }
- }
-
- private static double getMaxExecutorMemoryUsageForTopo(StormTopology topology, Map topologyConf) {
- double largestMemoryOperator = 0.0;
- for(Map<String, Double> entry : ResourceUtils.getBoltsResources(topology, topologyConf).values()) {
- double memoryRequirement = entry.get(Config.TOPOLOGY_COMPONENT_RESOURCES_OFFHEAP_MEMORY_MB)
- + entry.get(Config.TOPOLOGY_COMPONENT_RESOURCES_ONHEAP_MEMORY_MB);
- if(memoryRequirement > largestMemoryOperator) {
- largestMemoryOperator = memoryRequirement;
- }
- }
- for(Map<String, Double> entry : ResourceUtils.getSpoutsResources(topology, topologyConf).values()) {
- double memoryRequirement = entry.get(Config.TOPOLOGY_COMPONENT_RESOURCES_OFFHEAP_MEMORY_MB)
- + entry.get(Config.TOPOLOGY_COMPONENT_RESOURCES_ONHEAP_MEMORY_MB);
- if(memoryRequirement > largestMemoryOperator) {
- largestMemoryOperator = memoryRequirement;
- }
- }
- return largestMemoryOperator;
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/AtomicOutputStream.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/AtomicOutputStream.java b/storm-core/src/jvm/backtype/storm/blobstore/AtomicOutputStream.java
deleted file mode 100644
index 892e25c..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/AtomicOutputStream.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * An output stream where all of the data is committed on close,
- * or can be canceled with cancel.
- */
-public abstract class AtomicOutputStream extends OutputStream {
- /**
- * Cancel all of the writes associated with this stream and close it.
- */
- public abstract void cancel() throws IOException;
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/BlobKeySequenceInfo.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/BlobKeySequenceInfo.java b/storm-core/src/jvm/backtype/storm/blobstore/BlobKeySequenceInfo.java
deleted file mode 100644
index 8a01f1e..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/BlobKeySequenceInfo.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-public class BlobKeySequenceInfo {
- private String nimbusHostPort;
- private String sequenceNumber;
-
- public void setNimbusHostPort(String nimbusHostPort) {
- this.nimbusHostPort = nimbusHostPort;
- }
-
- public void setSequenceNumber(String sequenceNumber) {
- this.sequenceNumber = sequenceNumber;
- }
-
- public String getNimbusHostPort() {
- return nimbusHostPort;
- }
-
- public String getSequenceNumber() {
- return sequenceNumber;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/BlobStore.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/BlobStore.java b/storm-core/src/jvm/backtype/storm/blobstore/BlobStore.java
deleted file mode 100644
index 14879b4..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/BlobStore.java
+++ /dev/null
@@ -1,452 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-import javax.security.auth.Subject;
-
-import org.apache.storm.nimbus.NimbusInfo;
-import org.apache.commons.lang.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.storm.daemon.Shutdownable;
-import org.apache.storm.generated.AuthorizationException;
-import org.apache.storm.generated.KeyNotFoundException;
-import org.apache.storm.generated.KeyAlreadyExistsException;
-import org.apache.storm.generated.ReadableBlobMeta;
-import org.apache.storm.generated.SettableBlobMeta;
-
-/**
- * Provides a way to store blobs that can be downloaded.
- * Blobs must be able to be uploaded and listed from Nimbus,
- * and downloaded from the Supervisors. It is a key value based
- * store. Key being a string and value being the blob data.
- *
- * ACL checking must take place against the provided subject.
- * If the blob store does not support Security it must validate
- * that all ACLs set are always WORLD, everything.
- *
- * The users can upload their blobs through the blob store command
- * line. The command line also allows us to update and delete blobs.
- *
- * Modifying the replication factor only works for HdfsBlobStore
- * as for the LocalFsBlobStore the replication is dependent on
- * the number of Nimbodes available.
- */
-public abstract class BlobStore implements Shutdownable {
- private static final Logger LOG = LoggerFactory.getLogger(BlobStore.class);
- private static final Pattern KEY_PATTERN = Pattern.compile("^[\\w \\t\\.:_-]+$");
- protected static final String BASE_BLOBS_DIR_NAME = "blobs";
-
- /**
- * Allows us to initialize the blob store
- * @param conf The storm configuration
- * @param baseDir The directory path to store the blobs
- * @param nimbusInfo Contains the nimbus host, port and leadership information.
- */
- public abstract void prepare(Map conf, String baseDir, NimbusInfo nimbusInfo);
-
- /**
- * Creates the blob.
- * @param key Key for the blob.
- * @param meta Metadata which contains the acls information
- * @param who Is the subject creating the blob.
- * @return AtomicOutputStream returns a stream into which the data
- * can be written.
- * @throws AuthorizationException
- * @throws KeyAlreadyExistsException
- */
- public abstract AtomicOutputStream createBlob(String key, SettableBlobMeta meta, Subject who) throws AuthorizationException, KeyAlreadyExistsException;
-
- /**
- * Updates the blob data.
- * @param key Key for the blob.
- * @param who Is the subject having the write privilege for the blob.
- * @return AtomicOutputStream returns a stream into which the data
- * can be written.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- public abstract AtomicOutputStream updateBlob(String key, Subject who) throws AuthorizationException, KeyNotFoundException;
-
- /**
- * Gets the current version of metadata for a blob
- * to be viewed by the user or downloaded by the supervisor.
- * @param key Key for the blob.
- * @param who Is the subject having the read privilege for the blob.
- * @return AtomicOutputStream returns a stream into which the data
- * can be written.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- public abstract ReadableBlobMeta getBlobMeta(String key, Subject who) throws AuthorizationException, KeyNotFoundException;
-
- /**
- * Sets the metadata with renewed acls for the blob.
- * @param key Key for the blob.
- * @param meta Metadata which contains the updated
- * acls information.
- * @param who Is the subject having the write privilege for the blob.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- public abstract void setBlobMeta(String key, SettableBlobMeta meta, Subject who) throws AuthorizationException, KeyNotFoundException;
-
- /**
- * Deletes the blob data and metadata.
- * @param key Key for the blob.
- * @param who Is the subject having write privilege for the blob.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- public abstract void deleteBlob(String key, Subject who) throws AuthorizationException, KeyNotFoundException;
-
- /**
- * Gets the InputStream to read the blob details
- * @param key Key for the blob.
- * @param who Is the subject having the read privilege for the blob.
- * @return InputStreamWithMeta has the additional
- * file length and version information.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- public abstract InputStreamWithMeta getBlob(String key, Subject who) throws AuthorizationException, KeyNotFoundException;
-
- /**
- * Returns an iterator with all the list of
- * keys currently available on the blob store.
- * @return Iterator<String>
- */
- public abstract Iterator<String> listKeys();
-
- /**
- * Gets the replication factor of the blob.
- * @param key Key for the blob.
- * @param who Is the subject having the read privilege for the blob.
- * @return BlobReplication object containing the
- * replication factor for the blob.
- * @throws Exception
- */
- public abstract int getBlobReplication(String key, Subject who) throws Exception;
-
- /**
- * Modifies the replication factor of the blob.
- * @param key Key for the blob.
- * @param replication The replication factor the
- * blob has to be set.
- * @param who Is the subject having the update privilege for the blob
- * @return BlobReplication object containing the
- * updated replication factor for the blob.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- * @throws IOException
- */
- public abstract int updateBlobReplication(String key, int replication, Subject who) throws AuthorizationException, KeyNotFoundException, IOException;
-
- /**
- * Filters keys based on the KeyFilter
- * passed as the argument.
- * @param filter KeyFilter
- * @param <R> Type
- * @return Set of filtered keys
- */
- public <R> Set<R> filterAndListKeys(KeyFilter<R> filter) {
- Set<R> ret = new HashSet<R>();
- Iterator<String> keys = listKeys();
- while (keys.hasNext()) {
- String key = keys.next();
- R filtered = filter.filter(key);
- if (filtered != null) {
- ret.add(filtered);
- }
- }
- return ret;
- }
-
- /**
- * Validates key checking for potentially harmful patterns
- * @param key Key for the blob.
- */
- public static final void validateKey(String key) throws AuthorizationException {
- if (StringUtils.isEmpty(key) || "..".equals(key) || ".".equals(key) || !KEY_PATTERN.matcher(key).matches()) {
- LOG.error("'{}' does not appear to be valid {}", key, KEY_PATTERN);
- throw new AuthorizationException(key+" does not appear to be a valid blob key");
- }
- }
-
- /**
- * Wrapper called to create the blob which contains
- * the byte data
- * @param key Key for the blob.
- * @param data Byte data that needs to be uploaded.
- * @param meta Metadata which contains the acls information
- * @param who Is the subject creating the blob.
- * @throws AuthorizationException
- * @throws KeyAlreadyExistsException
- * @throws IOException
- */
- public void createBlob(String key, byte [] data, SettableBlobMeta meta, Subject who) throws AuthorizationException, KeyAlreadyExistsException, IOException {
- AtomicOutputStream out = null;
- try {
- out = createBlob(key, meta, who);
- out.write(data);
- out.close();
- out = null;
- } finally {
- if (out != null) {
- out.cancel();
- }
- }
- }
-
- /**
- * Wrapper called to create the blob which contains
- * the byte data
- * @param key Key for the blob.
- * @param in InputStream from which the data is read to be
- * written as a part of the blob.
- * @param meta Metadata which contains the acls information
- * @param who Is the subject creating the blob.
- * @throws AuthorizationException
- * @throws KeyAlreadyExistsException
- * @throws IOException
- */
- public void createBlob(String key, InputStream in, SettableBlobMeta meta, Subject who) throws AuthorizationException, KeyAlreadyExistsException, IOException {
- AtomicOutputStream out = null;
- try {
- out = createBlob(key, meta, who);
- byte[] buffer = new byte[2048];
- int len = 0;
- while ((len = in.read(buffer)) > 0) {
- out.write(buffer, 0, len);
- }
- out.close();
- } catch (AuthorizationException | IOException | RuntimeException e) {
- if (out !=null) {
- out.cancel();
- }
- } finally {
- in.close();
- }
- }
-
- /**
- * Reads the blob from the blob store
- * and writes it into the output stream.
- * @param key Key for the blob.
- * @param out Output stream
- * @param who Is the subject having read
- * privilege for the blob.
- * @throws IOException
- * @throws KeyNotFoundException
- * @throws AuthorizationException
- */
- public void readBlobTo(String key, OutputStream out, Subject who) throws IOException, KeyNotFoundException, AuthorizationException {
- InputStreamWithMeta in = getBlob(key, who);
- if (in == null) {
- throw new IOException("Could not find " + key);
- }
- byte[] buffer = new byte[2048];
- int len = 0;
- try{
- while ((len = in.read(buffer)) > 0) {
- out.write(buffer, 0, len);
- }
- } finally {
- in.close();
- out.flush();
- }
- }
-
- /**
- * Wrapper around readBlobTo which
- * returns a ByteArray output stream.
- * @param key Key for the blob.
- * @param who Is the subject having
- * the read privilege for the blob.
- * @return ByteArrayOutputStream
- * @throws IOException
- * @throws KeyNotFoundException
- * @throws AuthorizationException
- */
- public byte[] readBlob(String key, Subject who) throws IOException, KeyNotFoundException, AuthorizationException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- readBlobTo(key, out, who);
- byte[] bytes = out.toByteArray();
- out.close();
- return bytes;
- }
-
- /**
- * Output stream implementation used for reading the
- * metadata and data information.
- */
- protected class BlobStoreFileOutputStream extends AtomicOutputStream {
- private BlobStoreFile part;
- private OutputStream out;
-
- public BlobStoreFileOutputStream(BlobStoreFile part) throws IOException {
- this.part = part;
- this.out = part.getOutputStream();
- }
-
- @Override
- public void close() throws IOException {
- try {
- //close means commit
- out.close();
- part.commit();
- } catch (IOException | RuntimeException e) {
- cancel();
- throw e;
- }
- }
-
- @Override
- public void cancel() throws IOException {
- try {
- out.close();
- } finally {
- part.cancel();
- }
- }
-
- @Override
- public void write(int b) throws IOException {
- out.write(b);
- }
-
- @Override
- public void write(byte []b) throws IOException {
- out.write(b);
- }
-
- @Override
- public void write(byte []b, int offset, int len) throws IOException {
- out.write(b, offset, len);
- }
- }
-
- /**
- * Input stream implementation used for writing
- * both the metadata containing the acl information
- * and the blob data.
- */
- protected class BlobStoreFileInputStream extends InputStreamWithMeta {
- private BlobStoreFile part;
- private InputStream in;
-
- public BlobStoreFileInputStream(BlobStoreFile part) throws IOException {
- this.part = part;
- this.in = part.getInputStream();
- }
-
- @Override
- public long getVersion() throws IOException {
- return part.getModTime();
- }
-
- @Override
- public int read() throws IOException {
- return in.read();
- }
-
- @Override
- public int read(byte[] b, int off, int len) throws IOException {
- return in.read(b, off, len);
- }
-
- @Override
- public int read(byte[] b) throws IOException {
- return in.read(b);
- }
-
- @Override
- public int available() throws IOException {
- return in.available();
- }
-
- @Override
- public long getFileLength() throws IOException {
- return part.getFileLength();
- }
-
- @Override
- public void close() throws IOException {
- in.close();
- }
- }
-
- /**
- * Blob store implements its own version of iterator
- * to list the blobs
- */
- public static class KeyTranslationIterator implements Iterator<String> {
- private Iterator<String> it = null;
- private String next = null;
- private String prefix = null;
-
- public KeyTranslationIterator(Iterator<String> it, String prefix) throws IOException {
- this.it = it;
- this.prefix = prefix;
- primeNext();
- }
-
- private void primeNext() {
- next = null;
- while (it.hasNext()) {
- String tmp = it.next();
- if (tmp.startsWith(prefix)) {
- next = tmp.substring(prefix.length());
- return;
- }
- }
- }
-
- @Override
- public boolean hasNext() {
- return next != null;
- }
-
- @Override
- public String next() {
- if (!hasNext()) {
- throw new NoSuchElementException();
- }
- String current = next;
- primeNext();
- return current;
- }
-
- @Override
- public void remove() {
- throw new UnsupportedOperationException("Delete Not Supported");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreAclHandler.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreAclHandler.java b/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreAclHandler.java
deleted file mode 100644
index 5b3866d..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreAclHandler.java
+++ /dev/null
@@ -1,409 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-import org.apache.storm.Config;
-import org.apache.storm.generated.AccessControl;
-import org.apache.storm.generated.AccessControlType;
-import org.apache.storm.generated.AuthorizationException;
-import org.apache.storm.generated.SettableBlobMeta;
-import org.apache.storm.security.auth.AuthUtils;
-import org.apache.storm.security.auth.IPrincipalToLocal;
-import org.apache.storm.security.auth.NimbusPrincipal;
-import org.apache.commons.lang.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.security.auth.Subject;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Provides common handling of acls for Blobstores.
- * Also contains some static utility functions related to Blobstores.
- */
-public class BlobStoreAclHandler {
- public static final Logger LOG = LoggerFactory.getLogger(BlobStoreAclHandler.class);
- private final IPrincipalToLocal _ptol;
-
- public static final int READ = 0x01;
- public static final int WRITE = 0x02;
- public static final int ADMIN = 0x04;
- public static final List<AccessControl> WORLD_EVERYTHING =
- Arrays.asList(new AccessControl(AccessControlType.OTHER, READ | WRITE | ADMIN));
- public static final List<AccessControl> DEFAULT = new ArrayList<AccessControl>();
- private Set<String> _supervisors;
- private Set<String> _admins;
- private boolean doAclValidation;
-
- public BlobStoreAclHandler(Map conf) {
- _ptol = AuthUtils.GetPrincipalToLocalPlugin(conf);
- _supervisors = new HashSet<String>();
- _admins = new HashSet<String>();
- if (conf.containsKey(Config.NIMBUS_SUPERVISOR_USERS)) {
- _supervisors.addAll((List<String>)conf.get(Config.NIMBUS_SUPERVISOR_USERS));
- }
- if (conf.containsKey(Config.NIMBUS_ADMINS)) {
- _admins.addAll((List<String>)conf.get(Config.NIMBUS_ADMINS));
- }
- if (conf.containsKey(Config.STORM_BLOBSTORE_ACL_VALIDATION_ENABLED)) {
- doAclValidation = (boolean)conf.get(Config.STORM_BLOBSTORE_ACL_VALIDATION_ENABLED);
- }
- }
-
- private static AccessControlType parseACLType(String type) {
- if ("other".equalsIgnoreCase(type) || "o".equalsIgnoreCase(type)) {
- return AccessControlType.OTHER;
- } else if ("user".equalsIgnoreCase(type) || "u".equalsIgnoreCase(type)) {
- return AccessControlType.USER;
- }
- throw new IllegalArgumentException(type+" is not a valid access control type");
- }
-
- private static int parseAccess(String access) {
- int ret = 0;
- for (char c: access.toCharArray()) {
- if ('r' == c) {
- ret = ret | READ;
- } else if ('w' == c) {
- ret = ret | WRITE;
- } else if ('a' == c) {
- ret = ret | ADMIN;
- } else if ('-' == c) {
- //ignored
- } else {
- throw new IllegalArgumentException("");
- }
- }
- return ret;
- }
-
- public static AccessControl parseAccessControl(String str) {
- String[] parts = str.split(":");
- String type = "other";
- String name = "";
- String access = "-";
- if (parts.length > 3) {
- throw new IllegalArgumentException("Don't know how to parse "+str+" into an ACL value");
- } else if (parts.length == 1) {
- type = "other";
- name = "";
- access = parts[0];
- } else if (parts.length == 2) {
- type = "user";
- name = parts[0];
- access = parts[1];
- } else if (parts.length == 3) {
- type = parts[0];
- name = parts[1];
- access = parts[2];
- }
- AccessControl ret = new AccessControl();
- ret.set_type(parseACLType(type));
- ret.set_name(name);
- ret.set_access(parseAccess(access));
- return ret;
- }
-
- private static String accessToString(int access) {
- StringBuilder ret = new StringBuilder();
- ret.append(((access & READ) > 0) ? "r" : "-");
- ret.append(((access & WRITE) > 0) ? "w" : "-");
- ret.append(((access & ADMIN) > 0) ? "a" : "-");
- return ret.toString();
- }
-
- public static String accessControlToString(AccessControl ac) {
- StringBuilder ret = new StringBuilder();
- switch(ac.get_type()) {
- case OTHER:
- ret.append("o");
- break;
- case USER:
- ret.append("u");
- break;
- default:
- throw new IllegalArgumentException("Don't know what a type of "+ac.get_type()+" means ");
- }
- ret.append(":");
- if (ac.is_set_name()) {
- ret.append(ac.get_name());
- }
- ret.append(":");
- ret.append(accessToString(ac.get_access()));
- return ret.toString();
- }
-
- public static void validateSettableACLs(String key, List<AccessControl> acls) throws AuthorizationException {
- Set<String> aclUsers = new HashSet<>();
- List<String> duplicateUsers = new ArrayList<>();
- for (AccessControl acl : acls) {
- String aclUser = acl.get_name();
- if (!StringUtils.isEmpty(aclUser) && !aclUsers.add(aclUser)) {
- LOG.error("'{}' user can't appear more than once in the ACLs", aclUser);
- duplicateUsers.add(aclUser);
- }
- }
- if (duplicateUsers.size() > 0) {
- String errorMessage = "user " + Arrays.toString(duplicateUsers.toArray())
- + " can't appear more than once in the ACLs for key [" + key +"].";
- throw new AuthorizationException(errorMessage);
- }
- }
-
- private Set<String> constructUserFromPrincipals(Subject who) {
- Set<String> user = new HashSet<String>();
- if (who != null) {
- for (Principal p : who.getPrincipals()) {
- user.add(_ptol.toLocal(p));
- }
- }
- return user;
- }
-
- private boolean isAdmin(Subject who) {
- Set<String> user = constructUserFromPrincipals(who);
- for (String u : user) {
- if (_admins.contains(u)) {
- return true;
- }
- }
- return false;
- }
-
- private boolean isReadOperation(int operation) {
- if (operation == 1) {
- return true;
- }
- return false;
- }
-
- private boolean isSupervisor(Subject who, int operation) {
- Set<String> user = constructUserFromPrincipals(who);
- if (isReadOperation(operation)) {
- for (String u : user) {
- if (_supervisors.contains(u)) {
- return true;
- }
- }
- }
- return false;
- }
-
- private boolean isNimbus(Subject who) {
- Set<Principal> principals;
- boolean isNimbusInstance = false;
- if (who != null) {
- principals = who.getPrincipals();
- for (Principal principal : principals) {
- if (principal instanceof NimbusPrincipal) {
- isNimbusInstance = true;
- }
- }
- }
- return isNimbusInstance;
- }
-
- public boolean checkForValidUsers(Subject who, int mask) {
- return isNimbus(who) || isAdmin(who) || isSupervisor(who,mask);
- }
-
- /**
- * The user should be able to see the metadata if and only if they have any of READ, WRITE, or ADMIN
- */
- public void validateUserCanReadMeta(List<AccessControl> acl, Subject who, String key) throws AuthorizationException {
- hasAnyPermissions(acl, (READ|WRITE|ADMIN), who, key);
- }
-
- /**
- * Validates if the user has any of the permissions
- * mentioned in the mask.
- * @param acl ACL for the key.
- * @param mask mask holds the cumulative value of
- * READ = 1, WRITE = 2 or ADMIN = 4 permissions.
- * mask = 1 implies READ privilege.
- * mask = 5 implies READ and ADMIN privileges.
- * @param who Is the user against whom the permissions
- * are validated for a key using the ACL and the mask.
- * @param key Key used to identify the blob.
- * @throws AuthorizationException
- */
- public void hasAnyPermissions(List<AccessControl> acl, int mask, Subject who, String key) throws AuthorizationException {
- if (!doAclValidation) {
- return;
- }
- Set<String> user = constructUserFromPrincipals(who);
- LOG.debug("user {}", user);
- if (checkForValidUsers(who, mask)) {
- return;
- }
- for (AccessControl ac : acl) {
- int allowed = getAllowed(ac, user);
- LOG.debug(" user: {} allowed: {} key: {}", user, allowed, key);
- if ((allowed & mask) > 0) {
- return;
- }
- }
- throw new AuthorizationException(
- user + " does not have access to " + key);
- }
-
- /**
- * Validates if the user has at least the set of permissions
- * mentioned in the mask.
- * @param acl ACL for the key.
- * @param mask mask holds the cumulative value of
- * READ = 1, WRITE = 2 or ADMIN = 4 permissions.
- * mask = 1 implies READ privilege.
- * mask = 5 implies READ and ADMIN privileges.
- * @param who Is the user against whom the permissions
- * are validated for a key using the ACL and the mask.
- * @param key Key used to identify the blob.
- * @throws AuthorizationException
- */
- public void hasPermissions(List<AccessControl> acl, int mask, Subject who, String key) throws AuthorizationException {
- if (!doAclValidation) {
- return;
- }
- Set<String> user = constructUserFromPrincipals(who);
- LOG.debug("user {}", user);
- if (checkForValidUsers(who, mask)) {
- return;
- }
- for (AccessControl ac : acl) {
- int allowed = getAllowed(ac, user);
- mask = ~allowed & mask;
- LOG.debug(" user: {} allowed: {} disallowed: {} key: {}", user, allowed, mask, key);
- }
- if (mask == 0) {
- return;
- }
- throw new AuthorizationException(
- user + " does not have " + namedPerms(mask) + " access to " + key);
- }
-
- public void normalizeSettableBlobMeta(String key, SettableBlobMeta meta, Subject who, int opMask) {
- meta.set_acl(normalizeSettableACLs(key, meta.get_acl(), who, opMask));
- }
-
- private String namedPerms(int mask) {
- StringBuilder b = new StringBuilder();
- b.append("[");
- if ((mask & READ) > 0) {
- b.append("READ ");
- }
- if ((mask & WRITE) > 0) {
- b.append("WRITE ");
- }
- if ((mask & ADMIN) > 0) {
- b.append("ADMIN ");
- }
- b.append("]");
- return b.toString();
- }
-
- private int getAllowed(AccessControl ac, Set<String> users) {
- switch (ac.get_type()) {
- case OTHER:
- return ac.get_access();
- case USER:
- if (users.contains(ac.get_name())) {
- return ac.get_access();
- }
- return 0;
- default:
- return 0;
- }
- }
-
- private List<AccessControl> removeBadACLs(List<AccessControl> accessControls) {
- List<AccessControl> resultAcl = new ArrayList<AccessControl>();
- for (AccessControl control : accessControls) {
- if(control.get_type().equals(AccessControlType.OTHER) && (control.get_access() == 0 )) {
- LOG.debug("Removing invalid blobstore world ACL " +
- BlobStoreAclHandler.accessControlToString(control));
- continue;
- }
- resultAcl.add(control);
- }
- return resultAcl;
- }
-
- private final List<AccessControl> normalizeSettableACLs(String key, List<AccessControl> acls, Subject who,
- int opMask) {
- List<AccessControl> cleanAcls = removeBadACLs(acls);
- Set<String> userNames = getUserNamesFromSubject(who);
- for (String user : userNames) {
- fixACLsForUser(cleanAcls, user, opMask);
- }
- if ((who == null || userNames.isEmpty()) && !worldEverything(acls)) {
- cleanAcls.addAll(BlobStoreAclHandler.WORLD_EVERYTHING);
- LOG.debug("Access Control for key {} is normalized to world everything {}", key, cleanAcls);
- if (!acls.isEmpty())
- LOG.warn("Access control for blob with key {} is normalized to WORLD_EVERYTHING", key);
- }
- return cleanAcls;
- }
-
- private boolean worldEverything(List<AccessControl> acls) {
- boolean isWorldEverything = false;
- for (AccessControl acl : acls) {
- if (acl.get_type() == AccessControlType.OTHER && acl.get_access() == (READ|WRITE|ADMIN)) {
- isWorldEverything = true;
- break;
- }
- }
- return isWorldEverything;
- }
-
- private void fixACLsForUser(List<AccessControl> acls, String user, int mask) {
- boolean foundUserACL = false;
- for (AccessControl control : acls) {
- if (control.get_type() == AccessControlType.USER && control.get_name().equals(user)) {
- int currentAccess = control.get_access();
- if ((currentAccess & mask) != mask) {
- control.set_access(currentAccess | mask);
- }
- foundUserACL = true;
- break;
- }
- }
- if (!foundUserACL) {
- AccessControl userACL = new AccessControl();
- userACL.set_type(AccessControlType.USER);
- userACL.set_name(user);
- userACL.set_access(mask);
- acls.add(userACL);
- }
- }
-
- private Set<String> getUserNamesFromSubject(Subject who) {
- Set<String> user = new HashSet<String>();
- if (who != null) {
- for(Principal p: who.getPrincipals()) {
- user.add(_ptol.toLocal(p));
- }
- }
- return user;
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreFile.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreFile.java b/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreFile.java
deleted file mode 100644
index 9de2f4a..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreFile.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-import org.apache.storm.generated.SettableBlobMeta;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.regex.Pattern;
-
-/**
- * Provides an base implementation for creating a blobstore based on file backed storage.
- */
-public abstract class BlobStoreFile {
- public static final Logger LOG = LoggerFactory.getLogger(BlobStoreFile.class);
-
- protected static final String TMP_EXT = ".tmp";
- protected static final Pattern TMP_NAME_PATTERN = Pattern.compile("^\\d+\\" + TMP_EXT + "$");
- protected static final String BLOBSTORE_DATA_FILE = "data";
-
- public abstract void delete() throws IOException;
- public abstract String getKey();
- public abstract boolean isTmp();
- public abstract void setMetadata(SettableBlobMeta meta);
- public abstract SettableBlobMeta getMetadata();
- public abstract long getModTime() throws IOException;
- public abstract InputStream getInputStream() throws IOException;
- public abstract OutputStream getOutputStream() throws IOException;
- public abstract void commit() throws IOException;
- public abstract void cancel() throws IOException;
- public abstract long getFileLength() throws IOException;
-}
[09/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SupervisorInfo.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/SupervisorInfo.java b/storm-core/src/jvm/backtype/storm/generated/SupervisorInfo.java
deleted file mode 100644
index 44003c2..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/SupervisorInfo.java
+++ /dev/null
@@ -1,1446 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class SupervisorInfo implements org.apache.thrift.TBase<SupervisorInfo, SupervisorInfo._Fields>, java.io.Serializable, Cloneable, Comparable<SupervisorInfo> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SupervisorInfo");
-
- private static final org.apache.thrift.protocol.TField TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("time_secs", org.apache.thrift.protocol.TType.I64, (short)1);
- private static final org.apache.thrift.protocol.TField HOSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("hostname", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField ASSIGNMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("assignment_id", org.apache.thrift.protocol.TType.STRING, (short)3);
- private static final org.apache.thrift.protocol.TField USED_PORTS_FIELD_DESC = new org.apache.thrift.protocol.TField("used_ports", org.apache.thrift.protocol.TType.LIST, (short)4);
- private static final org.apache.thrift.protocol.TField META_FIELD_DESC = new org.apache.thrift.protocol.TField("meta", org.apache.thrift.protocol.TType.LIST, (short)5);
- private static final org.apache.thrift.protocol.TField SCHEDULER_META_FIELD_DESC = new org.apache.thrift.protocol.TField("scheduler_meta", org.apache.thrift.protocol.TType.MAP, (short)6);
- private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I64, (short)7);
- private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)8);
- private static final org.apache.thrift.protocol.TField RESOURCES_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("resources_map", org.apache.thrift.protocol.TType.MAP, (short)9);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new SupervisorInfoStandardSchemeFactory());
- schemes.put(TupleScheme.class, new SupervisorInfoTupleSchemeFactory());
- }
-
- private long time_secs; // required
- private String hostname; // required
- private String assignment_id; // optional
- private List<Long> used_ports; // optional
- private List<Long> meta; // optional
- private Map<String,String> scheduler_meta; // optional
- private long uptime_secs; // optional
- private String version; // optional
- private Map<String,Double> resources_map; // 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 {
- TIME_SECS((short)1, "time_secs"),
- HOSTNAME((short)2, "hostname"),
- ASSIGNMENT_ID((short)3, "assignment_id"),
- USED_PORTS((short)4, "used_ports"),
- META((short)5, "meta"),
- SCHEDULER_META((short)6, "scheduler_meta"),
- UPTIME_SECS((short)7, "uptime_secs"),
- VERSION((short)8, "version"),
- RESOURCES_MAP((short)9, "resources_map");
-
- 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: // TIME_SECS
- return TIME_SECS;
- case 2: // HOSTNAME
- return HOSTNAME;
- case 3: // ASSIGNMENT_ID
- return ASSIGNMENT_ID;
- case 4: // USED_PORTS
- return USED_PORTS;
- case 5: // META
- return META;
- case 6: // SCHEDULER_META
- return SCHEDULER_META;
- case 7: // UPTIME_SECS
- return UPTIME_SECS;
- case 8: // VERSION
- return VERSION;
- case 9: // RESOURCES_MAP
- return RESOURCES_MAP;
- 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 __TIME_SECS_ISSET_ID = 0;
- private static final int __UPTIME_SECS_ISSET_ID = 1;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.ASSIGNMENT_ID,_Fields.USED_PORTS,_Fields.META,_Fields.SCHEDULER_META,_Fields.UPTIME_SECS,_Fields.VERSION,_Fields.RESOURCES_MAP};
- 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.TIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("time_secs", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.HOSTNAME, new org.apache.thrift.meta_data.FieldMetaData("hostname", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.ASSIGNMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("assignment_id", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.USED_PORTS, new org.apache.thrift.meta_data.FieldMetaData("used_ports", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
- tmpMap.put(_Fields.META, new org.apache.thrift.meta_data.FieldMetaData("meta", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
- tmpMap.put(_Fields.SCHEDULER_META, new org.apache.thrift.meta_data.FieldMetaData("scheduler_meta", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.RESOURCES_MAP, new org.apache.thrift.meta_data.FieldMetaData("resources_map", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SupervisorInfo.class, metaDataMap);
- }
-
- public SupervisorInfo() {
- }
-
- public SupervisorInfo(
- long time_secs,
- String hostname)
- {
- this();
- this.time_secs = time_secs;
- set_time_secs_isSet(true);
- this.hostname = hostname;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public SupervisorInfo(SupervisorInfo other) {
- __isset_bitfield = other.__isset_bitfield;
- this.time_secs = other.time_secs;
- if (other.is_set_hostname()) {
- this.hostname = other.hostname;
- }
- if (other.is_set_assignment_id()) {
- this.assignment_id = other.assignment_id;
- }
- if (other.is_set_used_ports()) {
- List<Long> __this__used_ports = new ArrayList<Long>(other.used_ports);
- this.used_ports = __this__used_ports;
- }
- if (other.is_set_meta()) {
- List<Long> __this__meta = new ArrayList<Long>(other.meta);
- this.meta = __this__meta;
- }
- if (other.is_set_scheduler_meta()) {
- Map<String,String> __this__scheduler_meta = new HashMap<String,String>(other.scheduler_meta);
- this.scheduler_meta = __this__scheduler_meta;
- }
- this.uptime_secs = other.uptime_secs;
- if (other.is_set_version()) {
- this.version = other.version;
- }
- if (other.is_set_resources_map()) {
- Map<String,Double> __this__resources_map = new HashMap<String,Double>(other.resources_map);
- this.resources_map = __this__resources_map;
- }
- }
-
- public SupervisorInfo deepCopy() {
- return new SupervisorInfo(this);
- }
-
- @Override
- public void clear() {
- set_time_secs_isSet(false);
- this.time_secs = 0;
- this.hostname = null;
- this.assignment_id = null;
- this.used_ports = null;
- this.meta = null;
- this.scheduler_meta = null;
- set_uptime_secs_isSet(false);
- this.uptime_secs = 0;
- this.version = null;
- this.resources_map = null;
- }
-
- public long get_time_secs() {
- return this.time_secs;
- }
-
- public void set_time_secs(long time_secs) {
- this.time_secs = time_secs;
- set_time_secs_isSet(true);
- }
-
- public void unset_time_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field time_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_time_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __TIME_SECS_ISSET_ID);
- }
-
- public void set_time_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIME_SECS_ISSET_ID, value);
- }
-
- public String get_hostname() {
- return this.hostname;
- }
-
- public void set_hostname(String hostname) {
- this.hostname = hostname;
- }
-
- public void unset_hostname() {
- this.hostname = null;
- }
-
- /** Returns true if field hostname is set (has been assigned a value) and false otherwise */
- public boolean is_set_hostname() {
- return this.hostname != null;
- }
-
- public void set_hostname_isSet(boolean value) {
- if (!value) {
- this.hostname = null;
- }
- }
-
- public String get_assignment_id() {
- return this.assignment_id;
- }
-
- public void set_assignment_id(String assignment_id) {
- this.assignment_id = assignment_id;
- }
-
- public void unset_assignment_id() {
- this.assignment_id = null;
- }
-
- /** Returns true if field assignment_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_assignment_id() {
- return this.assignment_id != null;
- }
-
- public void set_assignment_id_isSet(boolean value) {
- if (!value) {
- this.assignment_id = null;
- }
- }
-
- public int get_used_ports_size() {
- return (this.used_ports == null) ? 0 : this.used_ports.size();
- }
-
- public java.util.Iterator<Long> get_used_ports_iterator() {
- return (this.used_ports == null) ? null : this.used_ports.iterator();
- }
-
- public void add_to_used_ports(long elem) {
- if (this.used_ports == null) {
- this.used_ports = new ArrayList<Long>();
- }
- this.used_ports.add(elem);
- }
-
- public List<Long> get_used_ports() {
- return this.used_ports;
- }
-
- public void set_used_ports(List<Long> used_ports) {
- this.used_ports = used_ports;
- }
-
- public void unset_used_ports() {
- this.used_ports = null;
- }
-
- /** Returns true if field used_ports is set (has been assigned a value) and false otherwise */
- public boolean is_set_used_ports() {
- return this.used_ports != null;
- }
-
- public void set_used_ports_isSet(boolean value) {
- if (!value) {
- this.used_ports = null;
- }
- }
-
- public int get_meta_size() {
- return (this.meta == null) ? 0 : this.meta.size();
- }
-
- public java.util.Iterator<Long> get_meta_iterator() {
- return (this.meta == null) ? null : this.meta.iterator();
- }
-
- public void add_to_meta(long elem) {
- if (this.meta == null) {
- this.meta = new ArrayList<Long>();
- }
- this.meta.add(elem);
- }
-
- public List<Long> get_meta() {
- return this.meta;
- }
-
- public void set_meta(List<Long> meta) {
- this.meta = meta;
- }
-
- public void unset_meta() {
- this.meta = null;
- }
-
- /** Returns true if field meta is set (has been assigned a value) and false otherwise */
- public boolean is_set_meta() {
- return this.meta != null;
- }
-
- public void set_meta_isSet(boolean value) {
- if (!value) {
- this.meta = null;
- }
- }
-
- public int get_scheduler_meta_size() {
- return (this.scheduler_meta == null) ? 0 : this.scheduler_meta.size();
- }
-
- public void put_to_scheduler_meta(String key, String val) {
- if (this.scheduler_meta == null) {
- this.scheduler_meta = new HashMap<String,String>();
- }
- this.scheduler_meta.put(key, val);
- }
-
- public Map<String,String> get_scheduler_meta() {
- return this.scheduler_meta;
- }
-
- public void set_scheduler_meta(Map<String,String> scheduler_meta) {
- this.scheduler_meta = scheduler_meta;
- }
-
- public void unset_scheduler_meta() {
- this.scheduler_meta = null;
- }
-
- /** Returns true if field scheduler_meta is set (has been assigned a value) and false otherwise */
- public boolean is_set_scheduler_meta() {
- return this.scheduler_meta != null;
- }
-
- public void set_scheduler_meta_isSet(boolean value) {
- if (!value) {
- this.scheduler_meta = null;
- }
- }
-
- public long get_uptime_secs() {
- return this.uptime_secs;
- }
-
- public void set_uptime_secs(long uptime_secs) {
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- }
-
- public void unset_uptime_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_uptime_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- public void set_uptime_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID, value);
- }
-
- public String get_version() {
- return this.version;
- }
-
- public void set_version(String version) {
- this.version = version;
- }
-
- public void unset_version() {
- this.version = null;
- }
-
- /** Returns true if field version is set (has been assigned a value) and false otherwise */
- public boolean is_set_version() {
- return this.version != null;
- }
-
- public void set_version_isSet(boolean value) {
- if (!value) {
- this.version = null;
- }
- }
-
- public int get_resources_map_size() {
- return (this.resources_map == null) ? 0 : this.resources_map.size();
- }
-
- public void put_to_resources_map(String key, double val) {
- if (this.resources_map == null) {
- this.resources_map = new HashMap<String,Double>();
- }
- this.resources_map.put(key, val);
- }
-
- public Map<String,Double> get_resources_map() {
- return this.resources_map;
- }
-
- public void set_resources_map(Map<String,Double> resources_map) {
- this.resources_map = resources_map;
- }
-
- public void unset_resources_map() {
- this.resources_map = null;
- }
-
- /** Returns true if field resources_map is set (has been assigned a value) and false otherwise */
- public boolean is_set_resources_map() {
- return this.resources_map != null;
- }
-
- public void set_resources_map_isSet(boolean value) {
- if (!value) {
- this.resources_map = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TIME_SECS:
- if (value == null) {
- unset_time_secs();
- } else {
- set_time_secs((Long)value);
- }
- break;
-
- case HOSTNAME:
- if (value == null) {
- unset_hostname();
- } else {
- set_hostname((String)value);
- }
- break;
-
- case ASSIGNMENT_ID:
- if (value == null) {
- unset_assignment_id();
- } else {
- set_assignment_id((String)value);
- }
- break;
-
- case USED_PORTS:
- if (value == null) {
- unset_used_ports();
- } else {
- set_used_ports((List<Long>)value);
- }
- break;
-
- case META:
- if (value == null) {
- unset_meta();
- } else {
- set_meta((List<Long>)value);
- }
- break;
-
- case SCHEDULER_META:
- if (value == null) {
- unset_scheduler_meta();
- } else {
- set_scheduler_meta((Map<String,String>)value);
- }
- break;
-
- case UPTIME_SECS:
- if (value == null) {
- unset_uptime_secs();
- } else {
- set_uptime_secs((Long)value);
- }
- break;
-
- case VERSION:
- if (value == null) {
- unset_version();
- } else {
- set_version((String)value);
- }
- break;
-
- case RESOURCES_MAP:
- if (value == null) {
- unset_resources_map();
- } else {
- set_resources_map((Map<String,Double>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TIME_SECS:
- return get_time_secs();
-
- case HOSTNAME:
- return get_hostname();
-
- case ASSIGNMENT_ID:
- return get_assignment_id();
-
- case USED_PORTS:
- return get_used_ports();
-
- case META:
- return get_meta();
-
- case SCHEDULER_META:
- return get_scheduler_meta();
-
- case UPTIME_SECS:
- return get_uptime_secs();
-
- case VERSION:
- return get_version();
-
- case RESOURCES_MAP:
- return get_resources_map();
-
- }
- 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 TIME_SECS:
- return is_set_time_secs();
- case HOSTNAME:
- return is_set_hostname();
- case ASSIGNMENT_ID:
- return is_set_assignment_id();
- case USED_PORTS:
- return is_set_used_ports();
- case META:
- return is_set_meta();
- case SCHEDULER_META:
- return is_set_scheduler_meta();
- case UPTIME_SECS:
- return is_set_uptime_secs();
- case VERSION:
- return is_set_version();
- case RESOURCES_MAP:
- return is_set_resources_map();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof SupervisorInfo)
- return this.equals((SupervisorInfo)that);
- return false;
- }
-
- public boolean equals(SupervisorInfo that) {
- if (that == null)
- return false;
-
- boolean this_present_time_secs = true;
- boolean that_present_time_secs = true;
- if (this_present_time_secs || that_present_time_secs) {
- if (!(this_present_time_secs && that_present_time_secs))
- return false;
- if (this.time_secs != that.time_secs)
- return false;
- }
-
- boolean this_present_hostname = true && this.is_set_hostname();
- boolean that_present_hostname = true && that.is_set_hostname();
- if (this_present_hostname || that_present_hostname) {
- if (!(this_present_hostname && that_present_hostname))
- return false;
- if (!this.hostname.equals(that.hostname))
- return false;
- }
-
- boolean this_present_assignment_id = true && this.is_set_assignment_id();
- boolean that_present_assignment_id = true && that.is_set_assignment_id();
- if (this_present_assignment_id || that_present_assignment_id) {
- if (!(this_present_assignment_id && that_present_assignment_id))
- return false;
- if (!this.assignment_id.equals(that.assignment_id))
- return false;
- }
-
- boolean this_present_used_ports = true && this.is_set_used_ports();
- boolean that_present_used_ports = true && that.is_set_used_ports();
- if (this_present_used_ports || that_present_used_ports) {
- if (!(this_present_used_ports && that_present_used_ports))
- return false;
- if (!this.used_ports.equals(that.used_ports))
- return false;
- }
-
- boolean this_present_meta = true && this.is_set_meta();
- boolean that_present_meta = true && that.is_set_meta();
- if (this_present_meta || that_present_meta) {
- if (!(this_present_meta && that_present_meta))
- return false;
- if (!this.meta.equals(that.meta))
- return false;
- }
-
- boolean this_present_scheduler_meta = true && this.is_set_scheduler_meta();
- boolean that_present_scheduler_meta = true && that.is_set_scheduler_meta();
- if (this_present_scheduler_meta || that_present_scheduler_meta) {
- if (!(this_present_scheduler_meta && that_present_scheduler_meta))
- return false;
- if (!this.scheduler_meta.equals(that.scheduler_meta))
- return false;
- }
-
- boolean this_present_uptime_secs = true && this.is_set_uptime_secs();
- boolean that_present_uptime_secs = true && that.is_set_uptime_secs();
- if (this_present_uptime_secs || that_present_uptime_secs) {
- if (!(this_present_uptime_secs && that_present_uptime_secs))
- return false;
- if (this.uptime_secs != that.uptime_secs)
- return false;
- }
-
- boolean this_present_version = true && this.is_set_version();
- boolean that_present_version = true && that.is_set_version();
- if (this_present_version || that_present_version) {
- if (!(this_present_version && that_present_version))
- return false;
- if (!this.version.equals(that.version))
- return false;
- }
-
- boolean this_present_resources_map = true && this.is_set_resources_map();
- boolean that_present_resources_map = true && that.is_set_resources_map();
- if (this_present_resources_map || that_present_resources_map) {
- if (!(this_present_resources_map && that_present_resources_map))
- return false;
- if (!this.resources_map.equals(that.resources_map))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_time_secs = true;
- list.add(present_time_secs);
- if (present_time_secs)
- list.add(time_secs);
-
- boolean present_hostname = true && (is_set_hostname());
- list.add(present_hostname);
- if (present_hostname)
- list.add(hostname);
-
- boolean present_assignment_id = true && (is_set_assignment_id());
- list.add(present_assignment_id);
- if (present_assignment_id)
- list.add(assignment_id);
-
- boolean present_used_ports = true && (is_set_used_ports());
- list.add(present_used_ports);
- if (present_used_ports)
- list.add(used_ports);
-
- boolean present_meta = true && (is_set_meta());
- list.add(present_meta);
- if (present_meta)
- list.add(meta);
-
- boolean present_scheduler_meta = true && (is_set_scheduler_meta());
- list.add(present_scheduler_meta);
- if (present_scheduler_meta)
- list.add(scheduler_meta);
-
- boolean present_uptime_secs = true && (is_set_uptime_secs());
- list.add(present_uptime_secs);
- if (present_uptime_secs)
- list.add(uptime_secs);
-
- boolean present_version = true && (is_set_version());
- list.add(present_version);
- if (present_version)
- list.add(version);
-
- boolean present_resources_map = true && (is_set_resources_map());
- list.add(present_resources_map);
- if (present_resources_map)
- list.add(resources_map);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(SupervisorInfo other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_time_secs()).compareTo(other.is_set_time_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_time_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.time_secs, other.time_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_hostname()).compareTo(other.is_set_hostname());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_hostname()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hostname, other.hostname);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assignment_id()).compareTo(other.is_set_assignment_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assignment_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assignment_id, other.assignment_id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_used_ports()).compareTo(other.is_set_used_ports());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_used_ports()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.used_ports, other.used_ports);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_meta()).compareTo(other.is_set_meta());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_meta()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.meta, other.meta);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_scheduler_meta()).compareTo(other.is_set_scheduler_meta());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_scheduler_meta()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scheduler_meta, other.scheduler_meta);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(other.is_set_uptime_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_uptime_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, other.uptime_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_version()).compareTo(other.is_set_version());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_version()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_resources_map()).compareTo(other.is_set_resources_map());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_resources_map()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resources_map, other.resources_map);
- 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("SupervisorInfo(");
- boolean first = true;
-
- sb.append("time_secs:");
- sb.append(this.time_secs);
- first = false;
- if (!first) sb.append(", ");
- sb.append("hostname:");
- if (this.hostname == null) {
- sb.append("null");
- } else {
- sb.append(this.hostname);
- }
- first = false;
- if (is_set_assignment_id()) {
- if (!first) sb.append(", ");
- sb.append("assignment_id:");
- if (this.assignment_id == null) {
- sb.append("null");
- } else {
- sb.append(this.assignment_id);
- }
- first = false;
- }
- if (is_set_used_ports()) {
- if (!first) sb.append(", ");
- sb.append("used_ports:");
- if (this.used_ports == null) {
- sb.append("null");
- } else {
- sb.append(this.used_ports);
- }
- first = false;
- }
- if (is_set_meta()) {
- if (!first) sb.append(", ");
- sb.append("meta:");
- if (this.meta == null) {
- sb.append("null");
- } else {
- sb.append(this.meta);
- }
- first = false;
- }
- if (is_set_scheduler_meta()) {
- if (!first) sb.append(", ");
- sb.append("scheduler_meta:");
- if (this.scheduler_meta == null) {
- sb.append("null");
- } else {
- sb.append(this.scheduler_meta);
- }
- first = false;
- }
- if (is_set_uptime_secs()) {
- if (!first) sb.append(", ");
- sb.append("uptime_secs:");
- sb.append(this.uptime_secs);
- first = false;
- }
- if (is_set_version()) {
- if (!first) sb.append(", ");
- sb.append("version:");
- if (this.version == null) {
- sb.append("null");
- } else {
- sb.append(this.version);
- }
- first = false;
- }
- if (is_set_resources_map()) {
- if (!first) sb.append(", ");
- sb.append("resources_map:");
- if (this.resources_map == null) {
- sb.append("null");
- } else {
- sb.append(this.resources_map);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_time_secs()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'time_secs' is unset! Struct:" + toString());
- }
-
- if (!is_set_hostname()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'hostname' 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 SupervisorInfoStandardSchemeFactory implements SchemeFactory {
- public SupervisorInfoStandardScheme getScheme() {
- return new SupervisorInfoStandardScheme();
- }
- }
-
- private static class SupervisorInfoStandardScheme extends StandardScheme<SupervisorInfo> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, SupervisorInfo 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: // TIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.time_secs = iprot.readI64();
- struct.set_time_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // HOSTNAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.hostname = iprot.readString();
- struct.set_hostname_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // ASSIGNMENT_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.assignment_id = iprot.readString();
- struct.set_assignment_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // USED_PORTS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list574 = iprot.readListBegin();
- struct.used_ports = new ArrayList<Long>(_list574.size);
- long _elem575;
- for (int _i576 = 0; _i576 < _list574.size; ++_i576)
- {
- _elem575 = iprot.readI64();
- struct.used_ports.add(_elem575);
- }
- iprot.readListEnd();
- }
- struct.set_used_ports_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // META
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list577 = iprot.readListBegin();
- struct.meta = new ArrayList<Long>(_list577.size);
- long _elem578;
- for (int _i579 = 0; _i579 < _list577.size; ++_i579)
- {
- _elem578 = iprot.readI64();
- struct.meta.add(_elem578);
- }
- iprot.readListEnd();
- }
- struct.set_meta_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // SCHEDULER_META
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map580 = iprot.readMapBegin();
- struct.scheduler_meta = new HashMap<String,String>(2*_map580.size);
- String _key581;
- String _val582;
- for (int _i583 = 0; _i583 < _map580.size; ++_i583)
- {
- _key581 = iprot.readString();
- _val582 = iprot.readString();
- struct.scheduler_meta.put(_key581, _val582);
- }
- iprot.readMapEnd();
- }
- struct.set_scheduler_meta_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // UPTIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.uptime_secs = iprot.readI64();
- struct.set_uptime_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 8: // VERSION
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.version = iprot.readString();
- struct.set_version_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 9: // RESOURCES_MAP
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map584 = iprot.readMapBegin();
- struct.resources_map = new HashMap<String,Double>(2*_map584.size);
- String _key585;
- double _val586;
- for (int _i587 = 0; _i587 < _map584.size; ++_i587)
- {
- _key585 = iprot.readString();
- _val586 = iprot.readDouble();
- struct.resources_map.put(_key585, _val586);
- }
- iprot.readMapEnd();
- }
- struct.set_resources_map_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, SupervisorInfo struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldBegin(TIME_SECS_FIELD_DESC);
- oprot.writeI64(struct.time_secs);
- oprot.writeFieldEnd();
- if (struct.hostname != null) {
- oprot.writeFieldBegin(HOSTNAME_FIELD_DESC);
- oprot.writeString(struct.hostname);
- oprot.writeFieldEnd();
- }
- if (struct.assignment_id != null) {
- if (struct.is_set_assignment_id()) {
- oprot.writeFieldBegin(ASSIGNMENT_ID_FIELD_DESC);
- oprot.writeString(struct.assignment_id);
- oprot.writeFieldEnd();
- }
- }
- if (struct.used_ports != null) {
- if (struct.is_set_used_ports()) {
- oprot.writeFieldBegin(USED_PORTS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.used_ports.size()));
- for (long _iter588 : struct.used_ports)
- {
- oprot.writeI64(_iter588);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.meta != null) {
- if (struct.is_set_meta()) {
- oprot.writeFieldBegin(META_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.meta.size()));
- for (long _iter589 : struct.meta)
- {
- oprot.writeI64(_iter589);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.scheduler_meta != null) {
- if (struct.is_set_scheduler_meta()) {
- oprot.writeFieldBegin(SCHEDULER_META_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.scheduler_meta.size()));
- for (Map.Entry<String, String> _iter590 : struct.scheduler_meta.entrySet())
- {
- oprot.writeString(_iter590.getKey());
- oprot.writeString(_iter590.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_uptime_secs()) {
- oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC);
- oprot.writeI64(struct.uptime_secs);
- oprot.writeFieldEnd();
- }
- if (struct.version != null) {
- if (struct.is_set_version()) {
- oprot.writeFieldBegin(VERSION_FIELD_DESC);
- oprot.writeString(struct.version);
- oprot.writeFieldEnd();
- }
- }
- if (struct.resources_map != null) {
- if (struct.is_set_resources_map()) {
- oprot.writeFieldBegin(RESOURCES_MAP_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, struct.resources_map.size()));
- for (Map.Entry<String, Double> _iter591 : struct.resources_map.entrySet())
- {
- oprot.writeString(_iter591.getKey());
- oprot.writeDouble(_iter591.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class SupervisorInfoTupleSchemeFactory implements SchemeFactory {
- public SupervisorInfoTupleScheme getScheme() {
- return new SupervisorInfoTupleScheme();
- }
- }
-
- private static class SupervisorInfoTupleScheme extends TupleScheme<SupervisorInfo> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, SupervisorInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeI64(struct.time_secs);
- oprot.writeString(struct.hostname);
- BitSet optionals = new BitSet();
- if (struct.is_set_assignment_id()) {
- optionals.set(0);
- }
- if (struct.is_set_used_ports()) {
- optionals.set(1);
- }
- if (struct.is_set_meta()) {
- optionals.set(2);
- }
- if (struct.is_set_scheduler_meta()) {
- optionals.set(3);
- }
- if (struct.is_set_uptime_secs()) {
- optionals.set(4);
- }
- if (struct.is_set_version()) {
- optionals.set(5);
- }
- if (struct.is_set_resources_map()) {
- optionals.set(6);
- }
- oprot.writeBitSet(optionals, 7);
- if (struct.is_set_assignment_id()) {
- oprot.writeString(struct.assignment_id);
- }
- if (struct.is_set_used_ports()) {
- {
- oprot.writeI32(struct.used_ports.size());
- for (long _iter592 : struct.used_ports)
- {
- oprot.writeI64(_iter592);
- }
- }
- }
- if (struct.is_set_meta()) {
- {
- oprot.writeI32(struct.meta.size());
- for (long _iter593 : struct.meta)
- {
- oprot.writeI64(_iter593);
- }
- }
- }
- if (struct.is_set_scheduler_meta()) {
- {
- oprot.writeI32(struct.scheduler_meta.size());
- for (Map.Entry<String, String> _iter594 : struct.scheduler_meta.entrySet())
- {
- oprot.writeString(_iter594.getKey());
- oprot.writeString(_iter594.getValue());
- }
- }
- }
- if (struct.is_set_uptime_secs()) {
- oprot.writeI64(struct.uptime_secs);
- }
- if (struct.is_set_version()) {
- oprot.writeString(struct.version);
- }
- if (struct.is_set_resources_map()) {
- {
- oprot.writeI32(struct.resources_map.size());
- for (Map.Entry<String, Double> _iter595 : struct.resources_map.entrySet())
- {
- oprot.writeString(_iter595.getKey());
- oprot.writeDouble(_iter595.getValue());
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, SupervisorInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.time_secs = iprot.readI64();
- struct.set_time_secs_isSet(true);
- struct.hostname = iprot.readString();
- struct.set_hostname_isSet(true);
- BitSet incoming = iprot.readBitSet(7);
- if (incoming.get(0)) {
- struct.assignment_id = iprot.readString();
- struct.set_assignment_id_isSet(true);
- }
- if (incoming.get(1)) {
- {
- org.apache.thrift.protocol.TList _list596 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32());
- struct.used_ports = new ArrayList<Long>(_list596.size);
- long _elem597;
- for (int _i598 = 0; _i598 < _list596.size; ++_i598)
- {
- _elem597 = iprot.readI64();
- struct.used_ports.add(_elem597);
- }
- }
- struct.set_used_ports_isSet(true);
- }
- if (incoming.get(2)) {
- {
- org.apache.thrift.protocol.TList _list599 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32());
- struct.meta = new ArrayList<Long>(_list599.size);
- long _elem600;
- for (int _i601 = 0; _i601 < _list599.size; ++_i601)
- {
- _elem600 = iprot.readI64();
- struct.meta.add(_elem600);
- }
- }
- struct.set_meta_isSet(true);
- }
- if (incoming.get(3)) {
- {
- org.apache.thrift.protocol.TMap _map602 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.scheduler_meta = new HashMap<String,String>(2*_map602.size);
- String _key603;
- String _val604;
- for (int _i605 = 0; _i605 < _map602.size; ++_i605)
- {
- _key603 = iprot.readString();
- _val604 = iprot.readString();
- struct.scheduler_meta.put(_key603, _val604);
- }
- }
- struct.set_scheduler_meta_isSet(true);
- }
- if (incoming.get(4)) {
- struct.uptime_secs = iprot.readI64();
- struct.set_uptime_secs_isSet(true);
- }
- if (incoming.get(5)) {
- struct.version = iprot.readString();
- struct.set_version_isSet(true);
- }
- if (incoming.get(6)) {
- {
- org.apache.thrift.protocol.TMap _map606 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32());
- struct.resources_map = new HashMap<String,Double>(2*_map606.size);
- String _key607;
- double _val608;
- for (int _i609 = 0; _i609 < _map606.size; ++_i609)
- {
- _key607 = iprot.readString();
- _val608 = iprot.readDouble();
- struct.resources_map.put(_key607, _val608);
- }
- }
- struct.set_resources_map_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SupervisorPageInfo.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/SupervisorPageInfo.java b/storm-core/src/jvm/backtype/storm/generated/SupervisorPageInfo.java
deleted file mode 100644
index c6bafd9..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/SupervisorPageInfo.java
+++ /dev/null
@@ -1,624 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class SupervisorPageInfo implements org.apache.thrift.TBase<SupervisorPageInfo, SupervisorPageInfo._Fields>, java.io.Serializable, Cloneable, Comparable<SupervisorPageInfo> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SupervisorPageInfo");
-
- private static final org.apache.thrift.protocol.TField SUPERVISOR_SUMMARIES_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisor_summaries", org.apache.thrift.protocol.TType.LIST, (short)1);
- private static final org.apache.thrift.protocol.TField WORKER_SUMMARIES_FIELD_DESC = new org.apache.thrift.protocol.TField("worker_summaries", org.apache.thrift.protocol.TType.LIST, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new SupervisorPageInfoStandardSchemeFactory());
- schemes.put(TupleScheme.class, new SupervisorPageInfoTupleSchemeFactory());
- }
-
- private List<SupervisorSummary> supervisor_summaries; // optional
- private List<WorkerSummary> worker_summaries; // 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 {
- SUPERVISOR_SUMMARIES((short)1, "supervisor_summaries"),
- WORKER_SUMMARIES((short)2, "worker_summaries");
-
- 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: // SUPERVISOR_SUMMARIES
- return SUPERVISOR_SUMMARIES;
- case 2: // WORKER_SUMMARIES
- return WORKER_SUMMARIES;
- 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.SUPERVISOR_SUMMARIES,_Fields.WORKER_SUMMARIES};
- 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.SUPERVISOR_SUMMARIES, new org.apache.thrift.meta_data.FieldMetaData("supervisor_summaries", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SupervisorSummary.class))));
- tmpMap.put(_Fields.WORKER_SUMMARIES, new org.apache.thrift.meta_data.FieldMetaData("worker_summaries", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkerSummary.class))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SupervisorPageInfo.class, metaDataMap);
- }
-
- public SupervisorPageInfo() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public SupervisorPageInfo(SupervisorPageInfo other) {
- if (other.is_set_supervisor_summaries()) {
- List<SupervisorSummary> __this__supervisor_summaries = new ArrayList<SupervisorSummary>(other.supervisor_summaries.size());
- for (SupervisorSummary other_element : other.supervisor_summaries) {
- __this__supervisor_summaries.add(new SupervisorSummary(other_element));
- }
- this.supervisor_summaries = __this__supervisor_summaries;
- }
- if (other.is_set_worker_summaries()) {
- List<WorkerSummary> __this__worker_summaries = new ArrayList<WorkerSummary>(other.worker_summaries.size());
- for (WorkerSummary other_element : other.worker_summaries) {
- __this__worker_summaries.add(new WorkerSummary(other_element));
- }
- this.worker_summaries = __this__worker_summaries;
- }
- }
-
- public SupervisorPageInfo deepCopy() {
- return new SupervisorPageInfo(this);
- }
-
- @Override
- public void clear() {
- this.supervisor_summaries = null;
- this.worker_summaries = null;
- }
-
- public int get_supervisor_summaries_size() {
- return (this.supervisor_summaries == null) ? 0 : this.supervisor_summaries.size();
- }
-
- public java.util.Iterator<SupervisorSummary> get_supervisor_summaries_iterator() {
- return (this.supervisor_summaries == null) ? null : this.supervisor_summaries.iterator();
- }
-
- public void add_to_supervisor_summaries(SupervisorSummary elem) {
- if (this.supervisor_summaries == null) {
- this.supervisor_summaries = new ArrayList<SupervisorSummary>();
- }
- this.supervisor_summaries.add(elem);
- }
-
- public List<SupervisorSummary> get_supervisor_summaries() {
- return this.supervisor_summaries;
- }
-
- public void set_supervisor_summaries(List<SupervisorSummary> supervisor_summaries) {
- this.supervisor_summaries = supervisor_summaries;
- }
-
- public void unset_supervisor_summaries() {
- this.supervisor_summaries = null;
- }
-
- /** Returns true if field supervisor_summaries is set (has been assigned a value) and false otherwise */
- public boolean is_set_supervisor_summaries() {
- return this.supervisor_summaries != null;
- }
-
- public void set_supervisor_summaries_isSet(boolean value) {
- if (!value) {
- this.supervisor_summaries = null;
- }
- }
-
- public int get_worker_summaries_size() {
- return (this.worker_summaries == null) ? 0 : this.worker_summaries.size();
- }
-
- public java.util.Iterator<WorkerSummary> get_worker_summaries_iterator() {
- return (this.worker_summaries == null) ? null : this.worker_summaries.iterator();
- }
-
- public void add_to_worker_summaries(WorkerSummary elem) {
- if (this.worker_summaries == null) {
- this.worker_summaries = new ArrayList<WorkerSummary>();
- }
- this.worker_summaries.add(elem);
- }
-
- public List<WorkerSummary> get_worker_summaries() {
- return this.worker_summaries;
- }
-
- public void set_worker_summaries(List<WorkerSummary> worker_summaries) {
- this.worker_summaries = worker_summaries;
- }
-
- public void unset_worker_summaries() {
- this.worker_summaries = null;
- }
-
- /** Returns true if field worker_summaries is set (has been assigned a value) and false otherwise */
- public boolean is_set_worker_summaries() {
- return this.worker_summaries != null;
- }
-
- public void set_worker_summaries_isSet(boolean value) {
- if (!value) {
- this.worker_summaries = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SUPERVISOR_SUMMARIES:
- if (value == null) {
- unset_supervisor_summaries();
- } else {
- set_supervisor_summaries((List<SupervisorSummary>)value);
- }
- break;
-
- case WORKER_SUMMARIES:
- if (value == null) {
- unset_worker_summaries();
- } else {
- set_worker_summaries((List<WorkerSummary>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SUPERVISOR_SUMMARIES:
- return get_supervisor_summaries();
-
- case WORKER_SUMMARIES:
- return get_worker_summaries();
-
- }
- 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 SUPERVISOR_SUMMARIES:
- return is_set_supervisor_summaries();
- case WORKER_SUMMARIES:
- return is_set_worker_summaries();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof SupervisorPageInfo)
- return this.equals((SupervisorPageInfo)that);
- return false;
- }
-
- public boolean equals(SupervisorPageInfo that) {
- if (that == null)
- return false;
-
- boolean this_present_supervisor_summaries = true && this.is_set_supervisor_summaries();
- boolean that_present_supervisor_summaries = true && that.is_set_supervisor_summaries();
- if (this_present_supervisor_summaries || that_present_supervisor_summaries) {
- if (!(this_present_supervisor_summaries && that_present_supervisor_summaries))
- return false;
- if (!this.supervisor_summaries.equals(that.supervisor_summaries))
- return false;
- }
-
- boolean this_present_worker_summaries = true && this.is_set_worker_summaries();
- boolean that_present_worker_summaries = true && that.is_set_worker_summaries();
- if (this_present_worker_summaries || that_present_worker_summaries) {
- if (!(this_present_worker_summaries && that_present_worker_summaries))
- return false;
- if (!this.worker_summaries.equals(that.worker_summaries))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_supervisor_summaries = true && (is_set_supervisor_summaries());
- list.add(present_supervisor_summaries);
- if (present_supervisor_summaries)
- list.add(supervisor_summaries);
-
- boolean present_worker_summaries = true && (is_set_worker_summaries());
- list.add(present_worker_summaries);
- if (present_worker_summaries)
- list.add(worker_summaries);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(SupervisorPageInfo other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_supervisor_summaries()).compareTo(other.is_set_supervisor_summaries());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_supervisor_summaries()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supervisor_summaries, other.supervisor_summaries);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_worker_summaries()).compareTo(other.is_set_worker_summaries());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_worker_summaries()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.worker_summaries, other.worker_summaries);
- 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("SupervisorPageInfo(");
- boolean first = true;
-
- if (is_set_supervisor_summaries()) {
- sb.append("supervisor_summaries:");
- if (this.supervisor_summaries == null) {
- sb.append("null");
- } else {
- sb.append(this.supervisor_summaries);
- }
- first = false;
- }
- if (is_set_worker_summaries()) {
- if (!first) sb.append(", ");
- sb.append("worker_summaries:");
- if (this.worker_summaries == null) {
- sb.append("null");
- } else {
- sb.append(this.worker_summaries);
- }
- 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 {
- 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 SupervisorPageInfoStandardSchemeFactory implements SchemeFactory {
- public SupervisorPageInfoStandardScheme getScheme() {
- return new SupervisorPageInfoStandardScheme();
- }
- }
-
- private static class SupervisorPageInfoStandardScheme extends StandardScheme<SupervisorPageInfo> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, SupervisorPageInfo 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: // SUPERVISOR_SUMMARIES
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list438 = iprot.readListBegin();
- struct.supervisor_summaries = new ArrayList<SupervisorSummary>(_list438.size);
- SupervisorSummary _elem439;
- for (int _i440 = 0; _i440 < _list438.size; ++_i440)
- {
- _elem439 = new SupervisorSummary();
- _elem439.read(iprot);
- struct.supervisor_summaries.add(_elem439);
- }
- iprot.readListEnd();
- }
- struct.set_supervisor_summaries_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // WORKER_SUMMARIES
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list441 = iprot.readListBegin();
- struct.worker_summaries = new ArrayList<WorkerSummary>(_list441.size);
- WorkerSummary _elem442;
- for (int _i443 = 0; _i443 < _list441.size; ++_i443)
- {
- _elem442 = new WorkerSummary();
- _elem442.read(iprot);
- struct.worker_summaries.add(_elem442);
- }
- iprot.readListEnd();
- }
- struct.set_worker_summaries_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, SupervisorPageInfo struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.supervisor_summaries != null) {
- if (struct.is_set_supervisor_summaries()) {
- oprot.writeFieldBegin(SUPERVISOR_SUMMARIES_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.supervisor_summaries.size()));
- for (SupervisorSummary _iter444 : struct.supervisor_summaries)
- {
- _iter444.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.worker_summaries != null) {
- if (struct.is_set_worker_summaries()) {
- oprot.writeFieldBegin(WORKER_SUMMARIES_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.worker_summaries.size()));
- for (WorkerSummary _iter445 : struct.worker_summaries)
- {
- _iter445.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class SupervisorPageInfoTupleSchemeFactory implements SchemeFactory {
- public SupervisorPageInfoTupleScheme getScheme() {
- return new SupervisorPageInfoTupleScheme();
- }
- }
-
- private static class SupervisorPageInfoTupleScheme extends TupleScheme<SupervisorPageInfo> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, SupervisorPageInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_supervisor_summaries()) {
- optionals.set(0);
- }
- if (struct.is_set_worker_summaries()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.is_set_supervisor_summaries()) {
- {
- oprot.writeI32(struct.supervisor_summaries.size());
- for (SupervisorSummary _iter446 : struct.supervisor_summaries)
- {
- _iter446.write(oprot);
- }
- }
- }
- if (struct.is_set_worker_summaries()) {
- {
- oprot.writeI32(struct.worker_summaries.size());
- for (WorkerSummary _iter447 : struct.worker_summaries)
- {
- _iter447.write(oprot);
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, SupervisorPageInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- {
- org.apache.thrift.protocol.TList _list448 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.supervisor_summaries = new ArrayList<SupervisorSummary>(_list448.size);
- SupervisorSummary _elem449;
- for (int _i450 = 0; _i450 < _list448.size; ++_i450)
- {
- _elem449 = new SupervisorSummary();
- _elem449.read(iprot);
- struct.supervisor_summaries.add(_elem449);
- }
- }
- struct.set_supervisor_summaries_isSet(true);
- }
- if (incoming.get(1)) {
- {
- org.apache.thrift.protocol.TList _list451 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.worker_summaries = new ArrayList<WorkerSummary>(_list451.size);
- WorkerSummary _elem452;
- for (int _i453 = 0; _i453 < _list451.size; ++_i453)
- {
- _elem452 = new WorkerSummary();
- _elem452.read(iprot);
- struct.worker_summaries.add(_elem452);
- }
- }
- struct.set_worker_summaries_isSet(true);
- }
- }
- }
-
-}
-
[15/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/NimbusSummary.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/NimbusSummary.java b/storm-core/src/jvm/backtype/storm/generated/NimbusSummary.java
deleted file mode 100644
index c0c5247..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/NimbusSummary.java
+++ /dev/null
@@ -1,796 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class NimbusSummary implements org.apache.thrift.TBase<NimbusSummary, NimbusSummary._Fields>, java.io.Serializable, Cloneable, Comparable<NimbusSummary> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NimbusSummary");
-
- private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)3);
- private static final org.apache.thrift.protocol.TField IS_LEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("isLeader", org.apache.thrift.protocol.TType.BOOL, (short)4);
- private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)5);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new NimbusSummaryStandardSchemeFactory());
- schemes.put(TupleScheme.class, new NimbusSummaryTupleSchemeFactory());
- }
-
- private String host; // required
- private int port; // required
- private int uptime_secs; // required
- private boolean isLeader; // required
- private String version; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- HOST((short)1, "host"),
- PORT((short)2, "port"),
- UPTIME_SECS((short)3, "uptime_secs"),
- IS_LEADER((short)4, "isLeader"),
- VERSION((short)5, "version");
-
- private static final Map<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: // HOST
- return HOST;
- case 2: // PORT
- return PORT;
- case 3: // UPTIME_SECS
- return UPTIME_SECS;
- case 4: // IS_LEADER
- return IS_LEADER;
- case 5: // VERSION
- return VERSION;
- 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 __PORT_ISSET_ID = 0;
- private static final int __UPTIME_SECS_ISSET_ID = 1;
- private static final int __ISLEADER_ISSET_ID = 2;
- private byte __isset_bitfield = 0;
- 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.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.IS_LEADER, new org.apache.thrift.meta_data.FieldMetaData("isLeader", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
- tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", 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(NimbusSummary.class, metaDataMap);
- }
-
- public NimbusSummary() {
- }
-
- public NimbusSummary(
- String host,
- int port,
- int uptime_secs,
- boolean isLeader,
- String version)
- {
- this();
- this.host = host;
- this.port = port;
- set_port_isSet(true);
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- this.isLeader = isLeader;
- set_isLeader_isSet(true);
- this.version = version;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public NimbusSummary(NimbusSummary other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_host()) {
- this.host = other.host;
- }
- this.port = other.port;
- this.uptime_secs = other.uptime_secs;
- this.isLeader = other.isLeader;
- if (other.is_set_version()) {
- this.version = other.version;
- }
- }
-
- public NimbusSummary deepCopy() {
- return new NimbusSummary(this);
- }
-
- @Override
- public void clear() {
- this.host = null;
- set_port_isSet(false);
- this.port = 0;
- set_uptime_secs_isSet(false);
- this.uptime_secs = 0;
- set_isLeader_isSet(false);
- this.isLeader = false;
- this.version = null;
- }
-
- public String get_host() {
- return this.host;
- }
-
- public void set_host(String host) {
- this.host = host;
- }
-
- public void unset_host() {
- this.host = null;
- }
-
- /** Returns true if field host is set (has been assigned a value) and false otherwise */
- public boolean is_set_host() {
- return this.host != null;
- }
-
- public void set_host_isSet(boolean value) {
- if (!value) {
- this.host = null;
- }
- }
-
- public int get_port() {
- return this.port;
- }
-
- public void set_port(int port) {
- this.port = port;
- set_port_isSet(true);
- }
-
- public void unset_port() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID);
- }
-
- /** Returns true if field port is set (has been assigned a value) and false otherwise */
- public boolean is_set_port() {
- return EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID);
- }
-
- public void set_port_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value);
- }
-
- public int get_uptime_secs() {
- return this.uptime_secs;
- }
-
- public void set_uptime_secs(int uptime_secs) {
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- }
-
- public void unset_uptime_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_uptime_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- public void set_uptime_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID, value);
- }
-
- public boolean is_isLeader() {
- return this.isLeader;
- }
-
- public void set_isLeader(boolean isLeader) {
- this.isLeader = isLeader;
- set_isLeader_isSet(true);
- }
-
- public void unset_isLeader() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISLEADER_ISSET_ID);
- }
-
- /** Returns true if field isLeader is set (has been assigned a value) and false otherwise */
- public boolean is_set_isLeader() {
- return EncodingUtils.testBit(__isset_bitfield, __ISLEADER_ISSET_ID);
- }
-
- public void set_isLeader_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISLEADER_ISSET_ID, value);
- }
-
- public String get_version() {
- return this.version;
- }
-
- public void set_version(String version) {
- this.version = version;
- }
-
- public void unset_version() {
- this.version = null;
- }
-
- /** Returns true if field version is set (has been assigned a value) and false otherwise */
- public boolean is_set_version() {
- return this.version != null;
- }
-
- public void set_version_isSet(boolean value) {
- if (!value) {
- this.version = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case HOST:
- if (value == null) {
- unset_host();
- } else {
- set_host((String)value);
- }
- break;
-
- case PORT:
- if (value == null) {
- unset_port();
- } else {
- set_port((Integer)value);
- }
- break;
-
- case UPTIME_SECS:
- if (value == null) {
- unset_uptime_secs();
- } else {
- set_uptime_secs((Integer)value);
- }
- break;
-
- case IS_LEADER:
- if (value == null) {
- unset_isLeader();
- } else {
- set_isLeader((Boolean)value);
- }
- break;
-
- case VERSION:
- if (value == null) {
- unset_version();
- } else {
- set_version((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case HOST:
- return get_host();
-
- case PORT:
- return get_port();
-
- case UPTIME_SECS:
- return get_uptime_secs();
-
- case IS_LEADER:
- return is_isLeader();
-
- case VERSION:
- return get_version();
-
- }
- 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 HOST:
- return is_set_host();
- case PORT:
- return is_set_port();
- case UPTIME_SECS:
- return is_set_uptime_secs();
- case IS_LEADER:
- return is_set_isLeader();
- case VERSION:
- return is_set_version();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof NimbusSummary)
- return this.equals((NimbusSummary)that);
- return false;
- }
-
- public boolean equals(NimbusSummary that) {
- if (that == null)
- return false;
-
- boolean this_present_host = true && this.is_set_host();
- boolean that_present_host = true && that.is_set_host();
- if (this_present_host || that_present_host) {
- if (!(this_present_host && that_present_host))
- return false;
- if (!this.host.equals(that.host))
- return false;
- }
-
- boolean this_present_port = true;
- boolean that_present_port = true;
- if (this_present_port || that_present_port) {
- if (!(this_present_port && that_present_port))
- return false;
- if (this.port != that.port)
- return false;
- }
-
- boolean this_present_uptime_secs = true;
- boolean that_present_uptime_secs = true;
- if (this_present_uptime_secs || that_present_uptime_secs) {
- if (!(this_present_uptime_secs && that_present_uptime_secs))
- return false;
- if (this.uptime_secs != that.uptime_secs)
- return false;
- }
-
- boolean this_present_isLeader = true;
- boolean that_present_isLeader = true;
- if (this_present_isLeader || that_present_isLeader) {
- if (!(this_present_isLeader && that_present_isLeader))
- return false;
- if (this.isLeader != that.isLeader)
- return false;
- }
-
- boolean this_present_version = true && this.is_set_version();
- boolean that_present_version = true && that.is_set_version();
- if (this_present_version || that_present_version) {
- if (!(this_present_version && that_present_version))
- return false;
- if (!this.version.equals(that.version))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_host = true && (is_set_host());
- list.add(present_host);
- if (present_host)
- list.add(host);
-
- boolean present_port = true;
- list.add(present_port);
- if (present_port)
- list.add(port);
-
- boolean present_uptime_secs = true;
- list.add(present_uptime_secs);
- if (present_uptime_secs)
- list.add(uptime_secs);
-
- boolean present_isLeader = true;
- list.add(present_isLeader);
- if (present_isLeader)
- list.add(isLeader);
-
- boolean present_version = true && (is_set_version());
- list.add(present_version);
- if (present_version)
- list.add(version);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(NimbusSummary other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_host()).compareTo(other.is_set_host());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_host()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, other.host);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_port()).compareTo(other.is_set_port());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_port()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(other.is_set_uptime_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_uptime_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, other.uptime_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_isLeader()).compareTo(other.is_set_isLeader());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_isLeader()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isLeader, other.isLeader);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_version()).compareTo(other.is_set_version());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_version()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
- 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("NimbusSummary(");
- boolean first = true;
-
- sb.append("host:");
- if (this.host == null) {
- sb.append("null");
- } else {
- sb.append(this.host);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("port:");
- sb.append(this.port);
- first = false;
- if (!first) sb.append(", ");
- sb.append("uptime_secs:");
- sb.append(this.uptime_secs);
- first = false;
- if (!first) sb.append(", ");
- sb.append("isLeader:");
- sb.append(this.isLeader);
- first = false;
- if (!first) sb.append(", ");
- sb.append("version:");
- if (this.version == null) {
- sb.append("null");
- } else {
- sb.append(this.version);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_host()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'host' is unset! Struct:" + toString());
- }
-
- if (!is_set_port()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'port' is unset! Struct:" + toString());
- }
-
- if (!is_set_uptime_secs()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString());
- }
-
- if (!is_set_isLeader()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'isLeader' is unset! Struct:" + toString());
- }
-
- if (!is_set_version()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'version' 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 NimbusSummaryStandardSchemeFactory implements SchemeFactory {
- public NimbusSummaryStandardScheme getScheme() {
- return new NimbusSummaryStandardScheme();
- }
- }
-
- private static class NimbusSummaryStandardScheme extends StandardScheme<NimbusSummary> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, NimbusSummary 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: // HOST
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.host = iprot.readString();
- struct.set_host_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // PORT
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.port = iprot.readI32();
- struct.set_port_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // UPTIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // IS_LEADER
- if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
- struct.isLeader = iprot.readBool();
- struct.set_isLeader_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // VERSION
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.version = iprot.readString();
- struct.set_version_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, NimbusSummary struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.host != null) {
- oprot.writeFieldBegin(HOST_FIELD_DESC);
- oprot.writeString(struct.host);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(PORT_FIELD_DESC);
- oprot.writeI32(struct.port);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.uptime_secs);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(IS_LEADER_FIELD_DESC);
- oprot.writeBool(struct.isLeader);
- oprot.writeFieldEnd();
- if (struct.version != null) {
- oprot.writeFieldBegin(VERSION_FIELD_DESC);
- oprot.writeString(struct.version);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class NimbusSummaryTupleSchemeFactory implements SchemeFactory {
- public NimbusSummaryTupleScheme getScheme() {
- return new NimbusSummaryTupleScheme();
- }
- }
-
- private static class NimbusSummaryTupleScheme extends TupleScheme<NimbusSummary> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, NimbusSummary struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.host);
- oprot.writeI32(struct.port);
- oprot.writeI32(struct.uptime_secs);
- oprot.writeBool(struct.isLeader);
- oprot.writeString(struct.version);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, NimbusSummary struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.host = iprot.readString();
- struct.set_host_isSet(true);
- struct.port = iprot.readI32();
- struct.set_port_isSet(true);
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- struct.isLeader = iprot.readBool();
- struct.set_isLeader_isSet(true);
- struct.version = iprot.readString();
- struct.set_version_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/NodeInfo.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/NodeInfo.java b/storm-core/src/jvm/backtype/storm/generated/NodeInfo.java
deleted file mode 100644
index 5776717..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/NodeInfo.java
+++ /dev/null
@@ -1,556 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class NodeInfo implements org.apache.thrift.TBase<NodeInfo, NodeInfo._Fields>, java.io.Serializable, Cloneable, Comparable<NodeInfo> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NodeInfo");
-
- private static final org.apache.thrift.protocol.TField NODE_FIELD_DESC = new org.apache.thrift.protocol.TField("node", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.SET, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new NodeInfoStandardSchemeFactory());
- schemes.put(TupleScheme.class, new NodeInfoTupleSchemeFactory());
- }
-
- private String node; // required
- private Set<Long> port; // 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 {
- NODE((short)1, "node"),
- PORT((short)2, "port");
-
- 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: // NODE
- return NODE;
- case 2: // PORT
- return PORT;
- 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.NODE, new org.apache.thrift.meta_data.FieldMetaData("node", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NodeInfo.class, metaDataMap);
- }
-
- public NodeInfo() {
- }
-
- public NodeInfo(
- String node,
- Set<Long> port)
- {
- this();
- this.node = node;
- this.port = port;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public NodeInfo(NodeInfo other) {
- if (other.is_set_node()) {
- this.node = other.node;
- }
- if (other.is_set_port()) {
- Set<Long> __this__port = new HashSet<Long>(other.port);
- this.port = __this__port;
- }
- }
-
- public NodeInfo deepCopy() {
- return new NodeInfo(this);
- }
-
- @Override
- public void clear() {
- this.node = null;
- this.port = null;
- }
-
- public String get_node() {
- return this.node;
- }
-
- public void set_node(String node) {
- this.node = node;
- }
-
- public void unset_node() {
- this.node = null;
- }
-
- /** Returns true if field node is set (has been assigned a value) and false otherwise */
- public boolean is_set_node() {
- return this.node != null;
- }
-
- public void set_node_isSet(boolean value) {
- if (!value) {
- this.node = null;
- }
- }
-
- public int get_port_size() {
- return (this.port == null) ? 0 : this.port.size();
- }
-
- public java.util.Iterator<Long> get_port_iterator() {
- return (this.port == null) ? null : this.port.iterator();
- }
-
- public void add_to_port(long elem) {
- if (this.port == null) {
- this.port = new HashSet<Long>();
- }
- this.port.add(elem);
- }
-
- public Set<Long> get_port() {
- return this.port;
- }
-
- public void set_port(Set<Long> port) {
- this.port = port;
- }
-
- public void unset_port() {
- this.port = null;
- }
-
- /** Returns true if field port is set (has been assigned a value) and false otherwise */
- public boolean is_set_port() {
- return this.port != null;
- }
-
- public void set_port_isSet(boolean value) {
- if (!value) {
- this.port = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case NODE:
- if (value == null) {
- unset_node();
- } else {
- set_node((String)value);
- }
- break;
-
- case PORT:
- if (value == null) {
- unset_port();
- } else {
- set_port((Set<Long>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case NODE:
- return get_node();
-
- case PORT:
- return get_port();
-
- }
- 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 NODE:
- return is_set_node();
- case PORT:
- return is_set_port();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof NodeInfo)
- return this.equals((NodeInfo)that);
- return false;
- }
-
- public boolean equals(NodeInfo that) {
- if (that == null)
- return false;
-
- boolean this_present_node = true && this.is_set_node();
- boolean that_present_node = true && that.is_set_node();
- if (this_present_node || that_present_node) {
- if (!(this_present_node && that_present_node))
- return false;
- if (!this.node.equals(that.node))
- return false;
- }
-
- boolean this_present_port = true && this.is_set_port();
- boolean that_present_port = true && that.is_set_port();
- if (this_present_port || that_present_port) {
- if (!(this_present_port && that_present_port))
- return false;
- if (!this.port.equals(that.port))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_node = true && (is_set_node());
- list.add(present_node);
- if (present_node)
- list.add(node);
-
- boolean present_port = true && (is_set_port());
- list.add(present_port);
- if (present_port)
- list.add(port);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(NodeInfo other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_node()).compareTo(other.is_set_node());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_node()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.node, other.node);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_port()).compareTo(other.is_set_port());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_port()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port);
- 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("NodeInfo(");
- boolean first = true;
-
- sb.append("node:");
- if (this.node == null) {
- sb.append("null");
- } else {
- sb.append(this.node);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("port:");
- if (this.port == null) {
- sb.append("null");
- } else {
- sb.append(this.port);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_node()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'node' is unset! Struct:" + toString());
- }
-
- if (!is_set_port()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'port' 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 NodeInfoStandardSchemeFactory implements SchemeFactory {
- public NodeInfoStandardScheme getScheme() {
- return new NodeInfoStandardScheme();
- }
- }
-
- private static class NodeInfoStandardScheme extends StandardScheme<NodeInfo> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, NodeInfo 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: // NODE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.node = iprot.readString();
- struct.set_node_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // PORT
- if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
- {
- org.apache.thrift.protocol.TSet _set610 = iprot.readSetBegin();
- struct.port = new HashSet<Long>(2*_set610.size);
- long _elem611;
- for (int _i612 = 0; _i612 < _set610.size; ++_i612)
- {
- _elem611 = iprot.readI64();
- struct.port.add(_elem611);
- }
- iprot.readSetEnd();
- }
- struct.set_port_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, NodeInfo struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.node != null) {
- oprot.writeFieldBegin(NODE_FIELD_DESC);
- oprot.writeString(struct.node);
- oprot.writeFieldEnd();
- }
- if (struct.port != null) {
- oprot.writeFieldBegin(PORT_FIELD_DESC);
- {
- oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, struct.port.size()));
- for (long _iter613 : struct.port)
- {
- oprot.writeI64(_iter613);
- }
- oprot.writeSetEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class NodeInfoTupleSchemeFactory implements SchemeFactory {
- public NodeInfoTupleScheme getScheme() {
- return new NodeInfoTupleScheme();
- }
- }
-
- private static class NodeInfoTupleScheme extends TupleScheme<NodeInfo> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, NodeInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.node);
- {
- oprot.writeI32(struct.port.size());
- for (long _iter614 : struct.port)
- {
- oprot.writeI64(_iter614);
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, NodeInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.node = iprot.readString();
- struct.set_node_isSet(true);
- {
- org.apache.thrift.protocol.TSet _set615 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, iprot.readI32());
- struct.port = new HashSet<Long>(2*_set615.size);
- long _elem616;
- for (int _i617 = 0; _i617 < _set615.size; ++_i617)
- {
- _elem616 = iprot.readI64();
- struct.port.add(_elem616);
- }
- }
- struct.set_port_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/NotAliveException.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/NotAliveException.java b/storm-core/src/jvm/backtype/storm/generated/NotAliveException.java
deleted file mode 100644
index 8d9374a..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/NotAliveException.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class NotAliveException extends TException implements org.apache.thrift.TBase<NotAliveException, NotAliveException._Fields>, java.io.Serializable, Cloneable, Comparable<NotAliveException> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NotAliveException");
-
- 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 NotAliveExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new NotAliveExceptionTupleSchemeFactory());
- }
-
- 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(NotAliveException.class, metaDataMap);
- }
-
- public NotAliveException() {
- }
-
- public NotAliveException(
- String msg)
- {
- this();
- this.msg = msg;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public NotAliveException(NotAliveException other) {
- if (other.is_set_msg()) {
- this.msg = other.msg;
- }
- }
-
- public NotAliveException deepCopy() {
- return new NotAliveException(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 NotAliveException)
- return this.equals((NotAliveException)that);
- return false;
- }
-
- public boolean equals(NotAliveException 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(NotAliveException 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("NotAliveException(");
- 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 NotAliveExceptionStandardSchemeFactory implements SchemeFactory {
- public NotAliveExceptionStandardScheme getScheme() {
- return new NotAliveExceptionStandardScheme();
- }
- }
-
- private static class NotAliveExceptionStandardScheme extends StandardScheme<NotAliveException> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, NotAliveException 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, NotAliveException 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 NotAliveExceptionTupleSchemeFactory implements SchemeFactory {
- public NotAliveExceptionTupleScheme getScheme() {
- return new NotAliveExceptionTupleScheme();
- }
- }
-
- private static class NotAliveExceptionTupleScheme extends TupleScheme<NotAliveException> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, NotAliveException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.msg);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, NotAliveException 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/a6171bd6/storm-core/src/jvm/backtype/storm/generated/NullStruct.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/NullStruct.java b/storm-core/src/jvm/backtype/storm/generated/NullStruct.java
deleted file mode 100644
index a37ecbd..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/NullStruct.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class NullStruct implements org.apache.thrift.TBase<NullStruct, NullStruct._Fields>, java.io.Serializable, Cloneable, Comparable<NullStruct> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NullStruct");
-
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new NullStructStandardSchemeFactory());
- schemes.put(TupleScheme.class, new NullStructTupleSchemeFactory());
- }
-
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-;
-
- 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) {
- 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;
- }
- }
- 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);
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NullStruct.class, metaDataMap);
- }
-
- public NullStruct() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public NullStruct(NullStruct other) {
- }
-
- public NullStruct deepCopy() {
- return new NullStruct(this);
- }
-
- @Override
- public void clear() {
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- }
- 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) {
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof NullStruct)
- return this.equals((NullStruct)that);
- return false;
- }
-
- public boolean equals(NullStruct that) {
- if (that == null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(NullStruct other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- 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("NullStruct(");
- boolean first = true;
-
- 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 {
- 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 NullStructStandardSchemeFactory implements SchemeFactory {
- public NullStructStandardScheme getScheme() {
- return new NullStructStandardScheme();
- }
- }
-
- private static class NullStructStandardScheme extends StandardScheme<NullStruct> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, NullStruct 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) {
- 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, NullStruct struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class NullStructTupleSchemeFactory implements SchemeFactory {
- public NullStructTupleScheme getScheme() {
- return new NullStructTupleScheme();
- }
- }
-
- private static class NullStructTupleScheme extends TupleScheme<NullStruct> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, NullStruct struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, NullStruct struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/NumErrorsChoice.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/NumErrorsChoice.java b/storm-core/src/jvm/backtype/storm/generated/NumErrorsChoice.java
deleted file mode 100644
index 73421ee..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/NumErrorsChoice.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum NumErrorsChoice implements org.apache.thrift.TEnum {
- ALL(0),
- NONE(1),
- ONE(2);
-
- private final int value;
-
- private NumErrorsChoice(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static NumErrorsChoice findByValue(int value) {
- switch (value) {
- case 0:
- return ALL;
- case 1:
- return NONE;
- case 2:
- return ONE;
- default:
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ProfileAction.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ProfileAction.java b/storm-core/src/jvm/backtype/storm/generated/ProfileAction.java
deleted file mode 100644
index f783c98..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ProfileAction.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum ProfileAction implements org.apache.thrift.TEnum {
- JPROFILE_STOP(0),
- JPROFILE_START(1),
- JPROFILE_DUMP(2),
- JMAP_DUMP(3),
- JSTACK_DUMP(4),
- JVM_RESTART(5);
-
- private final int value;
-
- private ProfileAction(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static ProfileAction findByValue(int value) {
- switch (value) {
- case 0:
- return JPROFILE_STOP;
- case 1:
- return JPROFILE_START;
- case 2:
- return JPROFILE_DUMP;
- case 3:
- return JMAP_DUMP;
- case 4:
- return JSTACK_DUMP;
- case 5:
- return JVM_RESTART;
- default:
- return null;
- }
- }
-}
[02/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/WorkerResources.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/WorkerResources.java b/storm-core/src/jvm/backtype/storm/generated/WorkerResources.java
deleted file mode 100644
index ca424b3..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/WorkerResources.java
+++ /dev/null
@@ -1,605 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class WorkerResources implements org.apache.thrift.TBase<WorkerResources, WorkerResources._Fields>, java.io.Serializable, Cloneable, Comparable<WorkerResources> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkerResources");
-
- private static final org.apache.thrift.protocol.TField MEM_ON_HEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("mem_on_heap", org.apache.thrift.protocol.TType.DOUBLE, (short)1);
- private static final org.apache.thrift.protocol.TField MEM_OFF_HEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("mem_off_heap", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
- private static final org.apache.thrift.protocol.TField CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("cpu", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new WorkerResourcesStandardSchemeFactory());
- schemes.put(TupleScheme.class, new WorkerResourcesTupleSchemeFactory());
- }
-
- private double mem_on_heap; // optional
- private double mem_off_heap; // optional
- private double cpu; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- MEM_ON_HEAP((short)1, "mem_on_heap"),
- MEM_OFF_HEAP((short)2, "mem_off_heap"),
- CPU((short)3, "cpu");
-
- private static final Map<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: // MEM_ON_HEAP
- return MEM_ON_HEAP;
- case 2: // MEM_OFF_HEAP
- return MEM_OFF_HEAP;
- case 3: // CPU
- return CPU;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return 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 __MEM_ON_HEAP_ISSET_ID = 0;
- private static final int __MEM_OFF_HEAP_ISSET_ID = 1;
- private static final int __CPU_ISSET_ID = 2;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.MEM_ON_HEAP,_Fields.MEM_OFF_HEAP,_Fields.CPU};
- 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.MEM_ON_HEAP, new org.apache.thrift.meta_data.FieldMetaData("mem_on_heap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.MEM_OFF_HEAP, new org.apache.thrift.meta_data.FieldMetaData("mem_off_heap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.CPU, new org.apache.thrift.meta_data.FieldMetaData("cpu", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WorkerResources.class, metaDataMap);
- }
-
- public WorkerResources() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public WorkerResources(WorkerResources other) {
- __isset_bitfield = other.__isset_bitfield;
- this.mem_on_heap = other.mem_on_heap;
- this.mem_off_heap = other.mem_off_heap;
- this.cpu = other.cpu;
- }
-
- public WorkerResources deepCopy() {
- return new WorkerResources(this);
- }
-
- @Override
- public void clear() {
- set_mem_on_heap_isSet(false);
- this.mem_on_heap = 0.0;
- set_mem_off_heap_isSet(false);
- this.mem_off_heap = 0.0;
- set_cpu_isSet(false);
- this.cpu = 0.0;
- }
-
- public double get_mem_on_heap() {
- return this.mem_on_heap;
- }
-
- public void set_mem_on_heap(double mem_on_heap) {
- this.mem_on_heap = mem_on_heap;
- set_mem_on_heap_isSet(true);
- }
-
- public void unset_mem_on_heap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MEM_ON_HEAP_ISSET_ID);
- }
-
- /** Returns true if field mem_on_heap is set (has been assigned a value) and false otherwise */
- public boolean is_set_mem_on_heap() {
- return EncodingUtils.testBit(__isset_bitfield, __MEM_ON_HEAP_ISSET_ID);
- }
-
- public void set_mem_on_heap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MEM_ON_HEAP_ISSET_ID, value);
- }
-
- public double get_mem_off_heap() {
- return this.mem_off_heap;
- }
-
- public void set_mem_off_heap(double mem_off_heap) {
- this.mem_off_heap = mem_off_heap;
- set_mem_off_heap_isSet(true);
- }
-
- public void unset_mem_off_heap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MEM_OFF_HEAP_ISSET_ID);
- }
-
- /** Returns true if field mem_off_heap is set (has been assigned a value) and false otherwise */
- public boolean is_set_mem_off_heap() {
- return EncodingUtils.testBit(__isset_bitfield, __MEM_OFF_HEAP_ISSET_ID);
- }
-
- public void set_mem_off_heap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MEM_OFF_HEAP_ISSET_ID, value);
- }
-
- public double get_cpu() {
- return this.cpu;
- }
-
- public void set_cpu(double cpu) {
- this.cpu = cpu;
- set_cpu_isSet(true);
- }
-
- public void unset_cpu() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CPU_ISSET_ID);
- }
-
- /** Returns true if field cpu is set (has been assigned a value) and false otherwise */
- public boolean is_set_cpu() {
- return EncodingUtils.testBit(__isset_bitfield, __CPU_ISSET_ID);
- }
-
- public void set_cpu_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CPU_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case MEM_ON_HEAP:
- if (value == null) {
- unset_mem_on_heap();
- } else {
- set_mem_on_heap((Double)value);
- }
- break;
-
- case MEM_OFF_HEAP:
- if (value == null) {
- unset_mem_off_heap();
- } else {
- set_mem_off_heap((Double)value);
- }
- break;
-
- case CPU:
- if (value == null) {
- unset_cpu();
- } else {
- set_cpu((Double)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case MEM_ON_HEAP:
- return get_mem_on_heap();
-
- case MEM_OFF_HEAP:
- return get_mem_off_heap();
-
- case CPU:
- return get_cpu();
-
- }
- 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 MEM_ON_HEAP:
- return is_set_mem_on_heap();
- case MEM_OFF_HEAP:
- return is_set_mem_off_heap();
- case CPU:
- return is_set_cpu();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof WorkerResources)
- return this.equals((WorkerResources)that);
- return false;
- }
-
- public boolean equals(WorkerResources that) {
- if (that == null)
- return false;
-
- boolean this_present_mem_on_heap = true && this.is_set_mem_on_heap();
- boolean that_present_mem_on_heap = true && that.is_set_mem_on_heap();
- if (this_present_mem_on_heap || that_present_mem_on_heap) {
- if (!(this_present_mem_on_heap && that_present_mem_on_heap))
- return false;
- if (this.mem_on_heap != that.mem_on_heap)
- return false;
- }
-
- boolean this_present_mem_off_heap = true && this.is_set_mem_off_heap();
- boolean that_present_mem_off_heap = true && that.is_set_mem_off_heap();
- if (this_present_mem_off_heap || that_present_mem_off_heap) {
- if (!(this_present_mem_off_heap && that_present_mem_off_heap))
- return false;
- if (this.mem_off_heap != that.mem_off_heap)
- return false;
- }
-
- boolean this_present_cpu = true && this.is_set_cpu();
- boolean that_present_cpu = true && that.is_set_cpu();
- if (this_present_cpu || that_present_cpu) {
- if (!(this_present_cpu && that_present_cpu))
- return false;
- if (this.cpu != that.cpu)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_mem_on_heap = true && (is_set_mem_on_heap());
- list.add(present_mem_on_heap);
- if (present_mem_on_heap)
- list.add(mem_on_heap);
-
- boolean present_mem_off_heap = true && (is_set_mem_off_heap());
- list.add(present_mem_off_heap);
- if (present_mem_off_heap)
- list.add(mem_off_heap);
-
- boolean present_cpu = true && (is_set_cpu());
- list.add(present_cpu);
- if (present_cpu)
- list.add(cpu);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(WorkerResources other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_mem_on_heap()).compareTo(other.is_set_mem_on_heap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_mem_on_heap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mem_on_heap, other.mem_on_heap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_mem_off_heap()).compareTo(other.is_set_mem_off_heap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_mem_off_heap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mem_off_heap, other.mem_off_heap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_cpu()).compareTo(other.is_set_cpu());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_cpu()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cpu, other.cpu);
- 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("WorkerResources(");
- boolean first = true;
-
- if (is_set_mem_on_heap()) {
- sb.append("mem_on_heap:");
- sb.append(this.mem_on_heap);
- first = false;
- }
- if (is_set_mem_off_heap()) {
- if (!first) sb.append(", ");
- sb.append("mem_off_heap:");
- sb.append(this.mem_off_heap);
- first = false;
- }
- if (is_set_cpu()) {
- if (!first) sb.append(", ");
- sb.append("cpu:");
- sb.append(this.cpu);
- 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 WorkerResourcesStandardSchemeFactory implements SchemeFactory {
- public WorkerResourcesStandardScheme getScheme() {
- return new WorkerResourcesStandardScheme();
- }
- }
-
- private static class WorkerResourcesStandardScheme extends StandardScheme<WorkerResources> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, WorkerResources 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: // MEM_ON_HEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.mem_on_heap = iprot.readDouble();
- struct.set_mem_on_heap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // MEM_OFF_HEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.mem_off_heap = iprot.readDouble();
- struct.set_mem_off_heap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // CPU
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.cpu = iprot.readDouble();
- struct.set_cpu_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, WorkerResources struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.is_set_mem_on_heap()) {
- oprot.writeFieldBegin(MEM_ON_HEAP_FIELD_DESC);
- oprot.writeDouble(struct.mem_on_heap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_mem_off_heap()) {
- oprot.writeFieldBegin(MEM_OFF_HEAP_FIELD_DESC);
- oprot.writeDouble(struct.mem_off_heap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_cpu()) {
- oprot.writeFieldBegin(CPU_FIELD_DESC);
- oprot.writeDouble(struct.cpu);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class WorkerResourcesTupleSchemeFactory implements SchemeFactory {
- public WorkerResourcesTupleScheme getScheme() {
- return new WorkerResourcesTupleScheme();
- }
- }
-
- private static class WorkerResourcesTupleScheme extends TupleScheme<WorkerResources> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, WorkerResources struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_mem_on_heap()) {
- optionals.set(0);
- }
- if (struct.is_set_mem_off_heap()) {
- optionals.set(1);
- }
- if (struct.is_set_cpu()) {
- optionals.set(2);
- }
- oprot.writeBitSet(optionals, 3);
- if (struct.is_set_mem_on_heap()) {
- oprot.writeDouble(struct.mem_on_heap);
- }
- if (struct.is_set_mem_off_heap()) {
- oprot.writeDouble(struct.mem_off_heap);
- }
- if (struct.is_set_cpu()) {
- oprot.writeDouble(struct.cpu);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, WorkerResources struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(3);
- if (incoming.get(0)) {
- struct.mem_on_heap = iprot.readDouble();
- struct.set_mem_on_heap_isSet(true);
- }
- if (incoming.get(1)) {
- struct.mem_off_heap = iprot.readDouble();
- struct.set_mem_off_heap_isSet(true);
- }
- if (incoming.get(2)) {
- struct.cpu = iprot.readDouble();
- struct.set_cpu_isSet(true);
- }
- }
- }
-
-}
-
[36/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/clojure/ClojureBolt.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/clojure/ClojureBolt.java b/storm-core/src/jvm/backtype/storm/clojure/ClojureBolt.java
deleted file mode 100644
index d56828b..0000000
--- a/storm-core/src/jvm/backtype/storm/clojure/ClojureBolt.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.clojure;
-
-import org.apache.storm.coordination.CoordinatedBolt.FinishedCallback;
-import org.apache.storm.generated.StreamInfo;
-import org.apache.storm.task.IBolt;
-import org.apache.storm.task.OutputCollector;
-import org.apache.storm.task.TopologyContext;
-import org.apache.storm.topology.IRichBolt;
-import org.apache.storm.topology.OutputFieldsDeclarer;
-import org.apache.storm.tuple.Fields;
-import org.apache.storm.tuple.Tuple;
-import org.apache.storm.utils.Utils;
-import clojure.lang.IFn;
-import clojure.lang.PersistentArrayMap;
-import clojure.lang.Keyword;
-import clojure.lang.Symbol;
-import clojure.lang.RT;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-
-public class ClojureBolt implements IRichBolt, FinishedCallback {
- Map<String, StreamInfo> _fields;
- List<String> _fnSpec;
- List<String> _confSpec;
- List<Object> _params;
-
- IBolt _bolt;
-
- public ClojureBolt(List fnSpec, List confSpec, List<Object> params, Map<String, StreamInfo> fields) {
- _fnSpec = fnSpec;
- _confSpec = confSpec;
- _params = params;
- _fields = fields;
- }
-
- @Override
- public void prepare(final Map stormConf, final TopologyContext context, final OutputCollector collector) {
- IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1));
- try {
- IFn preparer = (IFn) hof.applyTo(RT.seq(_params));
- final Map<Keyword,Object> collectorMap = new PersistentArrayMap( new Object[] {
- Keyword.intern(Symbol.create("output-collector")), collector,
- Keyword.intern(Symbol.create("context")), context});
- List<Object> args = new ArrayList<Object>() {{
- add(stormConf);
- add(context);
- add(collectorMap);
- }};
-
- _bolt = (IBolt) preparer.applyTo(RT.seq(args));
- //this is kind of unnecessary for clojure
- try {
- _bolt.prepare(stormConf, context, collector);
- } catch(AbstractMethodError ame) {
-
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void execute(Tuple input) {
- _bolt.execute(input);
- }
-
- @Override
- public void cleanup() {
- try {
- _bolt.cleanup();
- } catch(AbstractMethodError ame) {
-
- }
- }
-
- @Override
- public void declareOutputFields(OutputFieldsDeclarer declarer) {
- for(String stream: _fields.keySet()) {
- StreamInfo info = _fields.get(stream);
- declarer.declareStream(stream, info.is_direct(), new Fields(info.get_output_fields()));
- }
- }
-
- @Override
- public void finishedId(Object id) {
- if(_bolt instanceof FinishedCallback) {
- ((FinishedCallback) _bolt).finishedId(id);
- }
- }
-
- @Override
- public Map<String, Object> getComponentConfiguration() {
- IFn hof = Utils.loadClojureFn(_confSpec.get(0), _confSpec.get(1));
- try {
- return (Map) hof.applyTo(RT.seq(_params));
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/clojure/ClojureSpout.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/clojure/ClojureSpout.java b/storm-core/src/jvm/backtype/storm/clojure/ClojureSpout.java
deleted file mode 100644
index 61de3cd..0000000
--- a/storm-core/src/jvm/backtype/storm/clojure/ClojureSpout.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.clojure;
-
-import org.apache.storm.generated.StreamInfo;
-import org.apache.storm.spout.ISpout;
-import org.apache.storm.spout.SpoutOutputCollector;
-import org.apache.storm.task.TopologyContext;
-import org.apache.storm.topology.IRichSpout;
-import org.apache.storm.topology.OutputFieldsDeclarer;
-import org.apache.storm.tuple.Fields;
-import org.apache.storm.utils.Utils;
-import clojure.lang.IFn;
-import clojure.lang.PersistentArrayMap;
-import clojure.lang.Keyword;
-import clojure.lang.Symbol;
-import clojure.lang.RT;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-public class ClojureSpout implements IRichSpout {
- Map<String, StreamInfo> _fields;
- List<String> _fnSpec;
- List<String> _confSpec;
- List<Object> _params;
-
- ISpout _spout;
-
- public ClojureSpout(List fnSpec, List confSpec, List<Object> params, Map<String, StreamInfo> fields) {
- _fnSpec = fnSpec;
- _confSpec = confSpec;
- _params = params;
- _fields = fields;
- }
-
-
- @Override
- public void open(final Map conf, final TopologyContext context, final SpoutOutputCollector collector) {
- IFn hof = Utils.loadClojureFn(_fnSpec.get(0), _fnSpec.get(1));
- try {
- IFn preparer = (IFn) hof.applyTo(RT.seq(_params));
- final Map<Keyword,Object> collectorMap = new PersistentArrayMap( new Object[] {
- Keyword.intern(Symbol.create("output-collector")), collector,
- Keyword.intern(Symbol.create("context")), context});
- List<Object> args = new ArrayList<Object>() {{
- add(conf);
- add(context);
- add(collectorMap);
- }};
-
- _spout = (ISpout) preparer.applyTo(RT.seq(args));
- //this is kind of unnecessary for clojure
- try {
- _spout.open(conf, context, collector);
- } catch(AbstractMethodError ame) {
-
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void close() {
- try {
- _spout.close();
- } catch(AbstractMethodError ame) {
-
- }
- }
-
- @Override
- public void nextTuple() {
- try {
- _spout.nextTuple();
- } catch(AbstractMethodError ame) {
-
- }
-
- }
-
- @Override
- public void ack(Object msgId) {
- try {
- _spout.ack(msgId);
- } catch(AbstractMethodError ame) {
-
- }
-
- }
-
- @Override
- public void fail(Object msgId) {
- try {
- _spout.fail(msgId);
- } catch(AbstractMethodError ame) {
-
- }
-
- }
-
- @Override
- public void declareOutputFields(OutputFieldsDeclarer declarer) {
- for(String stream: _fields.keySet()) {
- StreamInfo info = _fields.get(stream);
- declarer.declareStream(stream, info.is_direct(), new Fields(info.get_output_fields()));
- }
- }
-
- @Override
- public Map<String, Object> getComponentConfiguration() {
- IFn hof = Utils.loadClojureFn(_confSpec.get(0), _confSpec.get(1));
- try {
- return (Map) hof.applyTo(RT.seq(_params));
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void activate() {
- try {
- _spout.activate();
- } catch(AbstractMethodError ame) {
-
- }
- }
-
- @Override
- public void deactivate() {
- try {
- _spout.deactivate();
- } catch(AbstractMethodError ame) {
-
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/clojure/RichShellBolt.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/clojure/RichShellBolt.java b/storm-core/src/jvm/backtype/storm/clojure/RichShellBolt.java
deleted file mode 100644
index 6de5637..0000000
--- a/storm-core/src/jvm/backtype/storm/clojure/RichShellBolt.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.clojure;
-
-import org.apache.storm.generated.StreamInfo;
-import org.apache.storm.task.ShellBolt;
-import org.apache.storm.topology.IRichBolt;
-import org.apache.storm.topology.OutputFieldsDeclarer;
-import org.apache.storm.tuple.Fields;
-import java.util.Map;
-
-public class RichShellBolt extends ShellBolt implements IRichBolt {
- private Map<String, StreamInfo> _outputs;
-
- public RichShellBolt(String[] command, Map<String, StreamInfo> outputs) {
- super(command);
- _outputs = outputs;
- }
-
- @Override
- public void declareOutputFields(OutputFieldsDeclarer declarer) {
- for(String stream: _outputs.keySet()) {
- StreamInfo def = _outputs.get(stream);
- if(def.is_direct()) {
- declarer.declareStream(stream, true, new Fields(def.get_output_fields()));
- } else {
- declarer.declareStream(stream, new Fields(def.get_output_fields()));
- }
- }
- }
-
- @Override
- public Map<String, Object> getComponentConfiguration() {
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/clojure/RichShellSpout.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/clojure/RichShellSpout.java b/storm-core/src/jvm/backtype/storm/clojure/RichShellSpout.java
deleted file mode 100644
index 9fb7e73..0000000
--- a/storm-core/src/jvm/backtype/storm/clojure/RichShellSpout.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.clojure;
-
-import org.apache.storm.generated.StreamInfo;
-import org.apache.storm.spout.ShellSpout;
-import org.apache.storm.topology.IRichSpout;
-import org.apache.storm.topology.OutputFieldsDeclarer;
-import org.apache.storm.tuple.Fields;
-import java.util.Map;
-
-public class RichShellSpout extends ShellSpout implements IRichSpout {
- private Map<String, StreamInfo> _outputs;
-
- public RichShellSpout(String[] command, Map<String, StreamInfo> outputs) {
- super(command);
- _outputs = outputs;
- }
-
- @Override
- public void declareOutputFields(OutputFieldsDeclarer declarer) {
- for(String stream: _outputs.keySet()) {
- StreamInfo def = _outputs.get(stream);
- if(def.is_direct()) {
- declarer.declareStream(stream, true, new Fields(def.get_output_fields()));
- } else {
- declarer.declareStream(stream, new Fields(def.get_output_fields()));
- }
- }
- }
-
- @Override
- public Map<String, Object> getComponentConfiguration() {
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/cluster/ClusterState.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/cluster/ClusterState.java b/storm-core/src/jvm/backtype/storm/cluster/ClusterState.java
deleted file mode 100644
index fdac92c..0000000
--- a/storm-core/src/jvm/backtype/storm/cluster/ClusterState.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.cluster;
-
-import clojure.lang.APersistentMap;
-import clojure.lang.IFn;
-import java.util.List;
-import org.apache.zookeeper.data.ACL;
-
-/**
- * ClusterState provides the API for the pluggable state store used by the
- * Storm daemons. Data is stored in path/value format, and the store supports
- * listing sub-paths at a given path.
- * All data should be available across all nodes with eventual consistency.
- *
- * IMPORTANT NOTE:
- * Heartbeats have different api calls used to interact with them. The root
- * path (/) may or may not be the same as the root path for the other api calls.
- *
- * For example, performing these two calls:
- * set_data("/path", data, acls);
- * void set_worker_hb("/path", heartbeat, acls);
- * may or may not cause a collision in "/path".
- * Never use the same paths with the *_hb* methods as you do with the others.
- */
-public interface ClusterState {
-
- /**
- * Registers a callback function that gets called when CuratorEvents happen.
- * @param callback is a clojure IFn that accepts the type - translated to
- * clojure keyword as in zookeeper.clj - and the path: (callback type path)
- * @return is an id that can be passed to unregister(...) to unregister the
- * callback.
- */
- String register(IFn callback);
-
- /**
- * Unregisters a callback function that was registered with register(...).
- * @param id is the String id that was returned from register(...).
- */
- void unregister(String id);
-
- /**
- * Path will be appended with a monotonically increasing integer, a new node
- * will be created there, and data will be put at that node.
- * @param path The path that the monotonically increasing integer suffix will
- * be added to.
- * @param data The data that will be written at the suffixed path's node.
- * @param acls The acls to apply to the path. May be null.
- * @return The path with the integer suffix appended.
- */
- String create_sequential(String path, byte[] data, List<ACL> acls);
-
- /**
- * Creates nodes for path and all its parents. Path elements are separated by
- * a "/", as in *nix filesystem notation. Equivalent to mkdir -p in *nix.
- * @param path The path to create, along with all its parents.
- * @param acls The acls to apply to the path. May be null.
- * @return path
- */
- String mkdirs(String path, List<ACL> acls);
-
- /**
- * Deletes the node at a given path, and any child nodes that may exist.
- * @param path The path to delete
- */
- void delete_node(String path);
-
- /**
- * Creates an ephemeral node at path. Ephemeral nodes are destroyed
- * by the store when the client disconnects.
- * @param path The path where a node will be created.
- * @param data The data to be written at the node.
- * @param acls The acls to apply to the path. May be null.
- */
- void set_ephemeral_node(String path, byte[] data, List<ACL> acls);
-
- /**
- * Gets the 'version' of the node at a path. Optionally sets a watch
- * on that node. The version should increase whenever a write happens.
- * @param path The path to get the version of.
- * @param watch Whether or not to set a watch on the path. Watched paths
- * emit events which are consumed by functions registered with the
- * register method. Very useful for catching updates to nodes.
- * @return The integer version of this node.
- */
- Integer get_version(String path, boolean watch);
-
- /**
- * Check if a node exists and optionally set a watch on the path.
- * @param path The path to check for the existence of a node.
- * @param watch Whether or not to set a watch on the path. Watched paths
- * emit events which are consumed by functions registered with the
- * register method. Very useful for catching updates to nodes.
- * @return Whether or not a node exists at path.
- */
- boolean node_exists(String path, boolean watch);
-
- /**
- * Get a list of paths of all the child nodes which exist immediately
- * under path.
- * @param path The path to look under
- * @param watch Whether or not to set a watch on the path. Watched paths
- * emit events which are consumed by functions registered with the
- * register method. Very useful for catching updates to nodes.
- * @return list of string paths under path.
- */
- List<String> get_children(String path, boolean watch);
-
- /**
- * Close the connection to the data store.
- */
- void close();
-
- /**
- * Set the value of the node at path to data.
- * @param path The path whose node we want to set.
- * @param data The data to put in the node.
- * @param acls The acls to apply to the path. May be null.
- */
- void set_data(String path, byte[] data, List<ACL> acls);
-
- /**
- * Get the data from the node at path
- * @param path The path to look under
- * @param watch Whether or not to set a watch on the path. Watched paths
- * emit events which are consumed by functions registered with the
- * register method. Very useful for catching updates to nodes.
- * @return The data at the node.
- */
- byte[] get_data(String path, boolean watch);
-
- /**
- * Get the data at the node along with its version. Data is returned
- * in an APersistentMap with clojure keyword keys :data and :version.
- * @param path The path to look under
- * @param watch Whether or not to set a watch on the path. Watched paths
- * emit events which are consumed by functions registered with the
- * register method. Very useful for catching updates to nodes.
- * @return An APersistentMap in the form {:data data :version version}
- */
- APersistentMap get_data_with_version(String path, boolean watch);
-
- /**
- * Write a worker heartbeat at the path.
- * @param path The path whose node we want to set.
- * @param data The data to put in the node.
- * @param acls The acls to apply to the path. May be null.
- */
- void set_worker_hb(String path, byte[] data, List<ACL> acls);
-
- /**
- * Get the heartbeat from the node at path
- * @param path The path to look under
- * @param watch Whether or not to set a watch on the path. Watched paths
- * emit events which are consumed by functions registered with the
- * register method. Very useful for catching updates to nodes.
- * @return The heartbeat at the node.
- */
- byte[] get_worker_hb(String path, boolean watch);
-
- /**
- * Get a list of paths of all the child nodes which exist immediately
- * under path. This is similar to get_children, but must be used for
- * any nodes
- * @param path The path to look under
- * @param watch Whether or not to set a watch on the path. Watched paths
- * emit events which are consumed by functions registered with the
- * register method. Very useful for catching updates to nodes.
- * @return list of string paths under path.
- */
- List<String> get_worker_hb_children(String path, boolean watch);
-
- /**
- * Deletes the heartbeat at a given path, and any child nodes that may exist.
- * @param path The path to delete.
- */
- void delete_worker_hb(String path);
-
- /**
- * Add a ClusterStateListener to the connection.
- * @param listener A ClusterStateListener to handle changing cluster state
- * events.
- */
- void add_listener(ClusterStateListener listener);
-
- /**
- * Force consistency on a path. Any writes committed on the path before
- * this call will be completely propagated when it returns.
- * @param path The path to synchronize.
- */
- void sync_path(String path);
-
- /**
- * Allows us to delete the znodes within /storm/blobstore/key_name
- * whose znodes start with the corresponding nimbusHostPortInfo
- * @param path /storm/blobstore/key_name
- * @param nimbusHostPortInfo Contains the host port information of
- * a nimbus node.
- */
- void delete_node_blobstore(String path, String nimbusHostPortInfo);
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/cluster/ClusterStateContext.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/cluster/ClusterStateContext.java b/storm-core/src/jvm/backtype/storm/cluster/ClusterStateContext.java
deleted file mode 100644
index 997bdc3..0000000
--- a/storm-core/src/jvm/backtype/storm/cluster/ClusterStateContext.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.storm.cluster;
-
-/**
- * This class is intended to provide runtime-context to ClusterStateFactory
- * implementors, giving information such as what daemon is creating it.
- */
-public class ClusterStateContext {
-
- private DaemonType daemonType;
-
- public ClusterStateContext() {
- daemonType = DaemonType.UNKNOWN;
- }
-
- public ClusterStateContext(DaemonType daemonType) {
- this.daemonType = daemonType;
- }
-
- public DaemonType getDaemonType() {
- return daemonType;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/cluster/ClusterStateFactory.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/cluster/ClusterStateFactory.java b/storm-core/src/jvm/backtype/storm/cluster/ClusterStateFactory.java
deleted file mode 100644
index 6474d82..0000000
--- a/storm-core/src/jvm/backtype/storm/cluster/ClusterStateFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.cluster;
-
-import clojure.lang.APersistentMap;
-import java.util.List;
-import org.apache.zookeeper.data.ACL;
-
-public interface ClusterStateFactory {
-
- ClusterState mkState(APersistentMap config, APersistentMap auth_conf, List<ACL> acls, ClusterStateContext context);
-
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/cluster/ClusterStateListener.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/cluster/ClusterStateListener.java b/storm-core/src/jvm/backtype/storm/cluster/ClusterStateListener.java
deleted file mode 100644
index 30e467e..0000000
--- a/storm-core/src/jvm/backtype/storm/cluster/ClusterStateListener.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.cluster;
-
-public interface ClusterStateListener {
- void stateChanged(ConnectionState newState);
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/cluster/ConnectionState.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/cluster/ConnectionState.java b/storm-core/src/jvm/backtype/storm/cluster/ConnectionState.java
deleted file mode 100644
index ec5e97d..0000000
--- a/storm-core/src/jvm/backtype/storm/cluster/ConnectionState.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.cluster;
-
-public enum ConnectionState {
- CONNECTED,
- RECONNECTED,
- LOST
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/cluster/DaemonType.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/cluster/DaemonType.java b/storm-core/src/jvm/backtype/storm/cluster/DaemonType.java
deleted file mode 100644
index 4589be3..0000000
--- a/storm-core/src/jvm/backtype/storm/cluster/DaemonType.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.storm.cluster;
-
-public enum DaemonType {
- SUPERVISOR,
- NIMBUS,
- WORKER,
- PACEMAKER,
- UNKNOWN
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/coordination/BatchBoltExecutor.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/coordination/BatchBoltExecutor.java b/storm-core/src/jvm/backtype/storm/coordination/BatchBoltExecutor.java
deleted file mode 100644
index eaa42bc..0000000
--- a/storm-core/src/jvm/backtype/storm/coordination/BatchBoltExecutor.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.coordination;
-
-import org.apache.storm.coordination.CoordinatedBolt.FinishedCallback;
-import org.apache.storm.coordination.CoordinatedBolt.TimeoutCallback;
-import org.apache.storm.task.OutputCollector;
-import org.apache.storm.task.TopologyContext;
-import org.apache.storm.topology.FailedException;
-import org.apache.storm.topology.IRichBolt;
-import org.apache.storm.topology.OutputFieldsDeclarer;
-import org.apache.storm.tuple.Tuple;
-import org.apache.storm.utils.Utils;
-import java.util.HashMap;
-import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BatchBoltExecutor implements IRichBolt, FinishedCallback, TimeoutCallback {
- public static final Logger LOG = LoggerFactory.getLogger(BatchBoltExecutor.class);
-
- byte[] _boltSer;
- Map<Object, IBatchBolt> _openTransactions;
- Map _conf;
- TopologyContext _context;
- BatchOutputCollectorImpl _collector;
-
- public BatchBoltExecutor(IBatchBolt bolt) {
- _boltSer = Utils.javaSerialize(bolt);
- }
-
- @Override
- public void prepare(Map conf, TopologyContext context, OutputCollector collector) {
- _conf = conf;
- _context = context;
- _collector = new BatchOutputCollectorImpl(collector);
- _openTransactions = new HashMap<>();
- }
-
- @Override
- public void execute(Tuple input) {
- Object id = input.getValue(0);
- IBatchBolt bolt = getBatchBolt(id);
- try {
- bolt.execute(input);
- _collector.ack(input);
- } catch(FailedException e) {
- LOG.error("Failed to process tuple in batch", e);
- _collector.fail(input);
- }
- }
-
- @Override
- public void cleanup() {
- }
-
- @Override
- public void finishedId(Object id) {
- IBatchBolt bolt = getBatchBolt(id);
- _openTransactions.remove(id);
- bolt.finishBatch();
- }
-
- @Override
- public void timeoutId(Object attempt) {
- _openTransactions.remove(attempt);
- }
-
-
- @Override
- public void declareOutputFields(OutputFieldsDeclarer declarer) {
- newTransactionalBolt().declareOutputFields(declarer);
- }
-
- @Override
- public Map<String, Object> getComponentConfiguration() {
- return newTransactionalBolt().getComponentConfiguration();
- }
-
- private IBatchBolt getBatchBolt(Object id) {
- IBatchBolt bolt = _openTransactions.get(id);
- if(bolt==null) {
- bolt = newTransactionalBolt();
- bolt.prepare(_conf, _context, _collector, id);
- _openTransactions.put(id, bolt);
- }
- return bolt;
- }
-
- private IBatchBolt newTransactionalBolt() {
- return Utils.javaDeserialize(_boltSer, IBatchBolt.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/coordination/BatchOutputCollector.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/coordination/BatchOutputCollector.java b/storm-core/src/jvm/backtype/storm/coordination/BatchOutputCollector.java
deleted file mode 100644
index c2b9f65..0000000
--- a/storm-core/src/jvm/backtype/storm/coordination/BatchOutputCollector.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.coordination;
-
-import org.apache.storm.utils.Utils;
-import java.util.List;
-
-public abstract class BatchOutputCollector {
-
- /**
- * Emits a tuple to the default output stream.
- */
- public List<Integer> emit(List<Object> tuple) {
- return emit(Utils.DEFAULT_STREAM_ID, tuple);
- }
-
- public abstract List<Integer> emit(String streamId, List<Object> tuple);
-
- /**
- * Emits a tuple to the specified task on the default output stream. This output
- * stream must have been declared as a direct stream, and the specified task must
- * use a direct grouping on this stream to receive the message.
- */
- public void emitDirect(int taskId, List<Object> tuple) {
- emitDirect(taskId, Utils.DEFAULT_STREAM_ID, tuple);
- }
-
- public abstract void emitDirect(int taskId, String streamId, List<Object> tuple);
-
- public abstract void reportError(Throwable error);
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/coordination/BatchOutputCollectorImpl.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/coordination/BatchOutputCollectorImpl.java b/storm-core/src/jvm/backtype/storm/coordination/BatchOutputCollectorImpl.java
deleted file mode 100644
index 246ae5d..0000000
--- a/storm-core/src/jvm/backtype/storm/coordination/BatchOutputCollectorImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.coordination;
-
-import org.apache.storm.task.OutputCollector;
-import org.apache.storm.tuple.Tuple;
-import java.util.List;
-
-public class BatchOutputCollectorImpl extends BatchOutputCollector {
- OutputCollector _collector;
-
- public BatchOutputCollectorImpl(OutputCollector collector) {
- _collector = collector;
- }
-
- @Override
- public List<Integer> emit(String streamId, List<Object> tuple) {
- return _collector.emit(streamId, tuple);
- }
-
- @Override
- public void emitDirect(int taskId, String streamId, List<Object> tuple) {
- _collector.emitDirect(taskId, streamId, tuple);
- }
-
- @Override
- public void reportError(Throwable error) {
- _collector.reportError(error);
- }
-
- public void ack(Tuple tup) {
- _collector.ack(tup);
- }
-
- public void fail(Tuple tup) {
- _collector.fail(tup);
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/coordination/BatchSubtopologyBuilder.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/coordination/BatchSubtopologyBuilder.java b/storm-core/src/jvm/backtype/storm/coordination/BatchSubtopologyBuilder.java
deleted file mode 100644
index bd72c89..0000000
--- a/storm-core/src/jvm/backtype/storm/coordination/BatchSubtopologyBuilder.java
+++ /dev/null
@@ -1,447 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.coordination;
-
-import org.apache.storm.Constants;
-import org.apache.storm.coordination.CoordinatedBolt.SourceArgs;
-import org.apache.storm.generated.GlobalStreamId;
-import org.apache.storm.generated.Grouping;
-import org.apache.storm.grouping.CustomStreamGrouping;
-import org.apache.storm.grouping.PartialKeyGrouping;
-import org.apache.storm.topology.BaseConfigurationDeclarer;
-import org.apache.storm.topology.BasicBoltExecutor;
-import org.apache.storm.topology.BoltDeclarer;
-import org.apache.storm.topology.IBasicBolt;
-import org.apache.storm.topology.IRichBolt;
-import org.apache.storm.topology.InputDeclarer;
-import org.apache.storm.topology.TopologyBuilder;
-import org.apache.storm.tuple.Fields;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-public class BatchSubtopologyBuilder {
- Map<String, Component> _bolts = new HashMap<String, Component>();
- Component _masterBolt;
- String _masterId;
-
- public BatchSubtopologyBuilder(String masterBoltId, IBasicBolt masterBolt, Number boltParallelism) {
- Integer p = boltParallelism == null ? null : boltParallelism.intValue();
- _masterBolt = new Component(new BasicBoltExecutor(masterBolt), p);
- _masterId = masterBoltId;
- }
-
- public BatchSubtopologyBuilder(String masterBoltId, IBasicBolt masterBolt) {
- this(masterBoltId, masterBolt, null);
- }
-
- public BoltDeclarer getMasterDeclarer() {
- return new BoltDeclarerImpl(_masterBolt);
- }
-
- public BoltDeclarer setBolt(String id, IBatchBolt bolt) {
- return setBolt(id, bolt, null);
- }
-
- public BoltDeclarer setBolt(String id, IBatchBolt bolt, Number parallelism) {
- return setBolt(id, new BatchBoltExecutor(bolt), parallelism);
- }
-
- public BoltDeclarer setBolt(String id, IBasicBolt bolt) {
- return setBolt(id, bolt, null);
- }
-
- public BoltDeclarer setBolt(String id, IBasicBolt bolt, Number parallelism) {
- return setBolt(id, new BasicBoltExecutor(bolt), parallelism);
- }
-
- private BoltDeclarer setBolt(String id, IRichBolt bolt, Number parallelism) {
- Integer p = null;
- if(parallelism!=null) p = parallelism.intValue();
- Component component = new Component(bolt, p);
- _bolts.put(id, component);
- return new BoltDeclarerImpl(component);
- }
-
- public void extendTopology(TopologyBuilder builder) {
- BoltDeclarer declarer = builder.setBolt(_masterId, new CoordinatedBolt(_masterBolt.bolt), _masterBolt.parallelism);
- for(InputDeclaration decl: _masterBolt.declarations) {
- decl.declare(declarer);
- }
- for(Map conf: _masterBolt.componentConfs) {
- declarer.addConfigurations(conf);
- }
- for(String id: _bolts.keySet()) {
- Component component = _bolts.get(id);
- Map<String, SourceArgs> coordinatedArgs = new HashMap<String, SourceArgs>();
- for(String c: componentBoltSubscriptions(component)) {
- SourceArgs source;
- if(c.equals(_masterId)) {
- source = SourceArgs.single();
- } else {
- source = SourceArgs.all();
- }
- coordinatedArgs.put(c, source);
- }
-
-
- BoltDeclarer input = builder.setBolt(id,
- new CoordinatedBolt(component.bolt,
- coordinatedArgs,
- null),
- component.parallelism);
- for(Map conf: component.componentConfs) {
- input.addConfigurations(conf);
- }
- for(String c: componentBoltSubscriptions(component)) {
- input.directGrouping(c, Constants.COORDINATED_STREAM_ID);
- }
- for(InputDeclaration d: component.declarations) {
- d.declare(input);
- }
- }
- }
-
- private Set<String> componentBoltSubscriptions(Component component) {
- Set<String> ret = new HashSet<String>();
- for(InputDeclaration d: component.declarations) {
- ret.add(d.getComponent());
- }
- return ret;
- }
-
- private static class Component {
- public IRichBolt bolt;
- public Integer parallelism;
- public List<InputDeclaration> declarations = new ArrayList<InputDeclaration>();
- public List<Map<String, Object>> componentConfs = new ArrayList<>();
-
- public Component(IRichBolt bolt, Integer parallelism) {
- this.bolt = bolt;
- this.parallelism = parallelism;
- }
- }
-
- private static interface InputDeclaration {
- void declare(InputDeclarer declarer);
- String getComponent();
- }
-
- private static class BoltDeclarerImpl extends BaseConfigurationDeclarer<BoltDeclarer> implements BoltDeclarer {
- Component _component;
-
- public BoltDeclarerImpl(Component component) {
- _component = component;
- }
-
- @Override
- public BoltDeclarer fieldsGrouping(final String component, final Fields fields) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.fieldsGrouping(component, fields);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer fieldsGrouping(final String component, final String streamId, final Fields fields) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.fieldsGrouping(component, streamId, fields);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer globalGrouping(final String component) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.globalGrouping(component);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer globalGrouping(final String component, final String streamId) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.globalGrouping(component, streamId);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer shuffleGrouping(final String component) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.shuffleGrouping(component);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer shuffleGrouping(final String component, final String streamId) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.shuffleGrouping(component, streamId);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer localOrShuffleGrouping(final String component) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.localOrShuffleGrouping(component);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer localOrShuffleGrouping(final String component, final String streamId) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.localOrShuffleGrouping(component, streamId);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer noneGrouping(final String component) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.noneGrouping(component);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer noneGrouping(final String component, final String streamId) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.noneGrouping(component, streamId);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer allGrouping(final String component) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.allGrouping(component);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer allGrouping(final String component, final String streamId) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.allGrouping(component, streamId);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer directGrouping(final String component) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.directGrouping(component);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer directGrouping(final String component, final String streamId) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.directGrouping(component, streamId);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer partialKeyGrouping(String componentId, Fields fields) {
- return customGrouping(componentId, new PartialKeyGrouping(fields));
- }
-
- @Override
- public BoltDeclarer partialKeyGrouping(String componentId, String streamId, Fields fields) {
- return customGrouping(componentId, streamId, new PartialKeyGrouping(fields));
- }
-
- @Override
- public BoltDeclarer customGrouping(final String component, final CustomStreamGrouping grouping) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.customGrouping(component, grouping);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer customGrouping(final String component, final String streamId, final CustomStreamGrouping grouping) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.customGrouping(component, streamId, grouping);
- }
-
- @Override
- public String getComponent() {
- return component;
- }
- });
- return this;
- }
-
- @Override
- public BoltDeclarer grouping(final GlobalStreamId stream, final Grouping grouping) {
- addDeclaration(new InputDeclaration() {
- @Override
- public void declare(InputDeclarer declarer) {
- declarer.grouping(stream, grouping);
- }
-
- @Override
- public String getComponent() {
- return stream.get_componentId();
- }
- });
- return this;
- }
-
- private void addDeclaration(InputDeclaration declaration) {
- _component.declarations.add(declaration);
- }
-
- @Override
- public BoltDeclarer addConfigurations(Map<String, Object> conf) {
- _component.componentConfs.add(conf);
- return this;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/coordination/CoordinatedBolt.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/coordination/CoordinatedBolt.java b/storm-core/src/jvm/backtype/storm/coordination/CoordinatedBolt.java
deleted file mode 100644
index 15ac5e2..0000000
--- a/storm-core/src/jvm/backtype/storm/coordination/CoordinatedBolt.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.coordination;
-
-import org.apache.storm.topology.FailedException;
-import java.util.Map.Entry;
-import org.apache.storm.tuple.Values;
-import org.apache.storm.generated.GlobalStreamId;
-import java.util.Collection;
-import org.apache.storm.Constants;
-import org.apache.storm.generated.Grouping;
-import org.apache.storm.task.IOutputCollector;
-import org.apache.storm.task.OutputCollector;
-import org.apache.storm.task.TopologyContext;
-import org.apache.storm.topology.IRichBolt;
-import org.apache.storm.topology.OutputFieldsDeclarer;
-import org.apache.storm.tuple.Fields;
-import org.apache.storm.tuple.Tuple;
-import org.apache.storm.utils.TimeCacheMap;
-import org.apache.storm.utils.Utils;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import static org.apache.storm.utils.Utils.get;
-
-/**
- * Coordination requires the request ids to be globally unique for awhile. This is so it doesn't get confused
- * in the case of retries.
- */
-public class CoordinatedBolt implements IRichBolt {
- public static final Logger LOG = LoggerFactory.getLogger(CoordinatedBolt.class);
-
- public static interface FinishedCallback {
- void finishedId(Object id);
- }
-
- public static interface TimeoutCallback {
- void timeoutId(Object id);
- }
-
-
- public static class SourceArgs implements Serializable {
- public boolean singleCount;
-
- protected SourceArgs(boolean singleCount) {
- this.singleCount = singleCount;
- }
-
- public static SourceArgs single() {
- return new SourceArgs(true);
- }
-
- public static SourceArgs all() {
- return new SourceArgs(false);
- }
-
- @Override
- public String toString() {
- return "<Single: " + singleCount + ">";
- }
- }
-
- public class CoordinatedOutputCollector implements IOutputCollector {
- IOutputCollector _delegate;
-
- public CoordinatedOutputCollector(IOutputCollector delegate) {
- _delegate = delegate;
- }
-
- public List<Integer> emit(String stream, Collection<Tuple> anchors, List<Object> tuple) {
- List<Integer> tasks = _delegate.emit(stream, anchors, tuple);
- updateTaskCounts(tuple.get(0), tasks);
- return tasks;
- }
-
- public void emitDirect(int task, String stream, Collection<Tuple> anchors, List<Object> tuple) {
- updateTaskCounts(tuple.get(0), Arrays.asList(task));
- _delegate.emitDirect(task, stream, anchors, tuple);
- }
-
- public void ack(Tuple tuple) {
- Object id = tuple.getValue(0);
- synchronized(_tracked) {
- TrackingInfo track = _tracked.get(id);
- if (track != null)
- track.receivedTuples++;
- }
- boolean failed = checkFinishId(tuple, TupleType.REGULAR);
- if(failed) {
- _delegate.fail(tuple);
- } else {
- _delegate.ack(tuple);
- }
- }
-
- public void fail(Tuple tuple) {
- Object id = tuple.getValue(0);
- synchronized(_tracked) {
- TrackingInfo track = _tracked.get(id);
- if (track != null)
- track.failed = true;
- }
- checkFinishId(tuple, TupleType.REGULAR);
- _delegate.fail(tuple);
- }
-
- public void resetTimeout(Tuple tuple) {
- _delegate.resetTimeout(tuple);
- }
-
- public void reportError(Throwable error) {
- _delegate.reportError(error);
- }
-
-
- private void updateTaskCounts(Object id, List<Integer> tasks) {
- synchronized(_tracked) {
- TrackingInfo track = _tracked.get(id);
- if (track != null) {
- Map<Integer, Integer> taskEmittedTuples = track.taskEmittedTuples;
- for(Integer task: tasks) {
- int newCount = get(taskEmittedTuples, task, 0) + 1;
- taskEmittedTuples.put(task, newCount);
- }
- }
- }
- }
- }
-
- private Map<String, SourceArgs> _sourceArgs;
- private IdStreamSpec _idStreamSpec;
- private IRichBolt _delegate;
- private Integer _numSourceReports;
- private List<Integer> _countOutTasks = new ArrayList<>();
- private OutputCollector _collector;
- private TimeCacheMap<Object, TrackingInfo> _tracked;
-
- public static class TrackingInfo {
- int reportCount = 0;
- int expectedTupleCount = 0;
- int receivedTuples = 0;
- boolean failed = false;
- Map<Integer, Integer> taskEmittedTuples = new HashMap<>();
- boolean receivedId = false;
- boolean finished = false;
- List<Tuple> ackTuples = new ArrayList<>();
-
- @Override
- public String toString() {
- return "reportCount: " + reportCount + "\n" +
- "expectedTupleCount: " + expectedTupleCount + "\n" +
- "receivedTuples: " + receivedTuples + "\n" +
- "failed: " + failed + "\n" +
- taskEmittedTuples.toString();
- }
- }
-
-
- public static class IdStreamSpec implements Serializable {
- GlobalStreamId _id;
-
- public GlobalStreamId getGlobalStreamId() {
- return _id;
- }
-
- public static IdStreamSpec makeDetectSpec(String component, String stream) {
- return new IdStreamSpec(component, stream);
- }
-
- protected IdStreamSpec(String component, String stream) {
- _id = new GlobalStreamId(component, stream);
- }
- }
-
- public CoordinatedBolt(IRichBolt delegate) {
- this(delegate, null, null);
- }
-
- public CoordinatedBolt(IRichBolt delegate, String sourceComponent, SourceArgs sourceArgs, IdStreamSpec idStreamSpec) {
- this(delegate, singleSourceArgs(sourceComponent, sourceArgs), idStreamSpec);
- }
-
- public CoordinatedBolt(IRichBolt delegate, Map<String, SourceArgs> sourceArgs, IdStreamSpec idStreamSpec) {
- _sourceArgs = sourceArgs;
- if(_sourceArgs==null) _sourceArgs = new HashMap<>();
- _delegate = delegate;
- _idStreamSpec = idStreamSpec;
- }
-
- public void prepare(Map config, TopologyContext context, OutputCollector collector) {
- TimeCacheMap.ExpiredCallback<Object, TrackingInfo> callback = null;
- if(_delegate instanceof TimeoutCallback) {
- callback = new TimeoutItems();
- }
- _tracked = new TimeCacheMap<>(context.maxTopologyMessageTimeout(), callback);
- _collector = collector;
- _delegate.prepare(config, context, new OutputCollector(new CoordinatedOutputCollector(collector)));
- for(String component: Utils.get(context.getThisTargets(),
- Constants.COORDINATED_STREAM_ID,
- new HashMap<String, Grouping>())
- .keySet()) {
- for(Integer task: context.getComponentTasks(component)) {
- _countOutTasks.add(task);
- }
- }
- if(!_sourceArgs.isEmpty()) {
- _numSourceReports = 0;
- for(Entry<String, SourceArgs> entry: _sourceArgs.entrySet()) {
- if(entry.getValue().singleCount) {
- _numSourceReports+=1;
- } else {
- _numSourceReports+=context.getComponentTasks(entry.getKey()).size();
- }
- }
- }
- }
-
- private boolean checkFinishId(Tuple tup, TupleType type) {
- Object id = tup.getValue(0);
- boolean failed = false;
-
- synchronized(_tracked) {
- TrackingInfo track = _tracked.get(id);
- try {
- if(track!=null) {
- boolean delayed = false;
- if(_idStreamSpec==null && type == TupleType.COORD || _idStreamSpec!=null && type==TupleType.ID) {
- track.ackTuples.add(tup);
- delayed = true;
- }
- if(track.failed) {
- failed = true;
- for(Tuple t: track.ackTuples) {
- _collector.fail(t);
- }
- _tracked.remove(id);
- } else if(track.receivedId
- && (_sourceArgs.isEmpty() ||
- track.reportCount==_numSourceReports &&
- track.expectedTupleCount == track.receivedTuples)){
- if(_delegate instanceof FinishedCallback) {
- ((FinishedCallback)_delegate).finishedId(id);
- }
- if(!(_sourceArgs.isEmpty() || type!=TupleType.REGULAR)) {
- throw new IllegalStateException("Coordination condition met on a non-coordinating tuple. Should be impossible");
- }
- Iterator<Integer> outTasks = _countOutTasks.iterator();
- while(outTasks.hasNext()) {
- int task = outTasks.next();
- int numTuples = get(track.taskEmittedTuples, task, 0);
- _collector.emitDirect(task, Constants.COORDINATED_STREAM_ID, tup, new Values(id, numTuples));
- }
- for(Tuple t: track.ackTuples) {
- _collector.ack(t);
- }
- track.finished = true;
- _tracked.remove(id);
- }
- if(!delayed && type!=TupleType.REGULAR) {
- if(track.failed) {
- _collector.fail(tup);
- } else {
- _collector.ack(tup);
- }
- }
- } else {
- if(type!=TupleType.REGULAR) _collector.fail(tup);
- }
- } catch(FailedException e) {
- LOG.error("Failed to finish batch", e);
- for(Tuple t: track.ackTuples) {
- _collector.fail(t);
- }
- _tracked.remove(id);
- failed = true;
- }
- }
- return failed;
- }
-
- public void execute(Tuple tuple) {
- Object id = tuple.getValue(0);
- TrackingInfo track;
- TupleType type = getTupleType(tuple);
- synchronized(_tracked) {
- track = _tracked.get(id);
- if(track==null) {
- track = new TrackingInfo();
- if(_idStreamSpec==null) track.receivedId = true;
- _tracked.put(id, track);
- }
- }
-
- if(type==TupleType.ID) {
- synchronized(_tracked) {
- track.receivedId = true;
- }
- checkFinishId(tuple, type);
- } else if(type==TupleType.COORD) {
- int count = (Integer) tuple.getValue(1);
- synchronized(_tracked) {
- track.reportCount++;
- track.expectedTupleCount+=count;
- }
- checkFinishId(tuple, type);
- } else {
- synchronized(_tracked) {
- _delegate.execute(tuple);
- }
- }
- }
-
- public void cleanup() {
- _delegate.cleanup();
- _tracked.cleanup();
- }
-
- public void declareOutputFields(OutputFieldsDeclarer declarer) {
- _delegate.declareOutputFields(declarer);
- declarer.declareStream(Constants.COORDINATED_STREAM_ID, true, new Fields("id", "count"));
- }
-
- @Override
- public Map<String, Object> getComponentConfiguration() {
- return _delegate.getComponentConfiguration();
- }
-
- private static Map<String, SourceArgs> singleSourceArgs(String sourceComponent, SourceArgs sourceArgs) {
- Map<String, SourceArgs> ret = new HashMap<>();
- ret.put(sourceComponent, sourceArgs);
- return ret;
- }
-
- private class TimeoutItems implements TimeCacheMap.ExpiredCallback<Object, TrackingInfo> {
- @Override
- public void expire(Object id, TrackingInfo val) {
- synchronized(_tracked) {
- // the combination of the lock and the finished flag ensure that
- // an id is never timed out if it has been finished
- val.failed = true;
- if(!val.finished) {
- ((TimeoutCallback) _delegate).timeoutId(id);
- }
- }
- }
- }
-
- private TupleType getTupleType(Tuple tuple) {
- if(_idStreamSpec!=null
- && tuple.getSourceGlobalStreamId().equals(_idStreamSpec._id)) {
- return TupleType.ID;
- } else if(!_sourceArgs.isEmpty()
- && tuple.getSourceStreamId().equals(Constants.COORDINATED_STREAM_ID)) {
- return TupleType.COORD;
- } else {
- return TupleType.REGULAR;
- }
- }
-
- static enum TupleType {
- REGULAR,
- ID,
- COORD
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/coordination/IBatchBolt.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/coordination/IBatchBolt.java b/storm-core/src/jvm/backtype/storm/coordination/IBatchBolt.java
deleted file mode 100644
index 7ea46b0..0000000
--- a/storm-core/src/jvm/backtype/storm/coordination/IBatchBolt.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.coordination;
-
-import org.apache.storm.task.TopologyContext;
-import org.apache.storm.topology.IComponent;
-import org.apache.storm.tuple.Tuple;
-import java.io.Serializable;
-import java.util.Map;
-
-public interface IBatchBolt<T> extends Serializable, IComponent {
- void prepare(Map conf, TopologyContext context, BatchOutputCollector collector, T id);
- void execute(Tuple tuple);
- void finishBatch();
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/daemon/ClientJarTransformerRunner.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/daemon/ClientJarTransformerRunner.java b/storm-core/src/jvm/backtype/storm/daemon/ClientJarTransformerRunner.java
deleted file mode 100644
index 50a56c4..0000000
--- a/storm-core/src/jvm/backtype/storm/daemon/ClientJarTransformerRunner.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.storm.daemon;
-
-import org.apache.storm.utils.Utils;
-
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.InputStream;
-
-/**
- * Main executable to load and run a jar transformer
- */
-public class ClientJarTransformerRunner {
- public static void main(String [] args) throws IOException {
- JarTransformer transformer = Utils.jarTransformer(args[0]);
- InputStream in = new FileInputStream(args[1]);
- OutputStream out = new FileOutputStream(args[2]);
- transformer.transform(in, out);
- in.close();
- out.close();
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/daemon/DirectoryCleaner.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/daemon/DirectoryCleaner.java b/storm-core/src/jvm/backtype/storm/daemon/DirectoryCleaner.java
deleted file mode 100644
index 047e024..0000000
--- a/storm-core/src/jvm/backtype/storm/daemon/DirectoryCleaner.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.daemon;
-
-import java.io.IOException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.nio.file.FileSystems;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.nio.file.Path;
-import java.nio.file.DirectoryStream;
-import java.util.Stack;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.Comparator;
-import java.util.PriorityQueue;
-import java.util.regex.Pattern;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Provide methods to help Logviewer to clean up
- * files in directories and to get a list of files without
- * worrying about excessive memory usage.
- *
- */
-public class DirectoryCleaner {
- private static final Logger LOG = LoggerFactory.getLogger(DirectoryCleaner.class);
- // used to recognize the pattern of active log files, we may remove the "current" from this list
- private static final Pattern ACTIVE_LOG_PATTERN = Pattern.compile(".*\\.(log|err|out|current|yaml|pid)$");
- // used to recognize the pattern of some meta files in a worker log directory
- private static final Pattern META_LOG_PATTERN= Pattern.compile(".*\\.(yaml|pid)$");
-
- // not defining this as static is to allow for mocking in tests
- public DirectoryStream<Path> getStreamForDirectory(File dir) throws IOException {
- DirectoryStream<Path> stream = Files.newDirectoryStream(dir.toPath());
- return stream;
- }
-
- /**
- * If totalSize of files exceeds the either the per-worker quota or global quota,
- * Logviewer deletes oldest inactive log files in a worker directory or in all worker dirs.
- * We use the parameter for_per_dir to switch between the two deletion modes.
- * @param dirs the list of directories to be scanned for deletion
- * @param quota the per-dir quota or the total quota for the all directories
- * @param for_per_dir if true, deletion happens for a single dir; otherwise, for all directories globally
- * @param active_dirs only for global deletion, we want to skip the active logs in active_dirs
- * @return number of files deleted
- */
- public int deleteOldestWhileTooLarge(List<File> dirs,
- long quota, boolean for_per_dir, Set<String> active_dirs) throws IOException {
- final int PQ_SIZE = 1024; // max number of files to delete for every round
- final int MAX_ROUNDS = 512; // max rounds of scanning the dirs
- long totalSize = 0;
- int deletedFiles = 0;
-
- for (File dir : dirs) {
- try (DirectoryStream<Path> stream = getStreamForDirectory(dir)) {
- for (Path path : stream) {
- File file = path.toFile();
- totalSize += file.length();
- }
- }
- }
- long toDeleteSize = totalSize - quota;
- if (toDeleteSize <= 0) {
- return deletedFiles;
- }
-
- Comparator<File> comparator = new Comparator<File>() {
- public int compare(File f1, File f2) {
- if (f1.lastModified() > f2.lastModified()) {
- return -1;
- } else {
- return 1;
- }
- }
- };
- // the oldest pq_size files in this directory will be placed in PQ, with the newest at the root
- PriorityQueue<File> pq = new PriorityQueue<File>(PQ_SIZE, comparator);
- int round = 0;
- while (toDeleteSize > 0) {
- LOG.debug("To delete size is {}, start a new round of deletion, round: {}", toDeleteSize, round);
- for (File dir : dirs) {
- try (DirectoryStream<Path> stream = getStreamForDirectory(dir)) {
- for (Path path : stream) {
- File file = path.toFile();
- if (for_per_dir) {
- if (ACTIVE_LOG_PATTERN.matcher(file.getName()).matches()) {
- continue; // skip active log files
- }
- } else { // for global cleanup
- if (active_dirs.contains(dir.getCanonicalPath())) { // for an active worker's dir, make sure for the last "/"
- if (ACTIVE_LOG_PATTERN.matcher(file.getName()).matches()) {
- continue; // skip active log files
- }
- } else {
- if (META_LOG_PATTERN.matcher(file.getName()).matches()) {
- continue; // skip yaml and pid files
- }
- }
- }
- if (pq.size() < PQ_SIZE) {
- pq.offer(file);
- } else {
- if (file.lastModified() < pq.peek().lastModified()) {
- pq.poll();
- pq.offer(file);
- }
- }
- }
- }
- }
- // need to reverse the order of elements in PQ to delete files from oldest to newest
- Stack<File> stack = new Stack<File>();
- while (!pq.isEmpty()) {
- File file = pq.poll();
- stack.push(file);
- }
- while (!stack.isEmpty() && toDeleteSize > 0) {
- File file = stack.pop();
- toDeleteSize -= file.length();
- LOG.info("Delete file: {}, size: {}, lastModified: {}", file.getCanonicalPath(), file.length(), file.lastModified());
- file.delete();
- deletedFiles++;
- }
- pq.clear();
- round++;
- if (round >= MAX_ROUNDS) {
- if (for_per_dir) {
- LOG.warn("Reach the MAX_ROUNDS: {} during per-dir deletion, you may have too many files in " +
- "a single directory : {}, will delete the rest files in next interval.",
- MAX_ROUNDS, dirs.get(0).getCanonicalPath());
- } else {
- LOG.warn("Reach the MAX_ROUNDS: {} during global deletion, you may have too many files, " +
- "will delete the rest files in next interval.", MAX_ROUNDS);
- }
- break;
- }
- }
- return deletedFiles;
- }
-
- // Note that to avoid memory problem, we only return the first 1024 files in a directory
- public static List<File> getFilesForDir(File dir) throws IOException {
- List<File> files = new ArrayList<File>();
- final int MAX_NUM = 1024;
-
- try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir.toPath())) {
- for (Path path : stream) {
- files.add(path.toFile());
- if (files.size() >= MAX_NUM) {
- break;
- }
- }
- }
- return files;
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/daemon/JarTransformer.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/daemon/JarTransformer.java b/storm-core/src/jvm/backtype/storm/daemon/JarTransformer.java
deleted file mode 100644
index fc4e2af..0000000
--- a/storm-core/src/jvm/backtype/storm/daemon/JarTransformer.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.storm.daemon;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * A plugin that can be used to transform a jar file in nimbus before it
- * is used by a topology.
- */
-public interface JarTransformer {
- public void transform(InputStream input, OutputStream output) throws IOException;
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/daemon/Shutdownable.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/daemon/Shutdownable.java b/storm-core/src/jvm/backtype/storm/daemon/Shutdownable.java
deleted file mode 100644
index fe9e6c9..0000000
--- a/storm-core/src/jvm/backtype/storm/daemon/Shutdownable.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.daemon;
-
-public interface Shutdownable {
- public void shutdown();
-}
[45/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
deleted file mode 100644
index 2888258..0000000
--- a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ /dev/null
@@ -1,1272 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.daemon.supervisor
- (:import [java.io File IOException FileOutputStream])
- (:import [org.apache.storm.scheduler ISupervisor]
- [org.apache.storm.utils LocalState Time Utils]
- [org.apache.storm.daemon Shutdownable]
- [org.apache.storm Constants]
- [org.apache.storm.cluster ClusterStateContext DaemonType]
- [java.net JarURLConnection]
- [java.net URI]
- [org.apache.commons.io FileUtils])
- (:use [org.apache.storm config util log timer local-state])
- (:import [org.apache.storm.generated AuthorizationException KeyNotFoundException WorkerResources])
- (:import [org.apache.storm.utils NimbusLeaderNotFoundException VersionInfo])
- (:import [java.nio.file Files StandardCopyOption])
- (:import [org.apache.storm Config])
- (:import [org.apache.storm.generated WorkerResources ProfileAction StormTopology])
- (:import [org.apache.storm.localizer LocalResource])
- (:use [org.apache.storm.daemon common])
- (:require [org.apache.storm.command [healthcheck :as healthcheck]])
- (:require [org.apache.storm.daemon [worker :as worker]]
- [org.apache.storm [process-simulator :as psim] [cluster :as cluster] [event :as event]]
- [clojure.set :as set])
- (:import [org.apache.thrift.transport TTransportException])
- (:import [org.apache.zookeeper data.ACL ZooDefs$Ids ZooDefs$Perms])
- (:import [org.yaml.snakeyaml Yaml]
- [org.yaml.snakeyaml.constructor SafeConstructor])
- (:require [metrics.gauges :refer [defgauge]])
- (:require [metrics.meters :refer [defmeter mark!]])
- (:gen-class
- :methods [^{:static true} [launch [org.apache.storm.scheduler.ISupervisor] void]]))
-
-; declare to avoid triggering forward reference issue
-(declare rm-topo-files assigned-storm-ids-from-port-assignments)
-
-(defmeter supervisor:num-workers-launched)
-
-(defmulti download-storm-code cluster-mode)
-(defmulti launch-worker (fn [supervisor & _] (cluster-mode (:conf supervisor))))
-
-(def STORM-VERSION (VersionInfo/getVersion))
-
-(defprotocol SupervisorDaemon
- (get-id [this])
- (get-conf [this])
- (shutdown-all-workers [this])
- )
-
-(defn- assignments-snapshot [storm-cluster-state callback assignment-versions]
- (let [storm-ids (.assignments storm-cluster-state callback)]
- (let [new-assignments
- (->>
- (dofor [sid storm-ids]
- (let [recorded-version (:version (get assignment-versions sid))]
- (if-let [assignment-version (.assignment-version storm-cluster-state sid callback)]
- (if (= assignment-version recorded-version)
- {sid (get assignment-versions sid)}
- {sid (.assignment-info-with-version storm-cluster-state sid callback)})
- {sid nil})))
- (apply merge)
- (filter-val not-nil?))
- new-profiler-actions
- (->>
- (dofor [sid (distinct storm-ids)]
- (if-let [topo-profile-actions (.get-topology-profile-requests storm-cluster-state sid false)]
- {sid topo-profile-actions}))
- (apply merge))]
-
- {:assignments (into {} (for [[k v] new-assignments] [k (:data v)]))
- :profiler-actions new-profiler-actions
- :versions new-assignments})))
-
-(defn- read-my-executors [assignments-snapshot storm-id assignment-id]
- (let [assignment (get assignments-snapshot storm-id)
- my-slots-resources (into {}
- (filter (fn [[[node _] _]] (= node assignment-id))
- (:worker->resources assignment)))
- my-executors (filter (fn [[_ [node _]]] (= node assignment-id))
- (:executor->node+port assignment))
- port-executors (apply merge-with
- concat
- (for [[executor [_ port]] my-executors]
- {port [executor]}
- ))]
- (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 storm-id (doall executors) (get my-slots-resources [assignment-id port]))]
- ))))
-
-(defn- read-assignments
- "Returns map from port to struct containing :storm-id, :executors and :resources"
- ([assignments-snapshot assignment-id]
- (->> (dofor [sid (keys assignments-snapshot)] (read-my-executors assignments-snapshot sid assignment-id))
- (apply merge-with (fn [& ignored] (throw-runtime "Should not have multiple topologies assigned to one port")))))
- ([assignments-snapshot assignment-id existing-assignment retries]
- (try (let [assignments (read-assignments assignments-snapshot assignment-id)]
- (reset! retries 0)
- assignments)
- (catch RuntimeException e
- (if (> @retries 2) (throw e) (swap! retries inc))
- (log-warn (.getMessage e) ": retrying " @retries " of 3")
- existing-assignment))))
-
-(defn- read-storm-code-locations
- [assignments-snapshot]
- (map-val :master-code-dir assignments-snapshot))
-
-(defn- read-downloaded-storm-ids [conf]
- (map #(url-decode %) (read-dir-contents (supervisor-stormdist-root conf)))
- )
-
-(defn read-worker-heartbeat [conf id]
- (let [local-state (worker-state conf id)]
- (try
- (ls-worker-heartbeat local-state)
- (catch Exception e
- (log-warn e "Failed to read local heartbeat for workerId : " id ",Ignoring exception.")
- nil))))
-
-
-(defn my-worker-ids [conf]
- (read-dir-contents (worker-root conf)))
-
-(defn read-worker-heartbeats
- "Returns map from worker id to heartbeat"
- [conf]
- (let [ids (my-worker-ids conf)]
- (into {}
- (dofor [id ids]
- [id (read-worker-heartbeat conf id)]))
- ))
-
-
-(defn matches-an-assignment? [worker-heartbeat assigned-executors]
- (let [local-assignment (assigned-executors (:port worker-heartbeat))]
- (and local-assignment
- (= (:storm-id worker-heartbeat) (:storm-id local-assignment))
- (= (disj (set (:executors worker-heartbeat)) Constants/SYSTEM_EXECUTOR_ID)
- (set (:executors local-assignment))))))
-
-(let [dead-workers (atom #{})]
- (defn get-dead-workers []
- @dead-workers)
- (defn add-dead-worker [worker]
- (swap! dead-workers conj worker))
- (defn remove-dead-worker [worker]
- (swap! dead-workers disj worker)))
-
-(defn is-worker-hb-timed-out? [now hb conf]
- (> (- now (:time-secs hb))
- (conf SUPERVISOR-WORKER-TIMEOUT-SECS)))
-
-(defn read-allocated-workers
- "Returns map from worker id to worker heartbeat. if the heartbeat is nil, then the worker is dead (timed out or never wrote heartbeat)"
- [supervisor assigned-executors now]
- (let [conf (:conf supervisor)
- ^LocalState local-state (:local-state supervisor)
- id->heartbeat (read-worker-heartbeats conf)
- approved-ids (set (keys (ls-approved-workers local-state)))]
- (into
- {}
- (dofor [[id hb] id->heartbeat]
- (let [state (cond
- (not hb)
- :not-started
- (or (not (contains? approved-ids id))
- (not (matches-an-assignment? hb assigned-executors)))
- :disallowed
- (or
- (when (get (get-dead-workers) id)
- (log-message "Worker Process " id " has died!")
- true)
- (is-worker-hb-timed-out? now hb conf))
- :timed-out
- true
- :valid)]
- (log-debug "Worker " id " is " state ": " (pr-str hb) " at supervisor time-secs " now)
- [id [state hb]]
- ))
- )))
-
-(defn- wait-for-worker-launch [conf id start-time]
- (let [state (worker-state conf id)]
- (loop []
- (let [hb (ls-worker-heartbeat state)]
- (when (and
- (not hb)
- (<
- (- (current-time-secs) start-time)
- (conf SUPERVISOR-WORKER-START-TIMEOUT-SECS)
- ))
- (log-message id " still hasn't started")
- (Time/sleep 500)
- (recur)
- )))
- (when-not (ls-worker-heartbeat state)
- (log-message "Worker " id " failed to start")
- )))
-
-(defn- wait-for-workers-launch [conf ids]
- (let [start-time (current-time-secs)]
- (doseq [id ids]
- (wait-for-worker-launch conf id start-time))
- ))
-
-(defn generate-supervisor-id []
- (uuid))
-
-(defnk worker-launcher [conf user args :environment {} :log-prefix nil :exit-code-callback nil :directory nil]
- (let [_ (when (clojure.string/blank? user)
- (throw (java.lang.IllegalArgumentException.
- "User cannot be blank when calling worker-launcher.")))
- wl-initial (conf SUPERVISOR-WORKER-LAUNCHER)
- storm-home (System/getProperty "storm.home")
- wl (if wl-initial wl-initial (str storm-home "/bin/worker-launcher"))
- command (concat [wl user] args)]
- (log-message "Running as user:" user " command:" (pr-str command))
- (launch-process command :environment environment :log-prefix log-prefix :exit-code-callback exit-code-callback :directory directory)
- ))
-
-(defnk worker-launcher-and-wait [conf user args :environment {} :log-prefix nil]
- (let [process (worker-launcher conf user args :environment environment)]
- (if log-prefix
- (read-and-log-stream log-prefix (.getInputStream process)))
- (try
- (.waitFor process)
- (catch InterruptedException e
- (log-message log-prefix " interrupted.")))
- (.exitValue process)))
-
-(defn- rmr-as-user
- "Launches a process owned by the given user that deletes the given path
- recursively. Throws RuntimeException if the directory is not removed."
- [conf id path]
- (let [user (Utils/getFileOwner path)]
- (worker-launcher-and-wait conf
- user
- ["rmr" path]
- :log-prefix (str "rmr " id))
- (if (exists-file? path)
- (throw (RuntimeException. (str path " was not deleted"))))))
-
-(defn try-cleanup-worker [conf id]
- (try
- (if (.exists (File. (worker-root conf id)))
- (do
- (if (conf SUPERVISOR-RUN-WORKER-AS-USER)
- (rmr-as-user conf id (worker-root conf id))
- (do
- (rmr (worker-heartbeats-root conf id))
- ;; this avoids a race condition with worker or subprocess writing pid around same time
- (rmr (worker-pids-root conf id))
- (rmr (worker-root conf id))))
- (remove-worker-user! conf id)
- (remove-dead-worker id)
- ))
- (catch IOException e
- (log-warn-error e "Failed to cleanup worker " id ". Will retry later"))
- (catch RuntimeException e
- (log-warn-error e "Failed to cleanup worker " id ". Will retry later"))))
-
-(defn shutdown-worker [supervisor id]
- (log-message "Shutting down " (:supervisor-id supervisor) ":" id)
- (let [conf (:conf supervisor)
- pids (read-dir-contents (worker-pids-root conf id))
- thread-pid (@(:worker-thread-pids-atom supervisor) id)
- shutdown-sleep-secs (conf SUPERVISOR-WORKER-SHUTDOWN-SLEEP-SECS)
- as-user (conf SUPERVISOR-RUN-WORKER-AS-USER)
- user (get-worker-user conf id)]
- (when thread-pid
- (psim/kill-process thread-pid))
- (doseq [pid pids]
- (if as-user
- (worker-launcher-and-wait conf user ["signal" pid "15"] :log-prefix (str "kill -15 " pid))
- (kill-process-with-sig-term pid)))
- (when-not (empty? pids)
- (log-message "Sleep " shutdown-sleep-secs " seconds for execution of cleanup threads on worker.")
- (sleep-secs shutdown-sleep-secs))
- (doseq [pid pids]
- (if as-user
- (worker-launcher-and-wait conf user ["signal" pid "9"] :log-prefix (str "kill -9 " pid))
- (force-kill-process pid))
- (if as-user
- (try
- (rmr-as-user conf id (worker-pid-path conf id pid))
- (rmpath (worker-pid-path conf id pid))
- (rmpath (worker-tmp-root conf id pid))
- (catch Exception e
- (log-warn-error e "Failed to cleanup pid dir: " pid " for worker " id". Will retry later")))))
- ;; on windows, the supervisor may still holds the lock on the worker directory
- (try-cleanup-worker conf id))
- (log-message "Shut down " (:supervisor-id supervisor) ":" id))
-
-(def SUPERVISOR-ZK-ACLS
- [(first ZooDefs$Ids/CREATOR_ALL_ACL)
- (ACL. (bit-or ZooDefs$Perms/READ ZooDefs$Perms/CREATE) ZooDefs$Ids/ANYONE_ID_UNSAFE)])
-
-(defn supervisor-data [conf shared-context ^ISupervisor isupervisor]
- {:conf conf
- :shared-context shared-context
- :isupervisor isupervisor
- :active (atom true)
- :uptime (uptime-computer)
- :version STORM-VERSION
- :worker-thread-pids-atom (atom {})
- :storm-cluster-state (cluster/mk-storm-cluster-state conf :acls (when
- (Utils/isZkAuthenticationConfiguredStormServer
- conf)
- SUPERVISOR-ZK-ACLS)
- :context (ClusterStateContext. DaemonType/SUPERVISOR))
- :local-state (supervisor-state conf)
- :supervisor-id (.getSupervisorId isupervisor)
- :assignment-id (.getAssignmentId isupervisor)
- :my-hostname (hostname conf)
- :curr-assignment (atom nil) ;; used for reporting used ports when heartbeating
- :heartbeat-timer (mk-timer :kill-fn (fn [t]
- (log-error t "Error when processing event")
- (exit-process! 20 "Error when processing an event")
- ))
- :event-timer (mk-timer :kill-fn (fn [t]
- (log-error t "Error when processing event")
- (exit-process! 20 "Error when processing an event")
- ))
- :blob-update-timer (mk-timer :kill-fn (defn blob-update-timer
- [t]
- (log-error t "Error when processing event")
- (exit-process! 20 "Error when processing a event"))
- :timer-name "blob-update-timer")
- :localizer (Utils/createLocalizer conf (supervisor-local-dir conf))
- :assignment-versions (atom {})
- :sync-retry (atom 0)
- :download-lock (Object.)
- :stormid->profiler-actions (atom {})
- })
-
-(defn required-topo-files-exist?
- [conf storm-id]
- (let [stormroot (supervisor-stormdist-root conf storm-id)
- stormjarpath (supervisor-stormjar-path stormroot)
- stormcodepath (supervisor-stormcode-path stormroot)
- stormconfpath (supervisor-stormconf-path stormroot)]
- (and (every? exists-file? [stormroot stormconfpath stormcodepath])
- (or (local-mode? conf)
- (exists-file? stormjarpath)))))
-
-(defn get-worker-assignment-helper-msg
- [assignment supervisor port id]
- (str (pr-str assignment) " for this supervisor " (:supervisor-id supervisor) " on port "
- port " with id " id))
-
-(defn get-valid-new-worker-ids
- [conf supervisor reassign-executors new-worker-ids]
- (into {}
- (remove nil?
- (dofor [[port assignment] reassign-executors]
- (let [id (new-worker-ids port)
- storm-id (:storm-id assignment)
- ^WorkerResources resources (:resources assignment)
- mem-onheap (.get_mem_on_heap resources)]
- ;; This condition checks for required files exist before launching the worker
- (if (required-topo-files-exist? conf storm-id)
- (do
- (log-message "Launching worker with assignment "
- (get-worker-assignment-helper-msg assignment supervisor port id))
- (local-mkdirs (worker-pids-root conf id))
- (local-mkdirs (worker-tmp-root conf id))
- (local-mkdirs (worker-heartbeats-root conf id))
- (launch-worker supervisor
- (:storm-id assignment)
- port
- id
- mem-onheap)
- [id port])
- (do
- (log-message "Missing topology storm code, so can't launch worker with assignment "
- (get-worker-assignment-helper-msg assignment supervisor port id))
- nil)))))))
-
-(defn sync-processes [supervisor]
- (let [conf (:conf supervisor)
- ^LocalState local-state (:local-state supervisor)
- assigned-executors (defaulted (ls-local-assignments local-state) {})
- assigned-storm-ids (assigned-storm-ids-from-port-assignments assigned-executors)
- localizer (:localizer supervisor)
- now (current-time-secs)
- allocated (read-allocated-workers supervisor assigned-executors now)
- keepers (filter-val
- (fn [[state _]] (= state :valid))
- allocated)
- keep-ports (set (for [[id [_ hb]] keepers] (:port hb)))
- reassign-executors (select-keys-pred (complement keep-ports) assigned-executors)
- new-worker-ids (into
- {}
- (for [port (keys reassign-executors)]
- [port (uuid)]))
- all-downloaded-storm-ids (set (read-downloaded-storm-ids conf))]
- ;; 1. to kill are those in allocated that are dead or disallowed
- ;; 2. kill the ones that should be dead
- ;; - read pids, kill -9 and individually remove file
- ;; - rmr heartbeat dir, rmdir pid dir, rmdir id dir (catch exception and log)
- ;; 3. remove any downloaded code that's no longer assigned to this supervisor
- ;; 4. of the rest, figure out what assignments aren't yet satisfied
- ;; 5. generate new worker ids, write new "approved workers" to LS
- ;; 6. create local dir for worker id
- ;; 7. launch new workers (give worker-id, port, and supervisor-id)
- ;; 8. wait for workers launch
- ;; Note: sync-processes runs based on local assignment, and avoid reading zk assignment.
- ;; It's due to race condition between sync-supervisor and sync-processes.
-
- (log-debug "Syncing processes")
- (log-debug "Assigned executors: " assigned-executors)
- (log-debug "Allocated: " allocated)
- (doseq [[id [state heartbeat]] allocated]
- (when (not= :valid state)
- (log-message
- "Shutting down and clearing state for id " id
- ". Current supervisor time: " now
- ". State: " state
- ", Heartbeat: " (pr-str heartbeat))
- (shutdown-worker supervisor id)))
-
- (doseq [storm-id all-downloaded-storm-ids]
- (when-not (assigned-storm-ids storm-id)
- (log-message "Removing code for storm id "
- storm-id)
- (rm-topo-files conf storm-id localizer true)))
-
- (let [valid-new-worker-ids (get-valid-new-worker-ids conf supervisor reassign-executors new-worker-ids)]
- (ls-approved-workers! local-state
- (merge
- (select-keys (ls-approved-workers local-state)
- (keys keepers))
- valid-new-worker-ids))
- (wait-for-workers-launch conf (keys valid-new-worker-ids)))))
-
-(defn assigned-storm-ids-from-port-assignments [assignment]
- (->> assignment
- vals
- (map :storm-id)
- set))
-
-(defn get-blob-localname
- "Given the blob information either gets the localname field if it exists,
- else routines the default value passed in."
- [blob-info defaultValue]
- (or (get blob-info "localname") defaultValue))
-
-(defn should-uncompress-blob?
- "Given the blob information returns the value of the uncompress field, handling it either being
- a string or a boolean value, or if it's not specified then returns false"
- [blob-info]
- (Boolean. (get blob-info "uncompress")))
-
-(defn remove-blob-references
- "Remove a reference to a blob when its no longer needed."
- [localizer storm-id conf]
- (let [storm-conf (read-supervisor-storm-conf conf storm-id)
- blobstore-map (storm-conf TOPOLOGY-BLOBSTORE-MAP)
- user (storm-conf TOPOLOGY-SUBMITTER-USER)
- topo-name (storm-conf TOPOLOGY-NAME)]
- (if blobstore-map
- (doseq [[k, v] blobstore-map]
- (.removeBlobReference localizer
- k
- user
- topo-name
- (should-uncompress-blob? v))))))
-
-(defn blobstore-map-to-localresources
- "Returns a list of LocalResources based on the blobstore-map passed in."
- [blobstore-map]
- (if blobstore-map
- (for [[k, v] blobstore-map] (LocalResource. k (should-uncompress-blob? v)))
- ()))
-
-(defn add-blob-references
- "For each of the downloaded topologies, adds references to the blobs that the topologies are
- using. This is used to reconstruct the cache on restart."
- [localizer storm-id conf]
- (let [storm-conf (read-supervisor-storm-conf conf storm-id)
- blobstore-map (storm-conf TOPOLOGY-BLOBSTORE-MAP)
- user (storm-conf TOPOLOGY-SUBMITTER-USER)
- topo-name (storm-conf TOPOLOGY-NAME)
- localresources (blobstore-map-to-localresources blobstore-map)]
- (if blobstore-map
- (.addReferences localizer localresources user topo-name))))
-
-(defn rm-topo-files
- [conf storm-id localizer rm-blob-refs?]
- (let [path (supervisor-stormdist-root conf storm-id)]
- (try
- (if rm-blob-refs?
- (remove-blob-references localizer storm-id conf))
- (if (conf SUPERVISOR-RUN-WORKER-AS-USER)
- (rmr-as-user conf storm-id path)
- (rmr (supervisor-stormdist-root conf storm-id)))
- (catch Exception e
- (log-message e (str "Exception removing: " storm-id))))))
-
-(defn verify-downloaded-files
- "Check for the files exists to avoid supervisor crashing
- Also makes sure there is no necessity for locking"
- [conf localizer assigned-storm-ids all-downloaded-storm-ids]
- (remove nil?
- (into #{}
- (for [storm-id all-downloaded-storm-ids
- :when (contains? assigned-storm-ids storm-id)]
- (when-not (required-topo-files-exist? conf storm-id)
- (log-debug "Files not present in topology directory")
- (rm-topo-files conf storm-id localizer false)
- storm-id)))))
-
-(defn mk-synchronize-supervisor [supervisor sync-processes event-manager processes-event-manager]
- (fn this []
- (let [conf (:conf supervisor)
- storm-cluster-state (:storm-cluster-state supervisor)
- ^ISupervisor isupervisor (:isupervisor supervisor)
- ^LocalState local-state (:local-state supervisor)
- sync-callback (fn [& ignored] (.add event-manager this))
- assignment-versions @(:assignment-versions supervisor)
- {assignments-snapshot :assignments
- storm-id->profiler-actions :profiler-actions
- versions :versions}
- (assignments-snapshot storm-cluster-state sync-callback assignment-versions)
- storm-code-map (read-storm-code-locations assignments-snapshot)
- all-downloaded-storm-ids (set (read-downloaded-storm-ids conf))
- existing-assignment (ls-local-assignments local-state)
- all-assignment (read-assignments assignments-snapshot
- (:assignment-id supervisor)
- existing-assignment
- (:sync-retry supervisor))
- new-assignment (->> all-assignment
- (filter-key #(.confirmAssigned isupervisor %)))
- assigned-storm-ids (assigned-storm-ids-from-port-assignments new-assignment)
- localizer (:localizer supervisor)
- checked-downloaded-storm-ids (set (verify-downloaded-files conf localizer assigned-storm-ids all-downloaded-storm-ids))
- downloaded-storm-ids (set/difference all-downloaded-storm-ids checked-downloaded-storm-ids)]
-
- ;; 1. download assigned topology code if it's not downloaded
- ;; 2. write new assignment to local assignment, and atom variables
- ;; 3. trigger sync-processes to take care of the rest
- ;; Note: mk-synchronize-supervisor runs based on zk assignment, and avoids touching local state
- ;; except updating new assignment which sync-processes will refer.
- ;; It's due to race condition between sync-supervisor and sync-processes.
-
- (log-debug "Synchronizing supervisor")
- (log-debug "Storm code map: " storm-code-map)
- (log-debug "All assignment: " all-assignment)
- (log-debug "New assignment: " new-assignment)
- (log-debug "Assigned Storm Ids " assigned-storm-ids)
- (log-debug "All Downloaded Ids " all-downloaded-storm-ids)
- (log-debug "Checked Downloaded Ids " checked-downloaded-storm-ids)
- (log-debug "Downloaded Ids " downloaded-storm-ids)
- (log-debug "Storm Ids Profiler Actions " storm-id->profiler-actions)
- ;; download code first
- ;; This might take awhile
- ;; - should this be done separately from usual monitoring?
- ;; should we only download when topology is assigned to this supervisor?
- (doseq [[storm-id master-code-dir] storm-code-map]
- (when (and (not (downloaded-storm-ids storm-id))
- (assigned-storm-ids storm-id))
- (log-message "Downloading code for storm id " storm-id)
- (try-cause
- (download-storm-code conf storm-id master-code-dir localizer)
-
- (catch NimbusLeaderNotFoundException e
- (log-warn-error e "Nimbus leader was not available."))
- (catch TTransportException e
- (log-warn-error e "There was a connection problem with nimbus.")))
- (log-message "Finished downloading code for storm id " storm-id)))
-
- (log-debug "Writing new assignment "
- (pr-str new-assignment))
- (doseq [p (set/difference (set (keys existing-assignment))
- (set (keys new-assignment)))]
- (.killedWorker isupervisor (int p)))
- (.assigned isupervisor (keys new-assignment))
- (ls-local-assignments! local-state
- new-assignment)
- (reset! (:assignment-versions supervisor) versions)
- (reset! (:stormid->profiler-actions supervisor) storm-id->profiler-actions)
- (reset! (:curr-assignment supervisor) new-assignment)
-
- (.add processes-event-manager sync-processes))))
-
-(defn mk-supervisor-capacities
- [conf]
- {Config/SUPERVISOR_MEMORY_CAPACITY_MB (double (conf SUPERVISOR-MEMORY-CAPACITY-MB))
- Config/SUPERVISOR_CPU_CAPACITY (double (conf SUPERVISOR-CPU-CAPACITY))})
-
-(defn update-blobs-for-topology!
- "Update each blob listed in the topology configuration if the latest version of the blob
- has not been downloaded."
- [conf storm-id localizer]
- (let [storm-conf (read-supervisor-storm-conf conf storm-id)
- blobstore-map (storm-conf TOPOLOGY-BLOBSTORE-MAP)
- user (storm-conf TOPOLOGY-SUBMITTER-USER)
- localresources (blobstore-map-to-localresources blobstore-map)]
- (try
- (.updateBlobs localizer localresources user)
- (catch AuthorizationException authExp
- (log-error authExp))
- (catch KeyNotFoundException knf
- (log-error knf)))))
-
-(defn update-blobs-for-all-topologies-fn
- "Returns a function that downloads all blobs listed in the topology configuration for all topologies assigned
- to this supervisor, and creates version files with a suffix. The returned function is intended to be run periodically
- by a timer, created elsewhere."
- [supervisor]
- (fn []
- (try-cause
- (let [conf (:conf supervisor)
- downloaded-storm-ids (set (read-downloaded-storm-ids conf))
- new-assignment @(:curr-assignment supervisor)
- assigned-storm-ids (assigned-storm-ids-from-port-assignments new-assignment)]
- (doseq [topology-id downloaded-storm-ids]
- (let [storm-root (supervisor-stormdist-root conf topology-id)]
- (when (assigned-storm-ids topology-id)
- (log-debug "Checking Blob updates for storm topology id " topology-id " With target_dir: " storm-root)
- (update-blobs-for-topology! conf topology-id (:localizer supervisor))))))
- (catch TTransportException e
- (log-error
- e
- "Network error while updating blobs, will retry again later"))
- (catch NimbusLeaderNotFoundException e
- (log-error
- e
- "Nimbus unavailable to update blobs, will retry again later")))))
-
-(defn jvm-cmd [cmd]
- (let [java-home (.get (System/getenv) "JAVA_HOME")]
- (if (nil? java-home)
- cmd
- (str java-home file-path-separator "bin" file-path-separator cmd))))
-
-(defn java-cmd []
- (jvm-cmd "java"))
-
-(defn jmap-dump-cmd [profile-cmd pid target-dir]
- [profile-cmd pid "jmap" target-dir])
-
-(defn jstack-dump-cmd [profile-cmd pid target-dir]
- [profile-cmd pid "jstack" target-dir])
-
-(defn jprofile-start [profile-cmd pid]
- [profile-cmd pid "start"])
-
-(defn jprofile-stop [profile-cmd pid target-dir]
- [profile-cmd pid "stop" target-dir])
-
-(defn jprofile-dump [profile-cmd pid workers-artifacts-directory]
- [profile-cmd pid "dump" workers-artifacts-directory])
-
-(defn jprofile-jvm-restart [profile-cmd pid]
- [profile-cmd pid "kill"])
-
-(defn- delete-topology-profiler-action [storm-cluster-state storm-id profile-action]
- (log-message "Deleting profiler action.." profile-action)
- (.delete-topology-profile-requests storm-cluster-state storm-id profile-action))
-
-(defnk launch-profiler-action-for-worker
- "Launch profiler action for a worker"
- [conf user target-dir command :environment {} :exit-code-on-profile-action nil :log-prefix nil]
- (if-let [run-worker-as-user (conf SUPERVISOR-RUN-WORKER-AS-USER)]
- (let [container-file (container-file-path target-dir)
- script-file (script-file-path target-dir)]
- (log-message "Running as user:" user " command:" (shell-cmd command))
- (if (exists-file? container-file) (rmr-as-user conf container-file container-file))
- (if (exists-file? script-file) (rmr-as-user conf script-file script-file))
- (worker-launcher
- conf
- user
- ["profiler" target-dir (write-script target-dir command :environment environment)]
- :log-prefix log-prefix
- :exit-code-callback exit-code-on-profile-action
- :directory (File. target-dir)))
- (launch-process
- command
- :environment environment
- :log-prefix log-prefix
- :exit-code-callback exit-code-on-profile-action
- :directory (File. target-dir))))
-
-(defn mk-run-profiler-actions-for-all-topologies
- "Returns a function that downloads all profile-actions listed for all topologies assigned
- to this supervisor, executes those actions as user and deletes them from zookeeper."
- [supervisor]
- (fn []
- (try
- (let [conf (:conf supervisor)
- stormid->profiler-actions @(:stormid->profiler-actions supervisor)
- storm-cluster-state (:storm-cluster-state supervisor)
- hostname (:my-hostname supervisor)
- storm-home (System/getProperty "storm.home")
- profile-cmd (str (clojure.java.io/file storm-home
- "bin"
- (conf WORKER-PROFILER-COMMAND)))]
- (doseq [[storm-id profiler-actions] stormid->profiler-actions]
- (when (not (empty? profiler-actions))
- (doseq [pro-action profiler-actions]
- (if (= hostname (:host pro-action))
- (let [port (:port pro-action)
- action ^ProfileAction (:action pro-action)
- stop? (> (System/currentTimeMillis) (:timestamp pro-action))
- target-dir (worker-artifacts-root conf storm-id port)
- storm-conf (read-supervisor-storm-conf conf storm-id)
- user (storm-conf TOPOLOGY-SUBMITTER-USER)
- environment (if-let [env (storm-conf TOPOLOGY-ENVIRONMENT)] env {})
- worker-pid (slurp (worker-artifacts-pid-path conf storm-id port))
- log-prefix (str "ProfilerAction process " storm-id ":" port " PROFILER_ACTION: " action " ")
- ;; Until PROFILER_STOP action is invalid, keep launching profiler start in case worker restarted
- ;; The profiler plugin script validates if JVM is recording before starting another recording.
- command (cond
- (= action ProfileAction/JMAP_DUMP) (jmap-dump-cmd profile-cmd worker-pid target-dir)
- (= action ProfileAction/JSTACK_DUMP) (jstack-dump-cmd profile-cmd worker-pid target-dir)
- (= action ProfileAction/JPROFILE_DUMP) (jprofile-dump profile-cmd worker-pid target-dir)
- (= action ProfileAction/JVM_RESTART) (jprofile-jvm-restart profile-cmd worker-pid)
- (and (not stop?)
- (= action ProfileAction/JPROFILE_STOP))
- (jprofile-start profile-cmd worker-pid) ;; Ensure the profiler is still running
- (and stop? (= action ProfileAction/JPROFILE_STOP)) (jprofile-stop profile-cmd worker-pid target-dir))
- action-on-exit (fn [exit-code]
- (log-message log-prefix " profile-action exited for code: " exit-code)
- (if stop?
- (delete-topology-profiler-action storm-cluster-state storm-id pro-action)))
- command (->> command (map str) (filter (complement empty?)))]
-
- (try
- (launch-profiler-action-for-worker conf
- user
- target-dir
- command
- :environment environment
- :exit-code-on-profile-action action-on-exit
- :log-prefix log-prefix)
- (catch IOException ioe
- (log-error ioe
- (str "Error in processing ProfilerAction '" action "' for " storm-id ":" port ", will retry later.")))
- (catch RuntimeException rte
- (log-error rte
- (str "Error in processing ProfilerAction '" action "' for " storm-id ":" port ", will retry later."))))))))))
- (catch Exception e
- (log-error e "Error running profiler actions, will retry again later")))))
-
-;; in local state, supervisor stores who its current assignments are
-;; another thread launches events to restart any dead processes if necessary
-(defserverfn mk-supervisor [conf shared-context ^ISupervisor isupervisor]
- (log-message "Starting Supervisor with conf " conf)
- (.prepare isupervisor conf (supervisor-isupervisor-dir conf))
- (FileUtils/cleanDirectory (File. (supervisor-tmp-dir conf)))
- (let [supervisor (supervisor-data conf shared-context isupervisor)
- [event-manager processes-event-manager :as managers] [(event/event-manager false) (event/event-manager false)]
- sync-processes (partial sync-processes supervisor)
- synchronize-supervisor (mk-synchronize-supervisor supervisor sync-processes event-manager processes-event-manager)
- synchronize-blobs-fn (update-blobs-for-all-topologies-fn supervisor)
- downloaded-storm-ids (set (read-downloaded-storm-ids conf))
- run-profiler-actions-fn (mk-run-profiler-actions-for-all-topologies supervisor)
- heartbeat-fn (fn [] (.supervisor-heartbeat!
- (:storm-cluster-state supervisor)
- (:supervisor-id supervisor)
- (->SupervisorInfo (current-time-secs)
- (:my-hostname supervisor)
- (:assignment-id supervisor)
- (keys @(:curr-assignment supervisor))
- ;; used ports
- (.getMetadata isupervisor)
- (conf SUPERVISOR-SCHEDULER-META)
- ((:uptime supervisor))
- (:version supervisor)
- (mk-supervisor-capacities conf))))]
- (heartbeat-fn)
-
- ;; should synchronize supervisor so it doesn't launch anything after being down (optimization)
- (schedule-recurring (:heartbeat-timer supervisor)
- 0
- (conf SUPERVISOR-HEARTBEAT-FREQUENCY-SECS)
- heartbeat-fn)
- (doseq [storm-id downloaded-storm-ids]
- (add-blob-references (:localizer supervisor) storm-id
- conf))
- ;; do this after adding the references so we don't try to clean things being used
- (.startCleaner (:localizer supervisor))
-
- (when (conf SUPERVISOR-ENABLE)
- ;; This isn't strictly necessary, but it doesn't hurt and ensures that the machine stays up
- ;; to date even if callbacks don't all work exactly right
- (schedule-recurring (:event-timer supervisor) 0 10 (fn [] (.add event-manager synchronize-supervisor)))
- (schedule-recurring (:event-timer supervisor)
- 0
- (conf SUPERVISOR-MONITOR-FREQUENCY-SECS)
- (fn [] (.add processes-event-manager sync-processes)))
-
- ;; Blob update thread. Starts with 30 seconds delay, every 30 seconds
- (schedule-recurring (:blob-update-timer supervisor)
- 30
- 30
- (fn [] (.add event-manager synchronize-blobs-fn)))
-
- (schedule-recurring (:event-timer supervisor)
- (* 60 5)
- (* 60 5)
- (fn [] (let [health-code (healthcheck/health-check conf)
- ids (my-worker-ids conf)]
- (if (not (= health-code 0))
- (do
- (doseq [id ids]
- (shutdown-worker supervisor id))
- (throw (RuntimeException. "Supervisor failed health check. Exiting.")))))))
-
- ;; Launch a thread that Runs profiler commands . Starts with 30 seconds delay, every 30 seconds
- (schedule-recurring (:event-timer supervisor)
- 30
- 30
- (fn [] (.add event-manager run-profiler-actions-fn))))
- (log-message "Starting supervisor with id " (:supervisor-id supervisor) " at host " (:my-hostname supervisor))
- (reify
- Shutdownable
- (shutdown [this]
- (log-message "Shutting down supervisor " (:supervisor-id supervisor))
- (reset! (:active supervisor) false)
- (cancel-timer (:heartbeat-timer supervisor))
- (cancel-timer (:event-timer supervisor))
- (cancel-timer (:blob-update-timer supervisor))
- (.shutdown event-manager)
- (.shutdown processes-event-manager)
- (.shutdown (:localizer supervisor))
- (.disconnect (:storm-cluster-state supervisor)))
- SupervisorDaemon
- (get-conf [this]
- conf)
- (get-id [this]
- (:supervisor-id supervisor))
- (shutdown-all-workers [this]
- (let [ids (my-worker-ids conf)]
- (doseq [id ids]
- (shutdown-worker supervisor id)
- )))
- DaemonCommon
- (waiting? [this]
- (or (not @(:active supervisor))
- (and
- (timer-waiting? (:heartbeat-timer supervisor))
- (timer-waiting? (:event-timer supervisor))
- (every? (memfn waiting?) managers)))
- ))))
-
-(defn kill-supervisor [supervisor]
- (.shutdown supervisor)
- )
-
-(defn setup-storm-code-dir
- [conf storm-conf dir]
- (if (conf SUPERVISOR-RUN-WORKER-AS-USER)
- (worker-launcher-and-wait conf (storm-conf TOPOLOGY-SUBMITTER-USER) ["code-dir" dir] :log-prefix (str "setup conf for " dir))))
-
-(defn setup-blob-permission
- [conf storm-conf path]
- (if (conf SUPERVISOR-RUN-WORKER-AS-USER)
- (worker-launcher-and-wait conf (storm-conf TOPOLOGY-SUBMITTER-USER) ["blob" path] :log-prefix (str "setup blob permissions for " path))))
-
-(defn download-blobs-for-topology!
- "Download all blobs passed by parameters for a given topology."
- [conf storm-conf localizer tmproot blobs fn-local-resources fn-symlink-name]
- (let [
- user (storm-conf TOPOLOGY-SUBMITTER-USER)
- topo-name (storm-conf TOPOLOGY-NAME)
- user-dir (.getLocalUserFileCacheDir localizer user)
- localresources (fn-local-resources blobs)]
- (when localresources
- (when-not (.exists user-dir)
- (FileUtils/forceMkdir user-dir))
- (try
- (let [localized-resources (.getBlobs localizer localresources user topo-name user-dir)]
- (setup-blob-permission conf storm-conf (.toString user-dir))
- (doseq [local-rsrc localized-resources]
- (let [rsrc-file-path (File. (.getFilePath local-rsrc))
- key-name (.getName rsrc-file-path)
- blob-symlink-target-name (.getName (File. (.getCurrentSymlinkPath local-rsrc)))
- symlink-name (fn-symlink-name blobs key-name)]
- (create-symlink! tmproot (.getParent rsrc-file-path) symlink-name
- blob-symlink-target-name))))
- (catch AuthorizationException authExp
- (log-error authExp))
- (catch KeyNotFoundException knf
- (log-error knf))))))
-
-(defn download-blobs-in-blobstore-map-for-topology!
- "Download all blobs listed in the topology configuration for a given topology."
- [conf stormconf-path localizer tmproot]
- (let [storm-conf (read-supervisor-storm-conf-given-path conf stormconf-path)
- blobstore-map (storm-conf TOPOLOGY-BLOBSTORE-MAP)]
- (download-blobs-for-topology! conf storm-conf localizer tmproot blobstore-map
- (fn [blobs] (blobstore-map-to-localresources blobs))
- (fn [blobs key-name] (get-blob-localname (get blobs key-name) key-name)))))
-
-(defn download-dependencies-for-topology!
- "Download all dependencies blobs listed in the topology configuration for a given topology."
- [conf stormconf-path stormcode-path localizer tmproot]
- (let [storm-conf (read-supervisor-storm-conf-given-path conf stormconf-path)
- storm-code (read-supervisor-storm-code-given-path stormcode-path)
- dependencies (concat (.get_dependency_jars ^StormTopology storm-code)
- (.get_dependency_artifacts ^StormTopology storm-code))]
- (download-blobs-for-topology! conf storm-conf localizer tmproot dependencies
- (fn [blobs] (map #(LocalResource. % false) blobs))
- (fn [_ key-name] key-name))))
-
-(defn get-blob-file-names
- [blobstore-map]
- (if blobstore-map
- (for [[k, data] blobstore-map]
- (get-blob-localname data k))))
-
-(defn download-blobs-for-topology-succeed?
- "Assert if all blobs are downloaded for the given topology"
- [target-dir file-names]
- (if-not (empty? file-names)
- (every? #(Utils/checkFileExists target-dir %) file-names)
- true))
-
-(defn download-blobs-in-blobstore-map-for-topology-succeed?
- "Assert if all blobs in blobstore map are downloaded for the given topology"
- [stormconf-path target-dir]
- (let [storm-conf (clojurify-structure (Utils/fromCompressedJsonConf (FileUtils/readFileToByteArray (File. stormconf-path))))
- blobstore-map (storm-conf TOPOLOGY-BLOBSTORE-MAP)
- file-names (get-blob-file-names blobstore-map)]
- (download-blobs-for-topology-succeed? target-dir file-names)))
-
-(defn download-dependencies-for-topology-succeed?
- "Assert if all dependencies blobs are downloaded for the given topology"
- [stormcode-path target-dir]
- (let [storm-code (read-supervisor-storm-code-given-path stormcode-path)
- file-names (concat (.get_dependency_jars ^StormTopology storm-code)
- (.get_dependency_artifacts ^StormTopology storm-code))]
- (download-blobs-for-topology-succeed? target-dir file-names)))
-
-;; distributed implementation
-(defmethod download-storm-code
- :distributed [conf storm-id master-code-dir localizer]
- ;; Downloading to permanent location is atomic
- (let [tmproot (str (supervisor-tmp-dir conf) file-path-separator (uuid))
- stormroot (supervisor-stormdist-root conf storm-id)
- blobstore (Utils/getClientBlobStoreForSupervisor conf)]
- (FileUtils/forceMkdir (File. tmproot))
- (if-not on-windows?
- (Utils/restrictPermissions tmproot)
- (if (conf SUPERVISOR-RUN-WORKER-AS-USER)
- (throw-runtime (str "ERROR: Windows doesn't implement setting the correct permissions"))))
- (Utils/downloadResourcesAsSupervisor (master-stormjar-key storm-id)
- (supervisor-stormjar-path tmproot) blobstore)
- (Utils/downloadResourcesAsSupervisor (master-stormcode-key storm-id)
- (supervisor-stormcode-path tmproot) blobstore)
- (Utils/downloadResourcesAsSupervisor (master-stormconf-key storm-id)
- (supervisor-stormconf-path tmproot) blobstore)
- (.shutdown blobstore)
- (extract-dir-from-jar (supervisor-stormjar-path tmproot) RESOURCES-SUBDIR tmproot)
- (download-blobs-in-blobstore-map-for-topology! conf (supervisor-stormconf-path tmproot) localizer
- tmproot)
- (download-dependencies-for-topology! conf (supervisor-stormconf-path tmproot) (supervisor-stormcode-path tmproot) localizer tmproot)
- (if (and (download-blobs-in-blobstore-map-for-topology-succeed? (supervisor-stormconf-path tmproot) tmproot)
- (download-dependencies-for-topology-succeed? (supervisor-stormcode-path tmproot) tmproot))
- (do
- (log-message "Successfully downloaded blob resources for storm-id " storm-id)
- (if on-windows?
- ; Files/move with non-empty directory doesn't work well on Windows
- (FileUtils/moveDirectory (File. tmproot) (File. stormroot))
- (do
- (FileUtils/forceMkdir (File. stormroot))
- (Files/move (.toPath (File. tmproot)) (.toPath (File. stormroot))
- (doto (make-array StandardCopyOption 1) (aset 0 StandardCopyOption/ATOMIC_MOVE)))))
- (setup-storm-code-dir conf (read-supervisor-storm-conf conf storm-id) stormroot))
- (do
- (log-message "Failed to download blob resources for storm-id " storm-id)
- (rmr tmproot)))))
-
-(defn write-log-metadata-to-yaml-file! [storm-id port data conf]
- (let [file (get-log-metadata-file conf storm-id port)]
- ;;run worker as user needs the directory to have special permissions
- ;; or it is insecure
- (when (not (.exists (.getParentFile file)))
- (if (conf SUPERVISOR-RUN-WORKER-AS-USER)
- (do (FileUtils/forceMkdir (.getParentFile file))
- (setup-storm-code-dir conf (read-supervisor-storm-conf conf storm-id) (.getCanonicalPath (.getParentFile file))))
- (.mkdirs (.getParentFile file))))
- (let [writer (java.io.FileWriter. file)
- yaml (Yaml.)]
- (try
- (.dump yaml data writer)
- (finally
- (.close writer))))))
-
-(defn write-log-metadata! [storm-conf user worker-id storm-id port conf]
- (let [data {TOPOLOGY-SUBMITTER-USER user
- "worker-id" worker-id
- LOGS-GROUPS (sort (distinct (remove nil?
- (concat
- (storm-conf LOGS-GROUPS)
- (storm-conf TOPOLOGY-GROUPS)))))
- LOGS-USERS (sort (distinct (remove nil?
- (concat
- (storm-conf LOGS-USERS)
- (storm-conf TOPOLOGY-USERS)))))}]
- (write-log-metadata-to-yaml-file! storm-id port data conf)))
-
-(defn jlp [stormroot conf]
- (let [resource-root (str stormroot File/separator RESOURCES-SUBDIR)
- os (clojure.string/replace (System/getProperty "os.name") #"\s+" "_")
- arch (System/getProperty "os.arch")
- arch-resource-root (str resource-root File/separator os "-" arch)]
- (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, 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)
- "%HEAP-MEM%" (str mem-onheap)}
- sub-fn #(reduce (fn [string entry]
- (apply clojure.string/replace string entry))
- %
- replacement-map)]
- (cond
- (nil? value) nil
- (sequential? value) (vec (map sub-fn value))
- :else (-> value sub-fn (clojure.string/split #"\s+")))))
-
-
-(defn create-blobstore-links
- "Create symlinks in worker launch directory for all blobs"
- [conf storm-id worker-id]
- (let [stormroot (supervisor-stormdist-root conf storm-id)
- storm-conf (read-supervisor-storm-conf conf storm-id)
- workerroot (worker-root conf worker-id)
- blobstore-map (storm-conf TOPOLOGY-BLOBSTORE-MAP)
- blob-file-names (get-blob-file-names blobstore-map)
- resource-file-names (cons RESOURCES-SUBDIR blob-file-names)]
- (log-message "Creating symlinks for worker-id: " worker-id " storm-id: "
- storm-id " for files(" (count resource-file-names) "): " (pr-str resource-file-names))
- (create-symlink! workerroot stormroot RESOURCES-SUBDIR)
- (doseq [file-name blob-file-names]
- (create-symlink! workerroot stormroot file-name file-name))))
-
-(defn create-artifacts-link
- "Create a symlink from workder directory to its port artifacts directory"
- [conf storm-id port worker-id]
- (let [worker-dir (worker-root conf worker-id)
- topo-dir (worker-artifacts-root conf storm-id)]
- (log-message "Creating symlinks for worker-id: " worker-id " storm-id: "
- storm-id " to its port artifacts directory")
- (if (.exists (File. worker-dir))
- (create-symlink! worker-dir topo-dir "artifacts" port))))
-
-(defmethod launch-worker
- :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")
- storm-options (System/getProperty "storm.options")
- storm-conf-file (System/getProperty "storm.conf.file")
- worker-tmp-dir (worker-tmp-root conf worker-id)
- storm-log-dir LOG-DIR
- storm-log-conf-dir (conf STORM-LOG4J2-CONF-DIR)
- storm-log4j2-conf-dir (if storm-log-conf-dir
- (if (is-absolute-path? storm-log-conf-dir)
- storm-log-conf-dir
- (str storm-home file-path-separator storm-log-conf-dir))
- (str storm-home file-path-separator "log4j2"))
- stormroot (supervisor-stormdist-root conf storm-id)
- jlp (jlp stormroot conf)
- stormjar (supervisor-stormjar-path stormroot)
- storm-topology (read-supervisor-topology conf storm-id)
- dependencies (concat (.get_dependency_jars ^StormTopology storm-topology)
- (.get_dependency_artifacts ^StormTopology storm-topology))
- dependency-locations (map #(File. stormroot %) dependencies)
- storm-conf (read-supervisor-storm-conf conf storm-id)
- topo-classpath (if-let [cp (storm-conf TOPOLOGY-CLASSPATH)]
- [cp]
- [])
- classpath (-> (worker-classpath)
- (add-to-classpath [stormjar])
- (add-to-classpath dependency-locations)
- (add-to-classpath topo-classpath))
- top-gc-opts (storm-conf TOPOLOGY-WORKER-GC-CHILDOPTS)
- 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)
- logfilename "worker.log"
- workers-artifacts (worker-artifacts-root conf)
- logging-sensitivity (storm-conf TOPOLOGY-LOGGING-SENSITIVITY "S3")
- worker-childopts (when-let [s (conf WORKER-CHILDOPTS)]
- (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 mem-onheap))
- worker--profiler-childopts (if (conf WORKER-PROFILER-ENABLED)
- (substitute-childopts (conf WORKER-PROFILER-CHILDOPTS) 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})
-
- log4j-configuration-file (str (if (.startsWith (System/getProperty "os.name") "Windows")
- (if (.startsWith storm-log4j2-conf-dir "file:")
- storm-log4j2-conf-dir
- (str "file:///" storm-log4j2-conf-dir))
- storm-log4j2-conf-dir)
- file-path-separator "worker.xml")
- command (concat
- [(java-cmd) "-cp" classpath
- topo-worker-logwriter-childopts
- (str "-Dlogfile.name=" logfilename)
- (str "-Dstorm.home=" storm-home)
- (str "-Dworkers.artifacts=" workers-artifacts)
- (str "-Dstorm.id=" storm-id)
- (str "-Dworker.id=" worker-id)
- (str "-Dworker.port=" port)
- (str "-Dstorm.log.dir=" storm-log-dir)
- (str "-Dlog4j.configurationFile=" log4j-configuration-file)
- (str "-DLog4jContextSelector=org.apache.logging.log4j.core.selector.BasicContextSelector")
- "org.apache.storm.LogWriter"]
- [(java-cmd) "-server"]
- worker-childopts
- topo-worker-childopts
- gc-opts
- worker--profiler-childopts
- [(str "-Djava.library.path=" jlp)
- (str "-Dlogfile.name=" logfilename)
- (str "-Dstorm.home=" storm-home)
- (str "-Dworkers.artifacts=" workers-artifacts)
- (str "-Dstorm.conf.file=" storm-conf-file)
- (str "-Dstorm.options=" storm-options)
- (str "-Dstorm.log.dir=" storm-log-dir)
- (str "-Djava.io.tmpdir=" worker-tmp-dir)
- (str "-Dlogging.sensitivity=" logging-sensitivity)
- (str "-Dlog4j.configurationFile=" log4j-configuration-file)
- (str "-DLog4jContextSelector=org.apache.logging.log4j.core.selector.BasicContextSelector")
- (str "-Dstorm.id=" storm-id)
- (str "-Dworker.id=" worker-id)
- (str "-Dworker.port=" port)
- "-cp" classpath
- "org.apache.storm.daemon.worker"
- storm-id
- (:assignment-id supervisor)
- port
- worker-id])
- command (->> command (map str) (filter (complement empty?)))]
- (log-message "Launching worker with command: " (shell-cmd command))
- (write-log-metadata! storm-conf user worker-id storm-id port conf)
- (set-worker-user! conf worker-id user)
- (create-artifacts-link conf storm-id port worker-id)
- (let [log-prefix (str "Worker Process " worker-id)
- callback (fn [exit-code]
- (log-message log-prefix " exited with code: " exit-code)
- (add-dead-worker worker-id))
- worker-dir (worker-root conf worker-id)]
- (remove-dead-worker worker-id)
- (create-blobstore-links conf storm-id worker-id)
- (if run-worker-as-user
- (worker-launcher conf user ["worker" worker-dir (write-script worker-dir command :environment topology-worker-environment)] :log-prefix log-prefix :exit-code-callback callback :directory (File. worker-dir))
- (launch-process command :environment topology-worker-environment :log-prefix log-prefix :exit-code-callback callback :directory (File. worker-dir)))
- )))
-
-;; local implementation
-
-(defn resources-jar []
- (->> (.split (current-classpath) File/pathSeparator)
- (filter #(.endsWith % ".jar"))
- (filter #(zip-contains-dir? % RESOURCES-SUBDIR))
- first ))
-
-(defmethod download-storm-code
- :local [conf storm-id master-code-dir localizer]
- (let [tmproot (str (supervisor-tmp-dir conf) file-path-separator (uuid))
- stormroot (supervisor-stormdist-root conf storm-id)
- blob-store (Utils/getNimbusBlobStore conf master-code-dir nil)]
- (try
- (FileUtils/forceMkdir (File. tmproot))
- (with-open [fos-storm-code (FileOutputStream. (supervisor-stormcode-path tmproot))
- fos-storm-conf (FileOutputStream. (supervisor-stormconf-path tmproot))]
- (.readBlobTo blob-store (master-stormcode-key storm-id) fos-storm-code nil)
- (.readBlobTo blob-store (master-stormconf-key storm-id) fos-storm-conf nil))
- (finally
- (.shutdown blob-store)))
- (FileUtils/moveDirectory (File. tmproot) (File. stormroot))
- (setup-storm-code-dir conf (read-supervisor-storm-conf conf storm-id) stormroot)
- (let [classloader (.getContextClassLoader (Thread/currentThread))
- resources-jar (resources-jar)
- url (.getResource classloader RESOURCES-SUBDIR)
- target-dir (str stormroot file-path-separator RESOURCES-SUBDIR)]
- (cond
- resources-jar
- (do
- (log-message "Extracting resources from jar at " resources-jar " to " target-dir)
- (extract-dir-from-jar resources-jar RESOURCES-SUBDIR stormroot))
- url
- (do
- (log-message "Copying resources at " (str url) " to " target-dir)
- (FileUtils/copyDirectory (File. (.getFile url)) (File. target-dir)))))))
-
-(defmethod launch-worker
- :local [supervisor storm-id port worker-id mem-onheap]
- (let [conf (:conf supervisor)
- pid (uuid)
- worker (worker/mk-worker conf
- (:shared-context supervisor)
- storm-id
- (:assignment-id supervisor)
- port
- worker-id)]
- (set-worker-user! conf worker-id "")
- (psim/register-process pid worker)
- (swap! (:worker-thread-pids-atom supervisor) assoc worker-id pid)
- ))
-
-(defn -launch
- [supervisor]
- (log-message "Starting supervisor for storm version '" STORM-VERSION "'")
- (let [conf (read-storm-config)]
- (validate-distributed-mode! conf)
- (let [supervisor (mk-supervisor conf nil supervisor)]
- (add-shutdown-hook-with-force-kill-in-1-sec #(.shutdown supervisor)))
- (defgauge supervisor:num-slots-used-gauge #(count (my-worker-ids conf)))
- (start-metrics-reporters conf)))
-
-(defn standalone-supervisor []
- (let [conf-atom (atom nil)
- id-atom (atom nil)]
- (reify ISupervisor
- (prepare [this conf local-dir]
- (reset! conf-atom conf)
- (let [state (LocalState. local-dir)
- curr-id (if-let [id (ls-supervisor-id state)]
- id
- (generate-supervisor-id))]
- (ls-supervisor-id! state curr-id)
- (reset! id-atom curr-id))
- )
- (confirmAssigned [this port]
- true)
- (getMetadata [this]
- (doall (map int (get @conf-atom SUPERVISOR-SLOTS-PORTS))))
- (getSupervisorId [this]
- @id-atom)
- (getAssignmentId [this]
- @id-atom)
- (killedWorker [this port]
- )
- (assigned [this ports]
- ))))
-
-(defn -main []
- (setup-default-uncaught-exception-handler)
- (-launch (standalone-supervisor)))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/task.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/task.clj b/storm-core/src/clj/backtype/storm/daemon/task.clj
deleted file mode 100644
index 1ae9b22..0000000
--- a/storm-core/src/clj/backtype/storm/daemon/task.clj
+++ /dev/null
@@ -1,189 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.daemon.task
- (:use [org.apache.storm.daemon common])
- (:use [org.apache.storm config util log])
- (:import [org.apache.storm.hooks ITaskHook])
- (:import [org.apache.storm.tuple Tuple TupleImpl])
- (:import [org.apache.storm.grouping LoadMapping])
- (:import [org.apache.storm.generated SpoutSpec Bolt StateSpoutSpec StormTopology])
- (:import [org.apache.storm.hooks.info SpoutAckInfo SpoutFailInfo
- EmitInfo BoltFailInfo BoltAckInfo])
- (:import [org.apache.storm.task TopologyContext ShellBolt WorkerTopologyContext])
- (:import [org.apache.storm.utils Utils])
- (:import [org.apache.storm.generated ShellComponent JavaObject])
- (:import [org.apache.storm.spout ShellSpout])
- (:import [java.util Collection List ArrayList])
- (:require [org.apache.storm
- [thrift :as thrift]
- [stats :as stats]])
- (:require [org.apache.storm.daemon.builtin-metrics :as builtin-metrics]))
-
-(defn mk-topology-context-builder [worker executor-data topology]
- (let [conf (:conf worker)]
- #(TopologyContext.
- topology
- (:storm-conf worker)
- (:task->component worker)
- (:component->sorted-tasks worker)
- (:component->stream->fields worker)
- (:storm-id worker)
- (supervisor-storm-resources-path
- (supervisor-stormdist-root conf (:storm-id worker)))
- (worker-pids-root conf (:worker-id worker))
- (int %)
- (:port worker)
- (:task-ids worker)
- (:default-shared-resources worker)
- (:user-shared-resources worker)
- (:shared-executor-data executor-data)
- (:interval->task->metric-registry executor-data)
- (:open-or-prepare-was-called? executor-data))))
-
-(defn system-topology-context [worker executor-data tid]
- ((mk-topology-context-builder
- worker
- executor-data
- (:system-topology worker))
- tid))
-
-(defn user-topology-context [worker executor-data tid]
- ((mk-topology-context-builder
- worker
- executor-data
- (:topology worker))
- tid))
-
-(defn- get-task-object [^StormTopology topology component-id]
- (let [spouts (.get_spouts topology)
- bolts (.get_bolts topology)
- state-spouts (.get_state_spouts topology)
- obj (Utils/getSetComponentObject
- (cond
- (contains? spouts component-id) (.get_spout_object ^SpoutSpec (get spouts component-id))
- (contains? bolts component-id) (.get_bolt_object ^Bolt (get bolts component-id))
- (contains? state-spouts component-id) (.get_state_spout_object ^StateSpoutSpec (get state-spouts component-id))
- true (throw-runtime "Could not find " component-id " in " topology)))
- obj (if (instance? ShellComponent obj)
- (if (contains? spouts component-id)
- (ShellSpout. obj)
- (ShellBolt. obj))
- obj )
- obj (if (instance? JavaObject obj)
- (thrift/instantiate-java-object obj)
- obj )]
- obj
- ))
-
-(defn get-context-hooks [^TopologyContext context]
- (.getHooks context))
-
-(defn hooks-empty? [^Collection hooks]
- (.isEmpty hooks))
-
-(defmacro apply-hooks [topology-context method-sym info-form]
- (let [hook-sym (with-meta (gensym "hook") {:tag 'org.apache.storm.hooks.ITaskHook})]
- `(let [hooks# (get-context-hooks ~topology-context)]
- (when-not (hooks-empty? hooks#)
- (let [info# ~info-form]
- (fast-list-iter [~hook-sym hooks#]
- (~method-sym ~hook-sym info#)
- ))))))
-
-
-;; TODO: this is all expensive... should be precomputed
-(defn send-unanchored
- [task-data stream values]
- (let [^TopologyContext topology-context (:system-context task-data)
- tasks-fn (:tasks-fn task-data)
- transfer-fn (-> task-data :executor-data :transfer-fn)
- out-tuple (TupleImpl. topology-context
- values
- (.getThisTaskId topology-context)
- stream)]
- (fast-list-iter [t (tasks-fn stream values)]
- (transfer-fn t out-tuple))))
-
-(defn mk-tasks-fn [task-data]
- (let [task-id (:task-id task-data)
- executor-data (:executor-data task-data)
- ^LoadMapping load-mapping (:load-mapping (:worker executor-data))
- component-id (:component-id executor-data)
- ^WorkerTopologyContext worker-context (:worker-context executor-data)
- storm-conf (:storm-conf executor-data)
- emit-sampler (mk-stats-sampler storm-conf)
- stream->component->grouper (:stream->component->grouper executor-data)
- user-context (:user-context task-data)
- executor-stats (:stats executor-data)
- debug? (= true (storm-conf TOPOLOGY-DEBUG))]
-
- (fn ([^Integer out-task-id ^String stream ^List values]
- (when debug?
- (log-message "Emitting direct: " out-task-id "; " component-id " " stream " " values))
- (let [target-component (.getComponentId worker-context out-task-id)
- component->grouping (get stream->component->grouper stream)
- grouping (get component->grouping target-component)
- out-task-id (if grouping out-task-id)]
- (when (and (not-nil? grouping) (not= :direct grouping))
- (throw (IllegalArgumentException. "Cannot emitDirect to a task expecting a regular grouping")))
- (apply-hooks user-context .emit (EmitInfo. values stream task-id [out-task-id]))
- (when (emit-sampler)
- (stats/emitted-tuple! executor-stats stream)
- (if out-task-id
- (stats/transferred-tuples! executor-stats stream 1)))
- (if out-task-id [out-task-id])
- ))
- ([^String stream ^List values]
- (when debug?
- (log-message "Emitting: " component-id " " stream " " values))
- (let [out-tasks (ArrayList.)]
- (fast-map-iter [[out-component grouper] (get stream->component->grouper stream)]
- (when (= :direct grouper)
- ;; TODO: this is wrong, need to check how the stream was declared
- (throw (IllegalArgumentException. "Cannot do regular emit to direct stream")))
- (let [comp-tasks (grouper task-id values load-mapping)]
- (if (or (sequential? comp-tasks) (instance? Collection comp-tasks))
- (.addAll out-tasks comp-tasks)
- (.add out-tasks comp-tasks)
- )))
- (apply-hooks user-context .emit (EmitInfo. values stream task-id out-tasks))
- (when (emit-sampler)
- (stats/emitted-tuple! executor-stats stream)
- (stats/transferred-tuples! executor-stats stream (count out-tasks)))
- out-tasks)))
- ))
-
-(defn mk-task-data [executor-data task-id]
- (recursive-map
- :executor-data executor-data
- :task-id task-id
- :system-context (system-topology-context (:worker executor-data) executor-data task-id)
- :user-context (user-topology-context (:worker executor-data) executor-data task-id)
- :builtin-metrics (builtin-metrics/make-data (:type executor-data) (:stats executor-data))
- :tasks-fn (mk-tasks-fn <>)
- :object (get-task-object (.getRawTopology ^TopologyContext (:system-context <>)) (:component-id executor-data))))
-
-
-(defn mk-task [executor-data task-id]
- (let [task-data (mk-task-data executor-data task-id)
- storm-conf (:storm-conf executor-data)]
- (doseq [klass (storm-conf TOPOLOGY-AUTO-TASK-HOOKS)]
- (.addTaskHook ^TopologyContext (:user-context task-data) (-> klass Class/forName .newInstance)))
- ;; when this is called, the threads for the executor haven't been started yet,
- ;; so we won't be risking trampling on the single-threaded claim strategy disruptor queue
- (send-unanchored task-data SYSTEM-STREAM-ID ["startup"])
- task-data
- ))
[43/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/scheduler/IsolationScheduler.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/scheduler/IsolationScheduler.clj b/storm-core/src/clj/backtype/storm/scheduler/IsolationScheduler.clj
deleted file mode 100644
index 2e86748..0000000
--- a/storm-core/src/clj/backtype/storm/scheduler/IsolationScheduler.clj
+++ /dev/null
@@ -1,219 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.scheduler.IsolationScheduler
- (:use [org.apache.storm util config log])
- (:require [org.apache.storm.scheduler.DefaultScheduler :as DefaultScheduler])
- (:import [java.util HashSet Set List LinkedList ArrayList Map HashMap])
- (:import [org.apache.storm.scheduler IScheduler Topologies
- Cluster TopologyDetails WorkerSlot SchedulerAssignment
- EvenScheduler ExecutorDetails])
- (:gen-class
- :init init
- :constructors {[] []}
- :state state
- :implements [org.apache.storm.scheduler.IScheduler]))
-
-(defn -init []
- [[] (container)])
-
-(defn -prepare [this conf]
- (container-set! (.state this) conf))
-
-(defn- compute-worker-specs "Returns mutable set of sets of executors"
- [^TopologyDetails details]
- (->> (.getExecutorToComponent details)
- reverse-map
- (map second)
- (apply concat)
- (map vector (repeat-seq (range (.getNumWorkers details))))
- (group-by first)
- (map-val #(map second %))
- vals
- (map set)
- (HashSet.)
- ))
-
-(defn isolated-topologies [conf topologies]
- (let [tset (-> conf (get ISOLATION-SCHEDULER-MACHINES) keys set)]
- (filter (fn [^TopologyDetails t] (contains? tset (.getName t))) topologies)
- ))
-
-;; map from topology id -> set of sets of executors
-(defn topology-worker-specs [iso-topologies]
- (->> iso-topologies
- (map (fn [t] {(.getId t) (compute-worker-specs t)}))
- (apply merge)))
-
-(defn machine-distribution [conf ^TopologyDetails topology]
- (let [name->machines (get conf ISOLATION-SCHEDULER-MACHINES)
- machines (get name->machines (.getName topology))
- workers (.getNumWorkers topology)]
- (-> (integer-divided workers machines)
- (dissoc 0)
- (HashMap.)
- )))
-
-(defn topology-machine-distribution [conf iso-topologies]
- (->> iso-topologies
- (map (fn [t] {(.getId t) (machine-distribution conf t)}))
- (apply merge)))
-
-(defn host-assignments [^Cluster cluster]
- (letfn [(to-slot-specs [^SchedulerAssignment ass]
- (->> ass
- .getExecutorToSlot
- reverse-map
- (map (fn [[slot executors]]
- [slot (.getTopologyId ass) (set executors)]))))]
- (->> cluster
- .getAssignments
- vals
- (mapcat to-slot-specs)
- (group-by (fn [[^WorkerSlot slot & _]] (.getHost cluster (.getNodeId slot))))
- )))
-
-(defn- decrement-distribution! [^Map distribution value]
- (let [v (-> distribution (get value) dec)]
- (if (zero? v)
- (.remove distribution value)
- (.put distribution value v))))
-
-;; returns list of list of slots, reverse sorted by number of slots
-(defn- host-assignable-slots [^Cluster cluster]
- (-<> cluster
- .getAssignableSlots
- (group-by #(.getHost cluster (.getNodeId ^WorkerSlot %)) <>)
- (dissoc <> nil)
- (sort-by #(-> % second count -) <>)
- shuffle
- (LinkedList. <>)
- ))
-
-(defn- host->used-slots [^Cluster cluster]
- (->> cluster
- .getUsedSlots
- (group-by #(.getHost cluster (.getNodeId ^WorkerSlot %)))
- ))
-
-(defn- distribution->sorted-amts [distribution]
- (->> distribution
- (mapcat (fn [[val amt]] (repeat amt val)))
- (sort-by -)
- ))
-
-(defn- allocated-topologies [topology-worker-specs]
- (->> topology-worker-specs
- (filter (fn [[_ worker-specs]] (empty? worker-specs)))
- (map first)
- set
- ))
-
-(defn- leftover-topologies [^Topologies topologies filter-ids-set]
- (->> topologies
- .getTopologies
- (filter (fn [^TopologyDetails t] (not (contains? filter-ids-set (.getId t)))))
- (map (fn [^TopologyDetails t] {(.getId t) t}))
- (apply merge)
- (Topologies.)
- ))
-
-;; for each isolated topology:
-;; compute even distribution of executors -> workers on the number of workers specified for the topology
-;; compute distribution of workers to machines
-;; determine host -> list of [slot, topology id, executors]
-;; iterate through hosts and: a machine is good if:
-;; 1. only running workers from one isolated topology
-;; 2. all workers running on it match one of the distributions of executors for that topology
-;; 3. matches one of the # of workers
-;; blacklist the good hosts and remove those workers from the list of need to be assigned workers
-;; otherwise unassign all other workers for isolated topologies if assigned
-
-(defn remove-elem-from-set! [^Set aset]
- (let [elem (-> aset .iterator .next)]
- (.remove aset elem)
- elem
- ))
-
-;; get host -> all assignable worker slots for non-blacklisted machines (assigned or not assigned)
-;; will then have a list of machines that need to be assigned (machine -> [topology, list of list of executors])
-;; match each spec to a machine (who has the right number of workers), free everything else on that machine and assign those slots (do one topology at a time)
-;; blacklist all machines who had production slots defined
-;; log isolated topologies who weren't able to get enough slots / machines
-;; run default scheduler on isolated topologies that didn't have enough slots + non-isolated topologies on remaining machines
-;; set blacklist to what it was initially
-(defn -schedule [this ^Topologies topologies ^Cluster cluster]
- (let [conf (container-get (.state this))
- orig-blacklist (HashSet. (.getBlacklistedHosts cluster))
- iso-topologies (isolated-topologies conf (.getTopologies topologies))
- iso-ids-set (->> iso-topologies (map #(.getId ^TopologyDetails %)) set)
- topology-worker-specs (topology-worker-specs iso-topologies)
- topology-machine-distribution (topology-machine-distribution conf iso-topologies)
- host-assignments (host-assignments cluster)]
- (doseq [[host assignments] host-assignments]
- (let [top-id (-> assignments first second)
- distribution (get topology-machine-distribution top-id)
- ^Set worker-specs (get topology-worker-specs top-id)
- num-workers (count assignments)
- ]
- (if (and (contains? iso-ids-set top-id)
- (every? #(= (second %) top-id) assignments)
- (contains? distribution num-workers)
- (every? #(contains? worker-specs (nth % 2)) assignments))
- (do (decrement-distribution! distribution num-workers)
- (doseq [[_ _ executors] assignments] (.remove worker-specs executors))
- (.blacklistHost cluster host))
- (doseq [[slot top-id _] assignments]
- (when (contains? iso-ids-set top-id)
- (.freeSlot cluster slot)
- ))
- )))
-
- (let [host->used-slots (host->used-slots cluster)
- ^LinkedList sorted-assignable-hosts (host-assignable-slots cluster)]
- ;; TODO: can improve things further by ordering topologies in terms of who needs the least workers
- (doseq [[top-id worker-specs] topology-worker-specs
- :let [amts (distribution->sorted-amts (get topology-machine-distribution top-id))]]
- (doseq [amt amts
- :let [[host host-slots] (.peek sorted-assignable-hosts)]]
- (when (and host-slots (>= (count host-slots) amt))
- (.poll sorted-assignable-hosts)
- (.freeSlots cluster (get host->used-slots host))
- (doseq [slot (take amt host-slots)
- :let [executors-set (remove-elem-from-set! worker-specs)]]
- (.assign cluster slot top-id executors-set))
- (.blacklistHost cluster host))
- )))
-
- (let [failed-iso-topologies (->> topology-worker-specs
- (mapcat (fn [[top-id worker-specs]]
- (if-not (empty? worker-specs) [top-id])
- )))]
- (if (empty? failed-iso-topologies)
- ;; run default scheduler on non-isolated topologies
- (-<> topology-worker-specs
- allocated-topologies
- (leftover-topologies topologies <>)
- (DefaultScheduler/default-schedule <> cluster))
- (do
- (log-warn "Unable to isolate topologies " (pr-str failed-iso-topologies) ". No machine had enough worker slots to run the remaining workers for these topologies. Clearing all other resources and will wait for enough resources for isolated topologies before allocating any other resources.")
- ;; clear workers off all hosts that are not blacklisted
- (doseq [[host slots] (host->used-slots cluster)]
- (if-not (.isBlacklistedHost cluster host)
- (.freeSlots cluster slots)
- )))
- ))
- (.setBlacklistedHosts cluster orig-blacklist)
- ))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/stats.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/stats.clj b/storm-core/src/clj/backtype/storm/stats.clj
deleted file mode 100644
index 17d0219..0000000
--- a/storm-core/src/clj/backtype/storm/stats.clj
+++ /dev/null
@@ -1,1584 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.stats
- (:import [org.apache.storm.generated Nimbus Nimbus$Processor Nimbus$Iface StormTopology ShellComponent
- NotAliveException AlreadyAliveException InvalidTopologyException GlobalStreamId
- ClusterSummary TopologyInfo TopologySummary ExecutorInfo ExecutorSummary ExecutorStats
- ExecutorSpecificStats SpoutStats BoltStats ErrorInfo
- SupervisorSummary CommonAggregateStats ComponentAggregateStats
- ComponentPageInfo ComponentType BoltAggregateStats
- ExecutorAggregateStats WorkerSummary SpecificAggregateStats
- SpoutAggregateStats TopologyPageInfo TopologyStats
- WorkerResources])
- (:import [org.apache.storm.utils Utils])
- (:import [org.apache.storm.scheduler WorkerSlot])
- (:import [org.apache.storm.metric.internal MultiCountStatAndMetric MultiLatencyStatAndMetric])
- (:use [org.apache.storm log util])
- (:use [clojure.math.numeric-tower :only [ceil]]))
-
-(def TEN-MIN-IN-SECONDS (* 10 60))
-
-(def COMMON-FIELDS [:emitted :transferred])
-(defrecord CommonStats [^MultiCountStatAndMetric emitted
- ^MultiCountStatAndMetric transferred
- rate])
-
-(def BOLT-FIELDS [:acked :failed :process-latencies :executed :execute-latencies])
-;;acked and failed count individual tuples
-(defrecord BoltExecutorStats [^CommonStats common
- ^MultiCountStatAndMetric acked
- ^MultiCountStatAndMetric failed
- ^MultiLatencyStatAndMetric process-latencies
- ^MultiCountStatAndMetric executed
- ^MultiLatencyStatAndMetric execute-latencies])
-
-(def SPOUT-FIELDS [:acked :failed :complete-latencies])
-;;acked and failed count tuple completion
-(defrecord SpoutExecutorStats [^CommonStats common
- ^MultiCountStatAndMetric acked
- ^MultiCountStatAndMetric failed
- ^MultiLatencyStatAndMetric complete-latencies])
-
-(def NUM-STAT-BUCKETS 20)
-
-(defn- mk-common-stats
- [rate]
- (CommonStats.
- (MultiCountStatAndMetric. NUM-STAT-BUCKETS)
- (MultiCountStatAndMetric. NUM-STAT-BUCKETS)
- rate))
-
-(defn mk-bolt-stats
- [rate]
- (BoltExecutorStats.
- (mk-common-stats rate)
- (MultiCountStatAndMetric. NUM-STAT-BUCKETS)
- (MultiCountStatAndMetric. NUM-STAT-BUCKETS)
- (MultiLatencyStatAndMetric. NUM-STAT-BUCKETS)
- (MultiCountStatAndMetric. NUM-STAT-BUCKETS)
- (MultiLatencyStatAndMetric. NUM-STAT-BUCKETS)))
-
-(defn mk-spout-stats
- [rate]
- (SpoutExecutorStats.
- (mk-common-stats rate)
- (MultiCountStatAndMetric. NUM-STAT-BUCKETS)
- (MultiCountStatAndMetric. NUM-STAT-BUCKETS)
- (MultiLatencyStatAndMetric. NUM-STAT-BUCKETS)))
-
-(defmacro stats-rate
- [stats]
- `(-> ~stats :common :rate))
-
-(defmacro stats-emitted
- [stats]
- `(-> ~stats :common :emitted))
-
-(defmacro stats-transferred
- [stats]
- `(-> ~stats :common :transferred))
-
-(defmacro stats-executed
- [stats]
- `(:executed ~stats))
-
-(defmacro stats-acked
- [stats]
- `(:acked ~stats))
-
-(defmacro stats-failed
- [stats]
- `(:failed ~stats))
-
-(defmacro stats-execute-latencies
- [stats]
- `(:execute-latencies ~stats))
-
-(defmacro stats-process-latencies
- [stats]
- `(:process-latencies ~stats))
-
-(defmacro stats-complete-latencies
- [stats]
- `(:complete-latencies ~stats))
-
-(defn emitted-tuple!
- [stats stream]
- (let [^MultiCountStatAndMetric emitted (stats-emitted stats)]
- (.incBy emitted ^Object stream ^long (stats-rate stats))))
-
-(defn transferred-tuples!
- [stats stream amt]
- (let [^MultiCountStatAndMetric transferred (stats-transferred stats)]
- (.incBy transferred ^Object stream ^long (* (stats-rate stats) amt))))
-
-(defn bolt-execute-tuple!
- [^BoltExecutorStats stats component stream latency-ms]
- (let [key [component stream]
- ^MultiCountStatAndMetric executed (stats-executed stats)
- ^MultiLatencyStatAndMetric exec-lat (stats-execute-latencies stats)]
- (.incBy executed key (stats-rate stats))
- (.record exec-lat key latency-ms)))
-
-(defn bolt-acked-tuple!
- [^BoltExecutorStats stats component stream latency-ms]
- (let [key [component stream]
- ^MultiCountStatAndMetric acked (stats-acked stats)
- ^MultiLatencyStatAndMetric process-lat (stats-process-latencies stats)]
- (.incBy acked key (stats-rate stats))
- (.record process-lat key latency-ms)))
-
-(defn bolt-failed-tuple!
- [^BoltExecutorStats stats component stream latency-ms]
- (let [key [component stream]
- ^MultiCountStatAndMetric failed (stats-failed stats)]
- (.incBy failed key (stats-rate stats))))
-
-(defn spout-acked-tuple!
- [^SpoutExecutorStats stats stream latency-ms]
- (let [^MultiCountStatAndMetric acked (stats-acked stats)
- ^MultiLatencyStatAndMetric complete-latencies (stats-complete-latencies stats)]
- (.incBy acked stream (stats-rate stats))
- (.record complete-latencies stream latency-ms)))
-
-(defn spout-failed-tuple!
- [^SpoutExecutorStats stats stream latency-ms]
- (let [^MultiCountStatAndMetric failed (stats-failed stats)]
- (.incBy failed stream (stats-rate stats))))
-
-(defn- close-stat! [stat]
- (.close stat))
-
-(defn- cleanup-common-stats!
- [^CommonStats stats]
- (doseq [f COMMON-FIELDS]
- (close-stat! (f stats))))
-
-(defn cleanup-bolt-stats!
- [^BoltExecutorStats stats]
- (cleanup-common-stats! (:common stats))
- (doseq [f BOLT-FIELDS]
- (close-stat! (f stats))))
-
-(defn cleanup-spout-stats!
- [^SpoutExecutorStats stats]
- (cleanup-common-stats! (:common stats))
- (doseq [f SPOUT-FIELDS]
- (close-stat! (f stats))))
-
-(defn- value-stats
- [stats fields]
- (into {} (dofor [f fields]
- [f (if (instance? MultiCountStatAndMetric (f stats))
- (.getTimeCounts ^MultiCountStatAndMetric (f stats))
- (.getTimeLatAvg ^MultiLatencyStatAndMetric (f stats)))])))
-
-(defn- value-common-stats
- [^CommonStats stats]
- (merge
- (value-stats stats COMMON-FIELDS)
- {:rate (:rate stats)}))
-
-(defn value-bolt-stats!
- [^BoltExecutorStats stats]
- (merge (value-common-stats (:common stats))
- (value-stats stats BOLT-FIELDS)
- {:type :bolt}))
-
-(defn value-spout-stats!
- [^SpoutExecutorStats stats]
- (merge (value-common-stats (:common stats))
- (value-stats stats SPOUT-FIELDS)
- {:type :spout}))
-
-(defmulti render-stats! class-selector)
-
-(defmethod render-stats! SpoutExecutorStats
- [stats]
- (value-spout-stats! stats))
-
-(defmethod render-stats! BoltExecutorStats
- [stats]
- (value-bolt-stats! stats))
-
-(defmulti cleanup-stats! class-selector)
-
-(defmethod cleanup-stats! SpoutExecutorStats
- [stats]
- (cleanup-spout-stats! stats))
-
-(defmethod cleanup-stats! BoltExecutorStats
- [stats]
- (cleanup-bolt-stats! stats))
-
-(defmulti thriftify-specific-stats :type)
-(defmulti clojurify-specific-stats class-selector)
-
-(defn window-set-converter
- ([stats key-fn first-key-fun]
- (into {}
- (for [[k v] stats]
- ;apply the first-key-fun only to first key.
- [(first-key-fun k)
- (into {} (for [[k2 v2] v]
- [(key-fn k2) v2]))])))
- ([stats first-key-fun]
- (window-set-converter stats identity first-key-fun)))
-
-(defn to-global-stream-id
- [[component stream]]
- (GlobalStreamId. component stream))
-
-(defn from-global-stream-id [global-stream-id]
- [(.get_componentId global-stream-id) (.get_streamId global-stream-id)])
-
-(defmethod clojurify-specific-stats BoltStats [^BoltStats stats]
- [(window-set-converter (.get_acked stats) from-global-stream-id identity)
- (window-set-converter (.get_failed stats) from-global-stream-id identity)
- (window-set-converter (.get_process_ms_avg stats) from-global-stream-id identity)
- (window-set-converter (.get_executed stats) from-global-stream-id identity)
- (window-set-converter (.get_execute_ms_avg stats) from-global-stream-id identity)])
-
-(defmethod clojurify-specific-stats SpoutStats [^SpoutStats stats]
- [(.get_acked stats)
- (.get_failed stats)
- (.get_complete_ms_avg stats)])
-
-(defn clojurify-executor-stats
- [^ExecutorStats stats]
- (let [ specific-stats (.get_specific stats)
- is_bolt? (.is_set_bolt specific-stats)
- specific-stats (if is_bolt? (.get_bolt specific-stats) (.get_spout specific-stats))
- specific-stats (clojurify-specific-stats specific-stats)
- common-stats (CommonStats. (.get_emitted stats)
- (.get_transferred stats)
- (.get_rate stats))]
- (if is_bolt?
- ; worker heart beat does not store the BoltExecutorStats or SpoutExecutorStats , instead it stores the result returned by render-stats!
- ; which flattens the BoltExecutorStats/SpoutExecutorStats by extracting values from all atoms and merging all values inside :common to top
- ;level map we are pretty much doing the same here.
- (dissoc (merge common-stats {:type :bolt} (apply ->BoltExecutorStats (into [nil] specific-stats))) :common)
- (dissoc (merge common-stats {:type :spout} (apply ->SpoutExecutorStats (into [nil] specific-stats))) :common)
- )))
-
-(defmethod thriftify-specific-stats :bolt
- [stats]
- (ExecutorSpecificStats/bolt
- (BoltStats.
- (window-set-converter (:acked stats) to-global-stream-id str)
- (window-set-converter (:failed stats) to-global-stream-id str)
- (window-set-converter (:process-latencies stats) to-global-stream-id str)
- (window-set-converter (:executed stats) to-global-stream-id str)
- (window-set-converter (:execute-latencies stats) to-global-stream-id str))))
-
-(defmethod thriftify-specific-stats :spout
- [stats]
- (ExecutorSpecificStats/spout
- (SpoutStats. (window-set-converter (:acked stats) str)
- (window-set-converter (:failed stats) str)
- (window-set-converter (:complete-latencies stats) str))))
-
-(defn thriftify-executor-stats
- [stats]
- (let [specific-stats (thriftify-specific-stats stats)
- rate (:rate stats)]
- (ExecutorStats. (window-set-converter (:emitted stats) str)
- (window-set-converter (:transferred stats) str)
- specific-stats
- rate)))
-
-(defn valid-number?
- "Returns true if x is a number that is not NaN or Infinity, false otherwise"
- [x]
- (and (number? x)
- (not (Double/isNaN x))
- (not (Double/isInfinite x))))
-
-(defn apply-default
- [f defaulting-fn & args]
- (apply f (map defaulting-fn args)))
-
-(defn apply-or-0
- [f & args]
- (apply apply-default
- f
- #(if (valid-number? %) % 0)
- args))
-
-(defn sum-or-0
- [& args]
- (apply apply-or-0 + args))
-
-(defn product-or-0
- [& args]
- (apply apply-or-0 * args))
-
-(defn max-or-0
- [& args]
- (apply apply-or-0 max args))
-
-(defn- agg-bolt-lat-and-count
- "Aggregates number executed, process latency, and execute latency across all
- streams."
- [idk->exec-avg idk->proc-avg idk->num-executed]
- (letfn [(weight-avg [[id avg]]
- (let [num-e (get idk->num-executed id)]
- (product-or-0 avg num-e)))]
- {:executeLatencyTotal (sum (map weight-avg idk->exec-avg))
- :processLatencyTotal (sum (map weight-avg idk->proc-avg))
- :executed (sum (vals idk->num-executed))}))
-
-(defn- agg-spout-lat-and-count
- "Aggregates number acked and complete latencies across all streams."
- [sid->comp-avg sid->num-acked]
- (letfn [(weight-avg [[id avg]]
- (product-or-0 avg (get sid->num-acked id)))]
- {:completeLatencyTotal (sum (map weight-avg sid->comp-avg))
- :acked (sum (vals sid->num-acked))}))
-
-(defn add-pairs
- ([] [0 0])
- ([[a1 a2] [b1 b2]]
- [(+ a1 b1) (+ a2 b2)]))
-
-(defn mk-include-sys-fn
- [include-sys?]
- (if include-sys?
- (fn [_] true)
- (fn [stream] (and (string? stream) (not (Utils/isSystemId stream))))))
-
-(defn mk-include-sys-filter
- "Returns a function that includes or excludes map entries whose keys are
- system ids."
- [include-sys?]
- (if include-sys?
- identity
- (partial filter-key (mk-include-sys-fn false))))
-
-(defn- agg-bolt-streams-lat-and-count
- "Aggregates number executed and process & execute latencies."
- [idk->exec-avg idk->proc-avg idk->executed]
- (letfn [(weight-avg [id avg]
- (let [num-e (idk->executed id)]
- (product-or-0 avg num-e)))]
- (into {}
- (for [k (keys idk->exec-avg)]
- [k {:executeLatencyTotal (weight-avg k (get idk->exec-avg k))
- :processLatencyTotal (weight-avg k (get idk->proc-avg k))
- :executed (idk->executed k)}]))))
-
-(defn- agg-spout-streams-lat-and-count
- "Aggregates number acked and complete latencies."
- [idk->comp-avg idk->acked]
- (letfn [(weight-avg [id avg]
- (let [num-e (get idk->acked id)]
- (product-or-0 avg num-e)))]
- (into {}
- (for [k (keys idk->comp-avg)]
- [k {:completeLatencyTotal (weight-avg k (get idk->comp-avg k))
- :acked (get idk->acked k)}]))))
-
-(defn swap-map-order
- "For a nested map, rearrange data such that the top-level keys become the
- nested map's keys and vice versa.
- Example:
- {:a {:X :banana, :Y :pear}, :b {:X :apple, :Y :orange}}
- -> {:Y {:a :pear, :b :orange}, :X {:a :banana, :b :apple}}"
- [m]
- (apply merge-with
- merge
- (map (fn [[k v]]
- (into {}
- (for [[k2 v2] v]
- [k2 {k v2}])))
- m)))
-
-(defn- compute-agg-capacity
- "Computes the capacity metric for one executor given its heartbeat data and
- uptime."
- [m uptime]
- (when uptime
- (->>
- ;; For each stream, create weighted averages and counts.
- (merge-with (fn weighted-avg+count-fn
- [avg cnt]
- [(* avg cnt) cnt])
- (get (:execute-latencies m) (str TEN-MIN-IN-SECONDS))
- (get (:executed m) (str TEN-MIN-IN-SECONDS)))
- vals ;; Ignore the stream ids.
- (reduce add-pairs
- [0. 0]) ;; Combine weighted averages and counts.
- ((fn [[weighted-avg cnt]]
- (if (> uptime 0)
- (div weighted-avg (* 1000 (min uptime TEN-MIN-IN-SECONDS)))
- 0.))))))
-
-(defn agg-pre-merge-comp-page-bolt
- [{exec-id :exec-id
- host :host
- port :port
- uptime :uptime
- comp-id :comp-id
- num-tasks :num-tasks
- statk->w->sid->num :stats}
- window
- include-sys?]
- (let [str-key (partial map-key str)
- handle-sys-components-fn (mk-include-sys-filter include-sys?)]
- {:executor-id exec-id,
- :host host,
- :port port,
- :uptime uptime,
- :num-executors 1,
- :num-tasks num-tasks,
- :capacity (compute-agg-capacity statk->w->sid->num uptime)
- :cid+sid->input-stats
- (merge-with
- merge
- (swap-map-order
- {:acked (-> statk->w->sid->num
- :acked
- str-key
- (get window))
- :failed (-> statk->w->sid->num
- :failed
- str-key
- (get window))})
- (agg-bolt-streams-lat-and-count (-> statk->w->sid->num
- :execute-latencies
- str-key
- (get window))
- (-> statk->w->sid->num
- :process-latencies
- str-key
- (get window))
- (-> statk->w->sid->num
- :executed
- str-key
- (get window)))),
- :sid->output-stats
- (swap-map-order
- {:emitted (-> statk->w->sid->num
- :emitted
- str-key
- (get window)
- handle-sys-components-fn)
- :transferred (-> statk->w->sid->num
- :transferred
- str-key
- (get window)
- handle-sys-components-fn)})}))
-
-(defn agg-pre-merge-comp-page-spout
- [{exec-id :exec-id
- host :host
- port :port
- uptime :uptime
- comp-id :comp-id
- num-tasks :num-tasks
- statk->w->sid->num :stats}
- window
- include-sys?]
- (let [str-key (partial map-key str)
- handle-sys-components-fn (mk-include-sys-filter include-sys?)]
- {:executor-id exec-id,
- :host host,
- :port port,
- :uptime uptime,
- :num-executors 1,
- :num-tasks num-tasks,
- :sid->output-stats
- (merge-with
- merge
- (agg-spout-streams-lat-and-count (-> statk->w->sid->num
- :complete-latencies
- str-key
- (get window))
- (-> statk->w->sid->num
- :acked
- str-key
- (get window)))
- (swap-map-order
- {:acked (-> statk->w->sid->num
- :acked
- str-key
- (get window))
- :failed (-> statk->w->sid->num
- :failed
- str-key
- (get window))
- :emitted (-> statk->w->sid->num
- :emitted
- str-key
- (get window)
- handle-sys-components-fn)
- :transferred (-> statk->w->sid->num
- :transferred
- str-key
- (get window)
- handle-sys-components-fn)}))}))
-
-(defn agg-pre-merge-topo-page-bolt
- [{comp-id :comp-id
- num-tasks :num-tasks
- statk->w->sid->num :stats
- uptime :uptime}
- window
- include-sys?]
- (let [str-key (partial map-key str)
- handle-sys-components-fn (mk-include-sys-filter include-sys?)]
- {comp-id
- (merge
- (agg-bolt-lat-and-count (-> statk->w->sid->num
- :execute-latencies
- str-key
- (get window))
- (-> statk->w->sid->num
- :process-latencies
- str-key
- (get window))
- (-> statk->w->sid->num
- :executed
- str-key
- (get window)))
- {:num-executors 1
- :num-tasks num-tasks
- :emitted (-> statk->w->sid->num
- :emitted
- str-key
- (get window)
- handle-sys-components-fn
- vals
- sum)
- :transferred (-> statk->w->sid->num
- :transferred
- str-key
- (get window)
- handle-sys-components-fn
- vals
- sum)
- :capacity (compute-agg-capacity statk->w->sid->num uptime)
- :acked (-> statk->w->sid->num
- :acked
- str-key
- (get window)
- vals
- sum)
- :failed (-> statk->w->sid->num
- :failed
- str-key
- (get window)
- vals
- sum)})}))
-
-(defn agg-pre-merge-topo-page-spout
- [{comp-id :comp-id
- num-tasks :num-tasks
- statk->w->sid->num :stats}
- window
- include-sys?]
- (let [str-key (partial map-key str)
- handle-sys-components-fn (mk-include-sys-filter include-sys?)]
- {comp-id
- (merge
- (agg-spout-lat-and-count (-> statk->w->sid->num
- :complete-latencies
- str-key
- (get window))
- (-> statk->w->sid->num
- :acked
- str-key
- (get window)))
- {:num-executors 1
- :num-tasks num-tasks
- :emitted (-> statk->w->sid->num
- :emitted
- str-key
- (get window)
- handle-sys-components-fn
- vals
- sum)
- :transferred (-> statk->w->sid->num
- :transferred
- str-key
- (get window)
- handle-sys-components-fn
- vals
- sum)
- :failed (-> statk->w->sid->num
- :failed
- str-key
- (get window)
- vals
- sum)})}))
-
-(defn merge-agg-comp-stats-comp-page-bolt
- [{acc-in :cid+sid->input-stats
- acc-out :sid->output-stats
- :as acc-bolt-stats}
- {bolt-in :cid+sid->input-stats
- bolt-out :sid->output-stats
- :as bolt-stats}]
- {:num-executors (inc (or (:num-executors acc-bolt-stats) 0)),
- :num-tasks (sum-or-0 (:num-tasks acc-bolt-stats) (:num-tasks bolt-stats)),
- :sid->output-stats (merge-with (partial merge-with sum-or-0)
- acc-out
- bolt-out),
- :cid+sid->input-stats (merge-with (partial merge-with sum-or-0)
- acc-in
- bolt-in),
- :executor-stats
- (let [sum-streams (fn [m k] (->> m vals (map k) (apply sum-or-0)))
- executed (sum-streams bolt-in :executed)]
- (conj (:executor-stats acc-bolt-stats)
- (merge
- (select-keys bolt-stats
- [:executor-id :uptime :host :port :capacity])
- {:emitted (sum-streams bolt-out :emitted)
- :transferred (sum-streams bolt-out :transferred)
- :acked (sum-streams bolt-in :acked)
- :failed (sum-streams bolt-in :failed)
- :executed executed}
- (->>
- (if (and executed (pos? executed))
- [(div (sum-streams bolt-in :executeLatencyTotal) executed)
- (div (sum-streams bolt-in :processLatencyTotal) executed)]
- [nil nil])
- (mapcat vector [:execute-latency :process-latency])
- (apply assoc {})))))})
-
-(defn merge-agg-comp-stats-comp-page-spout
- [{acc-out :sid->output-stats
- :as acc-spout-stats}
- {spout-out :sid->output-stats
- :as spout-stats}]
- {:num-executors (inc (or (:num-executors acc-spout-stats) 0)),
- :num-tasks (sum-or-0 (:num-tasks acc-spout-stats) (:num-tasks spout-stats)),
- :sid->output-stats (merge-with (partial merge-with sum-or-0)
- acc-out
- spout-out),
- :executor-stats
- (let [sum-streams (fn [m k] (->> m vals (map k) (apply sum-or-0)))
- acked (sum-streams spout-out :acked)]
- (conj (:executor-stats acc-spout-stats)
- (merge
- (select-keys spout-stats [:executor-id :uptime :host :port])
- {:emitted (sum-streams spout-out :emitted)
- :transferred (sum-streams spout-out :transferred)
- :acked acked
- :failed (sum-streams spout-out :failed)}
- {:complete-latency (if (and acked (pos? acked))
- (div (sum-streams spout-out
- :completeLatencyTotal)
- acked)
- nil)})))})
-
-(defn merge-agg-comp-stats-topo-page-bolt
- [acc-bolt-stats bolt-stats]
- {:num-executors (inc (or (:num-executors acc-bolt-stats) 0))
- :num-tasks (sum-or-0 (:num-tasks acc-bolt-stats) (:num-tasks bolt-stats))
- :emitted (sum-or-0 (:emitted acc-bolt-stats) (:emitted bolt-stats))
- :transferred (sum-or-0 (:transferred acc-bolt-stats)
- (:transferred bolt-stats))
- :capacity (max-or-0 (:capacity acc-bolt-stats) (:capacity bolt-stats))
- ;; We sum average latency totals here to avoid dividing at each step.
- ;; Compute the average latencies by dividing the total by the count.
- :executeLatencyTotal (sum-or-0 (:executeLatencyTotal acc-bolt-stats)
- (:executeLatencyTotal bolt-stats))
- :processLatencyTotal (sum-or-0 (:processLatencyTotal acc-bolt-stats)
- (:processLatencyTotal bolt-stats))
- :executed (sum-or-0 (:executed acc-bolt-stats) (:executed bolt-stats))
- :acked (sum-or-0 (:acked acc-bolt-stats) (:acked bolt-stats))
- :failed (sum-or-0 (:failed acc-bolt-stats) (:failed bolt-stats))})
-
-(defn merge-agg-comp-stats-topo-page-spout
- [acc-spout-stats spout-stats]
- {:num-executors (inc (or (:num-executors acc-spout-stats) 0))
- :num-tasks (sum-or-0 (:num-tasks acc-spout-stats) (:num-tasks spout-stats))
- :emitted (sum-or-0 (:emitted acc-spout-stats) (:emitted spout-stats))
- :transferred (sum-or-0 (:transferred acc-spout-stats) (:transferred spout-stats))
- ;; We sum average latency totals here to avoid dividing at each step.
- ;; Compute the average latencies by dividing the total by the count.
- :completeLatencyTotal (sum-or-0 (:completeLatencyTotal acc-spout-stats)
- (:completeLatencyTotal spout-stats))
- :acked (sum-or-0 (:acked acc-spout-stats) (:acked spout-stats))
- :failed (sum-or-0 (:failed acc-spout-stats) (:failed spout-stats))})
-
-(defn aggregate-count-streams
- [stats]
- (->> stats
- (map-val #(reduce + (vals %)))))
-
-(defn- agg-topo-exec-stats*
- "A helper function that does the common work to aggregate stats of one
- executor with the given map for the topology page."
- [window
- include-sys?
- {:keys [workers-set
- bolt-id->stats
- spout-id->stats
- window->emitted
- window->transferred
- window->comp-lat-wgt-avg
- window->acked
- window->failed] :as acc-stats}
- {:keys [stats] :as new-data}
- pre-merge-fn
- merge-fn
- comp-key]
- (let [cid->statk->num (pre-merge-fn new-data window include-sys?)
- {w->compLatWgtAvg :completeLatencyTotal
- w->acked :acked}
- (if (:complete-latencies stats)
- (swap-map-order
- (into {}
- (for [w (keys (:acked stats))]
- [w (agg-spout-lat-and-count
- (get (:complete-latencies stats) w)
- (get (:acked stats) w))])))
- {:completeLatencyTotal nil
- :acks (aggregate-count-streams (:acked stats))})
- handle-sys-components-fn (mk-include-sys-filter include-sys?)]
- (assoc {:workers-set (conj workers-set
- [(:host new-data) (:port new-data)])
- :bolt-id->stats bolt-id->stats
- :spout-id->stats spout-id->stats
- :window->emitted (->> (:emitted stats)
- (map-val handle-sys-components-fn)
- aggregate-count-streams
- (merge-with + window->emitted))
- :window->transferred (->> (:transferred stats)
- (map-val handle-sys-components-fn)
- aggregate-count-streams
- (merge-with + window->transferred))
- :window->comp-lat-wgt-avg (merge-with +
- window->comp-lat-wgt-avg
- w->compLatWgtAvg)
- :window->acked (if (= :spout (:type stats))
- (merge-with + window->acked w->acked)
- window->acked)
- :window->failed (if (= :spout (:type stats))
- (->> (:failed stats)
- aggregate-count-streams
- (merge-with + window->failed))
- window->failed)}
- comp-key (merge-with merge-fn
- (acc-stats comp-key)
- cid->statk->num)
- :type (:type stats))))
-
-(defmulti agg-topo-exec-stats
- "Combines the aggregate stats of one executor with the given map, selecting
- the appropriate window and including system components as specified."
- (fn dispatch-fn [& args] (:type (last args))))
-
-(defmethod agg-topo-exec-stats :bolt
- [window include-sys? acc-stats new-data]
- (agg-topo-exec-stats* window
- include-sys?
- acc-stats
- new-data
- agg-pre-merge-topo-page-bolt
- merge-agg-comp-stats-topo-page-bolt
- :bolt-id->stats))
-
-(defmethod agg-topo-exec-stats :spout
- [window include-sys? acc-stats new-data]
- (agg-topo-exec-stats* window
- include-sys?
- acc-stats
- new-data
- agg-pre-merge-topo-page-spout
- merge-agg-comp-stats-topo-page-spout
- :spout-id->stats))
-
-(defmethod agg-topo-exec-stats :default [_ _ acc-stats _] acc-stats)
-
-(defn get-last-error
- [storm-cluster-state storm-id component-id]
- (if-let [e (.last-error storm-cluster-state storm-id component-id)]
- (ErrorInfo. (:error e) (:time-secs e))))
-
-(defn component-type
- "Returns the component type (either :bolt or :spout) for a given
- topology and component id. Returns nil if not found."
- [^StormTopology topology id]
- (let [bolts (.get_bolts topology)
- spouts (.get_spouts topology)]
- (cond
- (Utils/isSystemId id) :bolt
- (.containsKey bolts id) :bolt
- (.containsKey spouts id) :spout)))
-
-(defn extract-nodeinfos-from-hb-for-comp
- ([exec->host+port task->component include-sys? comp-id]
- (distinct (for [[[start end :as executor] [host port]] exec->host+port
- :let [id (task->component start)]
- :when (and (or (nil? comp-id) (= comp-id id))
- (or include-sys? (not (Utils/isSystemId id))))]
- {:host host
- :port port}))))
-
-(defn extract-data-from-hb
- ([exec->host+port task->component beats include-sys? topology comp-id]
- (for [[[start end :as executor] [host port]] exec->host+port
- :let [beat (beats executor)
- id (task->component start)]
- :when (and (or (nil? comp-id) (= comp-id id))
- (or include-sys? (not (Utils/isSystemId id))))]
- {:exec-id executor
- :comp-id id
- :num-tasks (count (range start (inc end)))
- :host host
- :port port
- :uptime (:uptime beat)
- :stats (:stats beat)
- :type (or (:type (:stats beat))
- (component-type topology id))}))
- ([exec->host+port task->component beats include-sys? topology]
- (extract-data-from-hb exec->host+port
- task->component
- beats
- include-sys?
- topology
- nil)))
-
-(defn aggregate-topo-stats
- [window include-sys? data]
- (let [init-val {:workers-set #{}
- :bolt-id->stats {}
- :spout-id->stats {}
- :window->emitted {}
- :window->transferred {}
- :window->comp-lat-wgt-avg {}
- :window->acked {}
- :window->failed {}}
- reducer-fn (partial agg-topo-exec-stats
- window
- include-sys?)]
- (reduce reducer-fn init-val data)))
-
-(defn- compute-weighted-averages-per-window
- [acc-data wgt-avg-key divisor-key]
- (into {} (for [[window wgt-avg] (wgt-avg-key acc-data)
- :let [divisor ((divisor-key acc-data) window)]
- :when (and divisor (pos? divisor))]
- [(str window) (div wgt-avg divisor)])))
-
-(defn- post-aggregate-topo-stats
- [task->component exec->node+port last-err-fn acc-data]
- {:num-tasks (count task->component)
- :num-workers (count (:workers-set acc-data))
- :num-executors (count exec->node+port)
- :bolt-id->stats
- (into {} (for [[id m] (:bolt-id->stats acc-data)
- :let [executed (:executed m)]]
- [id (-> m
- (assoc :execute-latency
- (if (and executed (pos? executed))
- (div (or (:executeLatencyTotal m) 0)
- executed)
- 0)
- :process-latency
- (if (and executed (pos? executed))
- (div (or (:processLatencyTotal m) 0)
- executed)
- 0))
- (dissoc :executeLatencyTotal
- :processLatencyTotal)
- (assoc :lastError (last-err-fn id)))]))
- :spout-id->stats
- (into {} (for [[id m] (:spout-id->stats acc-data)
- :let [acked (:acked m)]]
- [id (-> m
- (assoc :complete-latency
- (if (and acked (pos? acked))
- (div (:completeLatencyTotal m)
- (:acked m))
- 0))
- (dissoc :completeLatencyTotal)
- (assoc :lastError (last-err-fn id)))]))
- :window->emitted (map-key str (:window->emitted acc-data))
- :window->transferred (map-key str (:window->transferred acc-data))
- :window->complete-latency
- (compute-weighted-averages-per-window acc-data
- :window->comp-lat-wgt-avg
- :window->acked)
- :window->acked (map-key str (:window->acked acc-data))
- :window->failed (map-key str (:window->failed acc-data))})
-
-(defn- thriftify-common-agg-stats
- [^ComponentAggregateStats s
- {:keys [num-tasks
- emitted
- transferred
- acked
- failed
- num-executors] :as statk->num}]
- (let [cas (CommonAggregateStats.)]
- (and num-executors (.set_num_executors cas num-executors))
- (and num-tasks (.set_num_tasks cas num-tasks))
- (and emitted (.set_emitted cas emitted))
- (and transferred (.set_transferred cas transferred))
- (and acked (.set_acked cas acked))
- (and failed (.set_failed cas failed))
- (.set_common_stats s cas)))
-
-(defn thriftify-bolt-agg-stats
- [statk->num]
- (let [{:keys [lastError
- execute-latency
- process-latency
- executed
- capacity]} statk->num
- s (ComponentAggregateStats.)]
- (.set_type s ComponentType/BOLT)
- (and lastError (.set_last_error s lastError))
- (thriftify-common-agg-stats s statk->num)
- (.set_specific_stats s
- (SpecificAggregateStats/bolt
- (let [bas (BoltAggregateStats.)]
- (and execute-latency (.set_execute_latency_ms bas execute-latency))
- (and process-latency (.set_process_latency_ms bas process-latency))
- (and executed (.set_executed bas executed))
- (and capacity (.set_capacity bas capacity))
- bas)))
- s))
-
-(defn thriftify-spout-agg-stats
- [statk->num]
- (let [{:keys [lastError
- complete-latency]} statk->num
- s (ComponentAggregateStats.)]
- (.set_type s ComponentType/SPOUT)
- (and lastError (.set_last_error s lastError))
- (thriftify-common-agg-stats s statk->num)
- (.set_specific_stats s
- (SpecificAggregateStats/spout
- (let [sas (SpoutAggregateStats.)]
- (and complete-latency (.set_complete_latency_ms sas complete-latency))
- sas)))
- s))
-
-(defn thriftify-topo-page-data
- [topology-id data]
- (let [{:keys [num-tasks
- num-workers
- num-executors
- spout-id->stats
- bolt-id->stats
- window->emitted
- window->transferred
- window->complete-latency
- window->acked
- window->failed]} data
- spout-agg-stats (into {}
- (for [[id m] spout-id->stats
- :let [m (assoc m :type :spout)]]
- [id
- (thriftify-spout-agg-stats m)]))
- bolt-agg-stats (into {}
- (for [[id m] bolt-id->stats
- :let [m (assoc m :type :bolt)]]
- [id
- (thriftify-bolt-agg-stats m)]))
- topology-stats (doto (TopologyStats.)
- (.set_window_to_emitted window->emitted)
- (.set_window_to_transferred window->transferred)
- (.set_window_to_complete_latencies_ms
- window->complete-latency)
- (.set_window_to_acked window->acked)
- (.set_window_to_failed window->failed))
- topo-page-info (doto (TopologyPageInfo. topology-id)
- (.set_num_tasks num-tasks)
- (.set_num_workers num-workers)
- (.set_num_executors num-executors)
- (.set_id_to_spout_agg_stats spout-agg-stats)
- (.set_id_to_bolt_agg_stats bolt-agg-stats)
- (.set_topology_stats topology-stats))]
- topo-page-info))
-
-(defn agg-worker-stats
- "Aggregate statistics per worker for a topology. Optionally filtering on specific supervisors."
- ([storm-id topo-info worker->resources include-sys? user-authorized]
- (agg-worker-stats storm-id topo-info worker->resources include-sys? user-authorized nil))
- ([storm-id topo-info worker->resources include-sys? user-authorized filter-supervisor]
- (let [{:keys [storm-name
- assignment
- beats
- task->component]} topo-info
- exec->node+port (:executor->node+port assignment)
- node->host (:node->host assignment)
- all-node+port->exec (reverse-map exec->node+port)
- node+port->exec (if (nil? filter-supervisor)
- all-node+port->exec
- (filter #(= filter-supervisor (ffirst %)) all-node+port->exec))
- handle-sys-components-fn (mk-include-sys-fn include-sys?)]
- (dofor [[[node port] executors] node+port->exec]
- (let [executor-tasks (map #(range (first %) (inc (last %))) executors)
- worker-beats (vals (select-keys beats executors))
- not-null-worker-beat (first (filter identity worker-beats))
- worker-uptime (or (:uptime not-null-worker-beat) 0)
- ;; list of components per executor ((c1 c2 c3) (c4) (c5))
- ;; if the executor was running only system components, an empty list for that executor is possible
- components-per-executor (for [tasks executor-tasks]
- (filter handle-sys-components-fn (map #(get task->component %) tasks)))
- component->num-tasks (frequencies (flatten components-per-executor))
- num-executors (count executors)
- default-worker-resources (WorkerResources.)
- resources (if (nil? worker->resources)
- default-worker-resources
- (or (.get worker->resources (WorkerSlot. node port))
- default-worker-resources))
- worker-summary (doto
- (WorkerSummary.)
- (.set_host (node->host node))
- (.set_uptime_secs worker-uptime)
- (.set_supervisor_id node)
- (.set_port port)
- (.set_topology_id storm-id)
- (.set_topology_name storm-name)
- (.set_num_executors num-executors)
- (.set_assigned_memonheap (.get_mem_on_heap resources))
- (.set_assigned_memoffheap (.get_mem_off_heap resources))
- (.set_assigned_cpu (.get_cpu resources)))]
- (if user-authorized (.set_component_to_num_tasks worker-summary component->num-tasks))
- worker-summary)))))
-
-(defn agg-topo-execs-stats
- "Aggregate various executor statistics for a topology from the given
- heartbeats."
- [topology-id
- exec->node+port
- task->component
- beats
- topology
- window
- include-sys?
- last-err-fn]
- (->> ;; This iterates over each executor one time, because of lazy evaluation.
- (extract-data-from-hb exec->node+port
- task->component
- beats
- include-sys?
- topology)
- (aggregate-topo-stats window include-sys?)
- (post-aggregate-topo-stats task->component exec->node+port last-err-fn)
- (thriftify-topo-page-data topology-id)))
-
-(defn- agg-bolt-exec-win-stats
- "A helper function that aggregates windowed stats from one bolt executor."
- [acc-stats new-stats include-sys?]
- (let [{w->execLatWgtAvg :executeLatencyTotal
- w->procLatWgtAvg :processLatencyTotal
- w->executed :executed}
- (swap-map-order
- (into {} (for [w (keys (:executed new-stats))]
- [w (agg-bolt-lat-and-count
- (get (:execute-latencies new-stats) w)
- (get (:process-latencies new-stats) w)
- (get (:executed new-stats) w))])))
- handle-sys-components-fn (mk-include-sys-filter include-sys?)]
- {:window->emitted (->> (:emitted new-stats)
- (map-val handle-sys-components-fn)
- aggregate-count-streams
- (merge-with + (:window->emitted acc-stats)))
- :window->transferred (->> (:transferred new-stats)
- (map-val handle-sys-components-fn)
- aggregate-count-streams
- (merge-with + (:window->transferred acc-stats)))
- :window->exec-lat-wgt-avg (merge-with +
- (:window->exec-lat-wgt-avg acc-stats)
- w->execLatWgtAvg)
- :window->proc-lat-wgt-avg (merge-with +
- (:window->proc-lat-wgt-avg acc-stats)
- w->procLatWgtAvg)
- :window->executed (merge-with + (:window->executed acc-stats) w->executed)
- :window->acked (->> (:acked new-stats)
- aggregate-count-streams
- (merge-with + (:window->acked acc-stats)))
- :window->failed (->> (:failed new-stats)
- aggregate-count-streams
- (merge-with + (:window->failed acc-stats)))}))
-
-(defn- agg-spout-exec-win-stats
- "A helper function that aggregates windowed stats from one spout executor."
- [acc-stats new-stats include-sys?]
- (let [{w->compLatWgtAvg :completeLatencyTotal
- w->acked :acked}
- (swap-map-order
- (into {} (for [w (keys (:acked new-stats))]
- [w (agg-spout-lat-and-count
- (get (:complete-latencies new-stats) w)
- (get (:acked new-stats) w))])))
- handle-sys-components-fn (mk-include-sys-filter include-sys?)]
- {:window->emitted (->> (:emitted new-stats)
- (map-val handle-sys-components-fn)
- aggregate-count-streams
- (merge-with + (:window->emitted acc-stats)))
- :window->transferred (->> (:transferred new-stats)
- (map-val handle-sys-components-fn)
- aggregate-count-streams
- (merge-with + (:window->transferred acc-stats)))
- :window->comp-lat-wgt-avg (merge-with +
- (:window->comp-lat-wgt-avg acc-stats)
- w->compLatWgtAvg)
- :window->acked (->> (:acked new-stats)
- aggregate-count-streams
- (merge-with + (:window->acked acc-stats)))
- :window->failed (->> (:failed new-stats)
- aggregate-count-streams
- (merge-with + (:window->failed acc-stats)))}))
-
-(defmulti agg-comp-exec-stats
- "Combines the aggregate stats of one executor with the given map, selecting
- the appropriate window and including system components as specified."
- (fn dispatch-fn [_ _ init-val _] (:type init-val)))
-
-(defmethod agg-comp-exec-stats :bolt
- [window include-sys? acc-stats new-data]
- (assoc (agg-bolt-exec-win-stats acc-stats (:stats new-data) include-sys?)
- :stats (merge-agg-comp-stats-comp-page-bolt
- (:stats acc-stats)
- (agg-pre-merge-comp-page-bolt new-data window include-sys?))
- :type :bolt))
-
-(defmethod agg-comp-exec-stats :spout
- [window include-sys? acc-stats new-data]
- (assoc (agg-spout-exec-win-stats acc-stats (:stats new-data) include-sys?)
- :stats (merge-agg-comp-stats-comp-page-spout
- (:stats acc-stats)
- (agg-pre-merge-comp-page-spout new-data window include-sys?))
- :type :spout))
-
-(defn- aggregate-comp-stats*
- [window include-sys? data init-val]
- (-> (partial agg-comp-exec-stats
- window
- include-sys?)
- (reduce init-val data)))
-
-(defmulti aggregate-comp-stats
- (fn dispatch-fn [& args] (-> args last first :type)))
-
-(defmethod aggregate-comp-stats :bolt
- [& args]
- (let [init-val {:type :bolt
- :cid+sid->input-stats {}
- :sid->output-stats {}
- :executor-stats []
- :window->emitted {}
- :window->transferred {}
- :window->exec-lat-wgt-avg {}
- :window->executed {}
- :window->proc-lat-wgt-avg {}
- :window->acked {}
- :window->failed {}}]
- (apply aggregate-comp-stats* (concat args (list init-val)))))
-
-(defmethod aggregate-comp-stats :spout
- [& args]
- (let [init-val {:type :spout
- :sid->output-stats {}
- :executor-stats []
- :window->emitted {}
- :window->transferred {}
- :window->comp-lat-wgt-avg {}
- :window->acked {}
- :window->failed {}}]
- (apply aggregate-comp-stats* (concat args (list init-val)))))
-
-(defmethod aggregate-comp-stats :default [& _] {})
-
-(defmulti post-aggregate-comp-stats
- (fn [_ _ data] (:type data)))
-
-(defmethod post-aggregate-comp-stats :bolt
- [task->component
- exec->host+port
- {{i-stats :cid+sid->input-stats
- o-stats :sid->output-stats
- num-tasks :num-tasks
- num-executors :num-executors} :stats
- comp-type :type :as acc-data}]
- {:type comp-type
- :num-tasks num-tasks
- :num-executors num-executors
- :cid+sid->input-stats
- (->> i-stats
- (map-val (fn [m]
- (let [executed (:executed m)
- lats (if (and executed (pos? executed))
- {:execute-latency
- (div (or (:executeLatencyTotal m) 0)
- executed)
- :process-latency
- (div (or (:processLatencyTotal m) 0)
- executed)}
- {:execute-latency 0
- :process-latency 0})]
- (-> m (merge lats) (dissoc :executeLatencyTotal
- :processLatencyTotal))))))
- :sid->output-stats o-stats
- :executor-stats (:executor-stats (:stats acc-data))
- :window->emitted (map-key str (:window->emitted acc-data))
- :window->transferred (map-key str (:window->transferred acc-data))
- :window->execute-latency
- (compute-weighted-averages-per-window acc-data
- :window->exec-lat-wgt-avg
- :window->executed)
- :window->executed (map-key str (:window->executed acc-data))
- :window->process-latency
- (compute-weighted-averages-per-window acc-data
- :window->proc-lat-wgt-avg
- :window->executed)
- :window->acked (map-key str (:window->acked acc-data))
- :window->failed (map-key str (:window->failed acc-data))})
-
-(defmethod post-aggregate-comp-stats :spout
- [task->component
- exec->host+port
- {{o-stats :sid->output-stats
- num-tasks :num-tasks
- num-executors :num-executors} :stats
- comp-type :type :as acc-data}]
- {:type comp-type
- :num-tasks num-tasks
- :num-executors num-executors
- :sid->output-stats
- (->> o-stats
- (map-val (fn [m]
- (let [acked (:acked m)
- lat (if (and acked (pos? acked))
- {:complete-latency
- (div (or (:completeLatencyTotal m) 0) acked)}
- {:complete-latency 0})]
- (-> m (merge lat) (dissoc :completeLatencyTotal))))))
- :executor-stats (:executor-stats (:stats acc-data))
- :window->emitted (map-key str (:window->emitted acc-data))
- :window->transferred (map-key str (:window->transferred acc-data))
- :window->complete-latency
- (compute-weighted-averages-per-window acc-data
- :window->comp-lat-wgt-avg
- :window->acked)
- :window->acked (map-key str (:window->acked acc-data))
- :window->failed (map-key str (:window->failed acc-data))})
-
-(defmethod post-aggregate-comp-stats :default [& _] {})
-
-(defn thriftify-exec-agg-stats
- [comp-id comp-type {:keys [executor-id host port uptime] :as stats}]
- (doto (ExecutorAggregateStats.)
- (.set_exec_summary (ExecutorSummary. (apply #(ExecutorInfo. %1 %2)
- executor-id)
- comp-id
- host
- port
- (or uptime 0)))
- (.set_stats ((condp = comp-type
- :bolt thriftify-bolt-agg-stats
- :spout thriftify-spout-agg-stats) stats))))
-
-(defn- thriftify-bolt-input-stats
- [cid+sid->input-stats]
- (into {} (for [[cid+sid input-stats] cid+sid->input-stats]
- [(to-global-stream-id cid+sid)
- (thriftify-bolt-agg-stats input-stats)])))
-
-(defn- thriftify-bolt-output-stats
- [sid->output-stats]
- (map-val thriftify-bolt-agg-stats sid->output-stats))
-
-(defn- thriftify-spout-output-stats
- [sid->output-stats]
- (map-val thriftify-spout-agg-stats sid->output-stats))
-
-(defn thriftify-comp-page-data
- [topo-id topology comp-id data]
- (let [w->stats (swap-map-order
- (merge
- {:emitted (:window->emitted data)
- :transferred (:window->transferred data)
- :acked (:window->acked data)
- :failed (:window->failed data)}
- (condp = (:type data)
- :bolt {:execute-latency (:window->execute-latency data)
- :process-latency (:window->process-latency data)
- :executed (:window->executed data)}
- :spout {:complete-latency
- (:window->complete-latency data)}
- {}))) ; default
- [compType exec-stats w->stats gsid->input-stats sid->output-stats]
- (condp = (component-type topology comp-id)
- :bolt [ComponentType/BOLT
- (->
- (partial thriftify-exec-agg-stats comp-id :bolt)
- (map (:executor-stats data)))
- (map-val thriftify-bolt-agg-stats w->stats)
- (thriftify-bolt-input-stats (:cid+sid->input-stats data))
- (thriftify-bolt-output-stats (:sid->output-stats data))]
- :spout [ComponentType/SPOUT
- (->
- (partial thriftify-exec-agg-stats comp-id :spout)
- (map (:executor-stats data)))
- (map-val thriftify-spout-agg-stats w->stats)
- nil ;; spouts do not have input stats
- (thriftify-spout-output-stats (:sid->output-stats data))]),
- num-executors (:num-executors data)
- num-tasks (:num-tasks data)
- ret (doto (ComponentPageInfo. comp-id compType)
- (.set_topology_id topo-id)
- (.set_topology_name nil)
- (.set_window_to_stats w->stats)
- (.set_sid_to_output_stats sid->output-stats)
- (.set_exec_stats exec-stats))]
- (and num-executors (.set_num_executors ret num-executors))
- (and num-tasks (.set_num_tasks ret num-tasks))
- (and gsid->input-stats
- (.set_gsid_to_input_stats ret gsid->input-stats))
- ret))
-
-(defn agg-comp-execs-stats
- "Aggregate various executor statistics for a component from the given
- heartbeats."
- [exec->host+port
- task->component
- beats
- window
- include-sys?
- topology-id
- topology
- component-id]
- (->> ;; This iterates over each executor one time, because of lazy evaluation.
- (extract-data-from-hb exec->host+port
- task->component
- beats
- include-sys?
- topology
- component-id)
- (aggregate-comp-stats window include-sys?)
- (post-aggregate-comp-stats task->component exec->host+port)
- (thriftify-comp-page-data topology-id topology component-id)))
-
-(defn expand-averages
- [avg counts]
- (let [avg (clojurify-structure avg)
- counts (clojurify-structure counts)]
- (into {}
- (for [[slice streams] counts]
- [slice
- (into {}
- (for [[stream c] streams]
- [stream
- [(* c (get-in avg [slice stream]))
- c]]
- ))]))))
-
-(defn expand-averages-seq
- [average-seq counts-seq]
- (->> (map vector average-seq counts-seq)
- (map #(apply expand-averages %))
- (apply merge-with (fn [s1 s2] (merge-with add-pairs s1 s2)))))
-
-(defn- val-avg
- [[t c]]
- (if (= c 0) 0
- (double (/ t c))))
-
-(defn aggregate-averages
- [average-seq counts-seq]
- (->> (expand-averages-seq average-seq counts-seq)
- (map-val
- (fn [s]
- (map-val val-avg s)))))
-
-(defn aggregate-avg-streams
- [avg counts]
- (let [expanded (expand-averages avg counts)]
- (->> expanded
- (map-val #(reduce add-pairs (vals %)))
- (map-val val-avg))))
-
-(defn pre-process
- [stream-summary include-sys?]
- (let [filter-fn (mk-include-sys-fn include-sys?)
- emitted (:emitted stream-summary)
- emitted (into {} (for [[window stat] emitted]
- {window (filter-key filter-fn stat)}))
- transferred (:transferred stream-summary)
- transferred (into {} (for [[window stat] transferred]
- {window (filter-key filter-fn stat)}))
- stream-summary (-> stream-summary (dissoc :emitted) (assoc :emitted emitted))
- stream-summary (-> stream-summary (dissoc :transferred) (assoc :transferred transferred))]
- stream-summary))
-
-(defn aggregate-counts
- [counts-seq]
- (->> counts-seq
- (map clojurify-structure)
- (apply merge-with
- (fn [s1 s2]
- (merge-with + s1 s2)))))
-
-(defn aggregate-common-stats
- [stats-seq]
- {:emitted (aggregate-counts (map #(.get_emitted ^ExecutorStats %) stats-seq))
- :transferred (aggregate-counts (map #(.get_transferred ^ExecutorStats %) stats-seq))})
-
-(defn aggregate-bolt-stats
- [stats-seq include-sys?]
- (let [stats-seq (collectify stats-seq)]
- (merge (pre-process (aggregate-common-stats stats-seq) include-sys?)
- {:acked
- (aggregate-counts (map #(.. ^ExecutorStats % get_specific get_bolt get_acked)
- stats-seq))
- :failed
- (aggregate-counts (map #(.. ^ExecutorStats % get_specific get_bolt get_failed)
- stats-seq))
- :executed
- (aggregate-counts (map #(.. ^ExecutorStats % get_specific get_bolt get_executed)
- stats-seq))
- :process-latencies
- (aggregate-averages (map #(.. ^ExecutorStats % get_specific get_bolt get_process_ms_avg)
- stats-seq)
- (map #(.. ^ExecutorStats % get_specific get_bolt get_acked)
- stats-seq))
- :execute-latencies
- (aggregate-averages (map #(.. ^ExecutorStats % get_specific get_bolt get_execute_ms_avg)
- stats-seq)
- (map #(.. ^ExecutorStats % get_specific get_bolt get_executed)
- stats-seq))})))
-
-(defn aggregate-spout-stats
- [stats-seq include-sys?]
- (let [stats-seq (collectify stats-seq)]
- (merge (pre-process (aggregate-common-stats stats-seq) include-sys?)
- {:acked
- (aggregate-counts (map #(.. ^ExecutorStats % get_specific get_spout get_acked)
- stats-seq))
- :failed
- (aggregate-counts (map #(.. ^ExecutorStats % get_specific get_spout get_failed)
- stats-seq))
- :complete-latencies
- (aggregate-averages (map #(.. ^ExecutorStats % get_specific get_spout get_complete_ms_avg)
- stats-seq)
- (map #(.. ^ExecutorStats % get_specific get_spout get_acked)
- stats-seq))})))
-
-(defn get-filled-stats
- [summs]
- (->> summs
- (map #(.get_stats ^ExecutorSummary %))
- (filter not-nil?)))
-
-(defn aggregate-spout-streams
- [stats]
- {:acked (aggregate-count-streams (:acked stats))
- :failed (aggregate-count-streams (:failed stats))
- :emitted (aggregate-count-streams (:emitted stats))
- :transferred (aggregate-count-streams (:transferred stats))
- :complete-latencies (aggregate-avg-streams (:complete-latencies stats)
- (:acked stats))})
-
-(defn spout-streams-stats
- [summs include-sys?]
- (let [stats-seq (get-filled-stats summs)]
- (aggregate-spout-streams
- (aggregate-spout-stats
- stats-seq include-sys?))))
-
-(defn aggregate-bolt-streams
- [stats]
- {:acked (aggregate-count-streams (:acked stats))
- :failed (aggregate-count-streams (:failed stats))
- :emitted (aggregate-count-streams (:emitted stats))
- :transferred (aggregate-count-streams (:transferred stats))
- :process-latencies (aggregate-avg-streams (:process-latencies stats)
- (:acked stats))
- :executed (aggregate-count-streams (:executed stats))
- :execute-latencies (aggregate-avg-streams (:execute-latencies stats)
- (:executed stats))})
-
-(defn compute-executor-capacity
- [^ExecutorSummary e]
- (let [stats (.get_stats e)
- stats (if stats
- (-> stats
- (aggregate-bolt-stats true)
- (aggregate-bolt-streams)
- swap-map-order
- (get (str TEN-MIN-IN-SECONDS))))
- uptime (nil-to-zero (.get_uptime_secs e))
- window (if (< uptime TEN-MIN-IN-SECONDS) uptime TEN-MIN-IN-SECONDS)
- executed (-> stats :executed nil-to-zero)
- latency (-> stats :execute-latencies nil-to-zero)]
- (if (> window 0)
- (div (* executed latency) (* 1000 window)))))
-
-(defn bolt-streams-stats
- [summs include-sys?]
- (let [stats-seq (get-filled-stats summs)]
- (aggregate-bolt-streams
- (aggregate-bolt-stats
- stats-seq include-sys?))))
-
-(defn total-aggregate-stats
- [spout-summs bolt-summs include-sys?]
- (let [spout-stats (get-filled-stats spout-summs)
- bolt-stats (get-filled-stats bolt-summs)
- agg-spout-stats (-> spout-stats
- (aggregate-spout-stats include-sys?)
- aggregate-spout-streams)
- agg-bolt-stats (-> bolt-stats
- (aggregate-bolt-stats include-sys?)
- aggregate-bolt-streams)]
- (merge-with
- (fn [s1 s2]
- (merge-with + s1 s2))
- (select-keys
- agg-bolt-stats
- ;; Include only keys that will be used. We want to count acked and
- ;; failed only for the "tuple trees," so we do not include those keys
- ;; from the bolt executors.
- [:emitted :transferred])
- agg-spout-stats)))
-
-(defn error-subset
- [error-str]
- (apply str (take 200 error-str)))
-
-(defn most-recent-error
- [errors-list]
- (let [error (->> errors-list
- (sort-by #(.get_error_time_secs ^ErrorInfo %))
- reverse
- first)]
- (if error
- (error-subset (.get_error ^ErrorInfo error))
- "")))
-
-(defn float-str [n]
- (if n
- (format "%.3f" (float n))
- "0"))
-
-(defn compute-bolt-capacity
- [executors]
- (->> executors
- (map compute-executor-capacity)
- (map nil-to-zero)
- (apply max)))
[41/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/ui/core.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/ui/core.clj b/storm-core/src/clj/backtype/storm/ui/core.clj
deleted file mode 100644
index 4365f27..0000000
--- a/storm-core/src/clj/backtype/storm/ui/core.clj
+++ /dev/null
@@ -1,1487 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.ui.core
- (:use compojure.core)
- (:use [clojure.java.shell :only [sh]])
- (:use ring.middleware.reload
- ring.middleware.multipart-params
- ring.middleware.multipart-params.temp-file)
- (:use [ring.middleware.json :only [wrap-json-params]])
- (:use [hiccup core page-helpers])
- (:use [org.apache.storm config util log stats zookeeper converter])
- (:use [org.apache.storm.ui helpers])
- (:use [org.apache.storm.daemon [common :only [ACKER-COMPONENT-ID ACKER-INIT-STREAM-ID ACKER-ACK-STREAM-ID
- ACKER-FAIL-STREAM-ID mk-authorization-handler
- start-metrics-reporters]]])
- (:import [org.apache.storm.utils Utils TopologySpoutLag]
- [org.apache.storm.generated NimbusSummary])
- (:use [clojure.string :only [blank? lower-case trim split]])
- (:import [org.apache.storm.generated ExecutorSpecificStats
- ExecutorStats ExecutorSummary ExecutorInfo TopologyInfo SpoutStats BoltStats
- ErrorInfo ClusterSummary SupervisorSummary TopologySummary
- Nimbus$Client StormTopology GlobalStreamId RebalanceOptions
- KillOptions GetInfoOptions NumErrorsChoice DebugOptions TopologyPageInfo
- TopologyStats CommonAggregateStats ComponentAggregateStats
- ComponentType BoltAggregateStats SpoutAggregateStats
- ExecutorAggregateStats SpecificAggregateStats ComponentPageInfo
- LogConfig LogLevel LogLevelAction SupervisorPageInfo WorkerSummary])
- (:import [org.apache.storm.security.auth AuthUtils ReqContext])
- (:import [org.apache.storm.generated AuthorizationException ProfileRequest ProfileAction NodeInfo])
- (:import [org.apache.storm.security.auth AuthUtils])
- (:import [org.apache.storm.utils VersionInfo])
- (:import [org.apache.storm Config])
- (:import [java.io File])
- (:require [compojure.route :as route]
- [compojure.handler :as handler]
- [ring.util.response :as resp]
- [org.apache.storm [thrift :as thrift]])
- (:require [ring.middleware.cors :refer [wrap-cors]])
- (:require [metrics.meters :refer [defmeter mark!]])
- (:import [org.apache.commons.lang StringEscapeUtils])
- (:import [org.apache.logging.log4j Level])
- (:gen-class))
-
-(def ^:dynamic *STORM-CONF* (read-storm-config))
-(def ^:dynamic *UI-ACL-HANDLER* (mk-authorization-handler (*STORM-CONF* NIMBUS-AUTHORIZER) *STORM-CONF*))
-(def ^:dynamic *UI-IMPERSONATION-HANDLER* (mk-authorization-handler (*STORM-CONF* NIMBUS-IMPERSONATION-AUTHORIZER) *STORM-CONF*))
-(def http-creds-handler (AuthUtils/GetUiHttpCredentialsPlugin *STORM-CONF*))
-(def STORM-VERSION (VersionInfo/getVersion))
-
-(defmeter ui:num-cluster-configuration-http-requests)
-(defmeter ui:num-cluster-summary-http-requests)
-(defmeter ui:num-nimbus-summary-http-requests)
-(defmeter ui:num-supervisor-http-requests)
-(defmeter ui:num-supervisor-summary-http-requests)
-(defmeter ui:num-all-topologies-summary-http-requests)
-(defmeter ui:num-topology-page-http-requests)
-(defmeter ui:num-topology-metric-http-requests)
-(defmeter ui:num-topology-lag-http-requests)
-(defmeter ui:num-build-visualization-http-requests)
-(defmeter ui:num-mk-visualization-data-http-requests)
-(defmeter ui:num-component-page-http-requests)
-(defmeter ui:num-log-config-http-requests)
-(defmeter ui:num-activate-topology-http-requests)
-(defmeter ui:num-deactivate-topology-http-requests)
-(defmeter ui:num-debug-topology-http-requests)
-(defmeter ui:num-component-op-response-http-requests)
-(defmeter ui:num-topology-op-response-http-requests)
-(defmeter ui:num-topology-op-response-http-requests)
-(defmeter ui:num-topology-op-response-http-requests)
-(defmeter ui:num-main-page-http-requests)
-
-(defn assert-authorized-user
- ([op]
- (assert-authorized-user op nil))
- ([op topology-conf]
- (let [context (ReqContext/context)]
- (if (.isImpersonating context)
- (if *UI-IMPERSONATION-HANDLER*
- (if-not (.permit *UI-IMPERSONATION-HANDLER* context op topology-conf)
- (let [principal (.principal context)
- real-principal (.realPrincipal context)
- user (if principal (.getName principal) "unknown")
- real-user (if real-principal (.getName real-principal) "unknown")
- remote-address (.remoteAddress context)]
- (throw (AuthorizationException.
- (str "user '" real-user "' is not authorized to impersonate user '" user "' from host '" remote-address "'. Please
- see SECURITY.MD to learn how to configure impersonation ACL.")))))
- (log-warn " principal " (.realPrincipal context) " is trying to impersonate " (.principal context) " but "
- NIMBUS-IMPERSONATION-AUTHORIZER " has no authorizer configured. This is a potential security hole.
- Please see SECURITY.MD to learn how to configure an impersonation authorizer.")))
-
- (if *UI-ACL-HANDLER*
- (if-not (.permit *UI-ACL-HANDLER* context op topology-conf)
- (let [principal (.principal context)
- user (if principal (.getName principal) "unknown")]
- (throw (AuthorizationException.
- (str "UI request '" op "' for '" user "' user is not authorized")))))))))
-
-(defn executor-summary-type
- [topology ^ExecutorSummary s]
- (component-type topology (.get_component_id s)))
-
-(defn spout-summary?
- [topology s]
- (= :spout (executor-summary-type topology s)))
-
-(defn bolt-summary?
- [topology s]
- (= :bolt (executor-summary-type topology s)))
-
-(defn group-by-comp
- [summs]
- (let [ret (group-by #(.get_component_id ^ExecutorSummary %) summs)]
- (into (sorted-map) ret )))
-
-(defn logviewer-link [host fname secure?]
- (if (and secure? (*STORM-CONF* LOGVIEWER-HTTPS-PORT))
- (url-format "https://%s:%s/log?file=%s"
- host
- (*STORM-CONF* LOGVIEWER-HTTPS-PORT)
- fname)
- (url-format "http://%s:%s/log?file=%s"
- host
- (*STORM-CONF* LOGVIEWER-PORT)
- fname)))
-
-(defn event-log-link
- [topology-id component-id host port secure?]
- (logviewer-link host (event-logs-filename topology-id port) secure?))
-
-(defn worker-log-link [host port topology-id secure?]
- (if (or (empty? host) (let [port_str (str port "")] (or (empty? port_str) (= "0" port_str))))
- ""
- (let [fname (logs-filename topology-id port)]
- (logviewer-link host fname secure?))))
-
-(defn nimbus-log-link [host]
- (url-format "http://%s:%s/daemonlog?file=nimbus.log" host (*STORM-CONF* LOGVIEWER-PORT)))
-
-(defn supervisor-log-link [host]
- (url-format "http://%s:%s/daemonlog?file=supervisor.log" host (*STORM-CONF* LOGVIEWER-PORT)))
-
-(defn get-error-data
- [error]
- (if error
- (error-subset (.get_error ^ErrorInfo error))
- ""))
-
-(defn get-error-port
- [error]
- (if error
- (.get_port ^ErrorInfo error)
- ""))
-
-(defn get-error-host
- [error]
- (if error
- (.get_host ^ErrorInfo error)
- ""))
-
-(defn get-error-time
- [error]
- (if error
- (.get_error_time_secs ^ErrorInfo error)))
-
-(defn worker-dump-link [host port topology-id]
- (url-format "http://%s:%s/dumps/%s/%s"
- (url-encode host)
- (*STORM-CONF* LOGVIEWER-PORT)
- (url-encode topology-id)
- (str (url-encode host) ":" (url-encode port))))
-
-(defn stats-times
- [stats-map]
- (sort-by #(Integer/parseInt %)
- (-> stats-map
- clojurify-structure
- (dissoc ":all-time")
- keys)))
-
-(defn window-hint
- [window]
- (if (= window ":all-time")
- "All time"
- (pretty-uptime-sec window)))
-
-(defn sanitize-stream-name
- [name]
- (let [sym-regex #"(?![A-Za-z_\-:\.])."]
- (str
- (if (re-find #"^[A-Za-z]" name)
- (clojure.string/replace name sym-regex "_")
- (clojure.string/replace (str \s name) sym-regex "_"))
- (hash name))))
-
-(defn sanitize-transferred
- [transferred]
- (into {}
- (for [[time, stream-map] transferred]
- [time, (into {}
- (for [[stream, trans] stream-map]
- [(sanitize-stream-name stream), trans]))])))
-
-(defn visualization-data
- [spout-bolt spout-comp-summs bolt-comp-summs window storm-id]
- (let [components (for [[id spec] spout-bolt]
- [id
- (let [inputs (.get_inputs (.get_common spec))
- bolt-summs (get bolt-comp-summs id)
- spout-summs (get spout-comp-summs id)
- bolt-cap (if bolt-summs
- (compute-bolt-capacity bolt-summs)
- 0)]
- {:type (if bolt-summs "bolt" "spout")
- :capacity bolt-cap
- :latency (if bolt-summs
- (get-in
- (bolt-streams-stats bolt-summs true)
- [:process-latencies window])
- (get-in
- (spout-streams-stats spout-summs true)
- [:complete-latencies window]))
- :transferred (or
- (get-in
- (spout-streams-stats spout-summs true)
- [:transferred window])
- (get-in
- (bolt-streams-stats bolt-summs true)
- [:transferred window]))
- :stats (let [mapfn (fn [dat]
- (map (fn [^ExecutorSummary summ]
- {:host (.get_host summ)
- :port (.get_port summ)
- :uptime_secs (.get_uptime_secs summ)
- :transferred (if-let [stats (.get_stats summ)]
- (sanitize-transferred (.get_transferred stats)))})
- dat))]
- (if bolt-summs
- (mapfn bolt-summs)
- (mapfn spout-summs)))
- :link (url-format "/component.html?id=%s&topology_id=%s" id storm-id)
- :inputs (for [[global-stream-id group] inputs]
- {:component (.get_componentId global-stream-id)
- :stream (.get_streamId global-stream-id)
- :sani-stream (sanitize-stream-name (.get_streamId global-stream-id))
- :grouping (clojure.core/name (thrift/grouping-type group))})})])]
- (into {} (doall components))))
-
-(defn stream-boxes [datmap]
- (let [filter-fn (mk-include-sys-fn true)
- streams
- (vec (doall (distinct
- (apply concat
- (for [[k v] datmap]
- (for [m (get v :inputs)]
- {:stream (get m :stream)
- :sani-stream (get m :sani-stream)
- :checked (not
- (Utils/isSystemId
- (get m :stream)))}))))))]
- (map (fn [row]
- {:row row}) (partition 4 4 nil streams))))
-
-(defn- get-topology-info
- ([^Nimbus$Client nimbus id]
- (.getTopologyInfo nimbus id))
- ([^Nimbus$Client nimbus id options]
- (.getTopologyInfoWithOpts nimbus id options)))
-
-(defn mk-visualization-data
- [id window include-sys?]
- (thrift/with-configured-nimbus-connection
- nimbus
- (let [window (if window window ":all-time")
- topology (.getTopology ^Nimbus$Client nimbus id)
- spouts (.get_spouts topology)
- bolts (.get_bolts topology)
- summ (->> (doto
- (GetInfoOptions.)
- (.set_num_err_choice NumErrorsChoice/NONE))
- (.getTopologyInfoWithOpts ^Nimbus$Client nimbus id))
- execs (.get_executors summ)
- spout-summs (filter (partial spout-summary? topology) execs)
- bolt-summs (filter (partial bolt-summary? topology) execs)
- spout-comp-summs (group-by-comp spout-summs)
- bolt-comp-summs (group-by-comp bolt-summs)
- bolt-comp-summs (filter-key (mk-include-sys-fn include-sys?)
- bolt-comp-summs)]
- (visualization-data
- (merge (hashmap-to-persistent spouts)
- (hashmap-to-persistent bolts))
- spout-comp-summs bolt-comp-summs window id))))
-
-(defn validate-tplg-submit-params [params]
- (let [tplg-jar-file (params :topologyJar)
- tplg-config (if (not-nil? (params :topologyConfig)) (from-json (params :topologyConfig)))]
- (cond
- (nil? tplg-jar-file) {:valid false :error "missing topology jar file"}
- (nil? tplg-config) {:valid false :error "missing topology config"}
- (nil? (tplg-config "topologyMainClass")) {:valid false :error "topologyMainClass missing in topologyConfig"}
- :else {:valid true})))
-
-(defn run-tplg-submit-cmd [tplg-jar-file tplg-config user]
- (let [tplg-main-class (if (not-nil? tplg-config) (trim (tplg-config "topologyMainClass")))
- tplg-main-class-args (if (not-nil? tplg-config) (tplg-config "topologyMainClassArgs"))
- storm-home (System/getProperty "storm.home")
- storm-conf-dir (str storm-home file-path-separator "conf")
- storm-log-dir (if (not-nil? (*STORM-CONF* "storm.log.dir")) (*STORM-CONF* "storm.log.dir")
- (str storm-home file-path-separator "logs"))
- storm-libs (str storm-home file-path-separator "lib" file-path-separator "*")
- java-cmd (str (System/getProperty "java.home") file-path-separator "bin" file-path-separator "java")
- storm-cmd (str storm-home file-path-separator "bin" file-path-separator "storm")
- tplg-cmd-response (apply sh
- (flatten
- [storm-cmd "jar" tplg-jar-file tplg-main-class
- (if (not-nil? tplg-main-class-args) tplg-main-class-args [])
- (if (not= user "unknown") (str "-c storm.doAsUser=" user) [])]))]
- (log-message "tplg-cmd-response " tplg-cmd-response)
- (cond
- (= (tplg-cmd-response :exit) 0) {"status" "success"}
- (and (not= (tplg-cmd-response :exit) 0)
- (not-nil? (re-find #"already exists on cluster" (tplg-cmd-response :err)))) {"status" "failed" "error" "Topology with the same name exists in cluster"}
- (not= (tplg-cmd-response :exit) 0) {"status" "failed" "error" (clojure.string/trim-newline (tplg-cmd-response :err))}
- :else {"status" "success" "response" "topology deployed"}
- )))
-
-(defn cluster-configuration []
- (thrift/with-configured-nimbus-connection nimbus
- (.getNimbusConf ^Nimbus$Client nimbus)))
-
-(defn topology-history-info
- ([user]
- (thrift/with-configured-nimbus-connection nimbus
- (topology-history-info (.getTopologyHistory ^Nimbus$Client nimbus user) user)))
- ([history user]
- {"topo-history"
- (into [] (.get_topo_ids history))}))
-
-(defn cluster-summary
- ([user]
- (thrift/with-configured-nimbus-connection nimbus
- (cluster-summary (.getClusterInfo ^Nimbus$Client nimbus) user)))
- ([^ClusterSummary summ user]
- (let [sups (.get_supervisors summ)
- used-slots (reduce + (map #(.get_num_used_workers ^SupervisorSummary %) sups))
- total-slots (reduce + (map #(.get_num_workers ^SupervisorSummary %) sups))
- free-slots (- total-slots used-slots)
- topologies (.get_topologies_size summ)
- total-tasks (->> (.get_topologies summ)
- (map #(.get_num_tasks ^TopologySummary %))
- (reduce +))
- total-executors (->> (.get_topologies summ)
- (map #(.get_num_executors ^TopologySummary %))
- (reduce +))
- resourceSummary (if (> (.size sups) 0)
- (reduce #(map + %1 %2)
- (for [^SupervisorSummary s sups
- :let [sup-total-mem (get (.get_total_resources s) Config/SUPERVISOR_MEMORY_CAPACITY_MB)
- sup-total-cpu (get (.get_total_resources s) Config/SUPERVISOR_CPU_CAPACITY)
- sup-avail-mem (max (- sup-total-mem (.get_used_mem s)) 0.0)
- sup-avail-cpu (max (- sup-total-cpu (.get_used_cpu s)) 0.0)]]
- [sup-total-mem sup-total-cpu sup-avail-mem sup-avail-cpu]))
- [0.0 0.0 0.0 0.0])
- total-mem (nth resourceSummary 0)
- total-cpu (nth resourceSummary 1)
- avail-mem (nth resourceSummary 2)
- avail-cpu (nth resourceSummary 3)]
- {"user" user
- "stormVersion" STORM-VERSION
- "supervisors" (count sups)
- "topologies" topologies
- "slotsTotal" total-slots
- "slotsUsed" used-slots
- "slotsFree" free-slots
- "executorsTotal" total-executors
- "tasksTotal" total-tasks
- "schedulerDisplayResource" (*STORM-CONF* Config/SCHEDULER_DISPLAY_RESOURCE)
- "totalMem" total-mem
- "totalCpu" total-cpu
- "availMem" avail-mem
- "availCpu" avail-cpu
- "memAssignedPercentUtil" (if (and (not (nil? total-mem)) (> total-mem 0.0)) (format "%.1f" (* (/ (- total-mem avail-mem) total-mem) 100.0)) 0.0)
- "cpuAssignedPercentUtil" (if (and (not (nil? total-cpu)) (> total-cpu 0.0)) (format "%.1f" (* (/ (- total-cpu avail-cpu) total-cpu) 100.0)) 0.0)})))
-
-(defn convert-to-nimbus-summary[nimbus-seed]
- (let [[host port] (.split nimbus-seed ":")]
- {
- "host" host
- "port" port
- "nimbusLogLink" (nimbus-log-link host)
- "status" "Offline"
- "version" "Not applicable"
- "nimbusUpTime" "Not applicable"
- "nimbusUptimeSeconds" "Not applicable"}
- ))
-
-(defn nimbus-summary
- ([]
- (thrift/with-configured-nimbus-connection nimbus
- (nimbus-summary
- (.get_nimbuses (.getClusterInfo ^Nimbus$Client nimbus)))))
- ([nimbuses]
- (let [nimbus-seeds (set (map #(str %1 ":" (*STORM-CONF* NIMBUS-THRIFT-PORT)) (set (*STORM-CONF* NIMBUS-SEEDS))))
- alive-nimbuses (set (map #(str (.get_host %1) ":" (.get_port %1)) nimbuses))
- offline-nimbuses (clojure.set/difference nimbus-seeds alive-nimbuses)
- offline-nimbuses-summary (map #(convert-to-nimbus-summary %1) offline-nimbuses)]
- {"nimbuses"
- (concat offline-nimbuses-summary
- (for [^NimbusSummary n nimbuses
- :let [uptime (.get_uptime_secs n)]]
- {
- "host" (.get_host n)
- "port" (.get_port n)
- "nimbusLogLink" (nimbus-log-link (.get_host n))
- "status" (if (.is_isLeader n) "Leader" "Not a Leader")
- "version" (.get_version n)
- "nimbusUpTime" (pretty-uptime-sec uptime)
- "nimbusUpTimeSeconds" uptime}))})))
-
-(defn worker-summary-to-json
- [secure? ^WorkerSummary worker-summary]
- (let [host (.get_host worker-summary)
- port (.get_port worker-summary)
- topology-id (.get_topology_id worker-summary)
- uptime-secs (.get_uptime_secs worker-summary)]
- {"supervisorId" (.get_supervisor_id worker-summary)
- "host" host
- "port" port
- "topologyId" topology-id
- "topologyName" (.get_topology_name worker-summary)
- "executorsTotal" (.get_num_executors worker-summary)
- "assignedMemOnHeap" (.get_assigned_memonheap worker-summary)
- "assignedMemOffHeap" (.get_assigned_memoffheap worker-summary)
- "assignedCpu" (.get_assigned_cpu worker-summary)
- "componentNumTasks" (.get_component_to_num_tasks worker-summary)
- "uptime" (pretty-uptime-sec uptime-secs)
- "uptimeSeconds" uptime-secs
- "workerLogLink" (worker-log-link host port topology-id secure?)}))
-
-(defn supervisor-summary-to-json
- [summary]
- (let [slotsTotal (.get_num_workers summary)
- slotsUsed (.get_num_used_workers summary)
- slotsFree (max (- slotsTotal slotsUsed) 0)
- totalMem (get (.get_total_resources summary) Config/SUPERVISOR_MEMORY_CAPACITY_MB)
- totalCpu (get (.get_total_resources summary) Config/SUPERVISOR_CPU_CAPACITY)
- usedMem (.get_used_mem summary)
- usedCpu (.get_used_cpu summary)
- availMem (max (- totalMem usedMem) 0)
- availCpu (max (- totalCpu usedCpu) 0)]
- {"id" (.get_supervisor_id summary)
- "host" (.get_host summary)
- "uptime" (pretty-uptime-sec (.get_uptime_secs summary))
- "uptimeSeconds" (.get_uptime_secs summary)
- "slotsTotal" slotsTotal
- "slotsUsed" slotsUsed
- "slotsFree" slotsFree
- "totalMem" totalMem
- "totalCpu" totalCpu
- "usedMem" usedMem
- "usedCpu" usedCpu
- "logLink" (supervisor-log-link (.get_host summary))
- "availMem" availMem
- "availCpu" availCpu
- "version" (.get_version summary)}))
-
-(defn supervisor-page-info
- ([supervisor-id host include-sys? secure?]
- (thrift/with-configured-nimbus-connection
- nimbus (supervisor-page-info (.getSupervisorPageInfo ^Nimbus$Client nimbus
- supervisor-id
- host
- include-sys?) secure?)))
- ([^SupervisorPageInfo supervisor-page-info secure?]
- ;; ask nimbus to return supervisor workers + any details user is allowed
- ;; access on a per-topology basis (i.e. components)
- (let [supervisors-json (map supervisor-summary-to-json (.get_supervisor_summaries supervisor-page-info))]
- {"supervisors" supervisors-json
- "schedulerDisplayResource" (*STORM-CONF* Config/SCHEDULER_DISPLAY_RESOURCE)
- "workers" (into [] (for [^WorkerSummary worker-summary (.get_worker_summaries supervisor-page-info)]
- (worker-summary-to-json secure? worker-summary)))})))
-
-(defn supervisor-summary
- ([]
- (thrift/with-configured-nimbus-connection nimbus
- (supervisor-summary
- (.get_supervisors (.getClusterInfo ^Nimbus$Client nimbus)))))
- ([summs]
- {"supervisors" (for [^SupervisorSummary s summs]
- (supervisor-summary-to-json s))
- "schedulerDisplayResource" (*STORM-CONF* Config/SCHEDULER_DISPLAY_RESOURCE)}))
-
-(defn all-topologies-summary
- ([]
- (thrift/with-configured-nimbus-connection
- nimbus
- (all-topologies-summary
- (.get_topologies (.getClusterInfo ^Nimbus$Client nimbus)))))
- ([summs]
- {"topologies"
- (for [^TopologySummary t summs]
- {
- "id" (.get_id t)
- "encodedId" (url-encode (.get_id t))
- "owner" (.get_owner t)
- "name" (.get_name t)
- "status" (.get_status t)
- "uptime" (pretty-uptime-sec (.get_uptime_secs t))
- "uptimeSeconds" (.get_uptime_secs t)
- "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)
- "requestedMemOnHeap" (.get_requested_memonheap t)
- "requestedMemOffHeap" (.get_requested_memoffheap t)
- "requestedTotalMem" (+ (.get_requested_memonheap t) (.get_requested_memoffheap t))
- "requestedCpu" (.get_requested_cpu t)
- "assignedMemOnHeap" (.get_assigned_memonheap t)
- "assignedMemOffHeap" (.get_assigned_memoffheap t)
- "assignedTotalMem" (+ (.get_assigned_memonheap t) (.get_assigned_memoffheap t))
- "assignedCpu" (.get_assigned_cpu t)})
- "schedulerDisplayResource" (*STORM-CONF* Config/SCHEDULER_DISPLAY_RESOURCE)}))
-
-(defn topology-stats [window stats]
- (let [times (stats-times (:emitted stats))
- display-map (into {} (for [t times] [t pretty-uptime-sec]))
- display-map (assoc display-map ":all-time" (fn [_] "All time"))]
- (for [w (concat times [":all-time"])
- :let [disp ((display-map w) w)]]
- {"windowPretty" disp
- "window" w
- "emitted" (get-in stats [:emitted w])
- "transferred" (get-in stats [:transferred w])
- "completeLatency" (float-str (get-in stats [:complete-latencies w]))
- "acked" (get-in stats [:acked w])
- "failed" (get-in stats [:failed w])})))
-
-(defn build-visualization [id window include-sys?]
- (thrift/with-configured-nimbus-connection nimbus
- (let [window (if window window ":all-time")
- topology-info (->> (doto
- (GetInfoOptions.)
- (.set_num_err_choice NumErrorsChoice/ONE))
- (.getTopologyInfoWithOpts ^Nimbus$Client nimbus
- id))
- storm-topology (.getTopology ^Nimbus$Client nimbus id)
- spout-executor-summaries (filter (partial spout-summary? storm-topology) (.get_executors topology-info))
- bolt-executor-summaries (filter (partial bolt-summary? storm-topology) (.get_executors topology-info))
- spout-comp-id->executor-summaries (group-by-comp spout-executor-summaries)
- bolt-comp-id->executor-summaries (group-by-comp bolt-executor-summaries)
- bolt-comp-id->executor-summaries (filter-key (mk-include-sys-fn include-sys?) bolt-comp-id->executor-summaries)
- id->spout-spec (.get_spouts storm-topology)
- id->bolt (.get_bolts storm-topology)
- visualizer-data (visualization-data (merge (hashmap-to-persistent id->spout-spec)
- (hashmap-to-persistent id->bolt))
- spout-comp-id->executor-summaries
- bolt-comp-id->executor-summaries
- window
- id)]
- {"visualizationTable" (stream-boxes visualizer-data)})))
-
-(defn- get-error-json
- [topo-id error-info secure?]
- (let [host (get-error-host error-info)
- port (get-error-port error-info)]
- {"lastError" (get-error-data error-info)
- "errorTime" (get-error-time error-info)
- "errorHost" host
- "errorPort" port
- "errorLapsedSecs" (if-let [t (get-error-time error-info)] (time-delta t))
- "errorWorkerLogLink" (worker-log-link host port topo-id secure?)}))
-
-(defn- common-agg-stats-json
- "Returns a JSON representation of a common aggregated statistics."
- [^CommonAggregateStats common-stats]
- {"executors" (.get_num_executors common-stats)
- "tasks" (.get_num_tasks common-stats)
- "emitted" (.get_emitted common-stats)
- "transferred" (.get_transferred common-stats)
- "acked" (.get_acked common-stats)
- "failed" (.get_failed common-stats)
- "requestedMemOnHeap" (.get (.get_resources_map common-stats) Config/TOPOLOGY_COMPONENT_RESOURCES_ONHEAP_MEMORY_MB)
- "requestedMemOffHeap" (.get (.get_resources_map common-stats) Config/TOPOLOGY_COMPONENT_RESOURCES_OFFHEAP_MEMORY_MB)
- "requestedCpu" (.get (.get_resources_map common-stats) Config/TOPOLOGY_COMPONENT_CPU_PCORE_PERCENT)})
-
-(defmulti comp-agg-stats-json
- "Returns a JSON representation of aggregated statistics."
- (fn [_ _ [id ^ComponentAggregateStats s]] (.get_type s)))
-
-(defmethod comp-agg-stats-json ComponentType/SPOUT
- [topo-id secure? [id ^ComponentAggregateStats s]]
- (let [^SpoutAggregateStats ss (.. s get_specific_stats get_spout)
- cs (.get_common_stats s)]
- (merge
- (common-agg-stats-json cs)
- (get-error-json topo-id (.get_last_error s) secure?)
- {"spoutId" id
- "encodedSpoutId" (url-encode id)
- "completeLatency" (float-str (.get_complete_latency_ms ss))})))
-
-(defmethod comp-agg-stats-json ComponentType/BOLT
- [topo-id secure? [id ^ComponentAggregateStats s]]
- (let [^BoltAggregateStats ss (.. s get_specific_stats get_bolt)
- cs (.get_common_stats s)]
- (merge
- (common-agg-stats-json cs)
- (get-error-json topo-id (.get_last_error s) secure?)
- {"boltId" id
- "encodedBoltId" (url-encode id)
- "capacity" (float-str (.get_capacity ss))
- "executeLatency" (float-str (.get_execute_latency_ms ss))
- "executed" (.get_executed ss)
- "processLatency" (float-str (.get_process_latency_ms ss))})))
-
-(defn- unpack-topology-page-info
- "Unpacks the serialized object to data structures"
- [^TopologyPageInfo topo-info window secure?]
- (let [id (.get_id topo-info)
- ^TopologyStats topo-stats (.get_topology_stats topo-info)
- stat->window->number
- {:emitted (.get_window_to_emitted topo-stats)
- :transferred (.get_window_to_transferred topo-stats)
- :complete-latencies (.get_window_to_complete_latencies_ms topo-stats)
- :acked (.get_window_to_acked topo-stats)
- :failed (.get_window_to_failed topo-stats)}
- topo-stats (topology-stats window stat->window->number)
- [debugEnabled
- samplingPct] (if-let [debug-opts (.get_debug_options topo-info)]
- [(.is_enable debug-opts)
- (.get_samplingpct debug-opts)])
- uptime (.get_uptime_secs topo-info)]
- {"id" id
- "encodedId" (url-encode id)
- "owner" (.get_owner topo-info)
- "name" (.get_name topo-info)
- "status" (.get_status topo-info)
- "uptime" (pretty-uptime-sec uptime)
- "uptimeSeconds" uptime
- "tasksTotal" (.get_num_tasks topo-info)
- "workersTotal" (.get_num_workers topo-info)
- "executorsTotal" (.get_num_executors topo-info)
- "schedulerInfo" (.get_sched_status topo-info)
- "requestedMemOnHeap" (.get_requested_memonheap topo-info)
- "requestedMemOffHeap" (.get_requested_memoffheap topo-info)
- "requestedCpu" (.get_requested_cpu topo-info)
- "assignedMemOnHeap" (.get_assigned_memonheap topo-info)
- "assignedMemOffHeap" (.get_assigned_memoffheap topo-info)
- "assignedTotalMem" (+ (.get_assigned_memonheap topo-info) (.get_assigned_memoffheap topo-info))
- "assignedCpu" (.get_assigned_cpu topo-info)
- "topologyStats" topo-stats
- "workers" (map (partial worker-summary-to-json secure?)
- (.get_workers topo-info))
- "spouts" (map (partial comp-agg-stats-json id secure?)
- (.get_id_to_spout_agg_stats topo-info))
- "bolts" (map (partial comp-agg-stats-json id secure?)
- (.get_id_to_bolt_agg_stats topo-info))
- "configuration" (.get_topology_conf topo-info)
- "debug" (or debugEnabled false)
- "samplingPct" (or samplingPct 10)
- "replicationCount" (.get_replication_count topo-info)}))
-
-(defn exec-host-port
- [executors]
- (for [^ExecutorSummary e executors]
- {"host" (.get_host e)
- "port" (.get_port e)}))
-
-(defn worker-host-port
- "Get the set of all worker host/ports"
- [id]
- (thrift/with-configured-nimbus-connection nimbus
- (distinct (exec-host-port (.get_executors (get-topology-info nimbus id))))))
-
-(defn topology-page [id window include-sys? user secure?]
- (thrift/with-configured-nimbus-connection nimbus
- (let [window (if window window ":all-time")
- window-hint (window-hint window)
- topo-page-info (.getTopologyPageInfo ^Nimbus$Client nimbus
- id
- window
- include-sys?)
- topology-conf (from-json (.get_topology_conf topo-page-info))
- msg-timeout (topology-conf TOPOLOGY-MESSAGE-TIMEOUT-SECS)]
- (merge
- (unpack-topology-page-info topo-page-info window secure?)
- {"user" user
- "window" window
- "windowHint" window-hint
- "msgTimeout" msg-timeout
- "configuration" topology-conf
- "visualizationTable" []
- "schedulerDisplayResource" (*STORM-CONF* Config/SCHEDULER_DISPLAY_RESOURCE)}))))
-
-(defn- average
- [vals]
- (/ (reduce + vals) (count vals)))
-
-(defn- merge-with-conj [& mlist]
- (let [flatten-keys (set (filter identity (flatten (map keys mlist))))
- dict-keys-with-empty-list (zipmap flatten-keys (repeat '()))]
- (apply merge-with conj dict-keys-with-empty-list mlist)))
-
-(defn- conj-specific-stats-by-field [window field-fn stats]
- (apply merge-with-conj (map #(into {} (.get (field-fn %) window)) stats)))
-
-(defn- reduce-conj-specific-stats-by-field [agg-val-fn stats-map]
- (let [fn-key-to-str (fn [key]
- (condp instance? key
- String {"stream_id" key}
- GlobalStreamId {"component_id" (.get_componentId key) "stream_id" (.get_streamId key)}
- {"stream_id" (str key)}))]
- (reduce-kv #(conj %1 (merge (fn-key-to-str %2) {"value" (agg-val-fn %3)})) '() stats-map)))
-
-(defn- merge-stats-specific-field-by-stream
- [window field-fn agg-val-fn stats]
- (reduce-conj-specific-stats-by-field agg-val-fn
- (conj-specific-stats-by-field window field-fn stats)))
-
-(defn- merge-executor-common-stats
- [window executor-stats]
- {"emitted"
- (merge-stats-specific-field-by-stream window #(.get_emitted %) sum executor-stats)
- "transferred"
- (merge-stats-specific-field-by-stream window #(.get_transferred %) sum executor-stats)
- })
-
-(defmulti merge-executor-specific-stats
- (fn [_ specific-stats]
- (if (.is_set_spout (first specific-stats)) :spout :bolt)))
-
-(defmethod merge-executor-specific-stats :spout
- [window specific-stats]
- (let [stats (map #(.get_spout %) specific-stats)]
- {"acked"
- (merge-stats-specific-field-by-stream window #(.get_acked %) sum stats)
- "failed"
- (merge-stats-specific-field-by-stream window #(.get_failed %) sum stats)
- "complete_ms_avg"
- (merge-stats-specific-field-by-stream window #(.get_complete_ms_avg %) #(float-str (average %)) stats)
- }
- ))
-
-(defmethod merge-executor-specific-stats :bolt
- [window specific-stats]
- (let [stats (map #(.get_bolt %) specific-stats)]
- {"acked"
- (merge-stats-specific-field-by-stream window #(.get_acked %) sum stats)
- "failed"
- (merge-stats-specific-field-by-stream window #(.get_failed %) sum stats)
- "process_ms_avg"
- (merge-stats-specific-field-by-stream window #(.get_process_ms_avg %) #(float-str (average %)) stats)
- "executed"
- (merge-stats-specific-field-by-stream window #(.get_executed %) sum stats)
- "executed_ms_avg"
- (merge-stats-specific-field-by-stream window #(.get_execute_ms_avg %) #(float-str (average %)) stats)
- }
- ))
-
-(defn merge-executor-stats [window component-id eslist]
- (let [stats (map #(.get_stats %) eslist)
- specific-stats (map #(.get_specific %) stats)]
- (merge {"id" component-id}
- (merge-executor-common-stats window stats)
- (merge-executor-specific-stats window specific-stats))))
-
-(defn topology-metrics-page [id window include-sys?]
- (thrift/with-configured-nimbus-connection nimbus
- (let [window (if window window ":all-time")
- window-hint (window-hint window)
- topology (.getTopology ^Nimbus$Client nimbus id)
- summ (->> (doto
- (GetInfoOptions.)
- (.set_num_err_choice NumErrorsChoice/NONE))
- (.getTopologyInfoWithOpts ^Nimbus$Client nimbus id))
- execs (.get_executors summ)
- spout-summs (filter (partial spout-summary? topology) execs)
- bolt-summs (filter (partial bolt-summary? topology) execs)
- spout-comp-summs (group-by-comp spout-summs)
- bolt-comp-summs (group-by-comp bolt-summs)
- bolt-comp-summs (filter-key (mk-include-sys-fn include-sys?)
- bolt-comp-summs)
- merged-spout-stats (map (fn [[k v]] (merge-executor-stats window k v)) spout-comp-summs)
- merged-bolt-stats (map (fn [[k v]] (merge-executor-stats window k v)) bolt-comp-summs)]
- (merge {"window" window "window-hint" window-hint "spouts" merged-spout-stats "bolts" merged-bolt-stats}))))
-
-(defn topology-lag [id topology-conf]
- (thrift/with-configured-nimbus-connection nimbus
- (let [topology (.getUserTopology ^Nimbus$Client nimbus
- id)]
- (TopologySpoutLag/lag topology topology-conf))))
-
-(defn component-errors
- [errors-list topology-id secure?]
- (let [errors (->> errors-list
- (sort-by #(.get_error_time_secs ^ErrorInfo %))
- reverse)]
- {"componentErrors"
- (for [^ErrorInfo e errors]
- {"errorTime" (get-error-time e)
- "errorHost" (.get_host e)
- "errorPort" (.get_port e)
- "errorWorkerLogLink" (worker-log-link (.get_host e)
- (.get_port e)
- topology-id
- secure?)
- "errorLapsedSecs" (if-let [t (get-error-time e)] (time-delta t))
- "error" (.get_error e)})}))
-
-(defmulti unpack-comp-agg-stat
- (fn [[_ ^ComponentAggregateStats s]] (.get_type s)))
-
-(defmethod unpack-comp-agg-stat ComponentType/BOLT
- [[window ^ComponentAggregateStats s]]
- (let [^CommonAggregateStats comm-s (.get_common_stats s)
- ^SpecificAggregateStats spec-s (.get_specific_stats s)
- ^BoltAggregateStats bolt-s (.get_bolt spec-s)]
- {"window" window
- "windowPretty" (window-hint window)
- "emitted" (.get_emitted comm-s)
- "transferred" (.get_transferred comm-s)
- "acked" (.get_acked comm-s)
- "failed" (.get_failed comm-s)
- "executeLatency" (float-str (.get_execute_latency_ms bolt-s))
- "processLatency" (float-str (.get_process_latency_ms bolt-s))
- "executed" (.get_executed bolt-s)
- "capacity" (float-str (.get_capacity bolt-s))}))
-
-(defmethod unpack-comp-agg-stat ComponentType/SPOUT
- [[window ^ComponentAggregateStats s]]
- (let [^CommonAggregateStats comm-s (.get_common_stats s)
- ^SpecificAggregateStats spec-s (.get_specific_stats s)
- ^SpoutAggregateStats spout-s (.get_spout spec-s)]
- {"window" window
- "windowPretty" (window-hint window)
- "emitted" (.get_emitted comm-s)
- "transferred" (.get_transferred comm-s)
- "acked" (.get_acked comm-s)
- "failed" (.get_failed comm-s)
- "completeLatency" (float-str (.get_complete_latency_ms spout-s))}))
-
-(defn- unpack-bolt-input-stat
- [[^GlobalStreamId s ^ComponentAggregateStats stats]]
- (let [^SpecificAggregateStats sas (.get_specific_stats stats)
- ^BoltAggregateStats bas (.get_bolt sas)
- ^CommonAggregateStats cas (.get_common_stats stats)
- comp-id (.get_componentId s)]
- {"component" comp-id
- "encodedComponentId" (url-encode comp-id)
- "stream" (.get_streamId s)
- "executeLatency" (float-str (.get_execute_latency_ms bas))
- "processLatency" (float-str (.get_process_latency_ms bas))
- "executed" (nil-to-zero (.get_executed bas))
- "acked" (nil-to-zero (.get_acked cas))
- "failed" (nil-to-zero (.get_failed cas))}))
-
-(defmulti unpack-comp-output-stat
- (fn [[_ ^ComponentAggregateStats s]] (.get_type s)))
-
-(defmethod unpack-comp-output-stat ComponentType/BOLT
- [[stream-id ^ComponentAggregateStats stats]]
- (let [^CommonAggregateStats cas (.get_common_stats stats)]
- {"stream" stream-id
- "emitted" (nil-to-zero (.get_emitted cas))
- "transferred" (nil-to-zero (.get_transferred cas))}))
-
-(defmethod unpack-comp-output-stat ComponentType/SPOUT
- [[stream-id ^ComponentAggregateStats stats]]
- (let [^CommonAggregateStats cas (.get_common_stats stats)
- ^SpecificAggregateStats spec-s (.get_specific_stats stats)
- ^SpoutAggregateStats spout-s (.get_spout spec-s)]
- {"stream" stream-id
- "emitted" (nil-to-zero (.get_emitted cas))
- "transferred" (nil-to-zero (.get_transferred cas))
- "completeLatency" (float-str (.get_complete_latency_ms spout-s))
- "acked" (nil-to-zero (.get_acked cas))
- "failed" (nil-to-zero (.get_failed cas))}))
-
-(defmulti unpack-comp-exec-stat
- (fn [_ _ ^ComponentAggregateStats cas] (.get_type (.get_stats ^ExecutorAggregateStats cas))))
-
-(defmethod unpack-comp-exec-stat ComponentType/BOLT
- [topology-id secure? ^ExecutorAggregateStats eas]
- (let [^ExecutorSummary summ (.get_exec_summary eas)
- ^ExecutorInfo info (.get_executor_info summ)
- ^ComponentAggregateStats stats (.get_stats eas)
- ^SpecificAggregateStats ss (.get_specific_stats stats)
- ^BoltAggregateStats bas (.get_bolt ss)
- ^CommonAggregateStats cas (.get_common_stats stats)
- host (.get_host summ)
- port (.get_port summ)
- exec-id (pretty-executor-info info)
- uptime (.get_uptime_secs summ)]
- {"id" exec-id
- "encodedId" (url-encode exec-id)
- "uptime" (pretty-uptime-sec uptime)
- "uptimeSeconds" uptime
- "host" host
- "port" port
- "emitted" (nil-to-zero (.get_emitted cas))
- "transferred" (nil-to-zero (.get_transferred cas))
- "capacity" (float-str (nil-to-zero (.get_capacity bas)))
- "executeLatency" (float-str (.get_execute_latency_ms bas))
- "executed" (nil-to-zero (.get_executed bas))
- "processLatency" (float-str (.get_process_latency_ms bas))
- "acked" (nil-to-zero (.get_acked cas))
- "failed" (nil-to-zero (.get_failed cas))
- "workerLogLink" (worker-log-link host port topology-id secure?)}))
-
-(defmethod unpack-comp-exec-stat ComponentType/SPOUT
- [topology-id secure? ^ExecutorAggregateStats eas]
- (let [^ExecutorSummary summ (.get_exec_summary eas)
- ^ExecutorInfo info (.get_executor_info summ)
- ^ComponentAggregateStats stats (.get_stats eas)
- ^SpecificAggregateStats ss (.get_specific_stats stats)
- ^SpoutAggregateStats sas (.get_spout ss)
- ^CommonAggregateStats cas (.get_common_stats stats)
- host (.get_host summ)
- port (.get_port summ)
- exec-id (pretty-executor-info info)
- uptime (.get_uptime_secs summ)]
- {"id" exec-id
- "encodedId" (url-encode exec-id)
- "uptime" (pretty-uptime-sec uptime)
- "uptimeSeconds" uptime
- "host" host
- "port" port
- "emitted" (nil-to-zero (.get_emitted cas))
- "transferred" (nil-to-zero (.get_transferred cas))
- "completeLatency" (float-str (.get_complete_latency_ms sas))
- "acked" (nil-to-zero (.get_acked cas))
- "failed" (nil-to-zero (.get_failed cas))
- "workerLogLink" (worker-log-link host port topology-id secure?)}))
-
-(defmulti unpack-component-page-info
- "Unpacks component-specific info to clojure data structures"
- (fn [^ComponentPageInfo info & _]
- (.get_component_type info)))
-
-(defmethod unpack-component-page-info ComponentType/BOLT
- [^ComponentPageInfo info topology-id window include-sys? secure?]
- (merge
- {"boltStats" (map unpack-comp-agg-stat (.get_window_to_stats info))
- "inputStats" (map unpack-bolt-input-stat (.get_gsid_to_input_stats info))
- "outputStats" (map unpack-comp-output-stat (.get_sid_to_output_stats info))
- "executorStats" (map (partial unpack-comp-exec-stat topology-id secure?)
- (.get_exec_stats info))}
- (-> info .get_errors (component-errors topology-id secure?))))
-
-(defmethod unpack-component-page-info ComponentType/SPOUT
- [^ComponentPageInfo info topology-id window include-sys? secure?]
- (merge
- {"spoutSummary" (map unpack-comp-agg-stat (.get_window_to_stats info))
- "outputStats" (map unpack-comp-output-stat (.get_sid_to_output_stats info))
- "executorStats" (map (partial unpack-comp-exec-stat topology-id secure?)
- (.get_exec_stats info))}
- (-> info .get_errors (component-errors topology-id secure?))))
-
-(defn get-active-profile-actions
- [nimbus topology-id component]
- (let [profile-actions (.getComponentPendingProfileActions nimbus
- topology-id
- component
- ProfileAction/JPROFILE_STOP)
- latest-profile-actions (map clojurify-profile-request profile-actions)
- active-actions (map (fn [profile-action]
- {"host" (:host profile-action)
- "port" (str (:port profile-action))
- "dumplink" (worker-dump-link (:host profile-action) (str (:port profile-action)) topology-id)
- "timestamp" (str (- (:timestamp profile-action) (System/currentTimeMillis)))})
- latest-profile-actions)]
- (log-message "Latest-active actions are: " (pr-str active-actions))
- active-actions))
-
-(defn component-page
- [topology-id component window include-sys? user secure?]
- (thrift/with-configured-nimbus-connection nimbus
- (let [window (or window ":all-time")
- window-hint (window-hint window)
- comp-page-info (.getComponentPageInfo ^Nimbus$Client nimbus
- topology-id
- component
- window
- include-sys?)
- topology-conf (from-json (.getTopologyConf ^Nimbus$Client nimbus
- topology-id))
- msg-timeout (topology-conf TOPOLOGY-MESSAGE-TIMEOUT-SECS)
- [debugEnabled
- samplingPct] (if-let [debug-opts (.get_debug_options comp-page-info)]
- [(.is_enable debug-opts)
- (.get_samplingpct debug-opts)])]
- (assoc
- (unpack-component-page-info comp-page-info
- topology-id
- window
- include-sys?
- secure?)
- "user" user
- "id" component
- "encodedId" (url-encode component)
- "name" (.get_topology_name comp-page-info)
- "executors" (.get_num_executors comp-page-info)
- "tasks" (.get_num_tasks comp-page-info)
- "requestedMemOnHeap" (.get (.get_resources_map comp-page-info) Config/TOPOLOGY_COMPONENT_RESOURCES_ONHEAP_MEMORY_MB)
- "requestedMemOffHeap" (.get (.get_resources_map comp-page-info) Config/TOPOLOGY_COMPONENT_RESOURCES_OFFHEAP_MEMORY_MB)
- "requestedCpu" (.get (.get_resources_map comp-page-info) Config/TOPOLOGY_COMPONENT_CPU_PCORE_PERCENT)
- "schedulerDisplayResource" (*STORM-CONF* Config/SCHEDULER_DISPLAY_RESOURCE)
- "topologyId" topology-id
- "topologyStatus" (.get_topology_status comp-page-info)
- "encodedTopologyId" (url-encode topology-id)
- "window" window
- "componentType" (-> comp-page-info .get_component_type str lower-case)
- "windowHint" window-hint
- "debug" (or debugEnabled false)
- "samplingPct" (or samplingPct 10)
- "eventLogLink" (event-log-link topology-id
- component
- (.get_eventlog_host comp-page-info)
- (.get_eventlog_port comp-page-info)
- secure?)
- "profilingAndDebuggingCapable" (not on-windows?)
- "profileActionEnabled" (*STORM-CONF* WORKER-PROFILER-ENABLED)
- "profilerActive" (if (*STORM-CONF* WORKER-PROFILER-ENABLED)
- (get-active-profile-actions nimbus topology-id component)
- [])))))
-
-(defn- level-to-dict [level]
- (if level
- (let [timeout (.get_reset_log_level_timeout_secs level)
- timeout-epoch (.get_reset_log_level_timeout_epoch level)
- target-level (.get_target_log_level level)
- reset-level (.get_reset_log_level level)]
- {"target_level" (.toString (Level/toLevel target-level))
- "reset_level" (.toString (Level/toLevel reset-level))
- "timeout" timeout
- "timeout_epoch" timeout-epoch})))
-
-(defn log-config [topology-id]
- (thrift/with-configured-nimbus-connection
- nimbus
- (let [log-config (.getLogConfig ^Nimbus$Client nimbus topology-id)
- named-logger-levels (into {}
- (for [[key val] (.get_named_logger_level log-config)]
- [(str key) (level-to-dict val)]))]
- {"namedLoggerLevels" named-logger-levels})))
-
-(defn topology-config [topology-id]
- (thrift/with-configured-nimbus-connection nimbus
- (from-json (.getTopologyConf ^Nimbus$Client nimbus topology-id))))
-
-(defn topology-op-response [topology-id op]
- {"topologyOperation" op,
- "topologyId" topology-id,
- "status" "success"
- })
-
-(defn component-op-response [topology-id component-id op]
- {"topologyOperation" op,
- "topologyId" topology-id,
- "componentId" component-id,
- "status" "success"
- })
-
-(defn check-include-sys?
- [sys?]
- (if (or (nil? sys?) (= "false" sys?)) false true))
-
-(def http-creds-handler (AuthUtils/GetUiHttpCredentialsPlugin *STORM-CONF*))
-
-(defn populate-context!
- "Populate the Storm RequestContext from an servlet-request. This should be called in each handler"
- [servlet-request]
- (when http-creds-handler
- (.populateContext http-creds-handler (ReqContext/context) servlet-request)))
-
-(defn get-user-name
- [servlet-request]
- (.getUserName http-creds-handler servlet-request))
-
-(defn json-profiling-disabled
- "Return a JSON response communicating that profiling is disabled and
- therefore unavailable."
- [callback]
- (json-response {"status" "disabled",
- "message" "Profiling is not enabled on this server"}
- callback
- :status 501))
-
-(defroutes main-routes
- (GET "/api/v1/cluster/configuration" [& m]
- (mark! ui:num-cluster-configuration-http-requests)
- (json-response (cluster-configuration)
- (:callback m) :serialize-fn identity))
- (GET "/api/v1/cluster/summary" [:as {:keys [cookies servlet-request]} & m]
- (mark! ui:num-cluster-summary-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "getClusterInfo")
- (let [user (get-user-name servlet-request)]
- (json-response (assoc (cluster-summary user)
- "bugtracker-url" (*STORM-CONF* UI-PROJECT-BUGTRACKER-URL)
- "central-log-url" (*STORM-CONF* UI-CENTRAL-LOGGING-URL)) (:callback m))))
- (GET "/api/v1/nimbus/summary" [:as {:keys [cookies servlet-request]} & m]
- (mark! ui:num-nimbus-summary-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "getClusterInfo")
- (json-response (nimbus-summary) (:callback m)))
- (GET "/api/v1/history/summary" [:as {:keys [cookies servlet-request]} & m]
- (let [user (.getUserName http-creds-handler servlet-request)]
- (json-response (topology-history-info user) (:callback m))))
- (GET "/api/v1/supervisor/summary" [:as {:keys [cookies servlet-request]} & m]
- (mark! ui:num-supervisor-summary-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "getClusterInfo")
- (json-response (assoc (supervisor-summary)
- "logviewerPort" (*STORM-CONF* LOGVIEWER-PORT)) (:callback m)))
- (GET "/api/v1/supervisor" [:as {:keys [cookies servlet-request scheme]} & m]
- (.mark ui:num-supervisor-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "getSupervisorPageInfo")
- ;; supervisor takes either an id or a host query parameter, and technically both
- ;; that said, if both the id and host are provided, the id wins
- (let [id (:id m)
- host (:host m)]
- (json-response (assoc (supervisor-page-info id host (check-include-sys? (:sys m)) (= scheme :https))
- "logviewerPort" (*STORM-CONF* LOGVIEWER-PORT)) (:callback m))))
- (GET "/api/v1/topology/summary" [:as {:keys [cookies servlet-request]} & m]
- (mark! ui:num-all-topologies-summary-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "getClusterInfo")
- (json-response (all-topologies-summary) (:callback m)))
- (GET "/api/v1/topology-workers/:id" [:as {:keys [cookies servlet-request]} id & m]
- (let [id (url-decode id)]
- (json-response {"hostPortList" (worker-host-port id)
- "logviewerPort" (*STORM-CONF* LOGVIEWER-PORT)} (:callback m))))
- (GET "/api/v1/topology/:id" [:as {:keys [cookies servlet-request scheme]} id & m]
- (mark! ui:num-topology-page-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "getTopology" (topology-config id))
- (let [user (get-user-name servlet-request)]
- (json-response (topology-page id (:window m) (check-include-sys? (:sys m)) user (= scheme :https)) (:callback m))))
- (GET "/api/v1/topology/:id/metrics" [:as {:keys [cookies servlet-request]} id & m]
- (mark! ui:num-topology-metric-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "getTopology" (topology-config id))
- (json-response (topology-metrics-page id (:window m) (check-include-sys? (:sys m))) (:callback m)))
- (GET "/api/v1/topology/:id/lag" [:as {:keys [cookies servlet-request scheme]} id & m]
- (mark! ui:num-topology-lag-http-requests)
- (populate-context! servlet-request)
- (let [topology-conf (topology-config id)]
- (assert-authorized-user "getUserTopology" topology-conf)
- (json-response (topology-lag id topology-conf) nil)))
- (GET "/api/v1/topology/:id/visualization-init" [:as {:keys [cookies servlet-request]} id & m]
- (mark! ui:num-build-visualization-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "getTopology" (topology-config id))
- (json-response (build-visualization id (:window m) (check-include-sys? (:sys m))) (:callback m)))
- (GET "/api/v1/topology/:id/visualization" [:as {:keys [cookies servlet-request]} id & m]
- (mark! ui:num-mk-visualization-data-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "getTopology" (topology-config id))
- (json-response (mk-visualization-data id (:window m) (check-include-sys? (:sys m))) (:callback m)))
- (GET "/api/v1/topology/:id/component/:component" [:as {:keys [cookies servlet-request scheme]} id component & m]
- (mark! ui:num-component-page-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "getTopology" (topology-config id))
- (let [user (get-user-name servlet-request)]
- (json-response
- (component-page id component (:window m) (check-include-sys? (:sys m)) user (= scheme :https))
- (:callback m))))
- (GET "/api/v1/topology/:id/logconfig" [:as {:keys [cookies servlet-request]} id & m]
- (mark! ui:num-log-config-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "getTopology" (topology-config id))
- (json-response (log-config id) (:callback m)))
- (POST "/api/v1/topology/:id/activate" [:as {:keys [cookies servlet-request]} id & m]
- (mark! ui:num-activate-topology-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "activate" (topology-config id))
- (thrift/with-configured-nimbus-connection nimbus
- (let [tplg (->> (doto
- (GetInfoOptions.)
- (.set_num_err_choice NumErrorsChoice/NONE))
- (.getTopologyInfoWithOpts ^Nimbus$Client nimbus id))
- name (.get_name tplg)]
- (.activate nimbus name)
- (log-message "Activating topology '" name "'")))
- (json-response (topology-op-response id "activate") (m "callback")))
- (POST "/api/v1/topology/:id/deactivate" [:as {:keys [cookies servlet-request]} id & m]
- (mark! ui:num-deactivate-topology-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "deactivate" (topology-config id))
- (thrift/with-configured-nimbus-connection nimbus
- (let [tplg (->> (doto
- (GetInfoOptions.)
- (.set_num_err_choice NumErrorsChoice/NONE))
- (.getTopologyInfoWithOpts ^Nimbus$Client nimbus id))
- name (.get_name tplg)]
- (.deactivate nimbus name)
- (log-message "Deactivating topology '" name "'")))
- (json-response (topology-op-response id "deactivate") (m "callback")))
- (POST "/api/v1/topology/:id/debug/:action/:spct" [:as {:keys [cookies servlet-request]} id action spct & m]
- (mark! ui:num-debug-topology-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "debug" (topology-config id))
- (thrift/with-configured-nimbus-connection nimbus
- (let [tplg (->> (doto
- (GetInfoOptions.)
- (.set_num_err_choice NumErrorsChoice/NONE))
- (.getTopologyInfoWithOpts ^Nimbus$Client nimbus id))
- name (.get_name tplg)
- enable? (= "enable" action)]
- (.debug nimbus name "" enable? (Integer/parseInt spct))
- (log-message "Debug topology [" name "] action [" action "] sampling pct [" spct "]")))
- (json-response (topology-op-response id (str "debug/" action)) (m "callback")))
- (POST "/api/v1/topology/:id/component/:component/debug/:action/:spct" [:as {:keys [cookies servlet-request]} id component action spct & m]
- (mark! ui:num-component-op-response-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "debug" (topology-config id))
- (thrift/with-configured-nimbus-connection nimbus
- (let [tplg (->> (doto
- (GetInfoOptions.)
- (.set_num_err_choice NumErrorsChoice/NONE))
- (.getTopologyInfoWithOpts ^Nimbus$Client nimbus id))
- name (.get_name tplg)
- enable? (= "enable" action)]
- (.debug nimbus name component enable? (Integer/parseInt spct))
- (log-message "Debug topology [" name "] component [" component "] action [" action "] sampling pct [" spct "]")))
- (json-response (component-op-response id component (str "/debug/" action)) (m "callback")))
- (POST "/api/v1/topology/:id/rebalance/:wait-time" [:as {:keys [cookies servlet-request]} id wait-time & m]
- (mark! ui:num-topology-op-response-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "rebalance" (topology-config id))
- (thrift/with-configured-nimbus-connection nimbus
- (let [tplg (->> (doto
- (GetInfoOptions.)
- (.set_num_err_choice NumErrorsChoice/NONE))
- (.getTopologyInfoWithOpts ^Nimbus$Client nimbus id))
- name (.get_name tplg)
- rebalance-options (m "rebalanceOptions")
- options (RebalanceOptions.)]
- (.set_wait_secs options (Integer/parseInt wait-time))
- (if (and (not-nil? rebalance-options) (contains? rebalance-options "numWorkers"))
- (.set_num_workers options (Integer/parseInt (.toString (rebalance-options "numWorkers")))))
- (if (and (not-nil? rebalance-options) (contains? rebalance-options "executors"))
- (doseq [keyval (rebalance-options "executors")]
- (.put_to_num_executors options (key keyval) (Integer/parseInt (.toString (val keyval))))))
- (.rebalance nimbus name options)
- (log-message "Rebalancing topology '" name "' with wait time: " wait-time " secs")))
- (json-response (topology-op-response id "rebalance") (m "callback")))
- (POST "/api/v1/topology/:id/kill/:wait-time" [:as {:keys [cookies servlet-request]} id wait-time & m]
- (mark! ui:num-topology-op-response-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "killTopology" (topology-config id))
- (thrift/with-configured-nimbus-connection nimbus
- (let [tplg (->> (doto
- (GetInfoOptions.)
- (.set_num_err_choice NumErrorsChoice/NONE))
- (.getTopologyInfoWithOpts ^Nimbus$Client nimbus id))
- name (.get_name tplg)
- options (KillOptions.)]
- (.set_wait_secs options (Integer/parseInt wait-time))
- (.killTopologyWithOpts nimbus name options)
- (log-message "Killing topology '" name "' with wait time: " wait-time " secs")))
- (json-response (topology-op-response id "kill") (m "callback")))
- (POST "/api/v1/topology/:id/logconfig" [:as {:keys [cookies servlet-request]} id namedLoggerLevels & m]
- (mark! ui:num-topology-op-response-http-requests)
- (populate-context! servlet-request)
- (assert-authorized-user "setLogConfig" (topology-config id))
- (thrift/with-configured-nimbus-connection
- nimbus
- (let [new-log-config (LogConfig.)]
- (doseq [[key level] namedLoggerLevels]
- (let [logger-name (str key)
- target-level (.get level "target_level")
- timeout (or (.get level "timeout") 0)
- named-logger-level (LogLevel.)]
- ;; if target-level is nil, do not set it, user wants to clear
- (log-message "The target level for " logger-name " is " target-level)
- (if (nil? target-level)
- (do
- (.set_action named-logger-level LogLevelAction/REMOVE)
- (.unset_target_log_level named-logger-level))
- (do
- (.set_action named-logger-level LogLevelAction/UPDATE)
- ;; the toLevel here ensures the string we get is valid
- (.set_target_log_level named-logger-level (.name (Level/toLevel target-level)))
- (.set_reset_log_level_timeout_secs named-logger-level timeout)))
- (log-message "Adding this " logger-name " " named-logger-level " to " new-log-config)
- (.put_to_named_logger_level new-log-config logger-name named-logger-level)))
- (log-message "Setting topology " id " log config " new-log-config)
- (.setLogConfig nimbus id new-log-config)
- (json-response (log-config id) (m "callback")))))
-
- (GET "/api/v1/topology/:id/profiling/start/:host-port/:timeout"
- [:as {:keys [servlet-request]} id host-port timeout & m]
- (if (get *STORM-CONF* WORKER-PROFILER-ENABLED)
- (do
- (populate-context! servlet-request)
- (thrift/with-configured-nimbus-connection nimbus
- (assert-authorized-user "setWorkerProfiler" (topology-config id))
- (let [[host, port] (split host-port #":")
- nodeinfo (NodeInfo. host (set [(Long. port)]))
- timestamp (+ (System/currentTimeMillis) (* 60000 (Long. timeout)))
- request (ProfileRequest. nodeinfo
- ProfileAction/JPROFILE_STOP)]
- (.set_time_stamp request timestamp)
- (.setWorkerProfiler nimbus id request)
- (json-response {"status" "ok"
- "id" host-port
- "timeout" timeout
- "dumplink" (worker-dump-link
- host
- port
- id)}
- (m "callback")))))
- (json-profiling-disabled (m "callback"))))
-
- (GET "/api/v1/topology/:id/profiling/stop/:host-port"
- [:as {:keys [servlet-request]} id host-port & m]
- (if (get *STORM-CONF* WORKER-PROFILER-ENABLED)
- (do
- (populate-context! servlet-request)
- (thrift/with-configured-nimbus-connection nimbus
- (assert-authorized-user "setWorkerProfiler" (topology-config id))
- (let [[host, port] (split host-port #":")
- nodeinfo (NodeInfo. host (set [(Long. port)]))
- timestamp 0
- request (ProfileRequest. nodeinfo
- ProfileAction/JPROFILE_STOP)]
- (.set_time_stamp request timestamp)
- (.setWorkerProfiler nimbus id request)
- (json-response {"status" "ok"
- "id" host-port}
- (m "callback")))))
- (json-profiling-disabled (m "callback"))))
-
- (GET "/api/v1/topology/:id/profiling/dumpprofile/:host-port"
- [:as {:keys [servlet-request]} id host-port & m]
- (if (get *STORM-CONF* WORKER-PROFILER-ENABLED)
- (do
- (populate-context! servlet-request)
- (thrift/with-configured-nimbus-connection nimbus
- (assert-authorized-user "setWorkerProfiler" (topology-config id))
- (let [[host, port] (split host-port #":")
- nodeinfo (NodeInfo. host (set [(Long. port)]))
- timestamp (System/currentTimeMillis)
- request (ProfileRequest. nodeinfo
- ProfileAction/JPROFILE_DUMP)]
- (.set_time_stamp request timestamp)
- (.setWorkerProfiler nimbus id request)
- (json-response {"status" "ok"
- "id" host-port}
- (m "callback")))))
- (json-profiling-disabled (m "callback"))))
-
- (GET "/api/v1/topology/:id/profiling/dumpjstack/:host-port"
- [:as {:keys [servlet-request]} id host-port & m]
- (populate-context! servlet-request)
- (thrift/with-configured-nimbus-connection nimbus
- (assert-authorized-user "setWorkerProfiler" (topology-config id))
- (let [[host, port] (split host-port #":")
- nodeinfo (NodeInfo. host (set [(Long. port)]))
- timestamp (System/currentTimeMillis)
- request (ProfileRequest. nodeinfo
- ProfileAction/JSTACK_DUMP)]
- (.set_time_stamp request timestamp)
- (.setWorkerProfiler nimbus id request)
- (json-response {"status" "ok"
- "id" host-port}
- (m "callback")))))
-
- (GET "/api/v1/topology/:id/profiling/restartworker/:host-port"
- [:as {:keys [servlet-request]} id host-port & m]
- (populate-context! servlet-request)
- (thrift/with-configured-nimbus-connection nimbus
- (assert-authorized-user "setWorkerProfiler" (topology-config id))
- (let [[host, port] (split host-port #":")
- nodeinfo (NodeInfo. host (set [(Long. port)]))
- timestamp (System/currentTimeMillis)
- request (ProfileRequest. nodeinfo
- ProfileAction/JVM_RESTART)]
- (.set_time_stamp request timestamp)
- (.setWorkerProfiler nimbus id request)
- (json-response {"status" "ok"
- "id" host-port}
- (m "callback")))))
-
- (GET "/api/v1/topology/:id/profiling/dumpheap/:host-port"
- [:as {:keys [servlet-request]} id host-port & m]
- (populate-context! servlet-request)
- (thrift/with-configured-nimbus-connection nimbus
- (assert-authorized-user "setWorkerProfiler" (topology-config id))
- (let [[host, port] (split host-port #":")
- nodeinfo (NodeInfo. host (set [(Long. port)]))
- timestamp (System/currentTimeMillis)
- request (ProfileRequest. nodeinfo
- ProfileAction/JMAP_DUMP)]
- (.set_time_stamp request timestamp)
- (.setWorkerProfiler nimbus id request)
- (json-response {"status" "ok"
- "id" host-port}
- (m "callback")))))
-
- (GET "/" [:as {cookies :cookies}]
- (mark! ui:num-main-page-http-requests)
- (resp/redirect "/index.html"))
- (route/resources "/")
- (route/not-found "Page not found"))
-
-(defn catch-errors
- [handler]
- (fn [request]
- (try
- (handler request)
- (catch Exception ex
- (json-response (exception->json ex) ((:query-params request) "callback") :status 500)))))
-
-(def app
- (handler/site (-> main-routes
- (wrap-cors :access-control-allow-origin [#".*"]
- :access-control-allow-headers :any
- :access-control-allow-methods [:get :put :post :delete])
- (wrap-json-params)
- (wrap-multipart-params)
- (wrap-reload '[org.apache.storm.ui.core])
- requests-middleware
- catch-errors)))
-
-(defn start-server!
- []
- (try
- (let [conf *STORM-CONF*
- header-buffer-size (int (.get conf UI-HEADER-BUFFER-BYTES))
- filters-confs [{:filter-class (conf UI-FILTER)
- :filter-params (conf UI-FILTER-PARAMS)}]
- https-port (if (not-nil? (conf UI-HTTPS-PORT)) (conf UI-HTTPS-PORT) 0)
- https-ks-path (conf UI-HTTPS-KEYSTORE-PATH)
- https-ks-password (conf UI-HTTPS-KEYSTORE-PASSWORD)
- https-ks-type (conf UI-HTTPS-KEYSTORE-TYPE)
- https-key-password (conf UI-HTTPS-KEY-PASSWORD)
- https-ts-path (conf UI-HTTPS-TRUSTSTORE-PATH)
- https-ts-password (conf UI-HTTPS-TRUSTSTORE-PASSWORD)
- https-ts-type (conf UI-HTTPS-TRUSTSTORE-TYPE)
- https-want-client-auth (conf UI-HTTPS-WANT-CLIENT-AUTH)
- https-need-client-auth (conf UI-HTTPS-NEED-CLIENT-AUTH)
- http-x-frame-options (conf UI-HTTP-X-FRAME-OPTIONS)]
- (start-metrics-reporters conf)
- (validate-x-frame-options! http-x-frame-options)
- (storm-run-jetty {:port (conf UI-PORT)
- :host (conf UI-HOST)
- :https-port https-port
- :configurator (fn [server]
- (config-ssl server
- https-port
- https-ks-path
- https-ks-password
- https-ks-type
- https-key-password
- https-ts-path
- https-ts-password
- https-ts-type
- https-need-client-auth
- https-want-client-auth)
- (doseq [connector (.getConnectors server)]
- (.setRequestHeaderSize connector header-buffer-size))
- (config-filter server app filters-confs http-x-frame-options))}))
- (catch Exception ex
- (log-error ex))))
-
-(defn -main
- []
- (log-message "Starting ui server for storm version '" STORM-VERSION "'")
- (start-server!))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/ui/helpers.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/ui/helpers.clj b/storm-core/src/clj/backtype/storm/ui/helpers.clj
deleted file mode 100644
index 94b426b..0000000
--- a/storm-core/src/clj/backtype/storm/ui/helpers.clj
+++ /dev/null
@@ -1,275 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.ui.helpers
- (:use compojure.core)
- (:use [hiccup core page-helpers])
- (:use [clojure
- [string :only [blank? join]]
- [walk :only [keywordize-keys]]])
- (:use [org.apache.storm config log])
- (:use [org.apache.storm.util :only [clojurify-structure uuid defnk to-json url-encode not-nil?]])
- (:use [clj-time coerce format])
- (:import [org.apache.storm.generated ExecutorInfo ExecutorSummary])
- (:import [org.apache.storm.logging.filters AccessLoggingFilter])
- (:import [java.util EnumSet])
- (:import [org.eclipse.jetty.server Server]
- [org.eclipse.jetty.server.nio SelectChannelConnector]
- [org.eclipse.jetty.server.ssl SslSocketConnector]
- [org.eclipse.jetty.servlet ServletHolder FilterMapping]
- [org.eclipse.jetty.util.ssl SslContextFactory]
- [org.eclipse.jetty.server DispatcherType]
- [org.eclipse.jetty.servlets CrossOriginFilter])
- (:require [ring.util servlet]
- [ring.util.response :as response])
- (:require [compojure.route :as route]
- [compojure.handler :as handler])
- (:require [metrics.meters :refer [defmeter mark!]]))
-
-(defmeter num-web-requests)
-
-(defn requests-middleware
- "Wrap request with Coda Hale metric for counting the number of web requests,
- and add Cache-Control: no-cache for html files in root directory (index.html, topology.html, etc)"
- [handler]
- (fn [req]
- (.mark num-web-requests)
- (let [uri (:uri req)
- res (handler req)
- content-type (response/get-header res "Content-Type")]
- ;; check that the response is html and that the path is for a root page: a single / in the path
- ;; then we know we don't want it cached (e.g. /index.html)
- (if (and (= content-type "text/html")
- (= 1 (count (re-seq #"/" uri))))
- ;; response for html page in root directory, no-cache
- (response/header res "Cache-Control" "no-cache")
- ;; else, carry on
- res))))
-
-
-(defn split-divide [val divider]
- [(Integer. (int (/ val divider))) (mod val divider)]
- )
-
-(def PRETTY-SEC-DIVIDERS
- [["s" 60]
- ["m" 60]
- ["h" 24]
- ["d" nil]])
-
-(def PRETTY-MS-DIVIDERS
- (cons ["ms" 1000]
- PRETTY-SEC-DIVIDERS))
-
-(defn pretty-uptime-str* [val dividers]
- (let [val (if (string? val) (Integer/parseInt val) val)
- vals (reduce (fn [[state val] [_ divider]]
- (if (pos? val)
- (let [[divided mod] (if divider
- (split-divide val divider)
- [nil val])]
- [(concat state [mod])
- divided]
- )
- [state val]
- ))
- [[] val]
- dividers)
- strs (->>
- (first vals)
- (map
- (fn [[suffix _] val]
- (str val suffix))
- dividers
- ))]
- (join " " (reverse strs))
- ))
-
-(defn pretty-uptime-sec [secs]
- (pretty-uptime-str* secs PRETTY-SEC-DIVIDERS))
-
-(defn pretty-uptime-ms [ms]
- (pretty-uptime-str* ms PRETTY-MS-DIVIDERS))
-
-
-(defelem table [headers-map data]
- [:table
- [:thead
- [:tr
- (for [h headers-map]
- [:th (if (:text h) [:span (:attr h) (:text h)] h)])
- ]]
- [:tbody
- (for [row data]
- [:tr
- (for [col row]
- [:td col]
- )]
- )]
- ])
-
-(defn url-format [fmt & args]
- (String/format fmt
- (to-array (map #(url-encode (str %)) args))))
-
-(defn pretty-executor-info [^ExecutorInfo e]
- (str "[" (.get_task_start e) "-" (.get_task_end e) "]"))
-
-(defn unauthorized-user-json
- [user]
- {"error" "No Authorization"
- "errorMessage" (str "User " user " is not authorized.")})
-
-(defn unauthorized-user-html [user]
- [[:h2 "User '" (escape-html user) "' is not authorized."]])
-
-(defn- mk-ssl-connector [port ks-path ks-password ks-type key-password
- ts-path ts-password ts-type need-client-auth want-client-auth]
- (let [sslContextFactory (doto (SslContextFactory.)
- (.setExcludeCipherSuites (into-array String ["SSL_RSA_WITH_RC4_128_MD5" "SSL_RSA_WITH_RC4_128_SHA"]))
- (.setExcludeProtocols (into-array String ["SSLv3"]))
- (.setAllowRenegotiate false)
- (.setKeyStorePath ks-path)
- (.setKeyStoreType ks-type)
- (.setKeyStorePassword ks-password)
- (.setKeyManagerPassword key-password))]
- (if (and (not-nil? ts-path) (not-nil? ts-password) (not-nil? ts-type))
- (do
- (.setTrustStore sslContextFactory ts-path)
- (.setTrustStoreType sslContextFactory ts-type)
- (.setTrustStorePassword sslContextFactory ts-password)))
- (cond
- need-client-auth (.setNeedClientAuth sslContextFactory true)
- want-client-auth (.setWantClientAuth sslContextFactory true))
- (doto (SslSocketConnector. sslContextFactory)
- (.setPort port))))
-
-
-(defn config-ssl [server port ks-path ks-password ks-type key-password
- ts-path ts-password ts-type need-client-auth want-client-auth]
- (when (> port 0)
- (.addConnector server (mk-ssl-connector port ks-path ks-password ks-type key-password
- ts-path ts-password ts-type need-client-auth want-client-auth))))
-
-(defn cors-filter-handler
- []
- (doto (org.eclipse.jetty.servlet.FilterHolder. (CrossOriginFilter.))
- (.setInitParameter CrossOriginFilter/ALLOWED_ORIGINS_PARAM "*")
- (.setInitParameter CrossOriginFilter/ALLOWED_METHODS_PARAM "GET, POST, PUT")
- (.setInitParameter CrossOriginFilter/ALLOWED_HEADERS_PARAM "X-Requested-With, X-Requested-By, Access-Control-Allow-Origin, Content-Type, Content-Length, Accept, Origin")
- (.setInitParameter CrossOriginFilter/ACCESS_CONTROL_ALLOW_ORIGIN_HEADER "*")
- ))
-
-(defn validate-x-frame-options!
- [x-frame-options]
- (if (.startsWith x-frame-options "ALLOW-FROM http") nil
- (case x-frame-options
- "DENY" nil
- "SAMEORIGIN" nil
- (throw
- (IllegalArgumentException. "Invalid X-Frame-Option specified!")))))
-
-(defn x-frame-options-filter-handler
- [x-frame-options]
- (let [filter (proxy [javax.servlet.Filter] []
- (doFilter [request response chain]
- (.setHeader response "X-Frame-Options" x-frame-options)
- (.doFilter chain request response))
- (init [config])
- (destroy [])
- )]
- (org.eclipse.jetty.servlet.FilterHolder. filter)))
-
-(defn mk-access-logging-filter-handler []
- (org.eclipse.jetty.servlet.FilterHolder. (AccessLoggingFilter.)))
-
-(defn config-filter
-([server handler filters-conf] (config-filter server handler filters-conf nil))
- ([server handler filters-confs http-x-frame-options](if filters-confs
- (let [servlet-holder (ServletHolder.
- (ring.util.servlet/servlet handler))
- context (doto (org.eclipse.jetty.servlet.ServletContextHandler. server "/")
- (.addServlet servlet-holder "/"))]
- (.addFilter context (cors-filter-handler) "/*" (EnumSet/allOf DispatcherType))
- (if-not (blank? http-x-frame-options)
- (.addFilter context (x-frame-options-filter-handler http-x-frame-options) "/*" FilterMapping/ALL))
- (doseq [{:keys [filter-name filter-class filter-params]} filters-confs]
- (if filter-class
- (let [filter-holder (doto (org.eclipse.jetty.servlet.FilterHolder.)
- (.setClassName filter-class)
- (.setName (or filter-name filter-class))
- (.setInitParameters (or filter-params {})))]
- (.addFilter context filter-holder "/*" FilterMapping/ALL))))
- (.addFilter context (mk-access-logging-filter-handler) "/*" (EnumSet/allOf DispatcherType))
- (.setHandler server context)))))
-
-(defn ring-response-from-exception [ex]
- {:headers {}
- :status 400
- :body (.getMessage ex)})
-
-(defn- remove-non-ssl-connectors [server]
- (doseq [c (.getConnectors server)]
- (when-not (or (nil? c) (instance? SslSocketConnector c))
- (.removeConnector server c)
- ))
- server)
-
-;; Modified from ring.adapter.jetty 1.3.0
-(defn- jetty-create-server
- "Construct a Jetty Server instance."
- [options]
- (let [connector (doto (SelectChannelConnector.)
- (.setPort (options :port 80))
- (.setHost (options :host))
- (.setMaxIdleTime (options :max-idle-time 200000)))
- server (doto (Server.)
- (.addConnector connector)
- (.setSendDateHeader true))
- https-port (options :https-port)]
- (if (and (not-nil? https-port) (> https-port 0)) (remove-non-ssl-connectors server))
- server))
-
-(defn storm-run-jetty
- "Modified version of run-jetty
- Assumes configurator sets handler."
- [config]
- {:pre [(:configurator config)]}
- (let [#^Server s (jetty-create-server (dissoc config :configurator))
- configurator (:configurator config)]
- (configurator s)
- (.start s)))
-
-(defn wrap-json-in-callback [callback response]
- (str callback "(" response ");"))
-
-(defnk json-response
- [data callback :serialize-fn to-json :status 200 :headers {}]
- {:status status
- :headers (merge {"Cache-Control" "no-cache, no-store"}
- (if (not-nil? callback) {"Content-Type" "application/javascript;charset=utf-8"}
- {"Content-Type" "application/json;charset=utf-8"})
- headers)
- :body (if (not-nil? callback)
- (wrap-json-in-callback callback (serialize-fn data))
- (serialize-fn data))})
-
-(defn exception->json
- [ex]
- {"error" "Internal Server Error"
- "errorMessage"
- (let [sw (java.io.StringWriter.)]
- (.printStackTrace ex (java.io.PrintWriter. sw))
- (.toString sw))})
[17/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LogLevelAction.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/LogLevelAction.java b/storm-core/src/jvm/backtype/storm/generated/LogLevelAction.java
deleted file mode 100644
index 1f0a41a..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/LogLevelAction.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum LogLevelAction implements org.apache.thrift.TEnum {
- UNCHANGED(1),
- UPDATE(2),
- REMOVE(3);
-
- private final int value;
-
- private LogLevelAction(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static LogLevelAction findByValue(int value) {
- switch (value) {
- case 1:
- return UNCHANGED;
- case 2:
- return UPDATE;
- case 3:
- return REMOVE;
- default:
- return null;
- }
- }
-}
[55/59] [abbrv] storm git commit: Syncing java files with master.
Posted by ka...@apache.org.
Syncing java files with master.
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/8e121dce
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/8e121dce
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/8e121dce
Branch: refs/heads/1.x-branch
Commit: 8e121dceedcedbddeefe2b702e8478cd3de72da4
Parents: 737847c
Author: Kyle Nusbaum <Ky...@gmail.com>
Authored: Mon Oct 10 21:03:25 2016 -0500
Committer: Kyle Nusbaum <Ky...@gmail.com>
Committed: Mon Oct 10 21:03:25 2016 -0500
----------------------------------------------------------------------
.../apache/storm/pacemaker/PacemakerClient.java | 50 ++++++++++----------
.../pacemaker/PacemakerConnectionException.java | 24 ++++++++++
2 files changed, 48 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/8e121dce/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
index 67201b8..cbbfe7f 100644
--- a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
+++ b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
@@ -55,12 +55,18 @@ public class PacemakerClient implements ISaslClient {
private HBMessage messages[];
private LinkedBlockingQueue<Integer> availableMessageSlots;
private ThriftNettyClientCodec.AuthMethod authMethod;
+
private static Timer timer = new Timer(true);
private StormBoundedExponentialBackoffRetry backoff = new StormBoundedExponentialBackoffRetry(100, 5000, 20);
private int retryTimes = 0;
+ //the constructor is invoked by pacemaker-state-factory-test
+ public PacemakerClient() {
+ bootstrap = new ClientBootstrap();
+ }
public PacemakerClient(Map config, String host) {
+
int port = (int)config.get(Config.PACEMAKER_PORT);
client_name = (String)config.get(Config.TOPOLOGY_NAME);
if(client_name == null) {
@@ -143,10 +149,6 @@ public class PacemakerClient implements ISaslClient {
retryTimes = 0;
}
- public boolean isReady() {
- return ready.get();
- }
-
@Override
public synchronized void channelReady() {
LOG.debug("Channel is ready.");
@@ -162,8 +164,7 @@ public class PacemakerClient implements ISaslClient {
return secret;
}
- public HBMessage send(HBMessage m) {
- waitUntilReady();
+ public HBMessage send(HBMessage m) throws PacemakerConnectionException {
LOG.debug("Sending message: {}", m.toString());
try {
int next = availableMessageSlots.take();
@@ -172,14 +173,11 @@ public class PacemakerClient implements ISaslClient {
messages[next] = m;
LOG.debug("Put message in slot: {}", Integer.toString(next));
do {
- try {
- if (channelRef.get() != null) {
- channelRef.get().write(m);
- m.wait(1000);
- }
- } catch (Exception exp) {
- LOG.error("error attempting to write to a channel {}", exp);
- waitUntilReady();
+ waitUntilReady();
+ Channel channel = channelRef.get();
+ if(channel != null) {
+ channel.write(m);
+ m.wait(1000);
}
} while (messages[next] == m);
}
@@ -199,16 +197,16 @@ public class PacemakerClient implements ISaslClient {
}
}
- public PacemakerClient waitUntilReady() {
+ private void waitUntilReady() throws PacemakerConnectionException {
// Wait for 'ready' (channel connected and maybe authentication)
- if(!isReady() || channelRef.get() == null) {
+ if(!ready.get() || channelRef.get() == null) {
synchronized(this) {
- if(!isReady()) {
+ if(!ready.get()) {
LOG.debug("Waiting for netty channel to be ready.");
try {
this.wait(1000);
- if(!isReady() || channelRef.get() == null) {
- throw new RuntimeException("Timed out waiting for channel ready.");
+ if(!ready.get() || channelRef.get() == null) {
+ throw new PacemakerConnectionException("Timed out waiting for channel ready.");
}
} catch (InterruptedException e) {
throw new RuntimeException(e);
@@ -216,14 +214,13 @@ public class PacemakerClient implements ISaslClient {
}
}
}
- return this;
}
public void gotMessage(HBMessage m) {
int message_id = m.get_message_id();
- if(message_id >= 0 && message_id < maxPending) {
+ if(message_id >=0 && message_id < maxPending) {
- LOG.debug("Pacemaker Client got message: {}", m.toString());
+ LOG.debug("Pacemaker client got message: {}", m.toString());
HBMessage request = messages[message_id];
if(request == null) {
@@ -245,10 +242,11 @@ public class PacemakerClient implements ISaslClient {
public void reconnect() {
final PacemakerClient client = this;
timer.schedule(new TimerTask() {
- public void run() {
- client.doReconnect();
- }
- }, backoff.getSleepTimeMs(retryTimes++, 0));
+ public void run() {
+ client.doReconnect();
+ }
+ },
+ backoff.getSleepTimeMs(retryTimes++, 0));
ready.set(false);
setupMessaging();
}
http://git-wip-us.apache.org/repos/asf/storm/blob/8e121dce/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerConnectionException.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerConnectionException.java b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerConnectionException.java
new file mode 100644
index 0000000..e2ad119
--- /dev/null
+++ b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerConnectionException.java
@@ -0,0 +1,24 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.storm.pacemaker;
+
+public class PacemakerConnectionException extends Exception {
+ public PacemakerConnectionException(String err) {
+ super(err);
+ }
+}
[49/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/config.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/config.clj b/storm-core/src/clj/backtype/storm/config.clj
deleted file mode 100644
index 1f19bd3..0000000
--- a/storm-core/src/clj/backtype/storm/config.clj
+++ /dev/null
@@ -1,338 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.config
- (:import [java.io FileReader File IOException]
- [org.apache.storm.generated StormTopology])
- (:import [org.apache.storm Config])
- (:import [org.apache.storm.utils Utils LocalState])
- (:import [org.apache.storm.validation ConfigValidation])
- (:import [org.apache.commons.io FileUtils])
- (:require [clojure [string :as str]])
- (:use [org.apache.storm log util]))
-
-(def RESOURCES-SUBDIR "resources")
-(def NIMBUS-DO-NOT-REASSIGN "NIMBUS-DO-NOT-REASSIGN")
-
-(defn- clojure-config-name [name]
- (.replace (.toUpperCase name) "_" "-"))
-
-; define clojure constants for every configuration parameter
-(doseq [f (seq (.getFields Config))]
- (let [name (.getName f)
- new-name (clojure-config-name name)]
- (eval
- `(def ~(symbol new-name) (. Config ~(symbol name))))))
-
-(def ALL-CONFIGS
- (dofor [f (seq (.getFields Config))]
- (.get f nil)))
-
-
-(defn cluster-mode
- [conf & args]
- (keyword (conf STORM-CLUSTER-MODE)))
-
-(defn local-mode?
- [conf]
- (let [mode (conf STORM-CLUSTER-MODE)]
- (condp = mode
- "local" true
- "distributed" false
- (throw (IllegalArgumentException.
- (str "Illegal cluster mode in conf: " mode))))))
-
-(defn sampling-rate
- [conf]
- (->> (conf TOPOLOGY-STATS-SAMPLE-RATE)
- (/ 1)
- int))
-
-(defn mk-stats-sampler
- [conf]
- (even-sampler (sampling-rate conf)))
-
-(defn read-default-config
- []
- (clojurify-structure (Utils/readDefaultConfig)))
-
-(defn validate-configs-with-schemas
- [conf]
- (ConfigValidation/validateFields conf))
-
-(defn read-storm-config
- []
- (let [conf (clojurify-structure (Utils/readStormConfig))]
- (validate-configs-with-schemas conf)
- conf))
-
-(defn read-yaml-config
- ([name must-exist]
- (let [conf (clojurify-structure (Utils/findAndReadConfigFile name must-exist))]
- (validate-configs-with-schemas conf)
- conf))
- ([name]
- (read-yaml-config true)))
-
-(defn absolute-storm-local-dir [conf]
- (let [storm-home (System/getProperty "storm.home")
- path (conf STORM-LOCAL-DIR)]
- (if path
- (if (is-absolute-path? path) path (str storm-home file-path-separator path))
- (str storm-home file-path-separator "storm-local"))))
-
-(def LOG-DIR
- (.getCanonicalPath
- (clojure.java.io/file (or (System/getProperty "storm.log.dir")
- (get (read-storm-config) "storm.log.dir")
- (str (System/getProperty "storm.home") file-path-separator "logs")))))
-
-(defn absolute-healthcheck-dir [conf]
- (let [storm-home (System/getProperty "storm.home")
- path (conf STORM-HEALTH-CHECK-DIR)]
- (if path
- (if (is-absolute-path? path) path (str storm-home file-path-separator path))
- (str storm-home file-path-separator "healthchecks"))))
-
-(defn master-local-dir
- [conf]
- (let [ret (str (absolute-storm-local-dir conf) file-path-separator "nimbus")]
- (FileUtils/forceMkdir (File. ret))
- ret))
-
-(defn master-stormjar-key
- [topology-id]
- (str topology-id "-stormjar.jar"))
-
-(defn master-stormcode-key
- [topology-id]
- (str topology-id "-stormcode.ser"))
-
-(defn master-stormconf-key
- [topology-id]
- (str topology-id "-stormconf.ser"))
-
-(defn master-stormdist-root
- ([conf]
- (str (master-local-dir conf) file-path-separator "stormdist"))
- ([conf storm-id]
- (str (master-stormdist-root conf) file-path-separator storm-id)))
-
-(defn master-tmp-dir
- [conf]
- (let [ret (str (master-local-dir conf) file-path-separator "tmp")]
- (FileUtils/forceMkdir (File. ret))
- ret ))
-
-(defn read-supervisor-storm-conf-given-path
- [conf stormconf-path]
- (merge conf (clojurify-structure (Utils/fromCompressedJsonConf (FileUtils/readFileToByteArray (File. stormconf-path))))))
-
-(defn read-supervisor-storm-code-given-path
- [stormcode-path]
- (Utils/deserialize (FileUtils/readFileToByteArray (File. stormcode-path)) StormTopology))
-
-(defn master-storm-metafile-path [stormroot ]
- (str stormroot file-path-separator "storm-code-distributor.meta"))
-
-(defn master-stormjar-path
- [stormroot]
- (str stormroot file-path-separator "stormjar.jar"))
-
-(defn master-stormcode-path
- [stormroot]
- (str stormroot file-path-separator "stormcode.ser"))
-
-(defn master-stormconf-path
- [stormroot]
- (str stormroot file-path-separator "stormconf.ser"))
-
-(defn master-inbox
- [conf]
- (let [ret (str (master-local-dir conf) file-path-separator "inbox")]
- (FileUtils/forceMkdir (File. ret))
- ret ))
-
-(defn master-inimbus-dir
- [conf]
- (str (master-local-dir conf) file-path-separator "inimbus"))
-
-(defn supervisor-local-dir
- [conf]
- (let [ret (str (absolute-storm-local-dir conf) file-path-separator "supervisor")]
- (FileUtils/forceMkdir (File. ret))
- ret))
-
-(defn supervisor-isupervisor-dir
- [conf]
- (str (supervisor-local-dir conf) file-path-separator "isupervisor"))
-
-(defn supervisor-stormdist-root
- ([conf]
- (str (supervisor-local-dir conf) file-path-separator "stormdist"))
- ([conf storm-id]
- (str (supervisor-stormdist-root conf) file-path-separator (url-encode storm-id))))
-
-(defn supervisor-stormjar-path [stormroot]
- (str stormroot file-path-separator "stormjar.jar"))
-
-(defn supervisor-storm-metafile-path [stormroot]
- (str stormroot file-path-separator "storm-code-distributor.meta"))
-
-(defn supervisor-stormcode-path
- [stormroot]
- (str stormroot file-path-separator "stormcode.ser"))
-
-(defn supervisor-stormconf-path
- [stormroot]
- (str stormroot file-path-separator "stormconf.ser"))
-
-(defn supervisor-tmp-dir
- [conf]
- (let [ret (str (supervisor-local-dir conf) file-path-separator "tmp")]
- (FileUtils/forceMkdir (File. ret))
- ret ))
-
-(defn supervisor-storm-resources-path
- [stormroot]
- (str stormroot file-path-separator RESOURCES-SUBDIR))
-
-(defn ^LocalState supervisor-state
- [conf]
- (LocalState. (str (supervisor-local-dir conf) file-path-separator "localstate")))
-
-(defn ^LocalState nimbus-topo-history-state
- [conf]
- (LocalState. (str (master-local-dir conf) file-path-separator "history")))
-
-(defn read-supervisor-storm-conf
- [conf storm-id]
- (let [stormroot (supervisor-stormdist-root conf storm-id)
- conf-path (supervisor-stormconf-path stormroot)]
- (read-supervisor-storm-conf-given-path conf conf-path)))
-
-(defn read-supervisor-topology
- [conf storm-id]
- (let [stormroot (supervisor-stormdist-root conf storm-id)
- topology-path (supervisor-stormcode-path stormroot)]
- (read-supervisor-storm-code-given-path topology-path)))
-
-(defn worker-user-root [conf]
- (str (absolute-storm-local-dir conf) "/workers-users"))
-
-(defn worker-user-file [conf worker-id]
- (str (worker-user-root conf) "/" worker-id))
-
-(defn get-worker-user [conf worker-id]
- (log-message "GET worker-user " worker-id)
- (try
- (str/trim (slurp (worker-user-file conf worker-id)))
- (catch IOException e
- (log-warn-error e "Failed to get worker user for " worker-id ".")
- nil
- )))
-
-(defn get-id-from-blob-key
- [key]
- (if-let [groups (re-find #"^(.*)((-stormjar\.jar)|(-stormcode\.ser)|(-stormconf\.ser))$" key)]
- (nth groups 1)))
-
-(defn set-worker-user! [conf worker-id user]
- (log-message "SET worker-user " worker-id " " user)
- (let [file (worker-user-file conf worker-id)]
- (.mkdirs (.getParentFile (File. file)))
- (spit (worker-user-file conf worker-id) user)))
-
-(defn remove-worker-user! [conf worker-id]
- (log-message "REMOVE worker-user " worker-id)
- (.delete (File. (worker-user-file conf worker-id))))
-
-(defn worker-artifacts-root
- ([conf]
- (let [workers-artifacts-dir (conf STORM-WORKERS-ARTIFACTS-DIR)]
- (if workers-artifacts-dir
- (if (is-absolute-path? workers-artifacts-dir)
- workers-artifacts-dir
- (str LOG-DIR file-path-separator workers-artifacts-dir))
- (str LOG-DIR file-path-separator "workers-artifacts"))))
- ([conf id]
- (str (worker-artifacts-root conf) file-path-separator id))
- ([conf id port]
- (str (worker-artifacts-root conf id) file-path-separator port)))
-
-(defn worker-artifacts-pid-path
- [conf id port]
- (str (worker-artifacts-root conf id port) file-path-separator "worker.pid"))
-
-(defn get-log-metadata-file
- ([fname]
- (let [[id port & _] (str/split fname (re-pattern file-path-separator))]
- (get-log-metadata-file (read-storm-config) id port)))
- ([conf id port]
- (clojure.java.io/file (str (worker-artifacts-root conf id) file-path-separator port file-path-separator) "worker.yaml")))
-
-(defn get-worker-dir-from-root
- [log-root id port]
- (clojure.java.io/file (str log-root file-path-separator id file-path-separator port)))
-
-(defn worker-root
- ([conf]
- (str (absolute-storm-local-dir conf) file-path-separator "workers"))
- ([conf id]
- (str (worker-root conf) file-path-separator id)))
-
-(defn worker-pids-root
- [conf id]
- (str (worker-root conf id) file-path-separator "pids"))
-
-(defn worker-tmp-root
- [conf id]
- (str (worker-root conf id) file-path-separator "tmp"))
-
-(defn worker-pid-path
- [conf id pid]
- (str (worker-pids-root conf id) file-path-separator pid))
-
-(defn worker-heartbeats-root
- [conf id]
- (str (worker-root conf id) file-path-separator "heartbeats"))
-
-;; workers heartbeat here with pid and timestamp
-;; if supervisor stops receiving heartbeat, it kills and restarts the process
-;; in local mode, keep a global map of ids to threads for simulating process management
-(defn ^LocalState worker-state
- [conf id]
- (LocalState. (worker-heartbeats-root conf id)))
-
-(defn override-login-config-with-system-property [conf]
- (if-let [login_conf_file (System/getProperty "java.security.auth.login.config")]
- (assoc conf "java.security.auth.login.config" login_conf_file)
- conf))
-
-(defn get-topo-logs-users
- [topology-conf]
- (sort (distinct (remove nil?
- (concat
- (topology-conf LOGS-USERS)
- (topology-conf TOPOLOGY-USERS))))))
-
-(defn get-topo-logs-groups
- [topology-conf]
- (sort (distinct (remove nil?
- (concat
- (topology-conf LOGS-GROUPS)
- (topology-conf TOPOLOGY-GROUPS))))))
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/converter.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/converter.clj b/storm-core/src/clj/backtype/storm/converter.clj
deleted file mode 100644
index bb2dc87..0000000
--- a/storm-core/src/clj/backtype/storm/converter.clj
+++ /dev/null
@@ -1,277 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.converter
- (:import [org.apache.storm.generated SupervisorInfo NodeInfo Assignment WorkerResources
- StormBase TopologyStatus ClusterWorkerHeartbeat ExecutorInfo ErrorInfo Credentials RebalanceOptions KillOptions
- TopologyActionOptions DebugOptions ProfileRequest])
- (:use [org.apache.storm util stats log])
- (:require [org.apache.storm.daemon [common :as common]]))
-
-(defn thriftify-supervisor-info [supervisor-info]
- (doto (SupervisorInfo.)
- (.set_time_secs (long (:time-secs supervisor-info)))
- (.set_hostname (:hostname supervisor-info))
- (.set_assignment_id (:assignment-id supervisor-info))
- (.set_used_ports (map long (:used-ports supervisor-info)))
- (.set_meta (map long (:meta supervisor-info)))
- (.set_scheduler_meta (:scheduler-meta supervisor-info))
- (.set_uptime_secs (long (:uptime-secs supervisor-info)))
- (.set_version (:version supervisor-info))
- (.set_resources_map (:resources-map supervisor-info))
- ))
-
-(defn clojurify-supervisor-info [^SupervisorInfo supervisor-info]
- (if supervisor-info
- (org.apache.storm.daemon.common.SupervisorInfo.
- (.get_time_secs supervisor-info)
- (.get_hostname supervisor-info)
- (.get_assignment_id supervisor-info)
- (if (.get_used_ports supervisor-info) (into [] (.get_used_ports supervisor-info)))
- (if (.get_meta supervisor-info) (into [] (.get_meta supervisor-info)))
- (if (.get_scheduler_meta supervisor-info) (into {} (.get_scheduler_meta supervisor-info)))
- (.get_uptime_secs supervisor-info)
- (.get_version supervisor-info)
- (if-let [res-map (.get_resources_map supervisor-info)] (into {} res-map)))))
-
-(defn thriftify-assignment [assignment]
- (let [thrift-assignment (doto (Assignment.)
- (.set_master_code_dir (:master-code-dir assignment))
- (.set_node_host (:node->host assignment))
- (.set_executor_node_port (into {}
- (map (fn [[k v]]
- [(map long k)
- (NodeInfo. (first v) (set (map long (rest v))))])
- (:executor->node+port assignment))))
- (.set_executor_start_time_secs
- (into {}
- (map (fn [[k v]]
- [(map long k) (long v)])
- (:executor->start-time-secs assignment)))))]
- (if (:worker->resources assignment)
- (.set_worker_resources thrift-assignment (into {} (map
- (fn [[node+port resources]]
- [(NodeInfo. (first node+port) (set (map long (rest node+port))))
- (doto (WorkerResources.)
- (.set_mem_on_heap (first resources))
- (.set_mem_off_heap (second resources))
- (.set_cpu (last resources)))])
- (:worker->resources assignment)))))
- thrift-assignment))
-
-(defn clojurify-executor->node_port [executor->node_port]
- (into {}
- (map-val
- (fn [nodeInfo]
- (concat [(.get_node nodeInfo)] (.get_port nodeInfo))) ;nodeInfo should be converted to [node,port1,port2..]
- (map-key
- (fn [list-of-executors]
- (into [] list-of-executors)) ; list of executors must be coverted to clojure vector to ensure it is sortable.
- executor->node_port))))
-
-(defn clojurify-worker->resources [worker->resources]
- "convert worker info to be [node, port]
- convert resources to be [mem_on_heap mem_off_heap cpu]"
- (into {} (map
- (fn [[nodeInfo resources]]
- [(concat [(.get_node nodeInfo)] (.get_port nodeInfo))
- [(.get_mem_on_heap resources) (.get_mem_off_heap resources) (.get_cpu resources)]])
- worker->resources)))
-
-(defn clojurify-assignment [^Assignment assignment]
- (if assignment
- (org.apache.storm.daemon.common.Assignment.
- (.get_master_code_dir assignment)
- (into {} (.get_node_host assignment))
- (clojurify-executor->node_port (into {} (.get_executor_node_port assignment)))
- (map-key (fn [executor] (into [] executor))
- (into {} (.get_executor_start_time_secs assignment)))
- (clojurify-worker->resources (into {} (.get_worker_resources assignment))))))
-
-(defn convert-to-symbol-from-status [status]
- (condp = status
- TopologyStatus/ACTIVE {:type :active}
- TopologyStatus/INACTIVE {:type :inactive}
- TopologyStatus/REBALANCING {:type :rebalancing}
- TopologyStatus/KILLED {:type :killed}
- nil))
-
-(defn- convert-to-status-from-symbol [status]
- (if status
- (condp = (:type status)
- :active TopologyStatus/ACTIVE
- :inactive TopologyStatus/INACTIVE
- :rebalancing TopologyStatus/REBALANCING
- :killed TopologyStatus/KILLED
- nil)))
-
-(defn clojurify-rebalance-options [^RebalanceOptions rebalance-options]
- (-> {:action :rebalance}
- (assoc-non-nil :delay-secs (if (.is_set_wait_secs rebalance-options) (.get_wait_secs rebalance-options)))
- (assoc-non-nil :num-workers (if (.is_set_num_workers rebalance-options) (.get_num_workers rebalance-options)))
- (assoc-non-nil :component->executors (if (.is_set_num_executors rebalance-options) (into {} (.get_num_executors rebalance-options))))))
-
-(defn thriftify-rebalance-options [rebalance-options]
- (if rebalance-options
- (let [thrift-rebalance-options (RebalanceOptions.)]
- (if (:delay-secs rebalance-options)
- (.set_wait_secs thrift-rebalance-options (int (:delay-secs rebalance-options))))
- (if (:num-workers rebalance-options)
- (.set_num_workers thrift-rebalance-options (int (:num-workers rebalance-options))))
- (if (:component->executors rebalance-options)
- (.set_num_executors thrift-rebalance-options (map-val int (:component->executors rebalance-options))))
- thrift-rebalance-options)))
-
-(defn clojurify-kill-options [^KillOptions kill-options]
- (-> {:action :kill}
- (assoc-non-nil :delay-secs (if (.is_set_wait_secs kill-options) (.get_wait_secs kill-options)))))
-
-(defn thriftify-kill-options [kill-options]
- (if kill-options
- (let [thrift-kill-options (KillOptions.)]
- (if (:delay-secs kill-options)
- (.set_wait_secs thrift-kill-options (int (:delay-secs kill-options))))
- thrift-kill-options)))
-
-(defn thriftify-topology-action-options [storm-base]
- (if (:topology-action-options storm-base)
- (let [ topology-action-options (:topology-action-options storm-base)
- action (:action topology-action-options)
- thrift-topology-action-options (TopologyActionOptions.)]
- (if (= action :kill)
- (.set_kill_options thrift-topology-action-options (thriftify-kill-options topology-action-options)))
- (if (= action :rebalance)
- (.set_rebalance_options thrift-topology-action-options (thriftify-rebalance-options topology-action-options)))
- thrift-topology-action-options)))
-
-(defn clojurify-topology-action-options [^TopologyActionOptions topology-action-options]
- (if topology-action-options
- (or (and (.is_set_kill_options topology-action-options)
- (clojurify-kill-options
- (.get_kill_options topology-action-options)))
- (and (.is_set_rebalance_options topology-action-options)
- (clojurify-rebalance-options
- (.get_rebalance_options topology-action-options))))))
-
-(defn clojurify-debugoptions [^DebugOptions options]
- (if options
- {
- :enable (.is_enable options)
- :samplingpct (.get_samplingpct options)
- }
- ))
-
-(defn thriftify-debugoptions [options]
- (doto (DebugOptions.)
- (.set_enable (get options :enable false))
- (.set_samplingpct (get options :samplingpct 10))))
-
-(defn thriftify-storm-base [storm-base]
- (doto (StormBase.)
- (.set_name (:storm-name storm-base))
- (.set_launch_time_secs (int (:launch-time-secs storm-base)))
- (.set_status (convert-to-status-from-symbol (:status storm-base)))
- (.set_num_workers (int (:num-workers storm-base)))
- (.set_component_executors (map-val int (:component->executors storm-base)))
- (.set_owner (:owner storm-base))
- (.set_topology_action_options (thriftify-topology-action-options storm-base))
- (.set_prev_status (convert-to-status-from-symbol (:prev-status storm-base)))
- (.set_component_debug (map-val thriftify-debugoptions (:component->debug storm-base)))))
-
-(defn clojurify-storm-base [^StormBase storm-base]
- (if storm-base
- (org.apache.storm.daemon.common.StormBase.
- (.get_name storm-base)
- (.get_launch_time_secs storm-base)
- (convert-to-symbol-from-status (.get_status storm-base))
- (.get_num_workers storm-base)
- (into {} (.get_component_executors storm-base))
- (.get_owner storm-base)
- (clojurify-topology-action-options (.get_topology_action_options storm-base))
- (convert-to-symbol-from-status (.get_prev_status storm-base))
- (map-val clojurify-debugoptions (.get_component_debug storm-base)))))
-
-(defn thriftify-stats [stats]
- (if stats
- (map-val thriftify-executor-stats
- (map-key #(ExecutorInfo. (int (first %1)) (int (last %1)))
- stats))
- {}))
-
-(defn clojurify-stats [stats]
- (if stats
- (map-val clojurify-executor-stats
- (map-key (fn [x] (list (.get_task_start x) (.get_task_end x)))
- stats))
- {}))
-
-(defn clojurify-zk-worker-hb [^ClusterWorkerHeartbeat worker-hb]
- (if worker-hb
- {:storm-id (.get_storm_id worker-hb)
- :executor-stats (clojurify-stats (into {} (.get_executor_stats worker-hb)))
- :uptime (.get_uptime_secs worker-hb)
- :time-secs (.get_time_secs worker-hb)
- }
- {}))
-
-(defn thriftify-zk-worker-hb [worker-hb]
- (if (not-empty (filter second (:executor-stats worker-hb)))
- (doto (ClusterWorkerHeartbeat.)
- (.set_uptime_secs (:uptime worker-hb))
- (.set_storm_id (:storm-id worker-hb))
- (.set_executor_stats (thriftify-stats (filter second (:executor-stats worker-hb))))
- (.set_time_secs (:time-secs worker-hb)))))
-
-(defn clojurify-error [^ErrorInfo error]
- (if error
- {
- :error (.get_error error)
- :time-secs (.get_error_time_secs error)
- :host (.get_host error)
- :port (.get_port error)
- }
- ))
-
-(defn thriftify-error [error]
- (doto (ErrorInfo. (:error error) (:time-secs error))
- (.set_host (:host error))
- (.set_port (:port error))))
-
-(defn clojurify-profile-request
- [^ProfileRequest request]
- (when request
- {:host (.get_node (.get_nodeInfo request))
- :port (first (.get_port (.get_nodeInfo request)))
- :action (.get_action request)
- :timestamp (.get_time_stamp request)}))
-
-(defn thriftify-profile-request
- [profile-request]
- (let [nodeinfo (doto (NodeInfo.)
- (.set_node (:host profile-request))
- (.set_port (set [(:port profile-request)])))
- request (ProfileRequest. nodeinfo (:action profile-request))]
- (.set_time_stamp request (:timestamp profile-request))
- request))
-
-(defn thriftify-credentials [credentials]
- (doto (Credentials.)
- (.set_creds (if credentials credentials {}))))
-
-(defn clojurify-crdentials [^Credentials credentials]
- (if credentials
- (into {} (.get_creds credentials))
- nil
- ))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/acker.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/acker.clj b/storm-core/src/clj/backtype/storm/daemon/acker.clj
deleted file mode 100644
index 012a8e3..0000000
--- a/storm-core/src/clj/backtype/storm/daemon/acker.clj
+++ /dev/null
@@ -1,116 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.daemon.acker
- (:import [org.apache.storm.task OutputCollector TopologyContext IBolt])
- (:import [org.apache.storm.tuple Tuple])
- (:import [org.apache.storm.utils RotatingMap MutableObject])
- (:import [java.util List Map])
- (:import [org.apache.storm Constants])
- (:use [org.apache.storm config util log])
- (:gen-class
- :init init
- :implements [org.apache.storm.task.IBolt]
- :constructors {[] []}
- :state state ))
-
-(def ACKER-COMPONENT-ID "__acker")
-(def ACKER-INIT-STREAM-ID "__ack_init")
-(def ACKER-ACK-STREAM-ID "__ack_ack")
-(def ACKER-FAIL-STREAM-ID "__ack_fail")
-(def ACKER-RESET-TIMEOUT-STREAM-ID "__ack_reset_timeout")
-
-(defn- update-ack [curr-entry val]
- (let [old (get curr-entry :val 0)]
- (assoc curr-entry :val (bit-xor old val))
- ))
-
-(defn- acker-emit-direct [^OutputCollector collector ^Integer task ^String stream ^List values]
- (.emitDirect collector task stream values)
- )
-
-(defn mk-acker-bolt []
- (let [output-collector (MutableObject.)
- pending (MutableObject.)]
- (reify IBolt
- (^void prepare [this ^Map storm-conf ^TopologyContext context ^OutputCollector collector]
- (.setObject output-collector collector)
- (.setObject pending (RotatingMap. 2))
- )
- (^void execute [this ^Tuple tuple]
- (let [^RotatingMap pending (.getObject pending)
- stream-id (.getSourceStreamId tuple)]
- (if (= stream-id Constants/SYSTEM_TICK_STREAM_ID)
- (.rotate pending)
- (let [id (.getValue tuple 0)
- ^OutputCollector output-collector (.getObject output-collector)
- curr (.get pending id)
- curr (condp = stream-id
- ACKER-INIT-STREAM-ID (-> curr
- (update-ack (.getValue tuple 1))
- (assoc :spout-task (.getValue tuple 2))
- (assoc :start-time (System/currentTimeMillis)))
- ACKER-ACK-STREAM-ID (update-ack curr (.getValue tuple 1))
- ACKER-FAIL-STREAM-ID (assoc curr :failed true)
- ACKER-RESET-TIMEOUT-STREAM-ID curr)]
- (.put pending id curr)
- (when (and curr (:spout-task curr))
- (cond (= 0 (:val curr))
- (do
- (.remove pending id)
- (acker-emit-direct output-collector
- (:spout-task curr)
- ACKER-ACK-STREAM-ID
- [id (time-delta-ms (:start-time curr))]
- ))
- (:failed curr)
- (do
- (.remove pending id)
- (acker-emit-direct output-collector
- (:spout-task curr)
- ACKER-FAIL-STREAM-ID
- [id (time-delta-ms (:start-time curr))]
- ))
- (= stream-id ACKER-RESET-TIMEOUT-STREAM-ID)
- (acker-emit-direct output-collector
- (:spout-task curr)
- ACKER-RESET-TIMEOUT-STREAM-ID
- [id (time-delta-ms (:start-time curr))]
- )
- ))
- (.ack output-collector tuple)
- ))))
- (^void cleanup [this]
- )
- )))
-
-(defn -init []
- [[] (container)])
-
-(defn -prepare [this conf context collector]
- (let [^IBolt ret (mk-acker-bolt)]
- (container-set! (.state ^org.apache.storm.daemon.acker this) ret)
- (.prepare ret conf context collector)
- ))
-
-(defn -execute [this tuple]
- (let [^IBolt delegate (container-get (.state ^org.apache.storm.daemon.acker this))]
- (.execute delegate tuple)
- ))
-
-(defn -cleanup [this]
- (let [^IBolt delegate (container-get (.state ^org.apache.storm.daemon.acker this))]
- (.cleanup delegate)
- ))
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/builtin_metrics.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/builtin_metrics.clj b/storm-core/src/clj/backtype/storm/daemon/builtin_metrics.clj
deleted file mode 100644
index 14d0132..0000000
--- a/storm-core/src/clj/backtype/storm/daemon/builtin_metrics.clj
+++ /dev/null
@@ -1,98 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.daemon.builtin-metrics
- (:import [org.apache.storm.metric.api CountMetric StateMetric IMetric IStatefulObject])
- (:import [org.apache.storm.metric.internal MultiCountStatAndMetric MultiLatencyStatAndMetric])
- (:import [org.apache.storm Config])
- (:use [org.apache.storm.stats]))
-
-(defrecord BuiltinSpoutMetrics [^MultiCountStatAndMetric ack-count
- ^MultiLatencyStatAndMetric complete-latency
- ^MultiCountStatAndMetric fail-count
- ^MultiCountStatAndMetric emit-count
- ^MultiCountStatAndMetric transfer-count])
-(defrecord BuiltinBoltMetrics [^MultiCountStatAndMetric ack-count
- ^MultiLatencyStatAndMetric process-latency
- ^MultiCountStatAndMetric fail-count
- ^MultiCountStatAndMetric execute-count
- ^MultiLatencyStatAndMetric execute-latency
- ^MultiCountStatAndMetric emit-count
- ^MultiCountStatAndMetric transfer-count])
-(defrecord SpoutThrottlingMetrics [^CountMetric skipped-max-spout
- ^CountMetric skipped-throttle
- ^CountMetric skipped-inactive])
-
-
-(defn make-data [executor-type stats]
- (condp = executor-type
- :spout (BuiltinSpoutMetrics. (stats-acked stats)
- (stats-complete-latencies stats)
- (stats-failed stats)
- (stats-emitted stats)
- (stats-transferred stats))
- :bolt (BuiltinBoltMetrics. (stats-acked stats)
- (stats-process-latencies stats)
- (stats-failed stats)
- (stats-executed stats)
- (stats-execute-latencies stats)
- (stats-emitted stats)
- (stats-transferred stats))))
-
-(defn make-spout-throttling-data []
- (SpoutThrottlingMetrics. (CountMetric.)
- (CountMetric.)
- (CountMetric.)))
-
-(defn register-spout-throttling-metrics [throttling-metrics storm-conf topology-context]
- (doseq [[kw imetric] throttling-metrics]
- (.registerMetric topology-context (str "__" (name kw)) imetric
- (int (get storm-conf Config/TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS)))))
-
-(defn register-all [builtin-metrics storm-conf topology-context]
- (doseq [[kw imetric] builtin-metrics]
- (.registerMetric topology-context (str "__" (name kw)) imetric
- (int (get storm-conf Config/TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS)))))
-
-(defn register-iconnection-server-metric [server storm-conf topology-context]
- (if (instance? IStatefulObject server)
- (.registerMetric topology-context "__recv-iconnection" (StateMetric. server)
- (int (get storm-conf Config/TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS)))))
-
-(defn register-iconnection-client-metrics [node+port->socket-ref storm-conf topology-context]
- (.registerMetric topology-context "__send-iconnection"
- (reify IMetric
- (^Object getValueAndReset [this]
- (into {}
- (map
- (fn [[node+port ^IStatefulObject connection]] [node+port (.getState connection)])
- (filter
- (fn [[node+port connection]] (instance? IStatefulObject connection))
- @node+port->socket-ref)))))
- (int (get storm-conf Config/TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS))))
-
-(defn register-queue-metrics [queues storm-conf topology-context]
- (doseq [[qname q] queues]
- (.registerMetric topology-context (str "__" (name qname)) (StateMetric. q)
- (int (get storm-conf Config/TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS)))))
-
-(defn skipped-max-spout! [^SpoutThrottlingMetrics m stats]
- (-> m .skipped-max-spout (.incrBy (stats-rate stats))))
-
-(defn skipped-throttle! [^SpoutThrottlingMetrics m stats]
- (-> m .skipped-throttle (.incrBy (stats-rate stats))))
-
-(defn skipped-inactive! [^SpoutThrottlingMetrics m stats]
- (-> m .skipped-inactive (.incrBy (stats-rate stats))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/common.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/common.clj b/storm-core/src/clj/backtype/storm/daemon/common.clj
deleted file mode 100644
index 003cb55..0000000
--- a/storm-core/src/clj/backtype/storm/daemon/common.clj
+++ /dev/null
@@ -1,431 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.daemon.common
- (:use [org.apache.storm log config util])
- (:import [org.apache.storm.generated StormTopology
- InvalidTopologyException GlobalStreamId]
- [org.apache.storm.utils ThriftTopologyUtils])
- (:import [org.apache.storm.utils Utils])
- (:import [org.apache.storm.daemon.metrics.reporters PreparableReporter]
- [com.codahale.metrics MetricRegistry]
- [org.apache.storm.daemon.metrics MetricsUtils])
- (:import [org.apache.storm.task WorkerTopologyContext])
- (:import [org.apache.storm Constants])
- (:import [org.apache.storm.metric SystemBolt])
- (:import [org.apache.storm.metric EventLoggerBolt MetricsConsumerBolt])
- (:import [org.apache.storm.security.auth IAuthorizer])
- (:import [java.io InterruptedIOException]
- (org.apache.storm.metric.filter FilterByMetricName)
- (org.apache.storm.metric.util DataPointExpander))
- (:require [clojure.set :as set])
- (:require [org.apache.storm.daemon.acker :as acker])
- (:require [org.apache.storm.thrift :as thrift])
- (:require [metrics.core :refer [default-registry]]))
-
-(defn start-metrics-reporter [reporter conf]
- (doto reporter
- (.prepare default-registry conf)
- (.start))
- (log-message "Started statistics report plugin..."))
-
-(defn start-metrics-reporters [conf]
- (doseq [reporter (MetricsUtils/getPreparableReporters conf)]
- (start-metrics-reporter reporter conf)))
-
-
-(def ACKER-COMPONENT-ID acker/ACKER-COMPONENT-ID)
-(def ACKER-INIT-STREAM-ID acker/ACKER-INIT-STREAM-ID)
-(def ACKER-ACK-STREAM-ID acker/ACKER-ACK-STREAM-ID)
-(def ACKER-FAIL-STREAM-ID acker/ACKER-FAIL-STREAM-ID)
-(def ACKER-RESET-TIMEOUT-STREAM-ID acker/ACKER-RESET-TIMEOUT-STREAM-ID)
-
-(def SYSTEM-STREAM-ID "__system")
-
-(def EVENTLOGGER-COMPONENT-ID "__eventlogger")
-(def EVENTLOGGER-STREAM-ID "__eventlog")
-
-(def SYSTEM-COMPONENT-ID Constants/SYSTEM_COMPONENT_ID)
-(def SYSTEM-TICK-STREAM-ID Constants/SYSTEM_TICK_STREAM_ID)
-(def METRICS-STREAM-ID Constants/METRICS_STREAM_ID)
-(def METRICS-TICK-STREAM-ID Constants/METRICS_TICK_STREAM_ID)
-(def CREDENTIALS-CHANGED-STREAM-ID Constants/CREDENTIALS_CHANGED_STREAM_ID)
-
-;; the task id is the virtual port
-;; node->host is here so that tasks know who to talk to just from assignment
-;; this avoid situation where node goes down and task doesn't know what to do information-wise
-(defrecord Assignment [master-code-dir node->host executor->node+port executor->start-time-secs worker->resources])
-
-
-;; component->executors is a map from spout/bolt id to number of executors for that component
-(defrecord StormBase [storm-name launch-time-secs status num-workers component->executors owner topology-action-options prev-status component->debug])
-
-(defrecord SupervisorInfo [time-secs hostname assignment-id used-ports meta scheduler-meta uptime-secs version resources-map])
-
-(defprotocol DaemonCommon
- (waiting? [this]))
-
-(defrecord ExecutorStats [^long processed
- ^long acked
- ^long emitted
- ^long transferred
- ^long failed])
-
-(defn new-executor-stats []
- (ExecutorStats. 0 0 0 0 0))
-
-(defn get-storm-id [storm-cluster-state storm-name]
- (let [active-storms (.active-storms storm-cluster-state)]
- (find-first
- #(= storm-name (:storm-name (.storm-base storm-cluster-state % nil)))
- active-storms)
- ))
-
-(defn topology-bases [storm-cluster-state]
- (let [active-topologies (.active-storms storm-cluster-state)]
- (into {}
- (dofor [id active-topologies]
- [id (.storm-base storm-cluster-state id nil)]
- ))
- ))
-
-(defn validate-distributed-mode! [conf]
- (if (local-mode? conf)
- (throw
- (IllegalArgumentException. "Cannot start server in local mode!"))))
-
-(defmacro defserverfn [name & body]
- `(let [exec-fn# (fn ~@body)]
- (defn ~name [& args#]
- (try-cause
- (apply exec-fn# args#)
- (catch InterruptedIOException e#
- (throw e#))
- (catch InterruptedException e#
- (throw e#))
- (catch Throwable t#
- (log-error t# "Error on initialization of server " ~(str name))
- (exit-process! 13 "Error on initialization")
- )))))
-
-(defn- validate-ids! [^StormTopology topology]
- (let [sets (map #(.getFieldValue topology %) thrift/STORM-TOPOLOGY-FIELDS)
- offending (apply any-intersection sets)]
- (if-not (empty? offending)
- (throw (InvalidTopologyException.
- (str "Duplicate component ids: " offending))))
- (doseq [f thrift/STORM-TOPOLOGY-FIELDS
- :let [obj-map (.getFieldValue topology f)]]
- (if-not (or (ThriftTopologyUtils/isWorkerHook f)
- (ThriftTopologyUtils/isDependencies f))
- (do
- (doseq [id (keys obj-map)]
- (if (Utils/isSystemId id)
- (throw (InvalidTopologyException.
- (str id " is not a valid component id")))))
- (doseq [obj (vals obj-map)
- id (-> obj .get_common .get_streams keys)]
- (if (Utils/isSystemId id)
- (throw (InvalidTopologyException.
- (str id " is not a valid stream id"))))))))))
-
-(defn all-components [^StormTopology topology]
- (apply merge {}
- (for [f thrift/STORM-TOPOLOGY-FIELDS]
- (if-not (or (ThriftTopologyUtils/isWorkerHook f)
- (ThriftTopologyUtils/isDependencies f))
- (.getFieldValue topology f)))))
-
-(defn component-conf [component]
- (->> component
- .get_common
- .get_json_conf
- from-json))
-
-(defn validate-basic! [^StormTopology topology]
- (validate-ids! topology)
- (doseq [f thrift/SPOUT-FIELDS
- obj (->> f (.getFieldValue topology) vals)]
- (if-not (empty? (-> obj .get_common .get_inputs))
- (throw (InvalidTopologyException. "May not declare inputs for a spout"))))
- (doseq [[comp-id comp] (all-components topology)
- :let [conf (component-conf comp)
- p (-> comp .get_common thrift/parallelism-hint)]]
- (when (and (> (conf TOPOLOGY-TASKS) 0)
- p
- (<= p 0))
- (throw (InvalidTopologyException. "Number of executors must be greater than 0 when number of tasks is greater than 0"))
- )))
-
-(defn validate-structure! [^StormTopology topology]
- ;; validate all the component subscribe from component+stream which actually exists in the topology
- ;; and if it is a fields grouping, validate the corresponding field exists
- (let [all-components (all-components topology)]
- (doseq [[id comp] all-components
- :let [inputs (.. comp get_common get_inputs)]]
- (doseq [[global-stream-id grouping] inputs
- :let [source-component-id (.get_componentId global-stream-id)
- source-stream-id (.get_streamId global-stream-id)]]
- (if-not (contains? all-components source-component-id)
- (throw (InvalidTopologyException. (str "Component: [" id "] subscribes from non-existent component [" source-component-id "]")))
- (let [source-streams (-> all-components (get source-component-id) .get_common .get_streams)]
- (if-not (contains? source-streams source-stream-id)
- (throw (InvalidTopologyException. (str "Component: [" id "] subscribes from non-existent stream: [" source-stream-id "] of component [" source-component-id "]")))
- (if (= :fields (thrift/grouping-type grouping))
- (let [grouping-fields (set (.get_fields grouping))
- source-stream-fields (-> source-streams (get source-stream-id) .get_output_fields set)
- diff-fields (set/difference grouping-fields source-stream-fields)]
- (when-not (empty? diff-fields)
- (throw (InvalidTopologyException. (str "Component: [" id "] subscribes from stream: [" source-stream-id "] of component [" source-component-id "] with non-existent fields: " diff-fields)))))))))))))
-
-(defn acker-inputs [^StormTopology topology]
- (let [bolt-ids (.. topology get_bolts keySet)
- spout-ids (.. topology get_spouts keySet)
- spout-inputs (apply merge
- (for [id spout-ids]
- {[id ACKER-INIT-STREAM-ID] ["id"]}
- ))
- bolt-inputs (apply merge
- (for [id bolt-ids]
- {[id ACKER-ACK-STREAM-ID] ["id"]
- [id ACKER-FAIL-STREAM-ID] ["id"]
- [id ACKER-RESET-TIMEOUT-STREAM-ID] ["id"]}
- ))]
- (merge spout-inputs bolt-inputs)))
-
-;; the event logger receives inputs from all the spouts and bolts
-;; with a field grouping on component id so that all tuples from a component
-;; goes to same executor and can be viewed via logviewer.
-(defn eventlogger-inputs [^StormTopology topology]
- (let [bolt-ids (.. topology get_bolts keySet)
- spout-ids (.. topology get_spouts keySet)
- spout-inputs (apply merge
- (for [id spout-ids]
- {[id EVENTLOGGER-STREAM-ID] ["component-id"]}
- ))
- bolt-inputs (apply merge
- (for [id bolt-ids]
- {[id EVENTLOGGER-STREAM-ID] ["component-id"]}
- ))]
- (merge spout-inputs bolt-inputs)))
-
-(defn add-acker! [storm-conf ^StormTopology ret]
- (let [num-executors (if (nil? (storm-conf TOPOLOGY-ACKER-EXECUTORS)) (storm-conf TOPOLOGY-WORKERS) (storm-conf TOPOLOGY-ACKER-EXECUTORS))
- acker-bolt (thrift/mk-bolt-spec* (acker-inputs ret)
- (new org.apache.storm.daemon.acker)
- {ACKER-ACK-STREAM-ID (thrift/direct-output-fields ["id" "time-delta-ms"])
- ACKER-FAIL-STREAM-ID (thrift/direct-output-fields ["id" "time-delta-ms"])
- ACKER-RESET-TIMEOUT-STREAM-ID (thrift/direct-output-fields ["id" "time-delta-ms"])
- }
- :p num-executors
- :conf {TOPOLOGY-TASKS num-executors
- TOPOLOGY-TICK-TUPLE-FREQ-SECS (storm-conf TOPOLOGY-MESSAGE-TIMEOUT-SECS)})]
- (dofor [[_ bolt] (.get_bolts ret)
- :let [common (.get_common bolt)]]
- (do
- (.put_to_streams common ACKER-ACK-STREAM-ID (thrift/output-fields ["id" "ack-val"]))
- (.put_to_streams common ACKER-FAIL-STREAM-ID (thrift/output-fields ["id"]))
- (.put_to_streams common ACKER-RESET-TIMEOUT-STREAM-ID (thrift/output-fields ["id"]))
- ))
- (dofor [[_ spout] (.get_spouts ret)
- :let [common (.get_common spout)
- spout-conf (merge
- (component-conf spout)
- {TOPOLOGY-TICK-TUPLE-FREQ-SECS (storm-conf TOPOLOGY-MESSAGE-TIMEOUT-SECS)})]]
- (do
- ;; this set up tick tuples to cause timeouts to be triggered
- (.set_json_conf common (to-json spout-conf))
- (.put_to_streams common ACKER-INIT-STREAM-ID (thrift/output-fields ["id" "init-val" "spout-task"]))
- (.put_to_inputs common
- (GlobalStreamId. ACKER-COMPONENT-ID ACKER-ACK-STREAM-ID)
- (thrift/mk-direct-grouping))
- (.put_to_inputs common
- (GlobalStreamId. ACKER-COMPONENT-ID ACKER-FAIL-STREAM-ID)
- (thrift/mk-direct-grouping))
- (.put_to_inputs common
- (GlobalStreamId. ACKER-COMPONENT-ID ACKER-RESET-TIMEOUT-STREAM-ID)
- (thrift/mk-direct-grouping))
- ))
- (.put_to_bolts ret "__acker" acker-bolt)
- ))
-
-(defn add-metric-streams! [^StormTopology topology]
- (doseq [[_ component] (all-components topology)
- :let [common (.get_common component)]]
- (.put_to_streams common METRICS-STREAM-ID
- (thrift/output-fields ["task-info" "data-points"]))))
-
-(defn add-system-streams! [^StormTopology topology]
- (doseq [[_ component] (all-components topology)
- :let [common (.get_common component)]]
- (.put_to_streams common SYSTEM-STREAM-ID (thrift/output-fields ["event"]))))
-
-
-(defn map-occurrences [afn coll]
- (->> coll
- (reduce (fn [[counts new-coll] x]
- (let [occurs (inc (get counts x 0))]
- [(assoc counts x occurs) (cons (afn x occurs) new-coll)]))
- [{} []])
- (second)
- (reverse)))
-
-(defn number-duplicates
- "(number-duplicates [\"a\", \"b\", \"a\"]) => [\"a\", \"b\", \"a#2\"]"
- [coll]
- (map-occurrences (fn [x occurences] (if (>= occurences 2) (str x "#" occurences) x)) coll))
-
-(defn metrics-consumer-register-ids
- "Generates a list of component ids for each metrics consumer
- e.g. [\"__metrics_org.mycompany.MyMetricsConsumer\", ..] "
- [storm-conf]
- (->> (get storm-conf TOPOLOGY-METRICS-CONSUMER-REGISTER)
- (map #(get % "class"))
- (number-duplicates)
- (map #(str Constants/METRICS_COMPONENT_ID_PREFIX %))))
-
-(defn metrics-consumer-bolt-specs [storm-conf topology]
- (let [component-ids-that-emit-metrics (cons SYSTEM-COMPONENT-ID (keys (all-components topology)))
- inputs (->> (for [comp-id component-ids-that-emit-metrics]
- {[comp-id METRICS-STREAM-ID] :shuffle})
- (into {}))
-
- mk-bolt-spec (fn [class arg p max-retain-metric-tuples whitelist blacklist expandMapType metricNameSeparator]
- (thrift/mk-bolt-spec*
- inputs
- (org.apache.storm.metric.MetricsConsumerBolt. class arg max-retain-metric-tuples
- (FilterByMetricName. whitelist blacklist)
- (DataPointExpander. expandMapType metricNameSeparator))
- {} :p p :conf {TOPOLOGY-TASKS p}))]
-
- (map
- (fn [component-id register]
- [component-id (mk-bolt-spec (get register "class")
- (get register "argument")
- (or (get register "parallelism.hint") 1)
- (or (get register "max.retain.metric.tuples") 100)
- (get register "whitelist")
- (get register "blacklist")
- (or (get register "expandMapType") false)
- (or (get register "metricNameSeparator") "."))])
-
- (metrics-consumer-register-ids storm-conf)
- (get storm-conf TOPOLOGY-METRICS-CONSUMER-REGISTER))))
-
-;; return the fields that event logger bolt expects
-(defn eventlogger-bolt-fields []
- [(EventLoggerBolt/FIELD_COMPONENT_ID) (EventLoggerBolt/FIELD_MESSAGE_ID) (EventLoggerBolt/FIELD_TS) (EventLoggerBolt/FIELD_VALUES)]
- )
-
-(defn add-eventlogger! [storm-conf ^StormTopology ret]
- (let [num-executors (if (nil? (storm-conf TOPOLOGY-EVENTLOGGER-EXECUTORS)) (storm-conf TOPOLOGY-WORKERS) (storm-conf TOPOLOGY-EVENTLOGGER-EXECUTORS))
- eventlogger-bolt (thrift/mk-bolt-spec* (eventlogger-inputs ret)
- (EventLoggerBolt.)
- {}
- :p num-executors
- :conf {TOPOLOGY-TASKS num-executors
- TOPOLOGY-TICK-TUPLE-FREQ-SECS (storm-conf TOPOLOGY-MESSAGE-TIMEOUT-SECS)})]
-
- (doseq [[_ component] (all-components ret)
- :let [common (.get_common component)]]
- (.put_to_streams common EVENTLOGGER-STREAM-ID (thrift/output-fields (eventlogger-bolt-fields))))
- (.put_to_bolts ret EVENTLOGGER-COMPONENT-ID eventlogger-bolt)
- ))
-
-(defn add-metric-components! [storm-conf ^StormTopology topology]
- (doseq [[comp-id bolt-spec] (metrics-consumer-bolt-specs storm-conf topology)]
- (.put_to_bolts topology comp-id bolt-spec)))
-
-(defn add-system-components! [conf ^StormTopology topology]
- (let [system-bolt-spec (thrift/mk-bolt-spec*
- {}
- (SystemBolt.)
- {SYSTEM-TICK-STREAM-ID (thrift/output-fields ["rate_secs"])
- METRICS-TICK-STREAM-ID (thrift/output-fields ["interval"])
- CREDENTIALS-CHANGED-STREAM-ID (thrift/output-fields ["creds"])}
- :p 0
- :conf {TOPOLOGY-TASKS 0})]
- (.put_to_bolts topology SYSTEM-COMPONENT-ID system-bolt-spec)))
-
-(defn system-topology! [storm-conf ^StormTopology topology]
- (validate-basic! topology)
- (let [ret (.deepCopy topology)]
- (add-acker! storm-conf ret)
- (add-eventlogger! storm-conf ret)
- (add-metric-components! storm-conf ret)
- (add-system-components! storm-conf ret)
- (add-metric-streams! ret)
- (add-system-streams! ret)
- (validate-structure! ret)
- ret
- ))
-
-(defn has-ackers? [storm-conf]
- (or (nil? (storm-conf TOPOLOGY-ACKER-EXECUTORS)) (> (storm-conf TOPOLOGY-ACKER-EXECUTORS) 0)))
-
-(defn has-eventloggers? [storm-conf]
- (or (nil? (storm-conf TOPOLOGY-EVENTLOGGER-EXECUTORS)) (> (storm-conf TOPOLOGY-EVENTLOGGER-EXECUTORS) 0)))
-
-(defn num-start-executors [component]
- (thrift/parallelism-hint (.get_common component)))
-
-(defn storm-task-info
- "Returns map from task -> component id"
- [^StormTopology user-topology storm-conf]
- (->> (system-topology! storm-conf user-topology)
- all-components
- (map-val (comp #(get % TOPOLOGY-TASKS) component-conf))
- (sort-by first)
- (mapcat (fn [[c num-tasks]] (repeat num-tasks c)))
- (map (fn [id comp] [id comp]) (iterate (comp int inc) (int 1)))
- (into {})
- ))
-
-(defn executor-id->tasks [[first-task-id last-task-id]]
- (->> (range first-task-id (inc last-task-id))
- (map int)))
-
-(defn worker-context [worker]
- (WorkerTopologyContext. (:system-topology worker)
- (:storm-conf worker)
- (:task->component worker)
- (:component->sorted-tasks worker)
- (:component->stream->fields worker)
- (:storm-id worker)
- (supervisor-storm-resources-path
- (supervisor-stormdist-root (:conf worker) (:storm-id worker)))
- (worker-pids-root (:conf worker) (:worker-id worker))
- (:port worker)
- (:task-ids worker)
- (:default-shared-resources worker)
- (:user-shared-resources worker)
- ))
-
-
-(defn to-task->node+port [executor->node+port]
- (->> executor->node+port
- (mapcat (fn [[e node+port]] (for [t (executor-id->tasks e)] [t node+port])))
- (into {})))
-
-(defn mk-authorization-handler [klassname conf]
- (let [aznClass (if klassname (Class/forName klassname))
- aznHandler (if aznClass (.newInstance aznClass))]
- (if aznHandler (.prepare ^IAuthorizer aznHandler conf))
- (log-debug "authorization class name:" klassname
- " class:" aznClass
- " handler:" aznHandler)
- aznHandler
- ))
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/drpc.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/drpc.clj b/storm-core/src/clj/backtype/storm/daemon/drpc.clj
deleted file mode 100644
index 5284454..0000000
--- a/storm-core/src/clj/backtype/storm/daemon/drpc.clj
+++ /dev/null
@@ -1,278 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.daemon.drpc
- (:import [org.apache.storm.security.auth AuthUtils ThriftServer ThriftConnectionType ReqContext])
- (:import [org.apache.storm.security.auth.authorizer DRPCAuthorizerBase])
- (:import [org.apache.storm.generated DistributedRPC DistributedRPC$Iface DistributedRPC$Processor
- DRPCRequest DRPCExecutionException DistributedRPCInvocations DistributedRPCInvocations$Iface
- DistributedRPCInvocations$Processor])
- (:import [java.util.concurrent Semaphore ConcurrentLinkedQueue
- ThreadPoolExecutor ArrayBlockingQueue TimeUnit])
- (:import [org.apache.storm.daemon Shutdownable])
- (:import [java.net InetAddress])
- (:import [org.apache.storm.generated AuthorizationException]
- [org.apache.storm.utils VersionInfo])
- (:use [org.apache.storm config log util])
- (:use [org.apache.storm.daemon common])
- (:use [org.apache.storm.ui helpers])
- (:use compojure.core)
- (:use ring.middleware.reload)
- (:require [compojure.handler :as handler])
- (:require [metrics.meters :refer [defmeter mark!]])
- (:gen-class))
-
-(defmeter drpc:num-execute-http-requests)
-(defmeter drpc:num-execute-calls)
-(defmeter drpc:num-result-calls)
-(defmeter drpc:num-failRequest-calls)
-(defmeter drpc:num-fetchRequest-calls)
-(defmeter drpc:num-shutdown-calls)
-
-(def STORM-VERSION (VersionInfo/getVersion))
-
-(defn timeout-check-secs [] 5)
-
-(defn acquire-queue [queues-atom function]
- (swap! queues-atom
- (fn [amap]
- (if-not (amap function)
- (assoc amap function (ConcurrentLinkedQueue.))
- amap)))
- (@queues-atom function))
-
-(defn check-authorization
- ([aclHandler mapping operation context function]
- (if (not-nil? context)
- (log-thrift-access-function (.requestID context) (.remoteAddress context) (.principal context) operation function))
- (if aclHandler
- (let [context (or context (ReqContext/context))]
- (if-not (.permit aclHandler context operation mapping)
- (let [principal (.principal context)
- user (if principal (.getName principal) "unknown")]
- (throw (AuthorizationException.
- (str "DRPC request '" operation "' for '"
- user "' user is not authorized"))))))))
- ([aclHandler mapping operation function]
- (check-authorization aclHandler mapping operation (ReqContext/context) function)))
-
-;; TODO: change this to use TimeCacheMap
-(defn service-handler [conf]
- (let [drpc-acl-handler (mk-authorization-handler (conf DRPC-AUTHORIZER) conf)
- ctr (atom 0)
- id->sem (atom {})
- id->result (atom {})
- id->start (atom {})
- id->function (atom {})
- id->request (atom {})
- request-queues (atom {})
- cleanup (fn [id] (swap! id->sem dissoc id)
- (swap! id->result dissoc id)
- (swap! id->function dissoc id)
- (swap! id->request dissoc id)
- (swap! id->start dissoc id))
- my-ip (.getHostAddress (InetAddress/getLocalHost))
- clear-thread (async-loop
- (fn []
- (doseq [[id start] @id->start]
- (when (> (time-delta start) (conf DRPC-REQUEST-TIMEOUT-SECS))
- (when-let [sem (@id->sem id)]
- (.remove (acquire-queue request-queues (@id->function id)) (@id->request id))
- (log-warn "Timeout DRPC request id: " id " start at " start)
- (.release sem))
- (cleanup id)))
- (timeout-check-secs)))]
- (reify DistributedRPC$Iface
- (^String execute
- [this ^String function ^String args]
- (mark! drpc:num-execute-calls)
- (log-debug "Received DRPC request for " function " (" args ") at " (System/currentTimeMillis))
- (check-authorization drpc-acl-handler
- {DRPCAuthorizerBase/FUNCTION_NAME function}
- "execute"
- function)
- (let [id (str (swap! ctr (fn [v] (mod (inc v) 1000000000))))
- ^Semaphore sem (Semaphore. 0)
- req (DRPCRequest. args id)
- ^ConcurrentLinkedQueue queue (acquire-queue request-queues function)]
- (swap! id->start assoc id (current-time-secs))
- (swap! id->sem assoc id sem)
- (swap! id->function assoc id function)
- (swap! id->request assoc id req)
- (.add queue req)
- (log-debug "Waiting for DRPC result for " function " " args " at " (System/currentTimeMillis))
- (.acquire sem)
- (log-debug "Acquired DRPC result for " function " " args " at " (System/currentTimeMillis))
- (let [result (@id->result id)]
- (cleanup id)
- (log-debug "Returning DRPC result for " function " " args " at " (System/currentTimeMillis))
- (if (instance? DRPCExecutionException result)
- (throw result)
- (if (nil? result)
- (throw (DRPCExecutionException. "Request timed out"))
- result)))))
-
- DistributedRPCInvocations$Iface
-
- (^void result
- [this ^String id ^String result]
- (mark! drpc:num-result-calls)
- (when-let [func (@id->function id)]
- (check-authorization drpc-acl-handler
- {DRPCAuthorizerBase/FUNCTION_NAME func}
- "result"
- func)
- (let [^Semaphore sem (@id->sem id)]
- (log-debug "Received result " result " for " id " at " (System/currentTimeMillis))
- (when sem
- (swap! id->result assoc id result)
- (.release sem)
- ))))
-
- (^void failRequest
- [this ^String id]
- (mark! drpc:num-failRequest-calls)
- (when-let [func (@id->function id)]
- (check-authorization drpc-acl-handler
- {DRPCAuthorizerBase/FUNCTION_NAME func}
- "failRequest"
- func)
- (let [^Semaphore sem (@id->sem id)]
- (when sem
- (swap! id->result assoc id (DRPCExecutionException. "Request failed"))
- (.release sem)))))
-
- (^DRPCRequest fetchRequest
- [this ^String func]
- (mark! drpc:num-fetchRequest-calls)
- (check-authorization drpc-acl-handler
- {DRPCAuthorizerBase/FUNCTION_NAME func}
- "fetchRequest"
- func)
- (let [^ConcurrentLinkedQueue queue (acquire-queue request-queues func)
- ret (.poll queue)]
- (if ret
- (do (log-debug "Fetched request for " func " at " (System/currentTimeMillis))
- ret)
- (DRPCRequest. "" ""))))
-
- Shutdownable
-
- (shutdown
- [this]
- (mark! drpc:num-shutdown-calls)
- (.interrupt clear-thread)))))
-
-(defn handle-request [handler]
- (fn [request]
- (handler request)))
-
-(defn populate-context!
- "Populate the Storm RequestContext from an servlet-request. This should be called in each handler"
- [http-creds-handler servlet-request]
- (when http-creds-handler
- (.populateContext http-creds-handler (ReqContext/context) servlet-request)))
-
-(defn webapp [handler http-creds-handler]
- (mark! drpc:num-execute-http-requests)
- (->
- (routes
- (POST "/drpc/:func" [:as {:keys [body servlet-request]} func & m]
- (let [args (slurp body)]
- (populate-context! http-creds-handler servlet-request)
- (.execute handler func args)))
- (POST "/drpc/:func/" [:as {:keys [body servlet-request]} func & m]
- (let [args (slurp body)]
- (populate-context! http-creds-handler servlet-request)
- (.execute handler func args)))
- (GET "/drpc/:func/:args" [:as {:keys [servlet-request]} func args & m]
- (populate-context! http-creds-handler servlet-request)
- (.execute handler func args))
- (GET "/drpc/:func/" [:as {:keys [servlet-request]} func & m]
- (populate-context! http-creds-handler servlet-request)
- (.execute handler func ""))
- (GET "/drpc/:func" [:as {:keys [servlet-request]} func & m]
- (populate-context! http-creds-handler servlet-request)
- (.execute handler func "")))
- (wrap-reload '[org.apache.storm.daemon.drpc])
- handle-request))
-
-(defn launch-server!
- ([]
- (log-message "Starting drpc server for storm version '" STORM-VERSION "'")
- (let [conf (read-storm-config)
- worker-threads (int (conf DRPC-WORKER-THREADS))
- queue-size (int (conf DRPC-QUEUE-SIZE))
- drpc-http-port (int (conf DRPC-HTTP-PORT))
- drpc-port (int (conf DRPC-PORT))
- drpc-service-handler (service-handler conf)
- ;; requests and returns need to be on separate thread pools, since calls to
- ;; "execute" don't unblock until other thrift methods are called. So if
- ;; 64 threads are calling execute, the server won't accept the result
- ;; invocations that will unblock those threads
- handler-server (when (> drpc-port 0)
- (ThriftServer. conf
- (DistributedRPC$Processor. drpc-service-handler)
- ThriftConnectionType/DRPC))
- invoke-server (ThriftServer. conf
- (DistributedRPCInvocations$Processor. drpc-service-handler)
- ThriftConnectionType/DRPC_INVOCATIONS)
- http-creds-handler (AuthUtils/GetDrpcHttpCredentialsPlugin conf)]
- (add-shutdown-hook-with-force-kill-in-1-sec (fn []
- (if handler-server (.stop handler-server))
- (.stop invoke-server)))
- (log-message "Starting Distributed RPC servers...")
- (future (.serve invoke-server))
- (when (> drpc-http-port 0)
- (let [app (-> (webapp drpc-service-handler http-creds-handler)
- requests-middleware)
- filter-class (conf DRPC-HTTP-FILTER)
- filter-params (conf DRPC-HTTP-FILTER-PARAMS)
- filters-confs [{:filter-class filter-class
- :filter-params filter-params}]
- https-port (int (conf DRPC-HTTPS-PORT))
- https-ks-path (conf DRPC-HTTPS-KEYSTORE-PATH)
- https-ks-password (conf DRPC-HTTPS-KEYSTORE-PASSWORD)
- https-ks-type (conf DRPC-HTTPS-KEYSTORE-TYPE)
- https-key-password (conf DRPC-HTTPS-KEY-PASSWORD)
- https-ts-path (conf DRPC-HTTPS-TRUSTSTORE-PATH)
- https-ts-password (conf DRPC-HTTPS-TRUSTSTORE-PASSWORD)
- https-ts-type (conf DRPC-HTTPS-TRUSTSTORE-TYPE)
- https-want-client-auth (conf DRPC-HTTPS-WANT-CLIENT-AUTH)
- https-need-client-auth (conf DRPC-HTTPS-NEED-CLIENT-AUTH)]
-
- (storm-run-jetty
- {:port drpc-http-port
- :configurator (fn [server]
- (config-ssl server
- https-port
- https-ks-path
- https-ks-password
- https-ks-type
- https-key-password
- https-ts-path
- https-ts-password
- https-ts-type
- https-need-client-auth
- https-want-client-auth)
- (config-filter server app filters-confs))})))
- (start-metrics-reporters conf)
- (when handler-server
- (.serve handler-server)))))
-
-(defn -main []
- (setup-default-uncaught-exception-handler)
- (launch-server!))
[52/59] [abbrv] storm git commit: Minor cleanup.
Posted by ka...@apache.org.
Minor cleanup.
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/20180cca
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/20180cca
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/20180cca
Branch: refs/heads/1.x-branch
Commit: 20180cca1de9b25dc391722a9088e10107a31443
Parents: a6171bd
Author: Kyle Nusbaum <Ky...@gmail.com>
Authored: Thu Sep 29 15:45:01 2016 -0500
Committer: Kyle Nusbaum <Ky...@gmail.com>
Committed: Thu Sep 29 15:45:01 2016 -0500
----------------------------------------------------------------------
storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/20180cca/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
index 13cc02d..d555dae 100644
--- a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
+++ b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
@@ -230,7 +230,7 @@ public class PacemakerClient implements ISaslClient {
public void gotMessage(HBMessage m) {
int message_id = m.get_message_id();
if(message_id >= 0 && message_id < maxPending) {
-
+
LOG.debug("Pacemaker Client got message: {}", m.toString());
HBMessage request = messages[message_id];
[18/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LocalAssignment.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/LocalAssignment.java b/storm-core/src/jvm/backtype/storm/generated/LocalAssignment.java
deleted file mode 100644
index b48d342..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/LocalAssignment.java
+++ /dev/null
@@ -1,676 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class LocalAssignment implements org.apache.thrift.TBase<LocalAssignment, LocalAssignment._Fields>, java.io.Serializable, Cloneable, Comparable<LocalAssignment> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LocalAssignment");
-
- private static final org.apache.thrift.protocol.TField TOPOLOGY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_id", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("executors", org.apache.thrift.protocol.TType.LIST, (short)2);
- private static final org.apache.thrift.protocol.TField RESOURCES_FIELD_DESC = new org.apache.thrift.protocol.TField("resources", org.apache.thrift.protocol.TType.STRUCT, (short)3);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new LocalAssignmentStandardSchemeFactory());
- schemes.put(TupleScheme.class, new LocalAssignmentTupleSchemeFactory());
- }
-
- private String topology_id; // required
- private List<ExecutorInfo> executors; // required
- private WorkerResources resources; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- TOPOLOGY_ID((short)1, "topology_id"),
- EXECUTORS((short)2, "executors"),
- RESOURCES((short)3, "resources");
-
- private static final Map<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: // TOPOLOGY_ID
- return TOPOLOGY_ID;
- case 2: // EXECUTORS
- return EXECUTORS;
- case 3: // RESOURCES
- return RESOURCES;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't 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.RESOURCES};
- 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.TOPOLOGY_ID, new org.apache.thrift.meta_data.FieldMetaData("topology_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.EXECUTORS, new org.apache.thrift.meta_data.FieldMetaData("executors", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ExecutorInfo.class))));
- tmpMap.put(_Fields.RESOURCES, new org.apache.thrift.meta_data.FieldMetaData("resources", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkerResources.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LocalAssignment.class, metaDataMap);
- }
-
- public LocalAssignment() {
- }
-
- public LocalAssignment(
- String topology_id,
- List<ExecutorInfo> executors)
- {
- this();
- this.topology_id = topology_id;
- this.executors = executors;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public LocalAssignment(LocalAssignment other) {
- if (other.is_set_topology_id()) {
- this.topology_id = other.topology_id;
- }
- if (other.is_set_executors()) {
- List<ExecutorInfo> __this__executors = new ArrayList<ExecutorInfo>(other.executors.size());
- for (ExecutorInfo other_element : other.executors) {
- __this__executors.add(new ExecutorInfo(other_element));
- }
- this.executors = __this__executors;
- }
- if (other.is_set_resources()) {
- this.resources = new WorkerResources(other.resources);
- }
- }
-
- public LocalAssignment deepCopy() {
- return new LocalAssignment(this);
- }
-
- @Override
- public void clear() {
- this.topology_id = null;
- this.executors = null;
- this.resources = null;
- }
-
- public String get_topology_id() {
- return this.topology_id;
- }
-
- public void set_topology_id(String topology_id) {
- this.topology_id = topology_id;
- }
-
- public void unset_topology_id() {
- this.topology_id = null;
- }
-
- /** Returns true if field topology_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_topology_id() {
- return this.topology_id != null;
- }
-
- public void set_topology_id_isSet(boolean value) {
- if (!value) {
- this.topology_id = null;
- }
- }
-
- public int get_executors_size() {
- return (this.executors == null) ? 0 : this.executors.size();
- }
-
- public java.util.Iterator<ExecutorInfo> get_executors_iterator() {
- return (this.executors == null) ? null : this.executors.iterator();
- }
-
- public void add_to_executors(ExecutorInfo elem) {
- if (this.executors == null) {
- this.executors = new ArrayList<ExecutorInfo>();
- }
- this.executors.add(elem);
- }
-
- public List<ExecutorInfo> get_executors() {
- return this.executors;
- }
-
- public void set_executors(List<ExecutorInfo> executors) {
- this.executors = executors;
- }
-
- public void unset_executors() {
- this.executors = null;
- }
-
- /** Returns true if field executors is set (has been assigned a value) and false otherwise */
- public boolean is_set_executors() {
- return this.executors != null;
- }
-
- public void set_executors_isSet(boolean value) {
- if (!value) {
- this.executors = null;
- }
- }
-
- public WorkerResources get_resources() {
- return this.resources;
- }
-
- public void set_resources(WorkerResources resources) {
- this.resources = resources;
- }
-
- public void unset_resources() {
- this.resources = null;
- }
-
- /** Returns true if field resources is set (has been assigned a value) and false otherwise */
- public boolean is_set_resources() {
- return this.resources != null;
- }
-
- public void set_resources_isSet(boolean value) {
- if (!value) {
- this.resources = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TOPOLOGY_ID:
- if (value == null) {
- unset_topology_id();
- } else {
- set_topology_id((String)value);
- }
- break;
-
- case EXECUTORS:
- if (value == null) {
- unset_executors();
- } else {
- set_executors((List<ExecutorInfo>)value);
- }
- break;
-
- case RESOURCES:
- if (value == null) {
- unset_resources();
- } else {
- set_resources((WorkerResources)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TOPOLOGY_ID:
- return get_topology_id();
-
- case EXECUTORS:
- return get_executors();
-
- case RESOURCES:
- return get_resources();
-
- }
- 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 TOPOLOGY_ID:
- return is_set_topology_id();
- case EXECUTORS:
- return is_set_executors();
- case RESOURCES:
- return is_set_resources();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof LocalAssignment)
- return this.equals((LocalAssignment)that);
- return false;
- }
-
- public boolean equals(LocalAssignment that) {
- if (that == null)
- return false;
-
- boolean this_present_topology_id = true && this.is_set_topology_id();
- boolean that_present_topology_id = true && that.is_set_topology_id();
- if (this_present_topology_id || that_present_topology_id) {
- if (!(this_present_topology_id && that_present_topology_id))
- return false;
- if (!this.topology_id.equals(that.topology_id))
- return false;
- }
-
- boolean this_present_executors = true && this.is_set_executors();
- boolean that_present_executors = true && that.is_set_executors();
- if (this_present_executors || that_present_executors) {
- if (!(this_present_executors && that_present_executors))
- return false;
- if (!this.executors.equals(that.executors))
- return false;
- }
-
- boolean this_present_resources = true && this.is_set_resources();
- boolean that_present_resources = true && that.is_set_resources();
- if (this_present_resources || that_present_resources) {
- if (!(this_present_resources && that_present_resources))
- return false;
- if (!this.resources.equals(that.resources))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_topology_id = true && (is_set_topology_id());
- list.add(present_topology_id);
- if (present_topology_id)
- list.add(topology_id);
-
- boolean present_executors = true && (is_set_executors());
- list.add(present_executors);
- if (present_executors)
- list.add(executors);
-
- boolean present_resources = true && (is_set_resources());
- list.add(present_resources);
- if (present_resources)
- list.add(resources);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(LocalAssignment other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_topology_id()).compareTo(other.is_set_topology_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topology_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology_id, other.topology_id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_executors()).compareTo(other.is_set_executors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_executors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executors, other.executors);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_resources()).compareTo(other.is_set_resources());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_resources()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resources, other.resources);
- 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("LocalAssignment(");
- boolean first = true;
-
- sb.append("topology_id:");
- if (this.topology_id == null) {
- sb.append("null");
- } else {
- sb.append(this.topology_id);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("executors:");
- if (this.executors == null) {
- sb.append("null");
- } else {
- sb.append(this.executors);
- }
- first = false;
- if (is_set_resources()) {
- if (!first) sb.append(", ");
- sb.append("resources:");
- if (this.resources == null) {
- sb.append("null");
- } else {
- sb.append(this.resources);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_topology_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'topology_id' is unset! Struct:" + toString());
- }
-
- if (!is_set_executors()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'executors' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- if (resources != null) {
- resources.validate();
- }
- }
-
- 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 LocalAssignmentStandardSchemeFactory implements SchemeFactory {
- public LocalAssignmentStandardScheme getScheme() {
- return new LocalAssignmentStandardScheme();
- }
- }
-
- private static class LocalAssignmentStandardScheme extends StandardScheme<LocalAssignment> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, LocalAssignment 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: // TOPOLOGY_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.topology_id = iprot.readString();
- struct.set_topology_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // EXECUTORS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list714 = iprot.readListBegin();
- struct.executors = new ArrayList<ExecutorInfo>(_list714.size);
- ExecutorInfo _elem715;
- for (int _i716 = 0; _i716 < _list714.size; ++_i716)
- {
- _elem715 = new ExecutorInfo();
- _elem715.read(iprot);
- struct.executors.add(_elem715);
- }
- iprot.readListEnd();
- }
- struct.set_executors_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // RESOURCES
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.resources = new WorkerResources();
- struct.resources.read(iprot);
- struct.set_resources_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, LocalAssignment struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.topology_id != null) {
- oprot.writeFieldBegin(TOPOLOGY_ID_FIELD_DESC);
- oprot.writeString(struct.topology_id);
- oprot.writeFieldEnd();
- }
- if (struct.executors != null) {
- oprot.writeFieldBegin(EXECUTORS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.executors.size()));
- for (ExecutorInfo _iter717 : struct.executors)
- {
- _iter717.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.resources != null) {
- if (struct.is_set_resources()) {
- oprot.writeFieldBegin(RESOURCES_FIELD_DESC);
- struct.resources.write(oprot);
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class LocalAssignmentTupleSchemeFactory implements SchemeFactory {
- public LocalAssignmentTupleScheme getScheme() {
- return new LocalAssignmentTupleScheme();
- }
- }
-
- private static class LocalAssignmentTupleScheme extends TupleScheme<LocalAssignment> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, LocalAssignment struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.topology_id);
- {
- oprot.writeI32(struct.executors.size());
- for (ExecutorInfo _iter718 : struct.executors)
- {
- _iter718.write(oprot);
- }
- }
- BitSet optionals = new BitSet();
- if (struct.is_set_resources()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_resources()) {
- struct.resources.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, LocalAssignment struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.topology_id = iprot.readString();
- struct.set_topology_id_isSet(true);
- {
- org.apache.thrift.protocol.TList _list719 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.executors = new ArrayList<ExecutorInfo>(_list719.size);
- ExecutorInfo _elem720;
- for (int _i721 = 0; _i721 < _list719.size; ++_i721)
- {
- _elem720 = new ExecutorInfo();
- _elem720.read(iprot);
- struct.executors.add(_elem720);
- }
- }
- struct.set_executors_isSet(true);
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.resources = new WorkerResources();
- struct.resources.read(iprot);
- struct.set_resources_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LocalStateData.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/LocalStateData.java b/storm-core/src/jvm/backtype/storm/generated/LocalStateData.java
deleted file mode 100644
index 4b8c430..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/LocalStateData.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class LocalStateData implements org.apache.thrift.TBase<LocalStateData, LocalStateData._Fields>, java.io.Serializable, Cloneable, Comparable<LocalStateData> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LocalStateData");
-
- private static final org.apache.thrift.protocol.TField SERIALIZED_PARTS_FIELD_DESC = new org.apache.thrift.protocol.TField("serialized_parts", org.apache.thrift.protocol.TType.MAP, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new LocalStateDataStandardSchemeFactory());
- schemes.put(TupleScheme.class, new LocalStateDataTupleSchemeFactory());
- }
-
- private Map<String,ThriftSerializedObject> serialized_parts; // 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 {
- SERIALIZED_PARTS((short)1, "serialized_parts");
-
- 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: // SERIALIZED_PARTS
- return SERIALIZED_PARTS;
- 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.SERIALIZED_PARTS, new org.apache.thrift.meta_data.FieldMetaData("serialized_parts", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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, ThriftSerializedObject.class))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LocalStateData.class, metaDataMap);
- }
-
- public LocalStateData() {
- }
-
- public LocalStateData(
- Map<String,ThriftSerializedObject> serialized_parts)
- {
- this();
- this.serialized_parts = serialized_parts;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public LocalStateData(LocalStateData other) {
- if (other.is_set_serialized_parts()) {
- Map<String,ThriftSerializedObject> __this__serialized_parts = new HashMap<String,ThriftSerializedObject>(other.serialized_parts.size());
- for (Map.Entry<String, ThriftSerializedObject> other_element : other.serialized_parts.entrySet()) {
-
- String other_element_key = other_element.getKey();
- ThriftSerializedObject other_element_value = other_element.getValue();
-
- String __this__serialized_parts_copy_key = other_element_key;
-
- ThriftSerializedObject __this__serialized_parts_copy_value = new ThriftSerializedObject(other_element_value);
-
- __this__serialized_parts.put(__this__serialized_parts_copy_key, __this__serialized_parts_copy_value);
- }
- this.serialized_parts = __this__serialized_parts;
- }
- }
-
- public LocalStateData deepCopy() {
- return new LocalStateData(this);
- }
-
- @Override
- public void clear() {
- this.serialized_parts = null;
- }
-
- public int get_serialized_parts_size() {
- return (this.serialized_parts == null) ? 0 : this.serialized_parts.size();
- }
-
- public void put_to_serialized_parts(String key, ThriftSerializedObject val) {
- if (this.serialized_parts == null) {
- this.serialized_parts = new HashMap<String,ThriftSerializedObject>();
- }
- this.serialized_parts.put(key, val);
- }
-
- public Map<String,ThriftSerializedObject> get_serialized_parts() {
- return this.serialized_parts;
- }
-
- public void set_serialized_parts(Map<String,ThriftSerializedObject> serialized_parts) {
- this.serialized_parts = serialized_parts;
- }
-
- public void unset_serialized_parts() {
- this.serialized_parts = null;
- }
-
- /** Returns true if field serialized_parts is set (has been assigned a value) and false otherwise */
- public boolean is_set_serialized_parts() {
- return this.serialized_parts != null;
- }
-
- public void set_serialized_parts_isSet(boolean value) {
- if (!value) {
- this.serialized_parts = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SERIALIZED_PARTS:
- if (value == null) {
- unset_serialized_parts();
- } else {
- set_serialized_parts((Map<String,ThriftSerializedObject>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SERIALIZED_PARTS:
- return get_serialized_parts();
-
- }
- 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 SERIALIZED_PARTS:
- return is_set_serialized_parts();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof LocalStateData)
- return this.equals((LocalStateData)that);
- return false;
- }
-
- public boolean equals(LocalStateData that) {
- if (that == null)
- return false;
-
- boolean this_present_serialized_parts = true && this.is_set_serialized_parts();
- boolean that_present_serialized_parts = true && that.is_set_serialized_parts();
- if (this_present_serialized_parts || that_present_serialized_parts) {
- if (!(this_present_serialized_parts && that_present_serialized_parts))
- return false;
- if (!this.serialized_parts.equals(that.serialized_parts))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_serialized_parts = true && (is_set_serialized_parts());
- list.add(present_serialized_parts);
- if (present_serialized_parts)
- list.add(serialized_parts);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(LocalStateData other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_serialized_parts()).compareTo(other.is_set_serialized_parts());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_serialized_parts()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serialized_parts, other.serialized_parts);
- 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("LocalStateData(");
- boolean first = true;
-
- sb.append("serialized_parts:");
- if (this.serialized_parts == null) {
- sb.append("null");
- } else {
- sb.append(this.serialized_parts);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_serialized_parts()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'serialized_parts' 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 LocalStateDataStandardSchemeFactory implements SchemeFactory {
- public LocalStateDataStandardScheme getScheme() {
- return new LocalStateDataStandardScheme();
- }
- }
-
- private static class LocalStateDataStandardScheme extends StandardScheme<LocalStateData> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, LocalStateData 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: // SERIALIZED_PARTS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map704 = iprot.readMapBegin();
- struct.serialized_parts = new HashMap<String,ThriftSerializedObject>(2*_map704.size);
- String _key705;
- ThriftSerializedObject _val706;
- for (int _i707 = 0; _i707 < _map704.size; ++_i707)
- {
- _key705 = iprot.readString();
- _val706 = new ThriftSerializedObject();
- _val706.read(iprot);
- struct.serialized_parts.put(_key705, _val706);
- }
- iprot.readMapEnd();
- }
- struct.set_serialized_parts_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, LocalStateData struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.serialized_parts != null) {
- oprot.writeFieldBegin(SERIALIZED_PARTS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.serialized_parts.size()));
- for (Map.Entry<String, ThriftSerializedObject> _iter708 : struct.serialized_parts.entrySet())
- {
- oprot.writeString(_iter708.getKey());
- _iter708.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class LocalStateDataTupleSchemeFactory implements SchemeFactory {
- public LocalStateDataTupleScheme getScheme() {
- return new LocalStateDataTupleScheme();
- }
- }
-
- private static class LocalStateDataTupleScheme extends TupleScheme<LocalStateData> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, LocalStateData struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.serialized_parts.size());
- for (Map.Entry<String, ThriftSerializedObject> _iter709 : struct.serialized_parts.entrySet())
- {
- oprot.writeString(_iter709.getKey());
- _iter709.getValue().write(oprot);
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, LocalStateData struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TMap _map710 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.serialized_parts = new HashMap<String,ThriftSerializedObject>(2*_map710.size);
- String _key711;
- ThriftSerializedObject _val712;
- for (int _i713 = 0; _i713 < _map710.size; ++_i713)
- {
- _key711 = iprot.readString();
- _val712 = new ThriftSerializedObject();
- _val712.read(iprot);
- struct.serialized_parts.put(_key711, _val712);
- }
- }
- struct.set_serialized_parts_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LogConfig.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/LogConfig.java b/storm-core/src/jvm/backtype/storm/generated/LogConfig.java
deleted file mode 100644
index f6633a6..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/LogConfig.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class LogConfig implements org.apache.thrift.TBase<LogConfig, LogConfig._Fields>, java.io.Serializable, Cloneable, Comparable<LogConfig> {
- 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new LogConfigStandardSchemeFactory());
- schemes.put(TupleScheme.class, new LogConfigTupleSchemeFactory());
- }
-
- private Map<String,LogLevel> 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<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 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 <i>other</i>.
- */
- public LogConfig(LogConfig other) {
- if (other.is_set_named_logger_level()) {
- Map<String,LogLevel> __this__named_logger_level = new HashMap<String,LogLevel>(other.named_logger_level.size());
- for (Map.Entry<String, LogLevel> 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<String,LogLevel>();
- }
- this.named_logger_level.put(key, val);
- }
-
- public Map<String,LogLevel> get_named_logger_level() {
- return this.named_logger_level;
- }
-
- public void set_named_logger_level(Map<String,LogLevel> 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<String,LogLevel>)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<Object> list = new ArrayList<Object>();
-
- boolean present_named_logger_level = true && (is_set_named_logger_level());
- list.add(present_named_logger_level);
- if (present_named_logger_level)
- list.add(named_logger_level);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(LogConfig other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_named_logger_level()).compareTo(other.is_set_named_logger_level());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_named_logger_level()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.named_logger_level, other.named_logger_level);
- 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("LogConfig(");
- boolean first = true;
-
- if (is_set_named_logger_level()) {
- sb.append("named_logger_level:");
- if (this.named_logger_level == null) {
- sb.append("null");
- } else {
- sb.append(this.named_logger_level);
- }
- 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 {
- 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 LogConfigStandardSchemeFactory implements SchemeFactory {
- public LogConfigStandardScheme getScheme() {
- return new LogConfigStandardScheme();
- }
- }
-
- private static class LogConfigStandardScheme extends StandardScheme<LogConfig> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, LogConfig 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 2: // NAMED_LOGGER_LEVEL
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map774 = iprot.readMapBegin();
- struct.named_logger_level = new HashMap<String,LogLevel>(2*_map774.size);
- String _key775;
- LogLevel _val776;
- for (int _i777 = 0; _i777 < _map774.size; ++_i777)
- {
- _key775 = iprot.readString();
- _val776 = new LogLevel();
- _val776.read(iprot);
- struct.named_logger_level.put(_key775, _val776);
- }
- iprot.readMapEnd();
- }
- struct.set_named_logger_level_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, LogConfig struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.named_logger_level != null) {
- if (struct.is_set_named_logger_level()) {
- oprot.writeFieldBegin(NAMED_LOGGER_LEVEL_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.named_logger_level.size()));
- for (Map.Entry<String, LogLevel> _iter778 : struct.named_logger_level.entrySet())
- {
- oprot.writeString(_iter778.getKey());
- _iter778.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class LogConfigTupleSchemeFactory implements SchemeFactory {
- public LogConfigTupleScheme getScheme() {
- return new LogConfigTupleScheme();
- }
- }
-
- private static class LogConfigTupleScheme extends TupleScheme<LogConfig> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, LogConfig struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_named_logger_level()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_named_logger_level()) {
- {
- oprot.writeI32(struct.named_logger_level.size());
- for (Map.Entry<String, LogLevel> _iter779 : struct.named_logger_level.entrySet())
- {
- oprot.writeString(_iter779.getKey());
- _iter779.getValue().write(oprot);
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, LogConfig struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- {
- org.apache.thrift.protocol.TMap _map780 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.named_logger_level = new HashMap<String,LogLevel>(2*_map780.size);
- String _key781;
- LogLevel _val782;
- for (int _i783 = 0; _i783 < _map780.size; ++_i783)
- {
- _key781 = iprot.readString();
- _val782 = new LogLevel();
- _val782.read(iprot);
- struct.named_logger_level.put(_key781, _val782);
- }
- }
- struct.set_named_logger_level_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LogLevel.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/LogLevel.java b/storm-core/src/jvm/backtype/storm/generated/LogLevel.java
deleted file mode 100644
index 332cabb..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/LogLevel.java
+++ /dev/null
@@ -1,836 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class LogLevel implements org.apache.thrift.TBase<LogLevel, LogLevel._Fields>, java.io.Serializable, Cloneable, Comparable<LogLevel> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LogLevel");
-
- private static final org.apache.thrift.protocol.TField ACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("action", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField TARGET_LOG_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("target_log_level", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField RESET_LOG_LEVEL_TIMEOUT_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("reset_log_level_timeout_secs", org.apache.thrift.protocol.TType.I32, (short)3);
- private static final org.apache.thrift.protocol.TField RESET_LOG_LEVEL_TIMEOUT_EPOCH_FIELD_DESC = new org.apache.thrift.protocol.TField("reset_log_level_timeout_epoch", org.apache.thrift.protocol.TType.I64, (short)4);
- private static final org.apache.thrift.protocol.TField RESET_LOG_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("reset_log_level", org.apache.thrift.protocol.TType.STRING, (short)5);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new LogLevelStandardSchemeFactory());
- schemes.put(TupleScheme.class, new LogLevelTupleSchemeFactory());
- }
-
- private LogLevelAction action; // required
- private String target_log_level; // optional
- private int reset_log_level_timeout_secs; // optional
- private long reset_log_level_timeout_epoch; // optional
- private String reset_log_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 {
- /**
- *
- * @see LogLevelAction
- */
- ACTION((short)1, "action"),
- TARGET_LOG_LEVEL((short)2, "target_log_level"),
- RESET_LOG_LEVEL_TIMEOUT_SECS((short)3, "reset_log_level_timeout_secs"),
- RESET_LOG_LEVEL_TIMEOUT_EPOCH((short)4, "reset_log_level_timeout_epoch"),
- RESET_LOG_LEVEL((short)5, "reset_log_level");
-
- 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: // ACTION
- return ACTION;
- case 2: // TARGET_LOG_LEVEL
- return TARGET_LOG_LEVEL;
- case 3: // RESET_LOG_LEVEL_TIMEOUT_SECS
- return RESET_LOG_LEVEL_TIMEOUT_SECS;
- case 4: // RESET_LOG_LEVEL_TIMEOUT_EPOCH
- return RESET_LOG_LEVEL_TIMEOUT_EPOCH;
- case 5: // RESET_LOG_LEVEL
- return RESET_LOG_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 int __RESET_LOG_LEVEL_TIMEOUT_SECS_ISSET_ID = 0;
- private static final int __RESET_LOG_LEVEL_TIMEOUT_EPOCH_ISSET_ID = 1;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.TARGET_LOG_LEVEL,_Fields.RESET_LOG_LEVEL_TIMEOUT_SECS,_Fields.RESET_LOG_LEVEL_TIMEOUT_EPOCH,_Fields.RESET_LOG_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.ACTION, new org.apache.thrift.meta_data.FieldMetaData("action", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, LogLevelAction.class)));
- tmpMap.put(_Fields.TARGET_LOG_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("target_log_level", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.RESET_LOG_LEVEL_TIMEOUT_SECS, new org.apache.thrift.meta_data.FieldMetaData("reset_log_level_timeout_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.RESET_LOG_LEVEL_TIMEOUT_EPOCH, new org.apache.thrift.meta_data.FieldMetaData("reset_log_level_timeout_epoch", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.RESET_LOG_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("reset_log_level", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LogLevel.class, metaDataMap);
- }
-
- public LogLevel() {
- }
-
- public LogLevel(
- LogLevelAction action)
- {
- this();
- this.action = action;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public LogLevel(LogLevel other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_action()) {
- this.action = other.action;
- }
- if (other.is_set_target_log_level()) {
- this.target_log_level = other.target_log_level;
- }
- this.reset_log_level_timeout_secs = other.reset_log_level_timeout_secs;
- this.reset_log_level_timeout_epoch = other.reset_log_level_timeout_epoch;
- if (other.is_set_reset_log_level()) {
- this.reset_log_level = other.reset_log_level;
- }
- }
-
- public LogLevel deepCopy() {
- return new LogLevel(this);
- }
-
- @Override
- public void clear() {
- this.action = null;
- this.target_log_level = null;
- set_reset_log_level_timeout_secs_isSet(false);
- this.reset_log_level_timeout_secs = 0;
- set_reset_log_level_timeout_epoch_isSet(false);
- this.reset_log_level_timeout_epoch = 0;
- this.reset_log_level = null;
- }
-
- /**
- *
- * @see LogLevelAction
- */
- public LogLevelAction get_action() {
- return this.action;
- }
-
- /**
- *
- * @see LogLevelAction
- */
- public void set_action(LogLevelAction action) {
- this.action = action;
- }
-
- public void unset_action() {
- this.action = null;
- }
-
- /** Returns true if field action is set (has been assigned a value) and false otherwise */
- public boolean is_set_action() {
- return this.action != null;
- }
-
- public void set_action_isSet(boolean value) {
- if (!value) {
- this.action = null;
- }
- }
-
- public String get_target_log_level() {
- return this.target_log_level;
- }
-
- public void set_target_log_level(String target_log_level) {
- this.target_log_level = target_log_level;
- }
-
- public void unset_target_log_level() {
- this.target_log_level = null;
- }
-
- /** Returns true if field target_log_level is set (has been assigned a value) and false otherwise */
- public boolean is_set_target_log_level() {
- return this.target_log_level != null;
- }
-
- public void set_target_log_level_isSet(boolean value) {
- if (!value) {
- this.target_log_level = null;
- }
- }
-
- public int get_reset_log_level_timeout_secs() {
- return this.reset_log_level_timeout_secs;
- }
-
- public void set_reset_log_level_timeout_secs(int reset_log_level_timeout_secs) {
- this.reset_log_level_timeout_secs = reset_log_level_timeout_secs;
- set_reset_log_level_timeout_secs_isSet(true);
- }
-
- public void unset_reset_log_level_timeout_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RESET_LOG_LEVEL_TIMEOUT_SECS_ISSET_ID);
- }
-
- /** Returns true if field reset_log_level_timeout_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_reset_log_level_timeout_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __RESET_LOG_LEVEL_TIMEOUT_SECS_ISSET_ID);
- }
-
- public void set_reset_log_level_timeout_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RESET_LOG_LEVEL_TIMEOUT_SECS_ISSET_ID, value);
- }
-
- public long get_reset_log_level_timeout_epoch() {
- return this.reset_log_level_timeout_epoch;
- }
-
- public void set_reset_log_level_timeout_epoch(long reset_log_level_timeout_epoch) {
- this.reset_log_level_timeout_epoch = reset_log_level_timeout_epoch;
- set_reset_log_level_timeout_epoch_isSet(true);
- }
-
- public void unset_reset_log_level_timeout_epoch() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RESET_LOG_LEVEL_TIMEOUT_EPOCH_ISSET_ID);
- }
-
- /** Returns true if field reset_log_level_timeout_epoch is set (has been assigned a value) and false otherwise */
- public boolean is_set_reset_log_level_timeout_epoch() {
- return EncodingUtils.testBit(__isset_bitfield, __RESET_LOG_LEVEL_TIMEOUT_EPOCH_ISSET_ID);
- }
-
- public void set_reset_log_level_timeout_epoch_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RESET_LOG_LEVEL_TIMEOUT_EPOCH_ISSET_ID, value);
- }
-
- public String get_reset_log_level() {
- return this.reset_log_level;
- }
-
- public void set_reset_log_level(String reset_log_level) {
- this.reset_log_level = reset_log_level;
- }
-
- public void unset_reset_log_level() {
- this.reset_log_level = null;
- }
-
- /** Returns true if field reset_log_level is set (has been assigned a value) and false otherwise */
- public boolean is_set_reset_log_level() {
- return this.reset_log_level != null;
- }
-
- public void set_reset_log_level_isSet(boolean value) {
- if (!value) {
- this.reset_log_level = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ACTION:
- if (value == null) {
- unset_action();
- } else {
- set_action((LogLevelAction)value);
- }
- break;
-
- case TARGET_LOG_LEVEL:
- if (value == null) {
- unset_target_log_level();
- } else {
- set_target_log_level((String)value);
- }
- break;
-
- case RESET_LOG_LEVEL_TIMEOUT_SECS:
- if (value == null) {
- unset_reset_log_level_timeout_secs();
- } else {
- set_reset_log_level_timeout_secs((Integer)value);
- }
- break;
-
- case RESET_LOG_LEVEL_TIMEOUT_EPOCH:
- if (value == null) {
- unset_reset_log_level_timeout_epoch();
- } else {
- set_reset_log_level_timeout_epoch((Long)value);
- }
- break;
-
- case RESET_LOG_LEVEL:
- if (value == null) {
- unset_reset_log_level();
- } else {
- set_reset_log_level((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ACTION:
- return get_action();
-
- case TARGET_LOG_LEVEL:
- return get_target_log_level();
-
- case RESET_LOG_LEVEL_TIMEOUT_SECS:
- return get_reset_log_level_timeout_secs();
-
- case RESET_LOG_LEVEL_TIMEOUT_EPOCH:
- return get_reset_log_level_timeout_epoch();
-
- case RESET_LOG_LEVEL:
- return get_reset_log_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 ACTION:
- return is_set_action();
- case TARGET_LOG_LEVEL:
- return is_set_target_log_level();
- case RESET_LOG_LEVEL_TIMEOUT_SECS:
- return is_set_reset_log_level_timeout_secs();
- case RESET_LOG_LEVEL_TIMEOUT_EPOCH:
- return is_set_reset_log_level_timeout_epoch();
- case RESET_LOG_LEVEL:
- return is_set_reset_log_level();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof LogLevel)
- return this.equals((LogLevel)that);
- return false;
- }
-
- public boolean equals(LogLevel that) {
- if (that == null)
- return false;
-
- boolean this_present_action = true && this.is_set_action();
- boolean that_present_action = true && that.is_set_action();
- if (this_present_action || that_present_action) {
- if (!(this_present_action && that_present_action))
- return false;
- if (!this.action.equals(that.action))
- return false;
- }
-
- boolean this_present_target_log_level = true && this.is_set_target_log_level();
- boolean that_present_target_log_level = true && that.is_set_target_log_level();
- if (this_present_target_log_level || that_present_target_log_level) {
- if (!(this_present_target_log_level && that_present_target_log_level))
- return false;
- if (!this.target_log_level.equals(that.target_log_level))
- return false;
- }
-
- boolean this_present_reset_log_level_timeout_secs = true && this.is_set_reset_log_level_timeout_secs();
- boolean that_present_reset_log_level_timeout_secs = true && that.is_set_reset_log_level_timeout_secs();
- if (this_present_reset_log_level_timeout_secs || that_present_reset_log_level_timeout_secs) {
- if (!(this_present_reset_log_level_timeout_secs && that_present_reset_log_level_timeout_secs))
- return false;
- if (this.reset_log_level_timeout_secs != that.reset_log_level_timeout_secs)
- return false;
- }
-
- boolean this_present_reset_log_level_timeout_epoch = true && this.is_set_reset_log_level_timeout_epoch();
- boolean that_present_reset_log_level_timeout_epoch = true && that.is_set_reset_log_level_timeout_epoch();
- if (this_present_reset_log_level_timeout_epoch || that_present_reset_log_level_timeout_epoch) {
- if (!(this_present_reset_log_level_timeout_epoch && that_present_reset_log_level_timeout_epoch))
- return false;
- if (this.reset_log_level_timeout_epoch != that.reset_log_level_timeout_epoch)
- return false;
- }
-
- boolean this_present_reset_log_level = true && this.is_set_reset_log_level();
- boolean that_present_reset_log_level = true && that.is_set_reset_log_level();
- if (this_present_reset_log_level || that_present_reset_log_level) {
- if (!(this_present_reset_log_level && that_present_reset_log_level))
- return false;
- if (!this.reset_log_level.equals(that.reset_log_level))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_action = true && (is_set_action());
- list.add(present_action);
- if (present_action)
- list.add(action.getValue());
-
- boolean present_target_log_level = true && (is_set_target_log_level());
- list.add(present_target_log_level);
- if (present_target_log_level)
- list.add(target_log_level);
-
- boolean present_reset_log_level_timeout_secs = true && (is_set_reset_log_level_timeout_secs());
- list.add(present_reset_log_level_timeout_secs);
- if (present_reset_log_level_timeout_secs)
- list.add(reset_log_level_timeout_secs);
-
- boolean present_reset_log_level_timeout_epoch = true && (is_set_reset_log_level_timeout_epoch());
- list.add(present_reset_log_level_timeout_epoch);
- if (present_reset_log_level_timeout_epoch)
- list.add(reset_log_level_timeout_epoch);
-
- boolean present_reset_log_level = true && (is_set_reset_log_level());
- list.add(present_reset_log_level);
- if (present_reset_log_level)
- list.add(reset_log_level);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(LogLevel other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_action()).compareTo(other.is_set_action());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_action()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.action, other.action);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_target_log_level()).compareTo(other.is_set_target_log_level());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_target_log_level()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.target_log_level, other.target_log_level);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_reset_log_level_timeout_secs()).compareTo(other.is_set_reset_log_level_timeout_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_reset_log_level_timeout_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reset_log_level_timeout_secs, other.reset_log_level_timeout_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_reset_log_level_timeout_epoch()).compareTo(other.is_set_reset_log_level_timeout_epoch());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_reset_log_level_timeout_epoch()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reset_log_level_timeout_epoch, other.reset_log_level_timeout_epoch);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_reset_log_level()).compareTo(other.is_set_reset_log_level());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_reset_log_level()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reset_log_level, other.reset_log_level);
- 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("LogLevel(");
- boolean first = true;
-
- sb.append("action:");
- if (this.action == null) {
- sb.append("null");
- } else {
- sb.append(this.action);
- }
- first = false;
- if (is_set_target_log_level()) {
- if (!first) sb.append(", ");
- sb.append("target_log_level:");
- if (this.target_log_level == null) {
- sb.append("null");
- } else {
- sb.append(this.target_log_level);
- }
- first = false;
- }
- if (is_set_reset_log_level_timeout_secs()) {
- if (!first) sb.append(", ");
- sb.append("reset_log_level_timeout_secs:");
- sb.append(this.reset_log_level_timeout_secs);
- first = false;
- }
- if (is_set_reset_log_level_timeout_epoch()) {
- if (!first) sb.append(", ");
- sb.append("reset_log_level_timeout_epoch:");
- sb.append(this.reset_log_level_timeout_epoch);
- first = false;
- }
- if (is_set_reset_log_level()) {
- if (!first) sb.append(", ");
- sb.append("reset_log_level:");
- if (this.reset_log_level == null) {
- sb.append("null");
- } else {
- sb.append(this.reset_log_level);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_action()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'action' 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 LogLevelStandardSchemeFactory implements SchemeFactory {
- public LogLevelStandardScheme getScheme() {
- return new LogLevelStandardScheme();
- }
- }
-
- private static class LogLevelStandardScheme extends StandardScheme<LogLevel> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, LogLevel 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: // ACTION
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.action = org.apache.storm.generated.LogLevelAction.findByValue(iprot.readI32());
- struct.set_action_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // TARGET_LOG_LEVEL
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.target_log_level = iprot.readString();
- struct.set_target_log_level_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // RESET_LOG_LEVEL_TIMEOUT_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.reset_log_level_timeout_secs = iprot.readI32();
- struct.set_reset_log_level_timeout_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // RESET_LOG_LEVEL_TIMEOUT_EPOCH
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.reset_log_level_timeout_epoch = iprot.readI64();
- struct.set_reset_log_level_timeout_epoch_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // RESET_LOG_LEVEL
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.reset_log_level = iprot.readString();
- struct.set_reset_log_level_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, LogLevel struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.action != null) {
- oprot.writeFieldBegin(ACTION_FIELD_DESC);
- oprot.writeI32(struct.action.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.target_log_level != null) {
- if (struct.is_set_target_log_level()) {
- oprot.writeFieldBegin(TARGET_LOG_LEVEL_FIELD_DESC);
- oprot.writeString(struct.target_log_level);
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_reset_log_level_timeout_secs()) {
- oprot.writeFieldBegin(RESET_LOG_LEVEL_TIMEOUT_SECS_FIELD_DESC);
- oprot.writeI32(struct.reset_log_level_timeout_secs);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_reset_log_level_timeout_epoch()) {
- oprot.writeFieldBegin(RESET_LOG_LEVEL_TIMEOUT_EPOCH_FIELD_DESC);
- oprot.writeI64(struct.reset_log_level_timeout_epoch);
- oprot.writeFieldEnd();
- }
- if (struct.reset_log_level != null) {
- if (struct.is_set_reset_log_level()) {
- oprot.writeFieldBegin(RESET_LOG_LEVEL_FIELD_DESC);
- oprot.writeString(struct.reset_log_level);
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class LogLevelTupleSchemeFactory implements SchemeFactory {
- public LogLevelTupleScheme getScheme() {
- return new LogLevelTupleScheme();
- }
- }
-
- private static class LogLevelTupleScheme extends TupleScheme<LogLevel> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, LogLevel struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeI32(struct.action.getValue());
- BitSet optionals = new BitSet();
- if (struct.is_set_target_log_level()) {
- optionals.set(0);
- }
- if (struct.is_set_reset_log_level_timeout_secs()) {
- optionals.set(1);
- }
- if (struct.is_set_reset_log_level_timeout_epoch()) {
- optionals.set(2);
- }
- if (struct.is_set_reset_log_level()) {
- optionals.set(3);
- }
- oprot.writeBitSet(optionals, 4);
- if (struct.is_set_target_log_level()) {
- oprot.writeString(struct.target_log_level);
- }
- if (struct.is_set_reset_log_level_timeout_secs()) {
- oprot.writeI32(struct.reset_log_level_timeout_secs);
- }
- if (struct.is_set_reset_log_level_timeout_epoch()) {
- oprot.writeI64(struct.reset_log_level_timeout_epoch);
- }
- if (struct.is_set_reset_log_level()) {
- oprot.writeString(struct.reset_log_level);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, LogLevel struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.action = org.apache.storm.generated.LogLevelAction.findByValue(iprot.readI32());
- struct.set_action_isSet(true);
- BitSet incoming = iprot.readBitSet(4);
- if (incoming.get(0)) {
- struct.target_log_level = iprot.readString();
- struct.set_target_log_level_isSet(true);
- }
- if (incoming.get(1)) {
- struct.reset_log_level_timeout_secs = iprot.readI32();
- struct.set_reset_log_level_timeout_secs_isSet(true);
- }
- if (incoming.get(2)) {
- struct.reset_log_level_timeout_epoch = iprot.readI64();
- struct.set_reset_log_level_timeout_epoch_isSet(true);
- }
- if (incoming.get(3)) {
- struct.reset_log_level = iprot.readString();
- struct.set_reset_log_level_isSet(true);
- }
- }
- }
-
-}
-
[07/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java b/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java
deleted file mode 100644
index 5e774e2..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHistoryInfo, TopologyHistoryInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TopologyHistoryInfo> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyHistoryInfo");
-
- private static final org.apache.thrift.protocol.TField TOPO_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("topo_ids", org.apache.thrift.protocol.TType.LIST, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new TopologyHistoryInfoStandardSchemeFactory());
- schemes.put(TupleScheme.class, new TopologyHistoryInfoTupleSchemeFactory());
- }
-
- private List<String> topo_ids; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- TOPO_IDS((short)1, "topo_ids");
-
- private static final Map<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: // TOPO_IDS
- return TOPO_IDS;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.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.TOPO_IDS, new org.apache.thrift.meta_data.FieldMetaData("topo_ids", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologyHistoryInfo.class, metaDataMap);
- }
-
- public TopologyHistoryInfo() {
- }
-
- public TopologyHistoryInfo(
- List<String> topo_ids)
- {
- this();
- this.topo_ids = topo_ids;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public TopologyHistoryInfo(TopologyHistoryInfo other) {
- if (other.is_set_topo_ids()) {
- List<String> __this__topo_ids = new ArrayList<String>(other.topo_ids);
- this.topo_ids = __this__topo_ids;
- }
- }
-
- public TopologyHistoryInfo deepCopy() {
- return new TopologyHistoryInfo(this);
- }
-
- @Override
- public void clear() {
- this.topo_ids = null;
- }
-
- public int get_topo_ids_size() {
- return (this.topo_ids == null) ? 0 : this.topo_ids.size();
- }
-
- public java.util.Iterator<String> get_topo_ids_iterator() {
- return (this.topo_ids == null) ? null : this.topo_ids.iterator();
- }
-
- public void add_to_topo_ids(String elem) {
- if (this.topo_ids == null) {
- this.topo_ids = new ArrayList<String>();
- }
- this.topo_ids.add(elem);
- }
-
- public List<String> get_topo_ids() {
- return this.topo_ids;
- }
-
- public void set_topo_ids(List<String> topo_ids) {
- this.topo_ids = topo_ids;
- }
-
- public void unset_topo_ids() {
- this.topo_ids = null;
- }
-
- /** Returns true if field topo_ids is set (has been assigned a value) and false otherwise */
- public boolean is_set_topo_ids() {
- return this.topo_ids != null;
- }
-
- public void set_topo_ids_isSet(boolean value) {
- if (!value) {
- this.topo_ids = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TOPO_IDS:
- if (value == null) {
- unset_topo_ids();
- } else {
- set_topo_ids((List<String>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TOPO_IDS:
- return get_topo_ids();
-
- }
- 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 TOPO_IDS:
- return is_set_topo_ids();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof TopologyHistoryInfo)
- return this.equals((TopologyHistoryInfo)that);
- return false;
- }
-
- public boolean equals(TopologyHistoryInfo that) {
- if (that == null)
- return false;
-
- boolean this_present_topo_ids = true && this.is_set_topo_ids();
- boolean that_present_topo_ids = true && that.is_set_topo_ids();
- if (this_present_topo_ids || that_present_topo_ids) {
- if (!(this_present_topo_ids && that_present_topo_ids))
- return false;
- if (!this.topo_ids.equals(that.topo_ids))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_topo_ids = true && (is_set_topo_ids());
- list.add(present_topo_ids);
- if (present_topo_ids)
- list.add(topo_ids);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(TopologyHistoryInfo other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_topo_ids()).compareTo(other.is_set_topo_ids());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topo_ids()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topo_ids, other.topo_ids);
- 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("TopologyHistoryInfo(");
- boolean first = true;
-
- sb.append("topo_ids:");
- if (this.topo_ids == null) {
- sb.append("null");
- } else {
- sb.append(this.topo_ids);
- }
- 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 {
- 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 TopologyHistoryInfoStandardSchemeFactory implements SchemeFactory {
- public TopologyHistoryInfoStandardScheme getScheme() {
- return new TopologyHistoryInfoStandardScheme();
- }
- }
-
- private static class TopologyHistoryInfoStandardScheme extends StandardScheme<TopologyHistoryInfo> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, TopologyHistoryInfo 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: // TOPO_IDS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list784 = iprot.readListBegin();
- struct.topo_ids = new ArrayList<String>(_list784.size);
- String _elem785;
- for (int _i786 = 0; _i786 < _list784.size; ++_i786)
- {
- _elem785 = iprot.readString();
- struct.topo_ids.add(_elem785);
- }
- iprot.readListEnd();
- }
- struct.set_topo_ids_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, TopologyHistoryInfo struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.topo_ids != null) {
- oprot.writeFieldBegin(TOPO_IDS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.topo_ids.size()));
- for (String _iter787 : struct.topo_ids)
- {
- oprot.writeString(_iter787);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class TopologyHistoryInfoTupleSchemeFactory implements SchemeFactory {
- public TopologyHistoryInfoTupleScheme getScheme() {
- return new TopologyHistoryInfoTupleScheme();
- }
- }
-
- private static class TopologyHistoryInfoTupleScheme extends TupleScheme<TopologyHistoryInfo> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, TopologyHistoryInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_topo_ids()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_topo_ids()) {
- {
- oprot.writeI32(struct.topo_ids.size());
- for (String _iter788 : struct.topo_ids)
- {
- oprot.writeString(_iter788);
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, TopologyHistoryInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- {
- org.apache.thrift.protocol.TList _list789 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.topo_ids = new ArrayList<String>(_list789.size);
- String _elem790;
- for (int _i791 = 0; _i791 < _list789.size; ++_i791)
- {
- _elem790 = iprot.readString();
- struct.topo_ids.add(_elem790);
- }
- }
- struct.set_topo_ids_isSet(true);
- }
- }
- }
-
-}
-
[05/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyPageInfo.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyPageInfo.java b/storm-core/src/jvm/backtype/storm/generated/TopologyPageInfo.java
deleted file mode 100644
index a0e25ce..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/TopologyPageInfo.java
+++ /dev/null
@@ -1,2757 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class TopologyPageInfo implements org.apache.thrift.TBase<TopologyPageInfo, TopologyPageInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TopologyPageInfo> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyPageInfo");
-
- private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)3);
- private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)4);
- private static final org.apache.thrift.protocol.TField NUM_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_tasks", org.apache.thrift.protocol.TType.I32, (short)5);
- private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)6);
- private static final org.apache.thrift.protocol.TField NUM_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_executors", org.apache.thrift.protocol.TType.I32, (short)7);
- private static final org.apache.thrift.protocol.TField TOPOLOGY_CONF_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_conf", org.apache.thrift.protocol.TType.STRING, (short)8);
- private static final org.apache.thrift.protocol.TField ID_TO_SPOUT_AGG_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("id_to_spout_agg_stats", org.apache.thrift.protocol.TType.MAP, (short)9);
- private static final org.apache.thrift.protocol.TField ID_TO_BOLT_AGG_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("id_to_bolt_agg_stats", org.apache.thrift.protocol.TType.MAP, (short)10);
- private static final org.apache.thrift.protocol.TField SCHED_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("sched_status", org.apache.thrift.protocol.TType.STRING, (short)11);
- private static final org.apache.thrift.protocol.TField TOPOLOGY_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_stats", org.apache.thrift.protocol.TType.STRUCT, (short)12);
- 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)13);
- private static final org.apache.thrift.protocol.TField DEBUG_OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("debug_options", org.apache.thrift.protocol.TType.STRUCT, (short)14);
- 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)15);
- private static final org.apache.thrift.protocol.TField WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("workers", org.apache.thrift.protocol.TType.LIST, (short)16);
- private static final org.apache.thrift.protocol.TField REQUESTED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)521);
- private static final org.apache.thrift.protocol.TField REQUESTED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memoffheap", org.apache.thrift.protocol.TType.DOUBLE, (short)522);
- private static final org.apache.thrift.protocol.TField REQUESTED_CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_cpu", org.apache.thrift.protocol.TType.DOUBLE, (short)523);
- private static final org.apache.thrift.protocol.TField ASSIGNED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("assigned_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)524);
- private static final org.apache.thrift.protocol.TField ASSIGNED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("assigned_memoffheap", org.apache.thrift.protocol.TType.DOUBLE, (short)525);
- private static final org.apache.thrift.protocol.TField ASSIGNED_CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("assigned_cpu", org.apache.thrift.protocol.TType.DOUBLE, (short)526);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new TopologyPageInfoStandardSchemeFactory());
- schemes.put(TupleScheme.class, new TopologyPageInfoTupleSchemeFactory());
- }
-
- private String id; // required
- private String name; // optional
- private int uptime_secs; // optional
- private String status; // optional
- private int num_tasks; // optional
- private int num_workers; // optional
- private int num_executors; // optional
- private String topology_conf; // optional
- private Map<String,ComponentAggregateStats> id_to_spout_agg_stats; // optional
- private Map<String,ComponentAggregateStats> id_to_bolt_agg_stats; // optional
- private String sched_status; // optional
- private TopologyStats topology_stats; // optional
- private String owner; // optional
- private DebugOptions debug_options; // optional
- private int replication_count; // optional
- private List<WorkerSummary> workers; // optional
- private double requested_memonheap; // optional
- private double requested_memoffheap; // optional
- private double requested_cpu; // optional
- private double assigned_memonheap; // optional
- private double assigned_memoffheap; // optional
- private double assigned_cpu; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- ID((short)1, "id"),
- NAME((short)2, "name"),
- UPTIME_SECS((short)3, "uptime_secs"),
- STATUS((short)4, "status"),
- NUM_TASKS((short)5, "num_tasks"),
- NUM_WORKERS((short)6, "num_workers"),
- NUM_EXECUTORS((short)7, "num_executors"),
- TOPOLOGY_CONF((short)8, "topology_conf"),
- ID_TO_SPOUT_AGG_STATS((short)9, "id_to_spout_agg_stats"),
- ID_TO_BOLT_AGG_STATS((short)10, "id_to_bolt_agg_stats"),
- SCHED_STATUS((short)11, "sched_status"),
- TOPOLOGY_STATS((short)12, "topology_stats"),
- OWNER((short)13, "owner"),
- DEBUG_OPTIONS((short)14, "debug_options"),
- REPLICATION_COUNT((short)15, "replication_count"),
- WORKERS((short)16, "workers"),
- REQUESTED_MEMONHEAP((short)521, "requested_memonheap"),
- REQUESTED_MEMOFFHEAP((short)522, "requested_memoffheap"),
- REQUESTED_CPU((short)523, "requested_cpu"),
- ASSIGNED_MEMONHEAP((short)524, "assigned_memonheap"),
- ASSIGNED_MEMOFFHEAP((short)525, "assigned_memoffheap"),
- ASSIGNED_CPU((short)526, "assigned_cpu");
-
- 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: // ID
- return ID;
- case 2: // NAME
- return NAME;
- case 3: // UPTIME_SECS
- return UPTIME_SECS;
- case 4: // STATUS
- return STATUS;
- case 5: // NUM_TASKS
- return NUM_TASKS;
- case 6: // NUM_WORKERS
- return NUM_WORKERS;
- case 7: // NUM_EXECUTORS
- return NUM_EXECUTORS;
- case 8: // TOPOLOGY_CONF
- return TOPOLOGY_CONF;
- case 9: // ID_TO_SPOUT_AGG_STATS
- return ID_TO_SPOUT_AGG_STATS;
- case 10: // ID_TO_BOLT_AGG_STATS
- return ID_TO_BOLT_AGG_STATS;
- case 11: // SCHED_STATUS
- return SCHED_STATUS;
- case 12: // TOPOLOGY_STATS
- return TOPOLOGY_STATS;
- case 13: // OWNER
- return OWNER;
- case 14: // DEBUG_OPTIONS
- return DEBUG_OPTIONS;
- case 15: // REPLICATION_COUNT
- return REPLICATION_COUNT;
- case 16: // WORKERS
- return WORKERS;
- case 521: // REQUESTED_MEMONHEAP
- return REQUESTED_MEMONHEAP;
- case 522: // REQUESTED_MEMOFFHEAP
- return REQUESTED_MEMOFFHEAP;
- case 523: // REQUESTED_CPU
- return REQUESTED_CPU;
- case 524: // ASSIGNED_MEMONHEAP
- return ASSIGNED_MEMONHEAP;
- case 525: // ASSIGNED_MEMOFFHEAP
- return ASSIGNED_MEMOFFHEAP;
- case 526: // ASSIGNED_CPU
- return ASSIGNED_CPU;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return 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 __UPTIME_SECS_ISSET_ID = 0;
- private static final int __NUM_TASKS_ISSET_ID = 1;
- private static final int __NUM_WORKERS_ISSET_ID = 2;
- private static final int __NUM_EXECUTORS_ISSET_ID = 3;
- private static final int __REPLICATION_COUNT_ISSET_ID = 4;
- private static final int __REQUESTED_MEMONHEAP_ISSET_ID = 5;
- private static final int __REQUESTED_MEMOFFHEAP_ISSET_ID = 6;
- private static final int __REQUESTED_CPU_ISSET_ID = 7;
- private static final int __ASSIGNED_MEMONHEAP_ISSET_ID = 8;
- private static final int __ASSIGNED_MEMOFFHEAP_ISSET_ID = 9;
- private static final int __ASSIGNED_CPU_ISSET_ID = 10;
- private short __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.NAME,_Fields.UPTIME_SECS,_Fields.STATUS,_Fields.NUM_TASKS,_Fields.NUM_WORKERS,_Fields.NUM_EXECUTORS,_Fields.TOPOLOGY_CONF,_Fields.ID_TO_SPOUT_AGG_STATS,_Fields.ID_TO_BOLT_AGG_STATS,_Fields.SCHED_STATUS,_Fields.TOPOLOGY_STATS,_Fields.OWNER,_Fields.DEBUG_OPTIONS,_Fields.REPLICATION_COUNT,_Fields.WORKERS,_Fields.REQUESTED_MEMONHEAP,_Fields.REQUESTED_MEMOFFHEAP,_Fields.REQUESTED_CPU,_Fields.ASSIGNED_MEMONHEAP,_Fields.ASSIGNED_MEMOFFHEAP,_Fields.ASSIGNED_CPU};
- 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- 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.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.NUM_TASKS, new org.apache.thrift.meta_data.FieldMetaData("num_tasks", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.NUM_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("num_workers", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.NUM_EXECUTORS, new org.apache.thrift.meta_data.FieldMetaData("num_executors", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.TOPOLOGY_CONF, new org.apache.thrift.meta_data.FieldMetaData("topology_conf", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.ID_TO_SPOUT_AGG_STATS, new org.apache.thrift.meta_data.FieldMetaData("id_to_spout_agg_stats", 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, ComponentAggregateStats.class))));
- tmpMap.put(_Fields.ID_TO_BOLT_AGG_STATS, new org.apache.thrift.meta_data.FieldMetaData("id_to_bolt_agg_stats", 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, ComponentAggregateStats.class))));
- tmpMap.put(_Fields.SCHED_STATUS, new org.apache.thrift.meta_data.FieldMetaData("sched_status", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.TOPOLOGY_STATS, new org.apache.thrift.meta_data.FieldMetaData("topology_stats", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TopologyStats.class)));
- 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.DEBUG_OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("debug_options", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DebugOptions.class)));
- 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)));
- tmpMap.put(_Fields.WORKERS, new org.apache.thrift.meta_data.FieldMetaData("workers", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkerSummary.class))));
- tmpMap.put(_Fields.REQUESTED_MEMONHEAP, new org.apache.thrift.meta_data.FieldMetaData("requested_memonheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.REQUESTED_MEMOFFHEAP, new org.apache.thrift.meta_data.FieldMetaData("requested_memoffheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.REQUESTED_CPU, new org.apache.thrift.meta_data.FieldMetaData("requested_cpu", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.ASSIGNED_MEMONHEAP, new org.apache.thrift.meta_data.FieldMetaData("assigned_memonheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.ASSIGNED_MEMOFFHEAP, new org.apache.thrift.meta_data.FieldMetaData("assigned_memoffheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.ASSIGNED_CPU, new org.apache.thrift.meta_data.FieldMetaData("assigned_cpu", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologyPageInfo.class, metaDataMap);
- }
-
- public TopologyPageInfo() {
- }
-
- public TopologyPageInfo(
- String id)
- {
- this();
- this.id = id;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public TopologyPageInfo(TopologyPageInfo other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_id()) {
- this.id = other.id;
- }
- if (other.is_set_name()) {
- this.name = other.name;
- }
- this.uptime_secs = other.uptime_secs;
- if (other.is_set_status()) {
- this.status = other.status;
- }
- this.num_tasks = other.num_tasks;
- this.num_workers = other.num_workers;
- this.num_executors = other.num_executors;
- if (other.is_set_topology_conf()) {
- this.topology_conf = other.topology_conf;
- }
- if (other.is_set_id_to_spout_agg_stats()) {
- Map<String,ComponentAggregateStats> __this__id_to_spout_agg_stats = new HashMap<String,ComponentAggregateStats>(other.id_to_spout_agg_stats.size());
- for (Map.Entry<String, ComponentAggregateStats> other_element : other.id_to_spout_agg_stats.entrySet()) {
-
- String other_element_key = other_element.getKey();
- ComponentAggregateStats other_element_value = other_element.getValue();
-
- String __this__id_to_spout_agg_stats_copy_key = other_element_key;
-
- ComponentAggregateStats __this__id_to_spout_agg_stats_copy_value = new ComponentAggregateStats(other_element_value);
-
- __this__id_to_spout_agg_stats.put(__this__id_to_spout_agg_stats_copy_key, __this__id_to_spout_agg_stats_copy_value);
- }
- this.id_to_spout_agg_stats = __this__id_to_spout_agg_stats;
- }
- if (other.is_set_id_to_bolt_agg_stats()) {
- Map<String,ComponentAggregateStats> __this__id_to_bolt_agg_stats = new HashMap<String,ComponentAggregateStats>(other.id_to_bolt_agg_stats.size());
- for (Map.Entry<String, ComponentAggregateStats> other_element : other.id_to_bolt_agg_stats.entrySet()) {
-
- String other_element_key = other_element.getKey();
- ComponentAggregateStats other_element_value = other_element.getValue();
-
- String __this__id_to_bolt_agg_stats_copy_key = other_element_key;
-
- ComponentAggregateStats __this__id_to_bolt_agg_stats_copy_value = new ComponentAggregateStats(other_element_value);
-
- __this__id_to_bolt_agg_stats.put(__this__id_to_bolt_agg_stats_copy_key, __this__id_to_bolt_agg_stats_copy_value);
- }
- this.id_to_bolt_agg_stats = __this__id_to_bolt_agg_stats;
- }
- if (other.is_set_sched_status()) {
- this.sched_status = other.sched_status;
- }
- if (other.is_set_topology_stats()) {
- this.topology_stats = new TopologyStats(other.topology_stats);
- }
- if (other.is_set_owner()) {
- this.owner = other.owner;
- }
- if (other.is_set_debug_options()) {
- this.debug_options = new DebugOptions(other.debug_options);
- }
- this.replication_count = other.replication_count;
- if (other.is_set_workers()) {
- List<WorkerSummary> __this__workers = new ArrayList<WorkerSummary>(other.workers.size());
- for (WorkerSummary other_element : other.workers) {
- __this__workers.add(new WorkerSummary(other_element));
- }
- this.workers = __this__workers;
- }
- this.requested_memonheap = other.requested_memonheap;
- this.requested_memoffheap = other.requested_memoffheap;
- this.requested_cpu = other.requested_cpu;
- this.assigned_memonheap = other.assigned_memonheap;
- this.assigned_memoffheap = other.assigned_memoffheap;
- this.assigned_cpu = other.assigned_cpu;
- }
-
- public TopologyPageInfo deepCopy() {
- return new TopologyPageInfo(this);
- }
-
- @Override
- public void clear() {
- this.id = null;
- this.name = null;
- set_uptime_secs_isSet(false);
- this.uptime_secs = 0;
- this.status = null;
- set_num_tasks_isSet(false);
- this.num_tasks = 0;
- set_num_workers_isSet(false);
- this.num_workers = 0;
- set_num_executors_isSet(false);
- this.num_executors = 0;
- this.topology_conf = null;
- this.id_to_spout_agg_stats = null;
- this.id_to_bolt_agg_stats = null;
- this.sched_status = null;
- this.topology_stats = null;
- this.owner = null;
- this.debug_options = null;
- set_replication_count_isSet(false);
- this.replication_count = 0;
- this.workers = null;
- set_requested_memonheap_isSet(false);
- this.requested_memonheap = 0.0;
- set_requested_memoffheap_isSet(false);
- this.requested_memoffheap = 0.0;
- set_requested_cpu_isSet(false);
- this.requested_cpu = 0.0;
- set_assigned_memonheap_isSet(false);
- this.assigned_memonheap = 0.0;
- set_assigned_memoffheap_isSet(false);
- this.assigned_memoffheap = 0.0;
- set_assigned_cpu_isSet(false);
- this.assigned_cpu = 0.0;
- }
-
- public String get_id() {
- return this.id;
- }
-
- public void set_id(String id) {
- this.id = id;
- }
-
- public void unset_id() {
- this.id = null;
- }
-
- /** Returns true if field id is set (has been assigned a value) and false otherwise */
- public boolean is_set_id() {
- return this.id != null;
- }
-
- public void set_id_isSet(boolean value) {
- if (!value) {
- this.id = 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_uptime_secs() {
- return this.uptime_secs;
- }
-
- public void set_uptime_secs(int uptime_secs) {
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- }
-
- public void unset_uptime_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_uptime_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- public void set_uptime_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID, value);
- }
-
- public String get_status() {
- return this.status;
- }
-
- public void set_status(String status) {
- this.status = status;
- }
-
- public void unset_status() {
- this.status = null;
- }
-
- /** Returns true if field status is set (has been assigned a value) and false otherwise */
- public boolean is_set_status() {
- return this.status != null;
- }
-
- public void set_status_isSet(boolean value) {
- if (!value) {
- this.status = null;
- }
- }
-
- public int get_num_tasks() {
- return this.num_tasks;
- }
-
- public void set_num_tasks(int num_tasks) {
- this.num_tasks = num_tasks;
- set_num_tasks_isSet(true);
- }
-
- public void unset_num_tasks() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_TASKS_ISSET_ID);
- }
-
- /** Returns true if field num_tasks is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_tasks() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_TASKS_ISSET_ID);
- }
-
- public void set_num_tasks_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_TASKS_ISSET_ID, value);
- }
-
- public int get_num_workers() {
- return this.num_workers;
- }
-
- public void set_num_workers(int num_workers) {
- this.num_workers = num_workers;
- set_num_workers_isSet(true);
- }
-
- public void unset_num_workers() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID);
- }
-
- /** Returns true if field num_workers is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_workers() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID);
- }
-
- public void set_num_workers_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID, value);
- }
-
- public int get_num_executors() {
- return this.num_executors;
- }
-
- public void set_num_executors(int num_executors) {
- this.num_executors = num_executors;
- set_num_executors_isSet(true);
- }
-
- public void unset_num_executors() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID);
- }
-
- /** Returns true if field num_executors is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_executors() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID);
- }
-
- public void set_num_executors_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID, value);
- }
-
- public String get_topology_conf() {
- return this.topology_conf;
- }
-
- public void set_topology_conf(String topology_conf) {
- this.topology_conf = topology_conf;
- }
-
- public void unset_topology_conf() {
- this.topology_conf = null;
- }
-
- /** Returns true if field topology_conf is set (has been assigned a value) and false otherwise */
- public boolean is_set_topology_conf() {
- return this.topology_conf != null;
- }
-
- public void set_topology_conf_isSet(boolean value) {
- if (!value) {
- this.topology_conf = null;
- }
- }
-
- public int get_id_to_spout_agg_stats_size() {
- return (this.id_to_spout_agg_stats == null) ? 0 : this.id_to_spout_agg_stats.size();
- }
-
- public void put_to_id_to_spout_agg_stats(String key, ComponentAggregateStats val) {
- if (this.id_to_spout_agg_stats == null) {
- this.id_to_spout_agg_stats = new HashMap<String,ComponentAggregateStats>();
- }
- this.id_to_spout_agg_stats.put(key, val);
- }
-
- public Map<String,ComponentAggregateStats> get_id_to_spout_agg_stats() {
- return this.id_to_spout_agg_stats;
- }
-
- public void set_id_to_spout_agg_stats(Map<String,ComponentAggregateStats> id_to_spout_agg_stats) {
- this.id_to_spout_agg_stats = id_to_spout_agg_stats;
- }
-
- public void unset_id_to_spout_agg_stats() {
- this.id_to_spout_agg_stats = null;
- }
-
- /** Returns true if field id_to_spout_agg_stats is set (has been assigned a value) and false otherwise */
- public boolean is_set_id_to_spout_agg_stats() {
- return this.id_to_spout_agg_stats != null;
- }
-
- public void set_id_to_spout_agg_stats_isSet(boolean value) {
- if (!value) {
- this.id_to_spout_agg_stats = null;
- }
- }
-
- public int get_id_to_bolt_agg_stats_size() {
- return (this.id_to_bolt_agg_stats == null) ? 0 : this.id_to_bolt_agg_stats.size();
- }
-
- public void put_to_id_to_bolt_agg_stats(String key, ComponentAggregateStats val) {
- if (this.id_to_bolt_agg_stats == null) {
- this.id_to_bolt_agg_stats = new HashMap<String,ComponentAggregateStats>();
- }
- this.id_to_bolt_agg_stats.put(key, val);
- }
-
- public Map<String,ComponentAggregateStats> get_id_to_bolt_agg_stats() {
- return this.id_to_bolt_agg_stats;
- }
-
- public void set_id_to_bolt_agg_stats(Map<String,ComponentAggregateStats> id_to_bolt_agg_stats) {
- this.id_to_bolt_agg_stats = id_to_bolt_agg_stats;
- }
-
- public void unset_id_to_bolt_agg_stats() {
- this.id_to_bolt_agg_stats = null;
- }
-
- /** Returns true if field id_to_bolt_agg_stats is set (has been assigned a value) and false otherwise */
- public boolean is_set_id_to_bolt_agg_stats() {
- return this.id_to_bolt_agg_stats != null;
- }
-
- public void set_id_to_bolt_agg_stats_isSet(boolean value) {
- if (!value) {
- this.id_to_bolt_agg_stats = null;
- }
- }
-
- public String get_sched_status() {
- return this.sched_status;
- }
-
- public void set_sched_status(String sched_status) {
- this.sched_status = sched_status;
- }
-
- public void unset_sched_status() {
- this.sched_status = null;
- }
-
- /** Returns true if field sched_status is set (has been assigned a value) and false otherwise */
- public boolean is_set_sched_status() {
- return this.sched_status != null;
- }
-
- public void set_sched_status_isSet(boolean value) {
- if (!value) {
- this.sched_status = null;
- }
- }
-
- public TopologyStats get_topology_stats() {
- return this.topology_stats;
- }
-
- public void set_topology_stats(TopologyStats topology_stats) {
- this.topology_stats = topology_stats;
- }
-
- public void unset_topology_stats() {
- this.topology_stats = null;
- }
-
- /** Returns true if field topology_stats is set (has been assigned a value) and false otherwise */
- public boolean is_set_topology_stats() {
- return this.topology_stats != null;
- }
-
- public void set_topology_stats_isSet(boolean value) {
- if (!value) {
- this.topology_stats = null;
- }
- }
-
- public String get_owner() {
- return this.owner;
- }
-
- public void set_owner(String owner) {
- this.owner = owner;
- }
-
- public void unset_owner() {
- this.owner = null;
- }
-
- /** Returns true if field owner is set (has been assigned a value) and false otherwise */
- public boolean is_set_owner() {
- return this.owner != null;
- }
-
- public void set_owner_isSet(boolean value) {
- if (!value) {
- this.owner = null;
- }
- }
-
- public DebugOptions get_debug_options() {
- return this.debug_options;
- }
-
- public void set_debug_options(DebugOptions debug_options) {
- this.debug_options = debug_options;
- }
-
- public void unset_debug_options() {
- this.debug_options = null;
- }
-
- /** Returns true if field debug_options is set (has been assigned a value) and false otherwise */
- public boolean is_set_debug_options() {
- return this.debug_options != null;
- }
-
- public void set_debug_options_isSet(boolean value) {
- if (!value) {
- this.debug_options = null;
- }
- }
-
- 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_bitfield = EncodingUtils.clearBit(__isset_bitfield, __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 EncodingUtils.testBit(__isset_bitfield, __REPLICATION_COUNT_ISSET_ID);
- }
-
- public void set_replication_count_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REPLICATION_COUNT_ISSET_ID, value);
- }
-
- public int get_workers_size() {
- return (this.workers == null) ? 0 : this.workers.size();
- }
-
- public java.util.Iterator<WorkerSummary> get_workers_iterator() {
- return (this.workers == null) ? null : this.workers.iterator();
- }
-
- public void add_to_workers(WorkerSummary elem) {
- if (this.workers == null) {
- this.workers = new ArrayList<WorkerSummary>();
- }
- this.workers.add(elem);
- }
-
- public List<WorkerSummary> get_workers() {
- return this.workers;
- }
-
- public void set_workers(List<WorkerSummary> workers) {
- this.workers = workers;
- }
-
- public void unset_workers() {
- this.workers = null;
- }
-
- /** Returns true if field workers is set (has been assigned a value) and false otherwise */
- public boolean is_set_workers() {
- return this.workers != null;
- }
-
- public void set_workers_isSet(boolean value) {
- if (!value) {
- this.workers = null;
- }
- }
-
- public double get_requested_memonheap() {
- return this.requested_memonheap;
- }
-
- public void set_requested_memonheap(double requested_memonheap) {
- this.requested_memonheap = requested_memonheap;
- set_requested_memonheap_isSet(true);
- }
-
- public void unset_requested_memonheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTED_MEMONHEAP_ISSET_ID);
- }
-
- /** Returns true if field requested_memonheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_requested_memonheap() {
- return EncodingUtils.testBit(__isset_bitfield, __REQUESTED_MEMONHEAP_ISSET_ID);
- }
-
- public void set_requested_memonheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTED_MEMONHEAP_ISSET_ID, value);
- }
-
- public double get_requested_memoffheap() {
- return this.requested_memoffheap;
- }
-
- public void set_requested_memoffheap(double requested_memoffheap) {
- this.requested_memoffheap = requested_memoffheap;
- set_requested_memoffheap_isSet(true);
- }
-
- public void unset_requested_memoffheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTED_MEMOFFHEAP_ISSET_ID);
- }
-
- /** Returns true if field requested_memoffheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_requested_memoffheap() {
- return EncodingUtils.testBit(__isset_bitfield, __REQUESTED_MEMOFFHEAP_ISSET_ID);
- }
-
- public void set_requested_memoffheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTED_MEMOFFHEAP_ISSET_ID, value);
- }
-
- public double get_requested_cpu() {
- return this.requested_cpu;
- }
-
- public void set_requested_cpu(double requested_cpu) {
- this.requested_cpu = requested_cpu;
- set_requested_cpu_isSet(true);
- }
-
- public void unset_requested_cpu() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTED_CPU_ISSET_ID);
- }
-
- /** Returns true if field requested_cpu is set (has been assigned a value) and false otherwise */
- public boolean is_set_requested_cpu() {
- return EncodingUtils.testBit(__isset_bitfield, __REQUESTED_CPU_ISSET_ID);
- }
-
- public void set_requested_cpu_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTED_CPU_ISSET_ID, value);
- }
-
- public double get_assigned_memonheap() {
- return this.assigned_memonheap;
- }
-
- public void set_assigned_memonheap(double assigned_memonheap) {
- this.assigned_memonheap = assigned_memonheap;
- set_assigned_memonheap_isSet(true);
- }
-
- public void unset_assigned_memonheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ASSIGNED_MEMONHEAP_ISSET_ID);
- }
-
- /** Returns true if field assigned_memonheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_assigned_memonheap() {
- return EncodingUtils.testBit(__isset_bitfield, __ASSIGNED_MEMONHEAP_ISSET_ID);
- }
-
- public void set_assigned_memonheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ASSIGNED_MEMONHEAP_ISSET_ID, value);
- }
-
- public double get_assigned_memoffheap() {
- return this.assigned_memoffheap;
- }
-
- public void set_assigned_memoffheap(double assigned_memoffheap) {
- this.assigned_memoffheap = assigned_memoffheap;
- set_assigned_memoffheap_isSet(true);
- }
-
- public void unset_assigned_memoffheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ASSIGNED_MEMOFFHEAP_ISSET_ID);
- }
-
- /** Returns true if field assigned_memoffheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_assigned_memoffheap() {
- return EncodingUtils.testBit(__isset_bitfield, __ASSIGNED_MEMOFFHEAP_ISSET_ID);
- }
-
- public void set_assigned_memoffheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ASSIGNED_MEMOFFHEAP_ISSET_ID, value);
- }
-
- public double get_assigned_cpu() {
- return this.assigned_cpu;
- }
-
- public void set_assigned_cpu(double assigned_cpu) {
- this.assigned_cpu = assigned_cpu;
- set_assigned_cpu_isSet(true);
- }
-
- public void unset_assigned_cpu() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ASSIGNED_CPU_ISSET_ID);
- }
-
- /** Returns true if field assigned_cpu is set (has been assigned a value) and false otherwise */
- public boolean is_set_assigned_cpu() {
- return EncodingUtils.testBit(__isset_bitfield, __ASSIGNED_CPU_ISSET_ID);
- }
-
- public void set_assigned_cpu_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ASSIGNED_CPU_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ID:
- if (value == null) {
- unset_id();
- } else {
- set_id((String)value);
- }
- break;
-
- case NAME:
- if (value == null) {
- unset_name();
- } else {
- set_name((String)value);
- }
- break;
-
- case UPTIME_SECS:
- if (value == null) {
- unset_uptime_secs();
- } else {
- set_uptime_secs((Integer)value);
- }
- break;
-
- case STATUS:
- if (value == null) {
- unset_status();
- } else {
- set_status((String)value);
- }
- break;
-
- case NUM_TASKS:
- if (value == null) {
- unset_num_tasks();
- } else {
- set_num_tasks((Integer)value);
- }
- break;
-
- case NUM_WORKERS:
- if (value == null) {
- unset_num_workers();
- } else {
- set_num_workers((Integer)value);
- }
- break;
-
- case NUM_EXECUTORS:
- if (value == null) {
- unset_num_executors();
- } else {
- set_num_executors((Integer)value);
- }
- break;
-
- case TOPOLOGY_CONF:
- if (value == null) {
- unset_topology_conf();
- } else {
- set_topology_conf((String)value);
- }
- break;
-
- case ID_TO_SPOUT_AGG_STATS:
- if (value == null) {
- unset_id_to_spout_agg_stats();
- } else {
- set_id_to_spout_agg_stats((Map<String,ComponentAggregateStats>)value);
- }
- break;
-
- case ID_TO_BOLT_AGG_STATS:
- if (value == null) {
- unset_id_to_bolt_agg_stats();
- } else {
- set_id_to_bolt_agg_stats((Map<String,ComponentAggregateStats>)value);
- }
- break;
-
- case SCHED_STATUS:
- if (value == null) {
- unset_sched_status();
- } else {
- set_sched_status((String)value);
- }
- break;
-
- case TOPOLOGY_STATS:
- if (value == null) {
- unset_topology_stats();
- } else {
- set_topology_stats((TopologyStats)value);
- }
- break;
-
- case OWNER:
- if (value == null) {
- unset_owner();
- } else {
- set_owner((String)value);
- }
- break;
-
- case DEBUG_OPTIONS:
- if (value == null) {
- unset_debug_options();
- } else {
- set_debug_options((DebugOptions)value);
- }
- break;
-
- case REPLICATION_COUNT:
- if (value == null) {
- unset_replication_count();
- } else {
- set_replication_count((Integer)value);
- }
- break;
-
- case WORKERS:
- if (value == null) {
- unset_workers();
- } else {
- set_workers((List<WorkerSummary>)value);
- }
- break;
-
- case REQUESTED_MEMONHEAP:
- if (value == null) {
- unset_requested_memonheap();
- } else {
- set_requested_memonheap((Double)value);
- }
- break;
-
- case REQUESTED_MEMOFFHEAP:
- if (value == null) {
- unset_requested_memoffheap();
- } else {
- set_requested_memoffheap((Double)value);
- }
- break;
-
- case REQUESTED_CPU:
- if (value == null) {
- unset_requested_cpu();
- } else {
- set_requested_cpu((Double)value);
- }
- break;
-
- case ASSIGNED_MEMONHEAP:
- if (value == null) {
- unset_assigned_memonheap();
- } else {
- set_assigned_memonheap((Double)value);
- }
- break;
-
- case ASSIGNED_MEMOFFHEAP:
- if (value == null) {
- unset_assigned_memoffheap();
- } else {
- set_assigned_memoffheap((Double)value);
- }
- break;
-
- case ASSIGNED_CPU:
- if (value == null) {
- unset_assigned_cpu();
- } else {
- set_assigned_cpu((Double)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ID:
- return get_id();
-
- case NAME:
- return get_name();
-
- case UPTIME_SECS:
- return get_uptime_secs();
-
- case STATUS:
- return get_status();
-
- case NUM_TASKS:
- return get_num_tasks();
-
- case NUM_WORKERS:
- return get_num_workers();
-
- case NUM_EXECUTORS:
- return get_num_executors();
-
- case TOPOLOGY_CONF:
- return get_topology_conf();
-
- case ID_TO_SPOUT_AGG_STATS:
- return get_id_to_spout_agg_stats();
-
- case ID_TO_BOLT_AGG_STATS:
- return get_id_to_bolt_agg_stats();
-
- case SCHED_STATUS:
- return get_sched_status();
-
- case TOPOLOGY_STATS:
- return get_topology_stats();
-
- case OWNER:
- return get_owner();
-
- case DEBUG_OPTIONS:
- return get_debug_options();
-
- case REPLICATION_COUNT:
- return get_replication_count();
-
- case WORKERS:
- return get_workers();
-
- case REQUESTED_MEMONHEAP:
- return get_requested_memonheap();
-
- case REQUESTED_MEMOFFHEAP:
- return get_requested_memoffheap();
-
- case REQUESTED_CPU:
- return get_requested_cpu();
-
- case ASSIGNED_MEMONHEAP:
- return get_assigned_memonheap();
-
- case ASSIGNED_MEMOFFHEAP:
- return get_assigned_memoffheap();
-
- case ASSIGNED_CPU:
- return get_assigned_cpu();
-
- }
- 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 ID:
- return is_set_id();
- case NAME:
- return is_set_name();
- case UPTIME_SECS:
- return is_set_uptime_secs();
- case STATUS:
- return is_set_status();
- case NUM_TASKS:
- return is_set_num_tasks();
- case NUM_WORKERS:
- return is_set_num_workers();
- case NUM_EXECUTORS:
- return is_set_num_executors();
- case TOPOLOGY_CONF:
- return is_set_topology_conf();
- case ID_TO_SPOUT_AGG_STATS:
- return is_set_id_to_spout_agg_stats();
- case ID_TO_BOLT_AGG_STATS:
- return is_set_id_to_bolt_agg_stats();
- case SCHED_STATUS:
- return is_set_sched_status();
- case TOPOLOGY_STATS:
- return is_set_topology_stats();
- case OWNER:
- return is_set_owner();
- case DEBUG_OPTIONS:
- return is_set_debug_options();
- case REPLICATION_COUNT:
- return is_set_replication_count();
- case WORKERS:
- return is_set_workers();
- case REQUESTED_MEMONHEAP:
- return is_set_requested_memonheap();
- case REQUESTED_MEMOFFHEAP:
- return is_set_requested_memoffheap();
- case REQUESTED_CPU:
- return is_set_requested_cpu();
- case ASSIGNED_MEMONHEAP:
- return is_set_assigned_memonheap();
- case ASSIGNED_MEMOFFHEAP:
- return is_set_assigned_memoffheap();
- case ASSIGNED_CPU:
- return is_set_assigned_cpu();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof TopologyPageInfo)
- return this.equals((TopologyPageInfo)that);
- return false;
- }
-
- public boolean equals(TopologyPageInfo that) {
- if (that == null)
- return false;
-
- boolean this_present_id = true && this.is_set_id();
- boolean that_present_id = true && that.is_set_id();
- if (this_present_id || that_present_id) {
- if (!(this_present_id && that_present_id))
- return false;
- if (!this.id.equals(that.id))
- 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_uptime_secs = true && this.is_set_uptime_secs();
- boolean that_present_uptime_secs = true && that.is_set_uptime_secs();
- if (this_present_uptime_secs || that_present_uptime_secs) {
- if (!(this_present_uptime_secs && that_present_uptime_secs))
- return false;
- if (this.uptime_secs != that.uptime_secs)
- return false;
- }
-
- boolean this_present_status = true && this.is_set_status();
- boolean that_present_status = true && that.is_set_status();
- if (this_present_status || that_present_status) {
- if (!(this_present_status && that_present_status))
- return false;
- if (!this.status.equals(that.status))
- return false;
- }
-
- boolean this_present_num_tasks = true && this.is_set_num_tasks();
- boolean that_present_num_tasks = true && that.is_set_num_tasks();
- if (this_present_num_tasks || that_present_num_tasks) {
- if (!(this_present_num_tasks && that_present_num_tasks))
- return false;
- if (this.num_tasks != that.num_tasks)
- return false;
- }
-
- boolean this_present_num_workers = true && this.is_set_num_workers();
- boolean that_present_num_workers = true && that.is_set_num_workers();
- if (this_present_num_workers || that_present_num_workers) {
- if (!(this_present_num_workers && that_present_num_workers))
- return false;
- if (this.num_workers != that.num_workers)
- return false;
- }
-
- boolean this_present_num_executors = true && this.is_set_num_executors();
- boolean that_present_num_executors = true && that.is_set_num_executors();
- if (this_present_num_executors || that_present_num_executors) {
- if (!(this_present_num_executors && that_present_num_executors))
- return false;
- if (this.num_executors != that.num_executors)
- return false;
- }
-
- boolean this_present_topology_conf = true && this.is_set_topology_conf();
- boolean that_present_topology_conf = true && that.is_set_topology_conf();
- if (this_present_topology_conf || that_present_topology_conf) {
- if (!(this_present_topology_conf && that_present_topology_conf))
- return false;
- if (!this.topology_conf.equals(that.topology_conf))
- return false;
- }
-
- boolean this_present_id_to_spout_agg_stats = true && this.is_set_id_to_spout_agg_stats();
- boolean that_present_id_to_spout_agg_stats = true && that.is_set_id_to_spout_agg_stats();
- if (this_present_id_to_spout_agg_stats || that_present_id_to_spout_agg_stats) {
- if (!(this_present_id_to_spout_agg_stats && that_present_id_to_spout_agg_stats))
- return false;
- if (!this.id_to_spout_agg_stats.equals(that.id_to_spout_agg_stats))
- return false;
- }
-
- boolean this_present_id_to_bolt_agg_stats = true && this.is_set_id_to_bolt_agg_stats();
- boolean that_present_id_to_bolt_agg_stats = true && that.is_set_id_to_bolt_agg_stats();
- if (this_present_id_to_bolt_agg_stats || that_present_id_to_bolt_agg_stats) {
- if (!(this_present_id_to_bolt_agg_stats && that_present_id_to_bolt_agg_stats))
- return false;
- if (!this.id_to_bolt_agg_stats.equals(that.id_to_bolt_agg_stats))
- return false;
- }
-
- boolean this_present_sched_status = true && this.is_set_sched_status();
- boolean that_present_sched_status = true && that.is_set_sched_status();
- if (this_present_sched_status || that_present_sched_status) {
- if (!(this_present_sched_status && that_present_sched_status))
- return false;
- if (!this.sched_status.equals(that.sched_status))
- return false;
- }
-
- boolean this_present_topology_stats = true && this.is_set_topology_stats();
- boolean that_present_topology_stats = true && that.is_set_topology_stats();
- if (this_present_topology_stats || that_present_topology_stats) {
- if (!(this_present_topology_stats && that_present_topology_stats))
- return false;
- if (!this.topology_stats.equals(that.topology_stats))
- return false;
- }
-
- boolean this_present_owner = true && this.is_set_owner();
- boolean that_present_owner = true && that.is_set_owner();
- if (this_present_owner || that_present_owner) {
- if (!(this_present_owner && that_present_owner))
- return false;
- if (!this.owner.equals(that.owner))
- return false;
- }
-
- boolean this_present_debug_options = true && this.is_set_debug_options();
- boolean that_present_debug_options = true && that.is_set_debug_options();
- if (this_present_debug_options || that_present_debug_options) {
- if (!(this_present_debug_options && that_present_debug_options))
- return false;
- if (!this.debug_options.equals(that.debug_options))
- 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;
- }
-
- boolean this_present_workers = true && this.is_set_workers();
- boolean that_present_workers = true && that.is_set_workers();
- if (this_present_workers || that_present_workers) {
- if (!(this_present_workers && that_present_workers))
- return false;
- if (!this.workers.equals(that.workers))
- return false;
- }
-
- boolean this_present_requested_memonheap = true && this.is_set_requested_memonheap();
- boolean that_present_requested_memonheap = true && that.is_set_requested_memonheap();
- if (this_present_requested_memonheap || that_present_requested_memonheap) {
- if (!(this_present_requested_memonheap && that_present_requested_memonheap))
- return false;
- if (this.requested_memonheap != that.requested_memonheap)
- return false;
- }
-
- boolean this_present_requested_memoffheap = true && this.is_set_requested_memoffheap();
- boolean that_present_requested_memoffheap = true && that.is_set_requested_memoffheap();
- if (this_present_requested_memoffheap || that_present_requested_memoffheap) {
- if (!(this_present_requested_memoffheap && that_present_requested_memoffheap))
- return false;
- if (this.requested_memoffheap != that.requested_memoffheap)
- return false;
- }
-
- boolean this_present_requested_cpu = true && this.is_set_requested_cpu();
- boolean that_present_requested_cpu = true && that.is_set_requested_cpu();
- if (this_present_requested_cpu || that_present_requested_cpu) {
- if (!(this_present_requested_cpu && that_present_requested_cpu))
- return false;
- if (this.requested_cpu != that.requested_cpu)
- return false;
- }
-
- boolean this_present_assigned_memonheap = true && this.is_set_assigned_memonheap();
- boolean that_present_assigned_memonheap = true && that.is_set_assigned_memonheap();
- if (this_present_assigned_memonheap || that_present_assigned_memonheap) {
- if (!(this_present_assigned_memonheap && that_present_assigned_memonheap))
- return false;
- if (this.assigned_memonheap != that.assigned_memonheap)
- return false;
- }
-
- boolean this_present_assigned_memoffheap = true && this.is_set_assigned_memoffheap();
- boolean that_present_assigned_memoffheap = true && that.is_set_assigned_memoffheap();
- if (this_present_assigned_memoffheap || that_present_assigned_memoffheap) {
- if (!(this_present_assigned_memoffheap && that_present_assigned_memoffheap))
- return false;
- if (this.assigned_memoffheap != that.assigned_memoffheap)
- return false;
- }
-
- boolean this_present_assigned_cpu = true && this.is_set_assigned_cpu();
- boolean that_present_assigned_cpu = true && that.is_set_assigned_cpu();
- if (this_present_assigned_cpu || that_present_assigned_cpu) {
- if (!(this_present_assigned_cpu && that_present_assigned_cpu))
- return false;
- if (this.assigned_cpu != that.assigned_cpu)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_id = true && (is_set_id());
- list.add(present_id);
- if (present_id)
- list.add(id);
-
- boolean present_name = true && (is_set_name());
- list.add(present_name);
- if (present_name)
- list.add(name);
-
- boolean present_uptime_secs = true && (is_set_uptime_secs());
- list.add(present_uptime_secs);
- if (present_uptime_secs)
- list.add(uptime_secs);
-
- boolean present_status = true && (is_set_status());
- list.add(present_status);
- if (present_status)
- list.add(status);
-
- boolean present_num_tasks = true && (is_set_num_tasks());
- list.add(present_num_tasks);
- if (present_num_tasks)
- list.add(num_tasks);
-
- boolean present_num_workers = true && (is_set_num_workers());
- list.add(present_num_workers);
- if (present_num_workers)
- list.add(num_workers);
-
- boolean present_num_executors = true && (is_set_num_executors());
- list.add(present_num_executors);
- if (present_num_executors)
- list.add(num_executors);
-
- boolean present_topology_conf = true && (is_set_topology_conf());
- list.add(present_topology_conf);
- if (present_topology_conf)
- list.add(topology_conf);
-
- boolean present_id_to_spout_agg_stats = true && (is_set_id_to_spout_agg_stats());
- list.add(present_id_to_spout_agg_stats);
- if (present_id_to_spout_agg_stats)
- list.add(id_to_spout_agg_stats);
-
- boolean present_id_to_bolt_agg_stats = true && (is_set_id_to_bolt_agg_stats());
- list.add(present_id_to_bolt_agg_stats);
- if (present_id_to_bolt_agg_stats)
- list.add(id_to_bolt_agg_stats);
-
- boolean present_sched_status = true && (is_set_sched_status());
- list.add(present_sched_status);
- if (present_sched_status)
- list.add(sched_status);
-
- boolean present_topology_stats = true && (is_set_topology_stats());
- list.add(present_topology_stats);
- if (present_topology_stats)
- list.add(topology_stats);
-
- boolean present_owner = true && (is_set_owner());
- list.add(present_owner);
- if (present_owner)
- list.add(owner);
-
- boolean present_debug_options = true && (is_set_debug_options());
- list.add(present_debug_options);
- if (present_debug_options)
- list.add(debug_options);
-
- boolean present_replication_count = true && (is_set_replication_count());
- list.add(present_replication_count);
- if (present_replication_count)
- list.add(replication_count);
-
- boolean present_workers = true && (is_set_workers());
- list.add(present_workers);
- if (present_workers)
- list.add(workers);
-
- boolean present_requested_memonheap = true && (is_set_requested_memonheap());
- list.add(present_requested_memonheap);
- if (present_requested_memonheap)
- list.add(requested_memonheap);
-
- boolean present_requested_memoffheap = true && (is_set_requested_memoffheap());
- list.add(present_requested_memoffheap);
- if (present_requested_memoffheap)
- list.add(requested_memoffheap);
-
- boolean present_requested_cpu = true && (is_set_requested_cpu());
- list.add(present_requested_cpu);
- if (present_requested_cpu)
- list.add(requested_cpu);
-
- boolean present_assigned_memonheap = true && (is_set_assigned_memonheap());
- list.add(present_assigned_memonheap);
- if (present_assigned_memonheap)
- list.add(assigned_memonheap);
-
- boolean present_assigned_memoffheap = true && (is_set_assigned_memoffheap());
- list.add(present_assigned_memoffheap);
- if (present_assigned_memoffheap)
- list.add(assigned_memoffheap);
-
- boolean present_assigned_cpu = true && (is_set_assigned_cpu());
- list.add(present_assigned_cpu);
- if (present_assigned_cpu)
- list.add(assigned_cpu);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(TopologyPageInfo other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_id()).compareTo(other.is_set_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
- 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_uptime_secs()).compareTo(other.is_set_uptime_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_uptime_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, other.uptime_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_status()).compareTo(other.is_set_status());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_status()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_tasks()).compareTo(other.is_set_num_tasks());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_tasks()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_tasks, other.num_tasks);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_workers()).compareTo(other.is_set_num_workers());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_workers()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_workers, other.num_workers);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_executors()).compareTo(other.is_set_num_executors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_executors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_executors, other.num_executors);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_topology_conf()).compareTo(other.is_set_topology_conf());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topology_conf()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology_conf, other.topology_conf);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_id_to_spout_agg_stats()).compareTo(other.is_set_id_to_spout_agg_stats());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_id_to_spout_agg_stats()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id_to_spout_agg_stats, other.id_to_spout_agg_stats);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_id_to_bolt_agg_stats()).compareTo(other.is_set_id_to_bolt_agg_stats());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_id_to_bolt_agg_stats()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id_to_bolt_agg_stats, other.id_to_bolt_agg_stats);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_sched_status()).compareTo(other.is_set_sched_status());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_sched_status()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sched_status, other.sched_status);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_topology_stats()).compareTo(other.is_set_topology_stats());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topology_stats()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology_stats, other.topology_stats);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_owner()).compareTo(other.is_set_owner());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_owner()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, other.owner);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_debug_options()).compareTo(other.is_set_debug_options());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_debug_options()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.debug_options, other.debug_options);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_replication_count()).compareTo(other.is_set_replication_count());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_replication_count()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.replication_count, other.replication_count);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_workers()).compareTo(other.is_set_workers());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_workers()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workers, other.workers);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_requested_memonheap()).compareTo(other.is_set_requested_memonheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_requested_memonheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requested_memonheap, other.requested_memonheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_requested_memoffheap()).compareTo(other.is_set_requested_memoffheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_requested_memoffheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requested_memoffheap, other.requested_memoffheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_requested_cpu()).compareTo(other.is_set_requested_cpu());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_requested_cpu()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requested_cpu, other.requested_cpu);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assigned_memonheap()).compareTo(other.is_set_assigned_memonheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assigned_memonheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assigned_memonheap, other.assigned_memonheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assigned_memoffheap()).compareTo(other.is_set_assigned_memoffheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assigned_memoffheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assigned_memoffheap, other.assigned_memoffheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assigned_cpu()).compareTo(other.is_set_assigned_cpu());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assigned_cpu()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assigned_cpu, other.assigned_cpu);
- 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("TopologyPageInfo(");
- boolean first = true;
-
- sb.append("id:");
- if (this.id == null) {
- sb.append("null");
- } else {
- sb.append(this.id);
- }
- 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 (is_set_uptime_secs()) {
- if (!first) sb.append(", ");
- sb.append("uptime_secs:");
- sb.append(this.uptime_secs);
- first = false;
- }
- if (is_set_status()) {
- if (!first) sb.append(", ");
- sb.append("status:");
- if (this.status == null) {
- sb.append("null");
- } else {
- sb.append(this.status);
- }
- first = false;
- }
- if (is_set_num_tasks()) {
- if (!first) sb.append(", ");
- sb.append("num_tasks:");
- sb.append(this.num_tasks);
- first = false;
- }
- if (is_set_num_workers()) {
- if (!first) sb.append(", ");
- sb.append("num_workers:");
- sb.append(this.num_workers);
- first = false;
- }
- if (is_set_num_executors()) {
- if (!first) sb.append(", ");
- sb.append("num_executors:");
- sb.append(this.num_executors);
- first = false;
- }
- if (is_set_topology_conf()) {
- if (!first) sb.append(", ");
- sb.append("topology_conf:");
- if (this.topology_conf == null) {
- sb.append("null");
- } else {
- sb.append(this.topology_conf);
- }
- first = false;
- }
- if (is_set_id_to_spout_agg_stats()) {
- if (!first) sb.append(", ");
- sb.append("id_to_spout_agg_stats:");
- if (this.id_to_spout_agg_stats == null) {
- sb.append("null");
- } else {
- sb.append(this.id_to_spout_agg_stats);
- }
- first = false;
- }
- if (is_set_id_to_bolt_agg_stats()) {
- if (!first) sb.append(", ");
- sb.append("id_to_bolt_agg_stats:");
- if (this.id_to_bolt_agg_stats == null) {
- sb.append("null");
- } else {
- sb.append(this.id_to_bolt_agg_stats);
- }
- first = false;
- }
- if (is_set_sched_status()) {
- if (!first) sb.append(", ");
- sb.append("sched_status:");
- if (this.sched_status == null) {
- sb.append("null");
- } else {
- sb.append(this.sched_status);
- }
- first = false;
- }
- if (is_set_topology_stats()) {
- if (!first) sb.append(", ");
- sb.append("topology_stats:");
- if (this.topology_stats == null) {
- sb.append("null");
- } else {
- sb.append(this.topology_stats);
- }
- first = false;
- }
- if (is_set_owner()) {
- if (!first) sb.append(", ");
- sb.append("owner:");
- if (this.owner == null) {
- sb.append("null");
- } else {
- sb.append(this.owner);
- }
- first = false;
- }
- if (is_set_debug_options()) {
- if (!first) sb.append(", ");
- sb.append("debug_options:");
- if (this.debug_options == null) {
- sb.append("null");
- } else {
- sb.append(this.debug_options);
- }
- first = false;
- }
- if (is_set_replication_count()) {
- if (!first) sb.append(", ");
- sb.append("replication_count:");
- sb.append(this.replication_count);
- first = false;
- }
- if (is_set_workers()) {
- if (!first) sb.append(", ");
- sb.append("workers:");
- if (this.workers == null) {
- sb.append("null");
- } else {
- sb.append(this.workers);
- }
- first = false;
- }
- if (is_set_requested_memonheap()) {
- if (!first) sb.append(", ");
- sb.append("requested_memonheap:");
- sb.append(this.requested_memonheap);
- first = false;
- }
- if (is_set_requested_memoffheap()) {
- if (!first) sb.append(", ");
- sb.append("requested_memoffheap:");
- sb.append(this.requested_memoffheap);
- first = false;
- }
- if (is_set_requested_cpu()) {
- if (!first) sb.append(", ");
- sb.append("requested_cpu:");
- sb.append(this.requested_cpu);
- first = false;
- }
- if (is_set_assigned_memonheap()) {
- if (!first) sb.append(", ");
- sb.append("assigned_memonheap:");
- sb.append(this.assigned_memonheap);
- first = false;
- }
- if (is_set_assigned_memoffheap()) {
- if (!first) sb.append(", ");
- sb.append("assigned_memoffheap:");
- sb.append(this.assigned_memoffheap);
- first = false;
- }
- if (is_set_assigned_cpu()) {
- if (!first) sb.append(", ");
- sb.append("assigned_cpu:");
- sb.append(this.assigned_cpu);
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- if (topology_stats != null) {
- topology_stats.validate();
- }
- if (debug_options != null) {
- debug_options.validate();
- }
- }
-
- 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 TopologyPageInfoStandardSchemeFactory implements SchemeFactory {
- public TopologyPageInfoStandardScheme getScheme() {
- return new TopologyPageInfoStandardScheme();
- }
- }
-
- private static class TopologyPageInfoStandardScheme extends StandardScheme<TopologyPageInfo> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, TopologyPageInfo 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: // ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.id = iprot.readString();
- struct.set_id_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: // UPTIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // STATUS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.status = iprot.readString();
- struct.set_status_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // NUM_TASKS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_tasks = iprot.readI32();
- struct.set_num_tasks_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // NUM_WORKERS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_workers = iprot.readI32();
- struct.set_num_workers_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // NUM_EXECUTORS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_executors = iprot.readI32();
- struct.set_num_executors_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 8: // TOPOLOGY_CONF
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.topology_conf = iprot.readString();
- struct.set_topology_conf_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 9: // ID_TO_SPOUT_AGG_STATS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map454 = iprot.readMapBegin();
- struct.id_to_spout_agg_stats = new HashMap<String,ComponentAggregateStats>(2*_map454.size);
- String _key455;
- ComponentAggregateStats _val456;
- for (int _i457 = 0; _i457 < _map454.size; ++_i457)
- {
- _key455 = iprot.readString();
- _val456 = new ComponentAggregateStats();
- _val456.read(iprot);
- struct.id_to_spout_agg_stats.put(_key455, _val456);
- }
- iprot.readMapEnd();
- }
- struct.set_id_to_spout_agg_stats_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 10: // ID_TO_BOLT_AGG_STATS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map458 = iprot.readMapBegin();
- struct.id_to_bolt_agg_stats = new HashMap<String,ComponentAggregateStats>(2*_map458.size);
- String _key459;
- ComponentAggregateStats _val460;
- for (int _i461 = 0; _i461 < _map458.size; ++_i461)
- {
- _key459 = iprot.readString();
- _val460 = new ComponentAggregateStats();
- _val460.read(iprot);
- struct.id_to_bolt_agg_stats.put(_key459, _val460);
- }
- iprot.readMapEnd();
- }
- struct.set_id_to_bolt_agg_stats_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 11: // SCHED_STATUS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.sched_status = iprot.readString();
- struct.set_sched_status_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 12: // TOPOLOGY_STATS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.topology_stats = new TopologyStats();
- struct.topology_stats.read(iprot);
- struct.set_topology_stats_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 13: // OWNER
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.owner = iprot.readString();
- struct.set_owner_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 14: // DEBUG_OPTIONS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.debug_options = new DebugOptions();
- struct.debug_options.read(iprot);
- struct.set_debug_options_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 15: // REPLICATION_COUNT
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.replication_count = iprot.readI32();
- struct.set_replication_count_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 16: // WORKERS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list462 = iprot.readListBegin();
- struct.workers = new ArrayList<WorkerSummary>(_list462.size);
- WorkerSummary _elem463;
- for (int _i464 = 0; _i464 < _list462.size; ++_i464)
- {
- _elem463 = new WorkerSummary();
- _elem463.read(iprot);
- struct.workers.add(_elem463);
- }
- iprot.readListEnd();
- }
- struct.set_workers_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 521: // REQUESTED_MEMONHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.requested_memonheap = iprot.readDouble();
- struct.set_requested_memonheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 522: // REQUESTED_MEMOFFHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.requested_memoffheap = iprot.readDouble();
- struct.set_requested_memoffheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 523: // REQUESTED_CPU
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.requested_cpu = iprot.readDouble();
- struct.set_requested_cpu_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 524: // ASSIGNED_MEMONHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.assigned_memonheap = iprot.readDouble();
- struct.set_assigned_memonheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 525: // ASSIGNED_MEMOFFHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.assigned_memoffheap = iprot.readDouble();
- struct.set_assigned_memoffheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 526: // ASSIGNED_CPU
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.assigned_cpu = iprot.readDouble();
- struct.set_assigned_cpu_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, TopologyPageInfo struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.id != null) {
- oprot.writeFieldBegin(ID_FIELD_DESC);
- oprot.writeString(struct.id);
- oprot.writeFieldEnd();
- }
- if (struct.name != null) {
- if (struct.is_set_name()) {
- oprot.writeFieldBegin(NAME_FIELD_DESC);
- oprot.writeString(struct.name);
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_uptime_secs()) {
- oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.uptime_secs);
- oprot.writeFieldEnd();
- }
- if (struct.status != null) {
- if (struct.is_set_status()) {
- oprot.writeFieldBegin(STATUS_FIELD_DESC);
- oprot.writeString(struct.status);
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_num_tasks()) {
- oprot.writeFieldBegin(NUM_TASKS_FIELD_DESC);
- oprot.writeI32(struct.num_tasks);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_num_workers()) {
- oprot.writeFieldBegin(NUM_WORKERS_FIELD_DESC);
- oprot.writeI32(struct.num_workers);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_num_executors()) {
- oprot.writeFieldBegin(NUM_EXECUTORS_FIELD_DESC);
- oprot.writeI32(struct.num_executors);
- oprot.writeFieldEnd();
- }
- if (struct.topology_conf != null) {
- if (struct.is_set_topology_conf()) {
-
<TRUNCATED>
[37/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreUtils.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreUtils.java b/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreUtils.java
deleted file mode 100644
index a1d3f5a..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/BlobStoreUtils.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.storm.Config;
-import org.apache.storm.generated.AuthorizationException;
-import org.apache.storm.generated.KeyAlreadyExistsException;
-import org.apache.storm.generated.KeyNotFoundException;
-import org.apache.storm.generated.ReadableBlobMeta;
-import org.apache.storm.nimbus.NimbusInfo;
-import org.apache.storm.security.auth.NimbusPrincipal;
-import org.apache.storm.utils.NimbusClient;
-import org.apache.storm.utils.Utils;
-import org.apache.storm.utils.ZookeeperAuthInfo;
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.thrift.transport.TTransportException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.security.auth.Subject;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
-public class BlobStoreUtils {
- private static final String BLOBSTORE_SUBTREE="/blobstore";
- private static final String BLOB_DEPENDENCIES_PREFIX = "dep-";
- private static final Logger LOG = LoggerFactory.getLogger(BlobStoreUtils.class);
-
- public static CuratorFramework createZKClient(Map conf) {
- List<String> zkServers = (List<String>) conf.get(Config.STORM_ZOOKEEPER_SERVERS);
- Object port = conf.get(Config.STORM_ZOOKEEPER_PORT);
- ZookeeperAuthInfo zkAuthInfo = new ZookeeperAuthInfo(conf);
- CuratorFramework zkClient = Utils.newCurator(conf, zkServers, port, (String) conf.get(Config.STORM_ZOOKEEPER_ROOT), zkAuthInfo);
- zkClient.start();
- return zkClient;
- }
-
- public static Subject getNimbusSubject() {
- Subject subject = new Subject();
- subject.getPrincipals().add(new NimbusPrincipal());
- return subject;
- }
-
- // Normalize state
- public static BlobKeySequenceInfo normalizeNimbusHostPortSequenceNumberInfo(String nimbusSeqNumberInfo) {
- BlobKeySequenceInfo keySequenceInfo = new BlobKeySequenceInfo();
- int lastIndex = nimbusSeqNumberInfo.lastIndexOf("-");
- keySequenceInfo.setNimbusHostPort(nimbusSeqNumberInfo.substring(0, lastIndex));
- keySequenceInfo.setSequenceNumber(nimbusSeqNumberInfo.substring(lastIndex + 1));
- return keySequenceInfo;
- }
-
- // Check for latest sequence number of a key inside zookeeper and return nimbodes containing the latest sequence number
- public static Set<NimbusInfo> getNimbodesWithLatestSequenceNumberOfBlob(CuratorFramework zkClient, String key) throws Exception {
- List<String> stateInfoList = zkClient.getChildren().forPath("/blobstore/" + key);
- Set<NimbusInfo> nimbusInfoSet = new HashSet<NimbusInfo>();
- int latestSeqNumber = getLatestSequenceNumber(stateInfoList);
- LOG.debug("getNimbodesWithLatestSequenceNumberOfBlob stateInfo {} version {}", stateInfoList, latestSeqNumber);
- // Get the nimbodes with the latest version
- for(String state : stateInfoList) {
- BlobKeySequenceInfo sequenceInfo = normalizeNimbusHostPortSequenceNumberInfo(state);
- if (latestSeqNumber == Integer.parseInt(sequenceInfo.getSequenceNumber())) {
- nimbusInfoSet.add(NimbusInfo.parse(sequenceInfo.getNimbusHostPort()));
- }
- }
- LOG.debug("nimbusInfoList {}", nimbusInfoSet);
- return nimbusInfoSet;
- }
-
- // Get sequence number details from latest sequence number of the blob
- public static int getLatestSequenceNumber(List<String> stateInfoList) {
- int seqNumber = 0;
- // Get latest sequence number of the blob present in the zookeeper --> possible to refactor this piece of code
- for (String state : stateInfoList) {
- BlobKeySequenceInfo sequenceInfo = normalizeNimbusHostPortSequenceNumberInfo(state);
- int currentSeqNumber = Integer.parseInt(sequenceInfo.getSequenceNumber());
- if (seqNumber < currentSeqNumber) {
- seqNumber = currentSeqNumber;
- LOG.debug("Sequence Info {}", seqNumber);
- }
- }
- LOG.debug("Latest Sequence Number {}", seqNumber);
- return seqNumber;
- }
-
- // Download missing blobs from potential nimbodes
- public static boolean downloadMissingBlob(Map conf, BlobStore blobStore, String key, Set<NimbusInfo> nimbusInfos)
- throws TTransportException {
- NimbusClient client;
- ReadableBlobMeta rbm;
- ClientBlobStore remoteBlobStore;
- InputStreamWithMeta in;
- boolean isSuccess = false;
- LOG.debug("Download blob NimbusInfos {}", nimbusInfos);
- for (NimbusInfo nimbusInfo : nimbusInfos) {
- if(isSuccess) {
- break;
- }
- try {
- client = new NimbusClient(conf, nimbusInfo.getHost(), nimbusInfo.getPort(), null);
- rbm = client.getClient().getBlobMeta(key);
- remoteBlobStore = new NimbusBlobStore();
- remoteBlobStore.setClient(conf, client);
- in = remoteBlobStore.getBlob(key);
- blobStore.createBlob(key, in, rbm.get_settable(), getNimbusSubject());
- // if key already exists while creating the blob else update it
- Iterator<String> keyIterator = blobStore.listKeys();
- while (keyIterator.hasNext()) {
- if (keyIterator.next().equals(key)) {
- LOG.debug("Success creating key, {}", key);
- isSuccess = true;
- break;
- }
- }
- } catch (IOException | AuthorizationException exception) {
- throw new RuntimeException(exception);
- } catch (KeyAlreadyExistsException kae) {
- LOG.info("KeyAlreadyExistsException Key: {} {}", key, kae);
- } catch (KeyNotFoundException knf) {
- // Catching and logging KeyNotFoundException because, if
- // there is a subsequent update and delete, the non-leader
- // nimbodes might throw an exception.
- LOG.info("KeyNotFoundException Key: {} {}", key, knf);
- } catch (Exception exp) {
- // Logging an exception while client is connecting
- LOG.error("Exception {}", exp);
- }
- }
-
- if (!isSuccess) {
- LOG.error("Could not download blob with key" + key);
- }
- return isSuccess;
- }
-
- // Download updated blobs from potential nimbodes
- public static boolean downloadUpdatedBlob(Map conf, BlobStore blobStore, String key, Set<NimbusInfo> nimbusInfos)
- throws TTransportException {
- NimbusClient client;
- ClientBlobStore remoteBlobStore;
- InputStreamWithMeta in;
- AtomicOutputStream out;
- boolean isSuccess = false;
- LOG.debug("Download blob NimbusInfos {}", nimbusInfos);
- for (NimbusInfo nimbusInfo : nimbusInfos) {
- if (isSuccess) {
- break;
- }
- try {
- client = new NimbusClient(conf, nimbusInfo.getHost(), nimbusInfo.getPort(), null);
- remoteBlobStore = new NimbusBlobStore();
- remoteBlobStore.setClient(conf, client);
- in = remoteBlobStore.getBlob(key);
- out = blobStore.updateBlob(key, getNimbusSubject());
- byte[] buffer = new byte[2048];
- int len = 0;
- while ((len = in.read(buffer)) > 0) {
- out.write(buffer, 0, len);
- }
- if (out != null) {
- out.close();
- }
- isSuccess = true;
- } catch (IOException | AuthorizationException exception) {
- throw new RuntimeException(exception);
- } catch (KeyNotFoundException knf) {
- // Catching and logging KeyNotFoundException because, if
- // there is a subsequent update and delete, the non-leader
- // nimbodes might throw an exception.
- LOG.info("KeyNotFoundException {}", knf);
- } catch (Exception exp) {
- // Logging an exception while client is connecting
- LOG.error("Exception {}", exp);
- }
- }
-
- if (!isSuccess) {
- LOG.error("Could not update the blob with key" + key);
- }
- return isSuccess;
- }
-
- // Get the list of keys from blobstore
- public static List<String> getKeyListFromBlobStore(BlobStore blobStore) throws Exception {
- Iterator<String> keys = blobStore.listKeys();
- List<String> keyList = new ArrayList<String>();
- if (keys != null) {
- while (keys.hasNext()) {
- keyList.add(keys.next());
- }
- }
- LOG.debug("KeyList from blobstore {}", keyList);
- return keyList;
- }
-
- public static void createStateInZookeeper(Map conf, String key, NimbusInfo nimbusInfo) throws TTransportException {
- ClientBlobStore cb = new NimbusBlobStore();
- cb.setClient(conf, new NimbusClient(conf, nimbusInfo.getHost(), nimbusInfo.getPort(), null));
- cb.createStateInZookeeper(key);
- }
-
- public static void updateKeyForBlobStore (Map conf, BlobStore blobStore, CuratorFramework zkClient, String key, NimbusInfo nimbusDetails) {
- try {
- // Most of clojure tests currently try to access the blobs using getBlob. Since, updateKeyForBlobStore
- // checks for updating the correct version of the blob as a part of nimbus ha before performing any
- // operation on it, there is a neccessity to stub several test cases to ignore this method. It is a valid
- // trade off to return if nimbusDetails which include the details of the current nimbus host port data are
- // not initialized as a part of the test. Moreover, this applies to only local blobstore when used along with
- // nimbus ha.
- if (nimbusDetails == null) {
- return;
- }
- boolean isListContainsCurrentNimbusInfo = false;
- List<String> stateInfo;
- if (zkClient.checkExists().forPath(BLOBSTORE_SUBTREE + "/" + key) == null) {
- return;
- }
- stateInfo = zkClient.getChildren().forPath(BLOBSTORE_SUBTREE + "/" + key);
- LOG.debug("StateInfo for update {}", stateInfo);
- Set<NimbusInfo> nimbusInfoList = getNimbodesWithLatestSequenceNumberOfBlob(zkClient, key);
-
- for (NimbusInfo nimbusInfo:nimbusInfoList) {
- if (nimbusInfo.getHost().equals(nimbusDetails.getHost())) {
- isListContainsCurrentNimbusInfo = true;
- break;
- }
- }
-
- if (!isListContainsCurrentNimbusInfo && downloadUpdatedBlob(conf, blobStore, key, nimbusInfoList)) {
- LOG.debug("Updating state inside zookeeper for an update");
- createStateInZookeeper(conf, key, nimbusDetails);
- }
- } catch (Exception exp) {
- throw new RuntimeException(exp);
- }
- }
-
- public static String generateDependencyBlobKey(String key) {
- return BLOB_DEPENDENCIES_PREFIX + key;
- }
-
- public static String applyUUIDToFileName(String fileName) {
- String fileNameWithExt = com.google.common.io.Files.getNameWithoutExtension(fileName);
- String ext = com.google.common.io.Files.getFileExtension(fileName);
- if (StringUtils.isEmpty(ext)) {
- fileName = fileName + "-" + UUID.randomUUID();
- } else {
- fileName = fileNameWithExt + "-" + UUID.randomUUID() + "." + ext;
- }
- return fileName;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/BlobSynchronizer.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/BlobSynchronizer.java b/storm-core/src/jvm/backtype/storm/blobstore/BlobSynchronizer.java
deleted file mode 100644
index bd34c32..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/BlobSynchronizer.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-import org.apache.storm.nimbus.NimbusInfo;
-import org.apache.curator.framework.CuratorFramework;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Is called periodically and updates the nimbus with blobs based on the state stored inside the zookeeper
- * for a non leader nimbus trying to be in sync with the operations performed on the leader nimbus.
- */
-public class BlobSynchronizer {
- private static final Logger LOG = LoggerFactory.getLogger(BlobSynchronizer.class);
- private CuratorFramework zkClient;
- private Map conf;
- private BlobStore blobStore;
- private Set<String> blobStoreKeySet = new HashSet<String>();
- private Set<String> zookeeperKeySet = new HashSet<String>();
- private NimbusInfo nimbusInfo;
-
- public BlobSynchronizer(BlobStore blobStore, Map conf) {
- this.blobStore = blobStore;
- this.conf = conf;
- }
-
- public void setNimbusInfo(NimbusInfo nimbusInfo) {
- this.nimbusInfo = nimbusInfo;
- }
-
- public void setZookeeperKeySet(Set<String> zookeeperKeySet) {
- this.zookeeperKeySet = zookeeperKeySet;
- }
-
- public void setBlobStoreKeySet(Set<String> blobStoreKeySet) {
- this.blobStoreKeySet = blobStoreKeySet;
- }
-
- public Set<String> getBlobStoreKeySet() {
- Set<String> keySet = new HashSet<String>();
- keySet.addAll(blobStoreKeySet);
- return keySet;
- }
-
- public Set<String> getZookeeperKeySet() {
- Set<String> keySet = new HashSet<String>();
- keySet.addAll(zookeeperKeySet);
- return keySet;
- }
-
- public synchronized void syncBlobs() {
- try {
- LOG.debug("Sync blobs - blobstore keys {}, zookeeper keys {}",getBlobStoreKeySet(), getZookeeperKeySet());
- zkClient = BlobStoreUtils.createZKClient(conf);
- deleteKeySetFromBlobStoreNotOnZookeeper(getBlobStoreKeySet(), getZookeeperKeySet());
- updateKeySetForBlobStore(getBlobStoreKeySet());
- Set<String> keySetToDownload = getKeySetToDownload(getBlobStoreKeySet(), getZookeeperKeySet());
- LOG.debug("Key set Blobstore-> Zookeeper-> DownloadSet {}-> {}-> {}", getBlobStoreKeySet(), getZookeeperKeySet(), keySetToDownload);
-
- for (String key : keySetToDownload) {
- Set<NimbusInfo> nimbusInfoSet = BlobStoreUtils.getNimbodesWithLatestSequenceNumberOfBlob(zkClient, key);
- if(BlobStoreUtils.downloadMissingBlob(conf, blobStore, key, nimbusInfoSet)) {
- BlobStoreUtils.createStateInZookeeper(conf, key, nimbusInfo);
- }
- }
- if (zkClient !=null) {
- zkClient.close();
- }
- } catch(InterruptedException exp) {
- LOG.error("InterruptedException {}", exp);
- } catch(Exception exp) {
- throw new RuntimeException(exp);
- }
- }
-
- public void deleteKeySetFromBlobStoreNotOnZookeeper(Set<String> keySetBlobStore, Set<String> keySetZookeeper) throws Exception {
- if (keySetBlobStore.removeAll(keySetZookeeper)
- || (keySetZookeeper.isEmpty() && !keySetBlobStore.isEmpty())) {
- LOG.debug("Key set to delete in blobstore {}", keySetBlobStore);
- for (String key : keySetBlobStore) {
- blobStore.deleteBlob(key, BlobStoreUtils.getNimbusSubject());
- }
- }
- }
-
- // Update current key list inside the blobstore if the version changes
- public void updateKeySetForBlobStore(Set<String> keySetBlobStore) {
- try {
- for (String key : keySetBlobStore) {
- LOG.debug("updating blob");
- BlobStoreUtils.updateKeyForBlobStore(conf, blobStore, zkClient, key, nimbusInfo);
- }
- } catch (Exception exp) {
- throw new RuntimeException(exp);
- }
- }
-
- // Make a key list to download
- public Set<String> getKeySetToDownload(Set<String> blobStoreKeySet, Set<String> zookeeperKeySet) {
- zookeeperKeySet.removeAll(blobStoreKeySet);
- LOG.debug("Key list to download {}", zookeeperKeySet);
- return zookeeperKeySet;
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/ClientBlobStore.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/ClientBlobStore.java b/storm-core/src/jvm/backtype/storm/blobstore/ClientBlobStore.java
deleted file mode 100644
index 61e48b3..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/ClientBlobStore.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-import org.apache.storm.daemon.Shutdownable;
-import org.apache.storm.generated.AuthorizationException;
-import org.apache.storm.generated.ReadableBlobMeta;
-import org.apache.storm.generated.SettableBlobMeta;
-import org.apache.storm.generated.KeyAlreadyExistsException;
-import org.apache.storm.generated.KeyNotFoundException;
-import org.apache.storm.utils.NimbusClient;
-
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * The ClientBlobStore has two concrete implementations
- * 1. NimbusBlobStore
- * 2. HdfsClientBlobStore
- *
- * Create, update, read and delete are some of the basic operations defined by this interface.
- * Each operation is validated for permissions against an user. We currently have NIMBUS_ADMINS and SUPERVISOR_ADMINS
- * configuration. NIMBUS_ADMINS are given READ, WRITE and ADMIN access whereas the SUPERVISOR_ADMINS are given READ
- * access in order to read and download the blobs form the nimbus.
- *
- * The ACLs for the blob store are validated against whether the subject is a NIMBUS_ADMIN, SUPERVISOR_ADMIN or USER
- * who has read, write or admin privileges in order to perform respective operations on the blob.
- *
- * For more detailed implementation
- * @see org.apache.storm.blobstore.NimbusBlobStore
- * @see org.apache.storm.blobstore.LocalFsBlobStore
- * @see org.apache.storm.hdfs.blobstore.HdfsClientBlobStore
- * @see org.apache.storm.hdfs.blobstore.HdfsBlobStore
- */
-public abstract class ClientBlobStore implements Shutdownable {
- protected Map conf;
-
- /**
- * Sets up the client API by parsing the configs.
- * @param conf The storm conf containing the config details.
- */
- public abstract void prepare(Map conf);
-
- /**
- * Client facing API to create a blob.
- * @param key blob key name.
- * @param meta contains ACL information.
- * @return AtomicOutputStream returns an output stream into which data can be written.
- * @throws AuthorizationException
- * @throws KeyAlreadyExistsException
- */
- protected abstract AtomicOutputStream createBlobToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyAlreadyExistsException;
-
- /**
- * Client facing API to update a blob.
- * @param key blob key name.
- * @return AtomicOutputStream returns an output stream into which data can be written.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- public abstract AtomicOutputStream updateBlob(String key) throws AuthorizationException, KeyNotFoundException;
-
- /**
- * Client facing API to read the metadata information.
- * @param key blob key name.
- * @return AtomicOutputStream returns an output stream into which data can be written.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- public abstract ReadableBlobMeta getBlobMeta(String key) throws AuthorizationException, KeyNotFoundException;
-
- /**
- * Client facing API to set the metadata for a blob.
- * @param key blob key name.
- * @param meta contains ACL information.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- protected abstract void setBlobMetaToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException;
-
- /**
- * Client facing API to delete a blob.
- * @param key blob key name.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- public abstract void deleteBlob(String key) throws AuthorizationException, KeyNotFoundException;
-
- /**
- * Client facing API to read a blob.
- * @param key blob key name.
- * @return an InputStream to read the metadata for a blob.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- public abstract InputStreamWithMeta getBlob(String key) throws AuthorizationException, KeyNotFoundException;
-
- /**
- * @return Iterator for a list of keys currently present in the blob store.
- */
- public abstract Iterator<String> listKeys();
-
- /**
- * Client facing API to read the replication of a blob.
- * @param key blob key name.
- * @return int indicates the replication factor of a blob.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- public abstract int getBlobReplication(String key) throws AuthorizationException, KeyNotFoundException;
-
- /**
- * Client facing API to update the replication of a blob.
- * @param key blob key name.
- * @param replication int indicates the replication factor a blob has to be set.
- * @return int indicates the replication factor of a blob.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- public abstract int updateBlobReplication(String key, int replication) throws AuthorizationException, KeyNotFoundException;
-
- /**
- * Client facing API to set a nimbus client.
- * @param conf storm conf
- * @param client NimbusClient
- * @return indicates where the client connection has been setup.
- */
- public abstract boolean setClient(Map conf, NimbusClient client);
-
- /**
- * Creates state inside a zookeeper.
- * Required for blobstore to write to zookeeper
- * when Nimbus HA is turned on in order to maintain
- * state consistency
- * @param key
- */
- public abstract void createStateInZookeeper(String key);
-
- /**
- * Client facing API to create a blob.
- * @param key blob key name.
- * @param meta contains ACL information.
- * @return AtomicOutputStream returns an output stream into which data can be written.
- * @throws AuthorizationException
- * @throws KeyAlreadyExistsException
- */
- public final AtomicOutputStream createBlob(String key, SettableBlobMeta meta) throws AuthorizationException, KeyAlreadyExistsException {
- if (meta !=null && meta.is_set_acl()) {
- BlobStoreAclHandler.validateSettableACLs(key, meta.get_acl());
- }
- return createBlobToExtend(key, meta);
- }
-
- /**
- * Client facing API to set the metadata for a blob.
- * @param key blob key name.
- * @param meta contains ACL information.
- * @throws AuthorizationException
- * @throws KeyNotFoundException
- */
- public final void setBlobMeta(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException {
- if (meta !=null && meta.is_set_acl()) {
- BlobStoreAclHandler.validateSettableACLs(key, meta.get_acl());
- }
- setBlobMetaToExtend(key, meta);
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/FileBlobStoreImpl.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/FileBlobStoreImpl.java b/storm-core/src/jvm/backtype/storm/blobstore/FileBlobStoreImpl.java
deleted file mode 100644
index 423e73c..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/FileBlobStoreImpl.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-import org.apache.storm.Config;
-import org.apache.storm.utils.Utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * Very basic blob store impl with no ACL handling.
- */
-public class FileBlobStoreImpl {
- private static final long FULL_CLEANUP_FREQ = 60 * 60 * 1000l;
- private static final int BUCKETS = 1024;
- private static final Logger LOG = LoggerFactory.getLogger(FileBlobStoreImpl.class);
- private static final Timer timer = new Timer("FileBlobStore cleanup thread", true);
-
- public class KeyInHashDirIterator implements Iterator<String> {
- private int currentBucket = 0;
- private Iterator<String> it = null;
- private String next = null;
-
- public KeyInHashDirIterator() throws IOException {
- primeNext();
- }
-
- private void primeNext() throws IOException {
- while (it == null && currentBucket < BUCKETS) {
- String name = String.valueOf(currentBucket);
- File dir = new File(fullPath, name);
- try {
- it = listKeys(dir);
- } catch (FileNotFoundException e) {
- it = null;
- }
- if (it == null || !it.hasNext()) {
- it = null;
- currentBucket++;
- } else {
- next = it.next();
- }
- }
- }
-
- @Override
- public boolean hasNext() {
- return next != null;
- }
-
- @Override
- public String next() {
- if (!hasNext()) {
- throw new NoSuchElementException();
- }
- String current = next;
- next = null;
- if (it != null) {
- if (!it.hasNext()) {
- it = null;
- currentBucket++;
- try {
- primeNext();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- } else {
- next = it.next();
- }
- }
- return current;
- }
-
- @Override
- public void remove() {
- throw new UnsupportedOperationException("Delete Not Supported");
- }
- }
-
- private File fullPath;
- private TimerTask cleanup = null;
-
- public FileBlobStoreImpl(File path, Map<String, Object> conf) throws IOException {
- LOG.info("Creating new blob store based in {}", path);
- fullPath = path;
- fullPath.mkdirs();
- Object shouldCleanup = conf.get(Config.BLOBSTORE_CLEANUP_ENABLE);
- if (Utils.getBoolean(shouldCleanup, false)) {
- LOG.debug("Starting File blobstore cleaner");
- cleanup = new TimerTask() {
- @Override
- public void run() {
- try {
- fullCleanup(FULL_CLEANUP_FREQ);
- } catch (IOException e) {
- LOG.error("Error trying to cleanup", e);
- }
- }
- };
- timer.scheduleAtFixedRate(cleanup, 0, FULL_CLEANUP_FREQ);
- }
- }
-
- /**
- * @return all keys that are available for reading.
- * @throws IOException on any error.
- */
- public Iterator<String> listKeys() throws IOException {
- return new KeyInHashDirIterator();
- }
-
- /**
- * Get an input stream for reading a part.
- * @param key the key of the part to read.
- * @return the where to read the data from.
- * @throws IOException on any error
- */
- public LocalFsBlobStoreFile read(String key) throws IOException {
- return new LocalFsBlobStoreFile(getKeyDir(key), BlobStoreFile.BLOBSTORE_DATA_FILE);
- }
-
- /**
- * Get an object tied to writing the data.
- * @param key the key of the part to write to.
- * @return an object that can be used to both write to, but also commit/cancel the operation.
- * @throws IOException on any error
- */
- public LocalFsBlobStoreFile write(String key, boolean create) throws IOException {
- return new LocalFsBlobStoreFile(getKeyDir(key), true, create);
- }
-
- /**
- * Check if the key exists in the blob store.
- * @param key the key to check for
- * @return true if it exists else false.
- */
- public boolean exists(String key) {
- return getKeyDir(key).exists();
- }
-
- /**
- * Delete a key from the blob store
- * @param key the key to delete
- * @throws IOException on any error
- */
- public void deleteKey(String key) throws IOException {
- File keyDir = getKeyDir(key);
- LocalFsBlobStoreFile pf = new LocalFsBlobStoreFile(keyDir, BlobStoreFile.BLOBSTORE_DATA_FILE);
- pf.delete();
- delete(keyDir);
- }
-
- private File getKeyDir(String key) {
- String hash = String.valueOf(Math.abs((long)key.hashCode()) % BUCKETS);
- File ret = new File(new File(fullPath, hash), key);
- LOG.debug("{} Looking for {} in {}", new Object[]{fullPath, key, hash});
- return ret;
- }
-
- public void fullCleanup(long age) throws IOException {
- long cleanUpIfBefore = System.currentTimeMillis() - age;
- Iterator<String> keys = new KeyInHashDirIterator();
- while (keys.hasNext()) {
- String key = keys.next();
- File keyDir = getKeyDir(key);
- Iterator<LocalFsBlobStoreFile> i = listBlobStoreFiles(keyDir);
- if (!i.hasNext()) {
- //The dir is empty, so try to delete it, may fail, but that is OK
- try {
- keyDir.delete();
- } catch (Exception e) {
- LOG.warn("Could not delete "+keyDir+" will try again later");
- }
- }
- while (i.hasNext()) {
- LocalFsBlobStoreFile f = i.next();
- if (f.isTmp()) {
- if (f.getModTime() <= cleanUpIfBefore) {
- f.delete();
- }
- }
- }
- }
- }
-
- protected Iterator<LocalFsBlobStoreFile> listBlobStoreFiles(File path) throws IOException {
- ArrayList<LocalFsBlobStoreFile> ret = new ArrayList<LocalFsBlobStoreFile>();
- File[] files = path.listFiles();
- if (files != null) {
- for (File sub: files) {
- try {
- ret.add(new LocalFsBlobStoreFile(sub.getParentFile(), sub.getName()));
- } catch (IllegalArgumentException e) {
- //Ignored the file did not match
- LOG.warn("Found an unexpected file in {} {}",path, sub.getName());
- }
- }
- }
- return ret.iterator();
- }
-
- protected Iterator<String> listKeys(File path) throws IOException {
- String[] files = path.list();
- if (files != null) {
- return Arrays.asList(files).iterator();
- }
- return new LinkedList<String>().iterator();
- }
-
- protected void delete(File path) throws IOException {
- Files.deleteIfExists(path.toPath());
- }
-
- public void shutdown() {
- if (cleanup != null) {
- cleanup.cancel();
- cleanup = null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/InputStreamWithMeta.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/InputStreamWithMeta.java b/storm-core/src/jvm/backtype/storm/blobstore/InputStreamWithMeta.java
deleted file mode 100644
index 6600a00..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/InputStreamWithMeta.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-public abstract class InputStreamWithMeta extends InputStream {
- public abstract long getVersion() throws IOException;
- public abstract long getFileLength() throws IOException;
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/KeyFilter.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/KeyFilter.java b/storm-core/src/jvm/backtype/storm/blobstore/KeyFilter.java
deleted file mode 100644
index c2d69e1..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/KeyFilter.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-public interface KeyFilter<R> {
- R filter(String key);
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/KeySequenceNumber.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/KeySequenceNumber.java b/storm-core/src/jvm/backtype/storm/blobstore/KeySequenceNumber.java
deleted file mode 100644
index 2425761..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/KeySequenceNumber.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.storm.blobstore;
-
-import org.apache.storm.nimbus.NimbusInfo;
-import org.apache.storm.utils.Utils;
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.ZooDefs;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.nio.ByteBuffer;
-import java.util.TreeSet;
-import java.util.Map;
-import java.util.List;
-
-/**
- * Class hands over the key sequence number which implies the number of updates made to a blob.
- * The information regarding the keys and the sequence number which represents the number of updates are
- * stored within the zookeeper in the following format.
- * /storm/blobstore/key_name/nimbushostport-sequencenumber
- * Example:
- * If there are two nimbodes with nimbus.seeds:leader,non-leader are set,
- * then the state inside the zookeeper is eventually stored as:
- * /storm/blobstore/key1/leader:8080-1
- * /storm/blobstore/key1/non-leader:8080-1
- * indicates that a new blob with the name key1 has been created on the leader
- * nimbus and the non-leader nimbus syncs after a call back is triggered by attempting
- * to download the blob and finally updates its state inside the zookeeper.
- *
- * A watch is placed on the /storm/blobstore/key1 and the znodes leader:8080-1 and
- * non-leader:8080-1 are ephemeral which implies that these nodes exist only until the
- * connection between the corresponding nimbus and the zookeeper persist. If in case the
- * nimbus crashes the node disappears under /storm/blobstore/key1.
- *
- * The sequence number for the keys are handed over based on the following scenario:
- * Lets assume there are three nimbodes up and running, one being the leader and the other
- * being the non-leader.
- *
- * 1. Create is straight forward.
- * Check whether the znode -> /storm/blobstore/key1 has been created or not. It implies
- * the blob has not been created yet. If not created, it creates it and updates the zookeeper
- * states under /storm/blobstore/key1 and /storm/blobstoremaxkeysequencenumber/key1.
- * The znodes it creates on these nodes are /storm/blobstore/key1/leader:8080-1,
- * /storm/blobstore/key1/non-leader:8080-1 and /storm/blobstoremaxkeysequencenumber/key1/1.
- * The latter holds the global sequence number across all nimbodes more like a static variable
- * indicating the true value of number of updates for a blob. This node helps to maintain sanity in case
- * leadership changes due to crashing.
- *
- * 2. Delete does not require to hand over the sequence number.
- *
- * 3. Finally, the update has few scenarios.
- *
- * The class implements a TreeSet. The basic idea is if all the nimbodes have the same
- * sequence number for the blob, then the number of elements in the set is 1 which holds
- * the latest value of sequence number. If the number of elements are greater than 1 then it
- * implies that there is sequence mismatch and there is need for syncing the blobs across
- * nimbodes.
- *
- * The logic for handing over sequence numbers based on the state are described as follows
- * Here consider Nimbus-1 alias as N1 and Nimbus-2 alias as N2.
- * Scenario 1:
- * Example: Normal create/update scenario
- * Operation Nimbus-1:state Nimbus-2:state Seq-Num-Nimbus-1 Seq-Num-Nimbus-2 Max-Seq-Num
- * Create-Key1 alive - Leader alive 1 1
- * Sync alive - Leader alive 1 1 (callback -> download) 1
- * Update-Key1 alive - Leader alive 2 1 2
- * Sync alive - Leader alive 2 2 (callback -> download) 2
- *
- * Scenario 2:
- * Example: Leader nimbus crash followed by leader election, update and ex-leader restored again
- * Operation Nimbus-1:state Nimbus-2:state Seq-Num-Nimbus-1 Seq-Num-Nimbus-2 Max-Seq-Num
- * Create alive - Leader alive 1 1
- * Sync alive - Leader alive 1 1 (callback -> download) 1
- * Update alive - Leader alive 2 1 2
- * Sync alive - Leader alive 2 2 (callback -> download) 2
- * Update alive - Leader alive 3 2 3
- * Crash crash - Leader alive 3 2 3
- * New - Leader crash alive - Leader 3 (Invalid) 2 3
- * Update crash alive - Leader 3 (Invalid) 4 (max-seq-num + 1) 4
- * N1-Restored alive alive - Leader 0 4 4
- * Sync alive alive - Leader 4 4 4
- *
- * Scenario 3:
- * Example: Leader nimbus crash followed by leader election, update and ex-leader restored again
- * Operation Nimbus-1:state Nimbus-2:state Seq-Num-Nimbus-1 Seq-Num-Nimbus-2 Max-Seq-Num
- * Create alive - Leader alive 1 1
- * Sync alive - Leader alive 1 1 (callback -> download) 1
- * Update alive - Leader alive 2 1 2
- * Sync alive - Leader alive 2 2 (callback -> download) 2
- * Update alive - Leader alive 3 2 3
- * Crash crash - Leader alive 3 2 3
- * Elect Leader crash alive - Leader 3 (Invalid) 2 3
- * N1-Restored alive alive - Leader 3 2 3
- * Read/Update alive alive - Leader 3 4 (Downloads from N1) 4
- * Sync alive alive - Leader 4 (callback) 4 4
- * Here the download is triggered whenever an operation corresponding to the blob is triggered on the
- * nimbus like a read or update operation. Here, in the read/update call it is hard to know which call
- * is read or update. Hence, by incrementing the sequence number to max-seq-num + 1 we ensure that the
- * synchronization happens appropriately and all nimbodes have the same blob.
- */
-public class KeySequenceNumber {
- private static final Logger LOG = LoggerFactory.getLogger(KeySequenceNumber.class);
- private final String BLOBSTORE_SUBTREE="/blobstore";
- private final String BLOBSTORE_MAX_KEY_SEQUENCE_SUBTREE="/blobstoremaxkeysequencenumber";
- private final String key;
- private final NimbusInfo nimbusInfo;
- private final int INT_CAPACITY = 4;
- private final int INITIAL_SEQUENCE_NUMBER = 1;
-
- public KeySequenceNumber(String key, NimbusInfo nimbusInfo) {
- this.key = key;
- this.nimbusInfo = nimbusInfo;
- }
-
- public synchronized int getKeySequenceNumber(Map conf) {
- TreeSet<Integer> sequenceNumbers = new TreeSet<Integer>();
- CuratorFramework zkClient = BlobStoreUtils.createZKClient(conf);
- try {
- // Key has not been created yet and it is the first time it is being created
- if(zkClient.checkExists().forPath(BLOBSTORE_SUBTREE + "/" + key) == null) {
- zkClient.create().creatingParentsIfNeeded().withMode(CreateMode.PERSISTENT)
- .withACL(ZooDefs.Ids.OPEN_ACL_UNSAFE).forPath(BLOBSTORE_MAX_KEY_SEQUENCE_SUBTREE + "/" + key);
- zkClient.setData().forPath(BLOBSTORE_MAX_KEY_SEQUENCE_SUBTREE + "/" + key,
- ByteBuffer.allocate(INT_CAPACITY).putInt(INITIAL_SEQUENCE_NUMBER).array());
- return INITIAL_SEQUENCE_NUMBER;
- }
-
- // When all nimbodes go down and one or few of them come up
- // Unfortunately there might not be an exact way to know which one contains the most updated blob,
- // if all go down which is unlikely. Hence there might be a need to update the blob if all go down.
- List<String> stateInfoList = zkClient.getChildren().forPath(BLOBSTORE_SUBTREE + "/" + key);
- LOG.debug("stateInfoList-size {} stateInfoList-data {}", stateInfoList.size(), stateInfoList);
- if(stateInfoList.isEmpty()) {
- return getMaxSequenceNumber(zkClient);
- }
-
- LOG.debug("stateInfoSize {}", stateInfoList.size());
- // In all other cases check for the latest update sequence of the blob on the nimbus
- // and assign the appropriate number. Check if all are have same sequence number,
- // if not assign the highest sequence number.
- for (String stateInfo:stateInfoList) {
- sequenceNumbers.add(Integer.parseInt(BlobStoreUtils.normalizeNimbusHostPortSequenceNumberInfo(stateInfo)
- .getSequenceNumber()));
- }
-
- // Update scenario 2 and 3 explain the code logic written here
- // especially when nimbus crashes and comes up after and before update
- // respectively.
- int currentSeqNumber = getMaxSequenceNumber(zkClient);
- if (!checkIfStateContainsCurrentNimbusHost(stateInfoList, nimbusInfo) && !nimbusInfo.isLeader()) {
- if (sequenceNumbers.last() < currentSeqNumber) {
- return currentSeqNumber;
- } else {
- return INITIAL_SEQUENCE_NUMBER - 1;
- }
- }
-
- // It covers scenarios expalined in scenario 3 when nimbus-1 holding the latest
- // update goes down before it is downloaded by nimbus-2. Nimbus-2 gets elected as a leader
- // after which nimbus-1 comes back up and a read or update is performed.
- if (!checkIfStateContainsCurrentNimbusHost(stateInfoList, nimbusInfo) && nimbusInfo.isLeader()) {
- incrementMaxSequenceNumber(zkClient, currentSeqNumber);
- return currentSeqNumber + 1;
- }
-
- // This code logic covers the update scenarios in 2 when the nimbus-1 goes down
- // before syncing the blob to nimbus-2 and an update happens.
- // If seq-num for nimbus-2 is 2 and max-seq-number is 3 then next sequence number is 4
- // (max-seq-number + 1).
- // Other scenario it covers is when max-seq-number and nimbus seq number are equal.
- if (sequenceNumbers.size() == 1) {
- if (sequenceNumbers.first() < currentSeqNumber) {
- incrementMaxSequenceNumber(zkClient, currentSeqNumber);
- return currentSeqNumber + 1;
- } else {
- incrementMaxSequenceNumber(zkClient, currentSeqNumber);
- return sequenceNumbers.first() + 1;
- }
- }
- } catch(Exception e) {
- LOG.error("Exception {}", e);
- } finally {
- if (zkClient != null) {
- zkClient.close();
- }
- }
- // Normal create update sync scenario returns the greatest sequence number in the set
- return sequenceNumbers.last();
- }
-
- private boolean checkIfStateContainsCurrentNimbusHost(List<String> stateInfoList, NimbusInfo nimbusInfo) {
- boolean containsNimbusHost = false;
- for(String stateInfo:stateInfoList) {
- if(stateInfo.contains(nimbusInfo.getHost())) {
- containsNimbusHost = true;
- break;
- }
- }
- return containsNimbusHost;
- }
-
- private void incrementMaxSequenceNumber(CuratorFramework zkClient, int count) throws Exception {
- zkClient.setData().forPath(BLOBSTORE_MAX_KEY_SEQUENCE_SUBTREE + "/" + key,
- ByteBuffer.allocate(INT_CAPACITY).putInt(count + 1).array());
- }
-
- private int getMaxSequenceNumber(CuratorFramework zkClient) throws Exception {
- return ByteBuffer.wrap(zkClient.getData()
- .forPath(BLOBSTORE_MAX_KEY_SEQUENCE_SUBTREE + "/" + key)).getInt();
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/LocalFsBlobStore.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/LocalFsBlobStore.java b/storm-core/src/jvm/backtype/storm/blobstore/LocalFsBlobStore.java
deleted file mode 100644
index 345d591..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/LocalFsBlobStore.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-import org.apache.storm.Config;
-import org.apache.storm.generated.SettableBlobMeta;
-import org.apache.storm.generated.AuthorizationException;
-import org.apache.storm.generated.KeyAlreadyExistsException;
-import org.apache.storm.generated.KeyNotFoundException;
-import org.apache.storm.generated.ReadableBlobMeta;
-
-import org.apache.storm.nimbus.NimbusInfo;
-import org.apache.storm.utils.Utils;
-import org.apache.curator.framework.CuratorFramework;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.security.auth.Subject;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;;
-
-import static org.apache.storm.blobstore.BlobStoreAclHandler.ADMIN;
-import static org.apache.storm.blobstore.BlobStoreAclHandler.READ;
-import static org.apache.storm.blobstore.BlobStoreAclHandler.WRITE;
-
-/**
- * Provides a local file system backed blob store implementation for Nimbus.
- *
- * For a local blob store the user and the supervisor use NimbusBlobStore Client API in order to talk to nimbus through thrift.
- * The authentication and authorization here is based on the subject.
- * We currently have NIMBUS_ADMINS and SUPERVISOR_ADMINS configuration. NIMBUS_ADMINS are given READ, WRITE and ADMIN
- * access whereas the SUPERVISOR_ADMINS are given READ access in order to read and download the blobs form the nimbus.
- *
- * The ACLs for the blob store are validated against whether the subject is a NIMBUS_ADMIN, SUPERVISOR_ADMIN or USER
- * who has read, write or admin privileges in order to perform respective operations on the blob.
- *
- * For local blob store
- * 1. The USER interacts with nimbus to upload and access blobs through NimbusBlobStore Client API.
- * 2. The USER sets the ACLs, and the blob access is validated against these ACLs.
- * 3. The SUPERVISOR interacts with nimbus through the NimbusBlobStore Client API to download the blobs.
- * The supervisors principal should match the set of users configured into SUPERVISOR_ADMINS.
- * Here, the PrincipalToLocalPlugin takes care of mapping the principal to user name before the ACL validation.
- */
-public class LocalFsBlobStore extends BlobStore {
- public static final Logger LOG = LoggerFactory.getLogger(LocalFsBlobStore.class);
- private static final String DATA_PREFIX = "data_";
- private static final String META_PREFIX = "meta_";
- protected BlobStoreAclHandler _aclHandler;
- private final String BLOBSTORE_SUBTREE = "/blobstore/";
- private NimbusInfo nimbusInfo;
- private FileBlobStoreImpl fbs;
- private final int allPermissions = READ | WRITE | ADMIN;
- private Map conf;
- private CuratorFramework zkClient;
-
- @Override
- public void prepare(Map conf, String overrideBase, NimbusInfo nimbusInfo) {
- this.conf = conf;
- this.nimbusInfo = nimbusInfo;
- zkClient = BlobStoreUtils.createZKClient(conf);
- if (overrideBase == null) {
- overrideBase = (String)conf.get(Config.BLOBSTORE_DIR);
- if (overrideBase == null) {
- overrideBase = (String) conf.get(Config.STORM_LOCAL_DIR);
- }
- }
- File baseDir = new File(overrideBase, BASE_BLOBS_DIR_NAME);
- try {
- fbs = new FileBlobStoreImpl(baseDir, conf);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- _aclHandler = new BlobStoreAclHandler(conf);
- }
-
- @Override
- public AtomicOutputStream createBlob(String key, SettableBlobMeta meta, Subject who) throws AuthorizationException, KeyAlreadyExistsException {
- LOG.debug("Creating Blob for key {}", key);
- validateKey(key);
- _aclHandler.normalizeSettableBlobMeta(key, meta, who, allPermissions);
- BlobStoreAclHandler.validateSettableACLs(key, meta.get_acl());
- _aclHandler.hasPermissions(meta.get_acl(), allPermissions, who, key);
- if (fbs.exists(DATA_PREFIX+key)) {
- throw new KeyAlreadyExistsException(key);
- }
- BlobStoreFileOutputStream mOut = null;
- try {
- mOut = new BlobStoreFileOutputStream(fbs.write(META_PREFIX+key, true));
- mOut.write(Utils.thriftSerialize(meta));
- mOut.close();
- mOut = null;
- return new BlobStoreFileOutputStream(fbs.write(DATA_PREFIX+key, true));
- } catch (IOException e) {
- throw new RuntimeException(e);
- } finally {
- if (mOut != null) {
- try {
- mOut.cancel();
- } catch (IOException e) {
- //Ignored
- }
- }
- }
- }
-
- @Override
- public AtomicOutputStream updateBlob(String key, Subject who) throws AuthorizationException, KeyNotFoundException {
- validateKey(key);
- checkForBlobOrDownload(key);
- SettableBlobMeta meta = getStoredBlobMeta(key);
- _aclHandler.hasPermissions(meta.get_acl(), WRITE, who, key);
- try {
- return new BlobStoreFileOutputStream(fbs.write(DATA_PREFIX+key, false));
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private SettableBlobMeta getStoredBlobMeta(String key) throws KeyNotFoundException {
- InputStream in = null;
- try {
- LocalFsBlobStoreFile pf = fbs.read(META_PREFIX+key);
- try {
- in = pf.getInputStream();
- } catch (FileNotFoundException fnf) {
- throw new KeyNotFoundException(key);
- }
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- byte [] buffer = new byte[2048];
- int len;
- while ((len = in.read(buffer)) > 0) {
- out.write(buffer, 0, len);
- }
- in.close();
- in = null;
- return Utils.thriftDeserialize(SettableBlobMeta.class, out.toByteArray());
- } catch (IOException e) {
- throw new RuntimeException(e);
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException e) {
- //Ignored
- }
- }
- }
- }
-
- @Override
- public ReadableBlobMeta getBlobMeta(String key, Subject who) throws AuthorizationException, KeyNotFoundException {
- validateKey(key);
- if(!checkForBlobOrDownload(key)) {
- checkForBlobUpdate(key);
- }
- SettableBlobMeta meta = getStoredBlobMeta(key);
- _aclHandler.validateUserCanReadMeta(meta.get_acl(), who, key);
- ReadableBlobMeta rbm = new ReadableBlobMeta();
- rbm.set_settable(meta);
- try {
- LocalFsBlobStoreFile pf = fbs.read(DATA_PREFIX+key);
- rbm.set_version(pf.getModTime());
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- return rbm;
- }
-
- @Override
- public void setBlobMeta(String key, SettableBlobMeta meta, Subject who) throws AuthorizationException, KeyNotFoundException {
- validateKey(key);
- checkForBlobOrDownload(key);
- _aclHandler.normalizeSettableBlobMeta(key, meta, who, ADMIN);
- BlobStoreAclHandler.validateSettableACLs(key, meta.get_acl());
- SettableBlobMeta orig = getStoredBlobMeta(key);
- _aclHandler.hasPermissions(orig.get_acl(), ADMIN, who, key);
- BlobStoreFileOutputStream mOut = null;
- try {
- mOut = new BlobStoreFileOutputStream(fbs.write(META_PREFIX+key, false));
- mOut.write(Utils.thriftSerialize(meta));
- mOut.close();
- mOut = null;
- } catch (IOException e) {
- throw new RuntimeException(e);
- } finally {
- if (mOut != null) {
- try {
- mOut.cancel();
- } catch (IOException e) {
- //Ignored
- }
- }
- }
- }
-
- @Override
- public void deleteBlob(String key, Subject who) throws AuthorizationException, KeyNotFoundException {
- validateKey(key);
- checkForBlobOrDownload(key);
- SettableBlobMeta meta = getStoredBlobMeta(key);
- _aclHandler.hasPermissions(meta.get_acl(), WRITE, who, key);
- try {
- fbs.deleteKey(DATA_PREFIX+key);
- fbs.deleteKey(META_PREFIX+key);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public InputStreamWithMeta getBlob(String key, Subject who) throws AuthorizationException, KeyNotFoundException {
- validateKey(key);
- if(!checkForBlobOrDownload(key)) {
- checkForBlobUpdate(key);
- }
- SettableBlobMeta meta = getStoredBlobMeta(key);
- _aclHandler.hasPermissions(meta.get_acl(), READ, who, key);
- try {
- return new BlobStoreFileInputStream(fbs.read(DATA_PREFIX+key));
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public Iterator<String> listKeys() {
- try {
- return new KeyTranslationIterator(fbs.listKeys(), DATA_PREFIX);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void shutdown() {
- if (zkClient != null) {
- zkClient.close();
- }
- }
-
- @Override
- public int getBlobReplication(String key, Subject who) throws Exception {
- int replicationCount = 0;
- validateKey(key);
- SettableBlobMeta meta = getStoredBlobMeta(key);
- _aclHandler.hasPermissions(meta.get_acl(), READ, who, key);
- if (zkClient.checkExists().forPath(BLOBSTORE_SUBTREE + key) == null) {
- return 0;
- }
- replicationCount = zkClient.getChildren().forPath(BLOBSTORE_SUBTREE + key).size();
- return replicationCount;
- }
-
- @Override
- public int updateBlobReplication(String key, int replication, Subject who) throws AuthorizationException, KeyNotFoundException {
- throw new UnsupportedOperationException("For local file system blob store the update blobs function does not work. " +
- "Please use HDFS blob store to make this feature available.");
- }
-
- //This additional check and download is for nimbus high availability in case you have more than one nimbus
- public synchronized boolean checkForBlobOrDownload(String key) {
- boolean checkBlobDownload = false;
- try {
- List<String> keyList = BlobStoreUtils.getKeyListFromBlobStore(this);
- if (!keyList.contains(key)) {
- if (zkClient.checkExists().forPath(BLOBSTORE_SUBTREE + key) != null) {
- Set<NimbusInfo> nimbusSet = BlobStoreUtils.getNimbodesWithLatestSequenceNumberOfBlob(zkClient, key);
- if (BlobStoreUtils.downloadMissingBlob(conf, this, key, nimbusSet)) {
- LOG.debug("Updating blobs state");
- BlobStoreUtils.createStateInZookeeper(conf, key, nimbusInfo);
- checkBlobDownload = true;
- }
- }
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- return checkBlobDownload;
- }
-
- public synchronized void checkForBlobUpdate(String key) {
- BlobStoreUtils.updateKeyForBlobStore(conf, this, zkClient, key, nimbusInfo);
- }
-
- public void fullCleanup(long age) throws IOException {
- fbs.fullCleanup(age);
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/LocalFsBlobStoreFile.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/LocalFsBlobStoreFile.java b/storm-core/src/jvm/backtype/storm/blobstore/LocalFsBlobStoreFile.java
deleted file mode 100644
index 1b7c969..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/LocalFsBlobStoreFile.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-import org.apache.storm.generated.SettableBlobMeta;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.file.Files;
-import java.nio.file.StandardCopyOption;
-import java.util.regex.Matcher;
-
-public class LocalFsBlobStoreFile extends BlobStoreFile {
-
- private final String _key;
- private final boolean _isTmp;
- private final File _path;
- private Long _modTime = null;
- private final boolean _mustBeNew;
- private SettableBlobMeta meta;
-
- public LocalFsBlobStoreFile(File base, String name) {
- if (BlobStoreFile.BLOBSTORE_DATA_FILE.equals(name)) {
- _isTmp = false;
- } else {
- Matcher m = TMP_NAME_PATTERN.matcher(name);
- if (!m.matches()) {
- throw new IllegalArgumentException("File name does not match '"+name+"' !~ "+TMP_NAME_PATTERN);
- }
- _isTmp = true;
- }
- _key = base.getName();
- _path = new File(base, name);
- _mustBeNew = false;
- }
-
- public LocalFsBlobStoreFile(File base, boolean isTmp, boolean mustBeNew) {
- _key = base.getName();
- _isTmp = isTmp;
- _mustBeNew = mustBeNew;
- if (_isTmp) {
- _path = new File(base, System.currentTimeMillis()+TMP_EXT);
- } else {
- _path = new File(base, BlobStoreFile.BLOBSTORE_DATA_FILE);
- }
- }
-
- @Override
- public void delete() throws IOException {
- _path.delete();
- }
-
- @Override
- public boolean isTmp() {
- return _isTmp;
- }
-
- @Override
- public String getKey() {
- return _key;
- }
-
- @Override
- public long getModTime() throws IOException {
- if (_modTime == null) {
- _modTime = _path.lastModified();
- }
- return _modTime;
- }
-
- @Override
- public InputStream getInputStream() throws IOException {
- if (isTmp()) {
- throw new IllegalStateException("Cannot read from a temporary part file.");
- }
- return new FileInputStream(_path);
- }
-
- @Override
- public OutputStream getOutputStream() throws IOException {
- if (!isTmp()) {
- throw new IllegalStateException("Can only write to a temporary part file.");
- }
- boolean success = false;
- try {
- success = _path.createNewFile();
- } catch (IOException e) {
- //Try to create the parent directory, may not work
- _path.getParentFile().mkdirs();
- success = _path.createNewFile();
- }
- if (!success) {
- throw new IOException(_path+" already exists");
- }
- return new FileOutputStream(_path);
- }
-
- @Override
- public void commit() throws IOException {
- if (!isTmp()) {
- throw new IllegalStateException("Can only write to a temporary part file.");
- }
-
- File dest = new File(_path.getParentFile(), BlobStoreFile.BLOBSTORE_DATA_FILE);
- if (_mustBeNew) {
- Files.move(_path.toPath(), dest.toPath(), StandardCopyOption.ATOMIC_MOVE);
- } else {
- Files.move(_path.toPath(), dest.toPath(), StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING);
- }
- }
-
- @Override
- public void cancel() throws IOException {
- if (!isTmp()) {
- throw new IllegalStateException("Can only write to a temporary part file.");
- }
- delete();
- }
-
- @Override
- public SettableBlobMeta getMetadata () {
- return meta;
- }
-
- @Override
- public void setMetadata (SettableBlobMeta meta) {
- this.meta = meta;
- }
-
- @Override
- public String toString() {
- return _path+":"+(_isTmp ? "tmp": BlobStoreFile.BLOBSTORE_DATA_FILE)+":"+_key;
- }
-
- @Override
- public long getFileLength() {
- return _path.length();
- }
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/blobstore/NimbusBlobStore.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/blobstore/NimbusBlobStore.java b/storm-core/src/jvm/backtype/storm/blobstore/NimbusBlobStore.java
deleted file mode 100644
index 009a07c..0000000
--- a/storm-core/src/jvm/backtype/storm/blobstore/NimbusBlobStore.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm.blobstore;
-
-import org.apache.storm.Config;
-import org.apache.storm.generated.AuthorizationException;
-import org.apache.storm.generated.BeginDownloadResult;
-import org.apache.storm.generated.ListBlobsResult;
-import org.apache.storm.generated.ReadableBlobMeta;
-import org.apache.storm.generated.SettableBlobMeta;
-import org.apache.storm.generated.KeyAlreadyExistsException;
-import org.apache.storm.generated.KeyNotFoundException;
-import org.apache.storm.utils.NimbusClient;
-import org.apache.storm.utils.Utils;
-import org.apache.thrift.TException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-/**
- * NimbusBlobStore is a USER facing client API to perform
- * basic operations such as create, update, delete and read
- * for local and hdfs blob store.
- *
- * For local blob store it is also the client facing API for
- * supervisor in order to download blobs from nimbus.
- */
-public class NimbusBlobStore extends ClientBlobStore {
- private static final Logger LOG = LoggerFactory.getLogger(NimbusBlobStore.class);
-
- public class NimbusKeyIterator implements Iterator<String> {
- private ListBlobsResult listBlobs = null;
- private int offset = 0;
- private boolean eof = false;
-
- public NimbusKeyIterator(ListBlobsResult listBlobs) {
- this.listBlobs = listBlobs;
- this.eof = (listBlobs.get_keys_size() == 0);
- }
-
- private boolean isCacheEmpty() {
- return listBlobs.get_keys_size() <= offset;
- }
-
- private void readMore() throws TException {
- if (!eof) {
- offset = 0;
- synchronized(client) {
- listBlobs = client.getClient().listBlobs(listBlobs.get_session());
- }
- if (listBlobs.get_keys_size() == 0) {
- eof = true;
- }
- }
- }
-
- @Override
- public synchronized boolean hasNext() {
- try {
- if (isCacheEmpty()) {
- readMore();
- }
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- return !eof;
- }
-
- @Override
- public synchronized String next() {
- if (!hasNext()) {
- throw new NoSuchElementException();
- }
- String ret = listBlobs.get_keys().get(offset);
- offset++;
- return ret;
- }
-
- @Override
- public void remove() {
- throw new UnsupportedOperationException("Delete Not Supported");
- }
- }
-
- public class NimbusDownloadInputStream extends InputStreamWithMeta {
- private BeginDownloadResult beginBlobDownload;
- private byte[] buffer = null;
- private int offset = 0;
- private int end = 0;
- private boolean eof = false;
-
- public NimbusDownloadInputStream(BeginDownloadResult beginBlobDownload) {
- this.beginBlobDownload = beginBlobDownload;
- }
-
- @Override
- public long getVersion() throws IOException {
- return beginBlobDownload.get_version();
- }
-
- @Override
- public synchronized int read() throws IOException {
- try {
- if (isEmpty()) {
- readMore();
- if (eof) {
- return -1;
- }
- }
- int length = Math.min(1, available());
- if (length == 0) {
- return -1;
- }
- int ret = buffer[offset];
- offset += length;
- return ret;
- } catch(TException exp) {
- throw new IOException(exp);
- }
- }
-
- @Override
- public synchronized int read(byte[] b, int off, int len) throws IOException {
- try {
- if (isEmpty()) {
- readMore();
- if (eof) {
- return -1;
- }
- }
- int length = Math.min(len, available());
- System.arraycopy(buffer, offset, b, off, length);
- offset += length;
- return length;
- } catch(TException exp) {
- throw new IOException(exp);
- }
- }
-
- private boolean isEmpty() {
- return buffer == null || offset >= end;
- }
-
- private void readMore() throws TException {
- if (!eof) {
- ByteBuffer buff;
- synchronized(client) {
- buff = client.getClient().downloadBlobChunk(beginBlobDownload.get_session());
- }
- buffer = buff.array();
- offset = buff.arrayOffset() + buff.position();
- int length = buff.remaining();
- end = offset + length;
- if (length == 0) {
- eof = true;
- }
- }
- }
-
- @Override
- public synchronized int read(byte[] b) throws IOException {
- return read(b, 0, b.length);
- }
-
- @Override
- public synchronized int available() {
- return buffer == null ? 0 : (end - offset);
- }
-
- @Override
- public long getFileLength() {
- return beginBlobDownload.get_data_size();
- }
- }
-
- public class NimbusUploadAtomicOutputStream extends AtomicOutputStream {
- private String session;
- private int maxChunkSize = 4096;
- private String key;
-
- public NimbusUploadAtomicOutputStream(String session, int bufferSize, String key) {
- this.session = session;
- this.maxChunkSize = bufferSize;
- this.key = key;
- }
-
- @Override
- public void cancel() throws IOException {
- try {
- synchronized(client) {
- client.getClient().cancelBlobUpload(session);
- }
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void write(int b) throws IOException {
- try {
- synchronized(client) {
- client.getClient().uploadBlobChunk(session, ByteBuffer.wrap(new byte[] {(byte)b}));
- }
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void write(byte []b) throws IOException {
- write(b, 0, b.length);
- }
-
- @Override
- public void write(byte []b, int offset, int len) throws IOException {
- try {
- int end = offset + len;
- for (int realOffset = offset; realOffset < end; realOffset += maxChunkSize) {
- int realLen = Math.min(end - realOffset, maxChunkSize);
- LOG.debug("Writing {} bytes of {} remaining",realLen,(end-realOffset));
- synchronized(client) {
- client.getClient().uploadBlobChunk(session, ByteBuffer.wrap(b, realOffset, realLen));
- }
- }
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void close() throws IOException {
- try {
- synchronized(client) {
- client.getClient().finishBlobUpload(session);
- client.getClient().createStateInZookeeper(key);
- }
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- private NimbusClient client;
- private int bufferSize = 4096;
-
- @Override
- public void prepare(Map conf) {
- this.client = NimbusClient.getConfiguredClient(conf);
- if (conf != null) {
- this.bufferSize = Utils.getInt(conf.get(Config.STORM_BLOBSTORE_INPUTSTREAM_BUFFER_SIZE_BYTES), bufferSize);
- }
- }
-
- @Override
- protected AtomicOutputStream createBlobToExtend(String key, SettableBlobMeta meta)
- throws AuthorizationException, KeyAlreadyExistsException {
- try {
- synchronized(client) {
- return new NimbusUploadAtomicOutputStream(client.getClient().beginCreateBlob(key, meta), this.bufferSize, key);
- }
- } catch (AuthorizationException | KeyAlreadyExistsException exp) {
- throw exp;
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public AtomicOutputStream updateBlob(String key)
- throws AuthorizationException, KeyNotFoundException {
- try {
- synchronized(client) {
- return new NimbusUploadAtomicOutputStream(client.getClient().beginUpdateBlob(key), this.bufferSize, key);
- }
- } catch (AuthorizationException | KeyNotFoundException exp) {
- throw exp;
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public ReadableBlobMeta getBlobMeta(String key) throws AuthorizationException, KeyNotFoundException {
- try {
- synchronized(client) {
- return client.getClient().getBlobMeta(key);
- }
- } catch (AuthorizationException | KeyNotFoundException exp) {
- throw exp;
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- protected void setBlobMetaToExtend(String key, SettableBlobMeta meta)
- throws AuthorizationException, KeyNotFoundException {
- try {
- synchronized(client) {
- client.getClient().setBlobMeta(key, meta);
- }
- } catch (AuthorizationException | KeyNotFoundException exp) {
- throw exp;
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void deleteBlob(String key) throws AuthorizationException, KeyNotFoundException {
- try {
- synchronized(client) {
- client.getClient().deleteBlob(key);
- }
- } catch (AuthorizationException | KeyNotFoundException exp) {
- throw exp;
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void createStateInZookeeper(String key) {
- try {
- synchronized(client) {
- client.getClient().createStateInZookeeper(key);
- }
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public InputStreamWithMeta getBlob(String key) throws AuthorizationException, KeyNotFoundException {
- try {
- synchronized(client) {
- return new NimbusDownloadInputStream(client.getClient().beginBlobDownload(key));
- }
- } catch (AuthorizationException | KeyNotFoundException exp) {
- throw exp;
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public Iterator<String> listKeys() {
- try {
- synchronized(client) {
- return new NimbusKeyIterator(client.getClient().listBlobs(""));
- }
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public int getBlobReplication(String key) throws AuthorizationException, KeyNotFoundException {
- try {
- return client.getClient().getBlobReplication(key);
- } catch (AuthorizationException | KeyNotFoundException exp) {
- throw exp;
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public int updateBlobReplication(String key, int replication) throws AuthorizationException, KeyNotFoundException {
- try {
- return client.getClient().updateBlobReplication(key, replication);
- } catch (AuthorizationException | KeyNotFoundException exp) {
- throw exp;
- } catch (TException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public boolean setClient(Map conf, NimbusClient client) {
- if (this.client != null) {
- this.client.close();
- }
- this.client = client;
- if (conf != null) {
- this.bufferSize = Utils.getInt(conf.get(Config.STORM_BLOBSTORE_INPUTSTREAM_BUFFER_SIZE_BYTES), bufferSize);
- }
- return true;
- }
-
- @Override
- protected void finalize() {
- shutdown();
- }
-
- @Override
- public void shutdown() {
- if (client != null) {
- client.close();
- client = null;
- }
- }
-}
[14/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ProfileRequest.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ProfileRequest.java b/storm-core/src/jvm/backtype/storm/generated/ProfileRequest.java
deleted file mode 100644
index 1189175..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ProfileRequest.java
+++ /dev/null
@@ -1,631 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ProfileRequest implements org.apache.thrift.TBase<ProfileRequest, ProfileRequest._Fields>, java.io.Serializable, Cloneable, Comparable<ProfileRequest> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ProfileRequest");
-
- private static final org.apache.thrift.protocol.TField NODE_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("nodeInfo", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField ACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("action", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField TIME_STAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("time_stamp", org.apache.thrift.protocol.TType.I64, (short)3);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ProfileRequestStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ProfileRequestTupleSchemeFactory());
- }
-
- private NodeInfo nodeInfo; // required
- private ProfileAction action; // required
- private long time_stamp; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- NODE_INFO((short)1, "nodeInfo"),
- /**
- *
- * @see ProfileAction
- */
- ACTION((short)2, "action"),
- TIME_STAMP((short)3, "time_stamp");
-
- private static final Map<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: // NODE_INFO
- return NODE_INFO;
- case 2: // ACTION
- return ACTION;
- case 3: // TIME_STAMP
- return TIME_STAMP;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " 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 __TIME_STAMP_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.TIME_STAMP};
- 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.NODE_INFO, new org.apache.thrift.meta_data.FieldMetaData("nodeInfo", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NodeInfo.class)));
- tmpMap.put(_Fields.ACTION, new org.apache.thrift.meta_data.FieldMetaData("action", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ProfileAction.class)));
- tmpMap.put(_Fields.TIME_STAMP, new org.apache.thrift.meta_data.FieldMetaData("time_stamp", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ProfileRequest.class, metaDataMap);
- }
-
- public ProfileRequest() {
- }
-
- public ProfileRequest(
- NodeInfo nodeInfo,
- ProfileAction action)
- {
- this();
- this.nodeInfo = nodeInfo;
- this.action = action;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ProfileRequest(ProfileRequest other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_nodeInfo()) {
- this.nodeInfo = new NodeInfo(other.nodeInfo);
- }
- if (other.is_set_action()) {
- this.action = other.action;
- }
- this.time_stamp = other.time_stamp;
- }
-
- public ProfileRequest deepCopy() {
- return new ProfileRequest(this);
- }
-
- @Override
- public void clear() {
- this.nodeInfo = null;
- this.action = null;
- set_time_stamp_isSet(false);
- this.time_stamp = 0;
- }
-
- public NodeInfo get_nodeInfo() {
- return this.nodeInfo;
- }
-
- public void set_nodeInfo(NodeInfo nodeInfo) {
- this.nodeInfo = nodeInfo;
- }
-
- public void unset_nodeInfo() {
- this.nodeInfo = null;
- }
-
- /** Returns true if field nodeInfo is set (has been assigned a value) and false otherwise */
- public boolean is_set_nodeInfo() {
- return this.nodeInfo != null;
- }
-
- public void set_nodeInfo_isSet(boolean value) {
- if (!value) {
- this.nodeInfo = null;
- }
- }
-
- /**
- *
- * @see ProfileAction
- */
- public ProfileAction get_action() {
- return this.action;
- }
-
- /**
- *
- * @see ProfileAction
- */
- public void set_action(ProfileAction action) {
- this.action = action;
- }
-
- public void unset_action() {
- this.action = null;
- }
-
- /** Returns true if field action is set (has been assigned a value) and false otherwise */
- public boolean is_set_action() {
- return this.action != null;
- }
-
- public void set_action_isSet(boolean value) {
- if (!value) {
- this.action = null;
- }
- }
-
- public long get_time_stamp() {
- return this.time_stamp;
- }
-
- public void set_time_stamp(long time_stamp) {
- this.time_stamp = time_stamp;
- set_time_stamp_isSet(true);
- }
-
- public void unset_time_stamp() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIME_STAMP_ISSET_ID);
- }
-
- /** Returns true if field time_stamp is set (has been assigned a value) and false otherwise */
- public boolean is_set_time_stamp() {
- return EncodingUtils.testBit(__isset_bitfield, __TIME_STAMP_ISSET_ID);
- }
-
- public void set_time_stamp_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIME_STAMP_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case NODE_INFO:
- if (value == null) {
- unset_nodeInfo();
- } else {
- set_nodeInfo((NodeInfo)value);
- }
- break;
-
- case ACTION:
- if (value == null) {
- unset_action();
- } else {
- set_action((ProfileAction)value);
- }
- break;
-
- case TIME_STAMP:
- if (value == null) {
- unset_time_stamp();
- } else {
- set_time_stamp((Long)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case NODE_INFO:
- return get_nodeInfo();
-
- case ACTION:
- return get_action();
-
- case TIME_STAMP:
- return get_time_stamp();
-
- }
- 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 NODE_INFO:
- return is_set_nodeInfo();
- case ACTION:
- return is_set_action();
- case TIME_STAMP:
- return is_set_time_stamp();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ProfileRequest)
- return this.equals((ProfileRequest)that);
- return false;
- }
-
- public boolean equals(ProfileRequest that) {
- if (that == null)
- return false;
-
- boolean this_present_nodeInfo = true && this.is_set_nodeInfo();
- boolean that_present_nodeInfo = true && that.is_set_nodeInfo();
- if (this_present_nodeInfo || that_present_nodeInfo) {
- if (!(this_present_nodeInfo && that_present_nodeInfo))
- return false;
- if (!this.nodeInfo.equals(that.nodeInfo))
- return false;
- }
-
- boolean this_present_action = true && this.is_set_action();
- boolean that_present_action = true && that.is_set_action();
- if (this_present_action || that_present_action) {
- if (!(this_present_action && that_present_action))
- return false;
- if (!this.action.equals(that.action))
- return false;
- }
-
- boolean this_present_time_stamp = true && this.is_set_time_stamp();
- boolean that_present_time_stamp = true && that.is_set_time_stamp();
- if (this_present_time_stamp || that_present_time_stamp) {
- if (!(this_present_time_stamp && that_present_time_stamp))
- return false;
- if (this.time_stamp != that.time_stamp)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_nodeInfo = true && (is_set_nodeInfo());
- list.add(present_nodeInfo);
- if (present_nodeInfo)
- list.add(nodeInfo);
-
- boolean present_action = true && (is_set_action());
- list.add(present_action);
- if (present_action)
- list.add(action.getValue());
-
- boolean present_time_stamp = true && (is_set_time_stamp());
- list.add(present_time_stamp);
- if (present_time_stamp)
- list.add(time_stamp);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ProfileRequest other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_nodeInfo()).compareTo(other.is_set_nodeInfo());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_nodeInfo()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nodeInfo, other.nodeInfo);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_action()).compareTo(other.is_set_action());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_action()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.action, other.action);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_time_stamp()).compareTo(other.is_set_time_stamp());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_time_stamp()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.time_stamp, other.time_stamp);
- 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("ProfileRequest(");
- boolean first = true;
-
- sb.append("nodeInfo:");
- if (this.nodeInfo == null) {
- sb.append("null");
- } else {
- sb.append(this.nodeInfo);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("action:");
- if (this.action == null) {
- sb.append("null");
- } else {
- sb.append(this.action);
- }
- first = false;
- if (is_set_time_stamp()) {
- if (!first) sb.append(", ");
- sb.append("time_stamp:");
- sb.append(this.time_stamp);
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_nodeInfo()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'nodeInfo' is unset! Struct:" + toString());
- }
-
- if (!is_set_action()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'action' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- if (nodeInfo != null) {
- nodeInfo.validate();
- }
- }
-
- 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 ProfileRequestStandardSchemeFactory implements SchemeFactory {
- public ProfileRequestStandardScheme getScheme() {
- return new ProfileRequestStandardScheme();
- }
- }
-
- private static class ProfileRequestStandardScheme extends StandardScheme<ProfileRequest> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ProfileRequest 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: // NODE_INFO
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.nodeInfo = new NodeInfo();
- struct.nodeInfo.read(iprot);
- struct.set_nodeInfo_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // ACTION
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.action = org.apache.storm.generated.ProfileAction.findByValue(iprot.readI32());
- struct.set_action_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // TIME_STAMP
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.time_stamp = iprot.readI64();
- struct.set_time_stamp_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, ProfileRequest struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.nodeInfo != null) {
- oprot.writeFieldBegin(NODE_INFO_FIELD_DESC);
- struct.nodeInfo.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.action != null) {
- oprot.writeFieldBegin(ACTION_FIELD_DESC);
- oprot.writeI32(struct.action.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.is_set_time_stamp()) {
- oprot.writeFieldBegin(TIME_STAMP_FIELD_DESC);
- oprot.writeI64(struct.time_stamp);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ProfileRequestTupleSchemeFactory implements SchemeFactory {
- public ProfileRequestTupleScheme getScheme() {
- return new ProfileRequestTupleScheme();
- }
- }
-
- private static class ProfileRequestTupleScheme extends TupleScheme<ProfileRequest> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ProfileRequest struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- struct.nodeInfo.write(oprot);
- oprot.writeI32(struct.action.getValue());
- BitSet optionals = new BitSet();
- if (struct.is_set_time_stamp()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_time_stamp()) {
- oprot.writeI64(struct.time_stamp);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ProfileRequest struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.nodeInfo = new NodeInfo();
- struct.nodeInfo.read(iprot);
- struct.set_nodeInfo_isSet(true);
- struct.action = org.apache.storm.generated.ProfileAction.findByValue(iprot.readI32());
- struct.set_action_isSet(true);
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.time_stamp = iprot.readI64();
- struct.set_time_stamp_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ReadableBlobMeta.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ReadableBlobMeta.java b/storm-core/src/jvm/backtype/storm/generated/ReadableBlobMeta.java
deleted file mode 100644
index 0cbd3b8..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ReadableBlobMeta.java
+++ /dev/null
@@ -1,510 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ReadableBlobMeta implements org.apache.thrift.TBase<ReadableBlobMeta, ReadableBlobMeta._Fields>, java.io.Serializable, Cloneable, Comparable<ReadableBlobMeta> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ReadableBlobMeta");
-
- private static final org.apache.thrift.protocol.TField SETTABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("settable", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I64, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ReadableBlobMetaStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ReadableBlobMetaTupleSchemeFactory());
- }
-
- private SettableBlobMeta settable; // required
- private long version; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SETTABLE((short)1, "settable"),
- VERSION((short)2, "version");
-
- 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: // SETTABLE
- return SETTABLE;
- case 2: // VERSION
- return VERSION;
- 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 __VERSION_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- 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.SETTABLE, new org.apache.thrift.meta_data.FieldMetaData("settable", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SettableBlobMeta.class)));
- tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ReadableBlobMeta.class, metaDataMap);
- }
-
- public ReadableBlobMeta() {
- }
-
- public ReadableBlobMeta(
- SettableBlobMeta settable,
- long version)
- {
- this();
- this.settable = settable;
- this.version = version;
- set_version_isSet(true);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ReadableBlobMeta(ReadableBlobMeta other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_settable()) {
- this.settable = new SettableBlobMeta(other.settable);
- }
- this.version = other.version;
- }
-
- public ReadableBlobMeta deepCopy() {
- return new ReadableBlobMeta(this);
- }
-
- @Override
- public void clear() {
- this.settable = null;
- set_version_isSet(false);
- this.version = 0;
- }
-
- public SettableBlobMeta get_settable() {
- return this.settable;
- }
-
- public void set_settable(SettableBlobMeta settable) {
- this.settable = settable;
- }
-
- public void unset_settable() {
- this.settable = null;
- }
-
- /** Returns true if field settable is set (has been assigned a value) and false otherwise */
- public boolean is_set_settable() {
- return this.settable != null;
- }
-
- public void set_settable_isSet(boolean value) {
- if (!value) {
- this.settable = null;
- }
- }
-
- public long get_version() {
- return this.version;
- }
-
- public void set_version(long version) {
- this.version = version;
- set_version_isSet(true);
- }
-
- public void unset_version() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VERSION_ISSET_ID);
- }
-
- /** Returns true if field version is set (has been assigned a value) and false otherwise */
- public boolean is_set_version() {
- return EncodingUtils.testBit(__isset_bitfield, __VERSION_ISSET_ID);
- }
-
- public void set_version_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VERSION_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SETTABLE:
- if (value == null) {
- unset_settable();
- } else {
- set_settable((SettableBlobMeta)value);
- }
- break;
-
- case VERSION:
- if (value == null) {
- unset_version();
- } else {
- set_version((Long)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SETTABLE:
- return get_settable();
-
- case VERSION:
- return get_version();
-
- }
- 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 SETTABLE:
- return is_set_settable();
- case VERSION:
- return is_set_version();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ReadableBlobMeta)
- return this.equals((ReadableBlobMeta)that);
- return false;
- }
-
- public boolean equals(ReadableBlobMeta that) {
- if (that == null)
- return false;
-
- boolean this_present_settable = true && this.is_set_settable();
- boolean that_present_settable = true && that.is_set_settable();
- if (this_present_settable || that_present_settable) {
- if (!(this_present_settable && that_present_settable))
- return false;
- if (!this.settable.equals(that.settable))
- return false;
- }
-
- boolean this_present_version = true;
- boolean that_present_version = true;
- if (this_present_version || that_present_version) {
- if (!(this_present_version && that_present_version))
- return false;
- if (this.version != that.version)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_settable = true && (is_set_settable());
- list.add(present_settable);
- if (present_settable)
- list.add(settable);
-
- boolean present_version = true;
- list.add(present_version);
- if (present_version)
- list.add(version);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ReadableBlobMeta other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_settable()).compareTo(other.is_set_settable());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_settable()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.settable, other.settable);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_version()).compareTo(other.is_set_version());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_version()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
- 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("ReadableBlobMeta(");
- boolean first = true;
-
- sb.append("settable:");
- if (this.settable == null) {
- sb.append("null");
- } else {
- sb.append(this.settable);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("version:");
- sb.append(this.version);
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_settable()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'settable' is unset! Struct:" + toString());
- }
-
- if (!is_set_version()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'version' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- if (settable != null) {
- settable.validate();
- }
- }
-
- 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 ReadableBlobMetaStandardSchemeFactory implements SchemeFactory {
- public ReadableBlobMetaStandardScheme getScheme() {
- return new ReadableBlobMetaStandardScheme();
- }
- }
-
- private static class ReadableBlobMetaStandardScheme extends StandardScheme<ReadableBlobMeta> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ReadableBlobMeta 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: // SETTABLE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.settable = new SettableBlobMeta();
- struct.settable.read(iprot);
- struct.set_settable_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // VERSION
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.version = iprot.readI64();
- struct.set_version_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, ReadableBlobMeta struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.settable != null) {
- oprot.writeFieldBegin(SETTABLE_FIELD_DESC);
- struct.settable.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(VERSION_FIELD_DESC);
- oprot.writeI64(struct.version);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ReadableBlobMetaTupleSchemeFactory implements SchemeFactory {
- public ReadableBlobMetaTupleScheme getScheme() {
- return new ReadableBlobMetaTupleScheme();
- }
- }
-
- private static class ReadableBlobMetaTupleScheme extends TupleScheme<ReadableBlobMeta> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ReadableBlobMeta struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- struct.settable.write(oprot);
- oprot.writeI64(struct.version);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ReadableBlobMeta struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.settable = new SettableBlobMeta();
- struct.settable.read(iprot);
- struct.set_settable_isSet(true);
- struct.version = iprot.readI64();
- struct.set_version_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/RebalanceOptions.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/RebalanceOptions.java b/storm-core/src/jvm/backtype/storm/generated/RebalanceOptions.java
deleted file mode 100644
index bbb8f91..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/RebalanceOptions.java
+++ /dev/null
@@ -1,664 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class RebalanceOptions implements org.apache.thrift.TBase<RebalanceOptions, RebalanceOptions._Fields>, java.io.Serializable, Cloneable, Comparable<RebalanceOptions> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RebalanceOptions");
-
- private static final org.apache.thrift.protocol.TField WAIT_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("wait_secs", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField NUM_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_executors", org.apache.thrift.protocol.TType.MAP, (short)3);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new RebalanceOptionsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new RebalanceOptionsTupleSchemeFactory());
- }
-
- private int wait_secs; // optional
- private int num_workers; // optional
- private Map<String,Integer> num_executors; // 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 {
- WAIT_SECS((short)1, "wait_secs"),
- NUM_WORKERS((short)2, "num_workers"),
- NUM_EXECUTORS((short)3, "num_executors");
-
- 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: // WAIT_SECS
- return WAIT_SECS;
- case 2: // NUM_WORKERS
- return NUM_WORKERS;
- case 3: // NUM_EXECUTORS
- return NUM_EXECUTORS;
- 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 __WAIT_SECS_ISSET_ID = 0;
- private static final int __NUM_WORKERS_ISSET_ID = 1;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.WAIT_SECS,_Fields.NUM_WORKERS,_Fields.NUM_EXECUTORS};
- 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.WAIT_SECS, new org.apache.thrift.meta_data.FieldMetaData("wait_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.NUM_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("num_workers", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.NUM_EXECUTORS, new org.apache.thrift.meta_data.FieldMetaData("num_executors", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RebalanceOptions.class, metaDataMap);
- }
-
- public RebalanceOptions() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public RebalanceOptions(RebalanceOptions other) {
- __isset_bitfield = other.__isset_bitfield;
- this.wait_secs = other.wait_secs;
- this.num_workers = other.num_workers;
- if (other.is_set_num_executors()) {
- Map<String,Integer> __this__num_executors = new HashMap<String,Integer>(other.num_executors);
- this.num_executors = __this__num_executors;
- }
- }
-
- public RebalanceOptions deepCopy() {
- return new RebalanceOptions(this);
- }
-
- @Override
- public void clear() {
- set_wait_secs_isSet(false);
- this.wait_secs = 0;
- set_num_workers_isSet(false);
- this.num_workers = 0;
- this.num_executors = null;
- }
-
- public int get_wait_secs() {
- return this.wait_secs;
- }
-
- public void set_wait_secs(int wait_secs) {
- this.wait_secs = wait_secs;
- set_wait_secs_isSet(true);
- }
-
- public void unset_wait_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WAIT_SECS_ISSET_ID);
- }
-
- /** Returns true if field wait_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_wait_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __WAIT_SECS_ISSET_ID);
- }
-
- public void set_wait_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WAIT_SECS_ISSET_ID, value);
- }
-
- public int get_num_workers() {
- return this.num_workers;
- }
-
- public void set_num_workers(int num_workers) {
- this.num_workers = num_workers;
- set_num_workers_isSet(true);
- }
-
- public void unset_num_workers() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID);
- }
-
- /** Returns true if field num_workers is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_workers() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID);
- }
-
- public void set_num_workers_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID, value);
- }
-
- public int get_num_executors_size() {
- return (this.num_executors == null) ? 0 : this.num_executors.size();
- }
-
- public void put_to_num_executors(String key, int val) {
- if (this.num_executors == null) {
- this.num_executors = new HashMap<String,Integer>();
- }
- this.num_executors.put(key, val);
- }
-
- public Map<String,Integer> get_num_executors() {
- return this.num_executors;
- }
-
- public void set_num_executors(Map<String,Integer> num_executors) {
- this.num_executors = num_executors;
- }
-
- public void unset_num_executors() {
- this.num_executors = null;
- }
-
- /** Returns true if field num_executors is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_executors() {
- return this.num_executors != null;
- }
-
- public void set_num_executors_isSet(boolean value) {
- if (!value) {
- this.num_executors = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case WAIT_SECS:
- if (value == null) {
- unset_wait_secs();
- } else {
- set_wait_secs((Integer)value);
- }
- break;
-
- case NUM_WORKERS:
- if (value == null) {
- unset_num_workers();
- } else {
- set_num_workers((Integer)value);
- }
- break;
-
- case NUM_EXECUTORS:
- if (value == null) {
- unset_num_executors();
- } else {
- set_num_executors((Map<String,Integer>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case WAIT_SECS:
- return get_wait_secs();
-
- case NUM_WORKERS:
- return get_num_workers();
-
- case NUM_EXECUTORS:
- return get_num_executors();
-
- }
- 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 WAIT_SECS:
- return is_set_wait_secs();
- case NUM_WORKERS:
- return is_set_num_workers();
- case NUM_EXECUTORS:
- return is_set_num_executors();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof RebalanceOptions)
- return this.equals((RebalanceOptions)that);
- return false;
- }
-
- public boolean equals(RebalanceOptions that) {
- if (that == null)
- return false;
-
- boolean this_present_wait_secs = true && this.is_set_wait_secs();
- boolean that_present_wait_secs = true && that.is_set_wait_secs();
- if (this_present_wait_secs || that_present_wait_secs) {
- if (!(this_present_wait_secs && that_present_wait_secs))
- return false;
- if (this.wait_secs != that.wait_secs)
- return false;
- }
-
- boolean this_present_num_workers = true && this.is_set_num_workers();
- boolean that_present_num_workers = true && that.is_set_num_workers();
- if (this_present_num_workers || that_present_num_workers) {
- if (!(this_present_num_workers && that_present_num_workers))
- return false;
- if (this.num_workers != that.num_workers)
- return false;
- }
-
- boolean this_present_num_executors = true && this.is_set_num_executors();
- boolean that_present_num_executors = true && that.is_set_num_executors();
- if (this_present_num_executors || that_present_num_executors) {
- if (!(this_present_num_executors && that_present_num_executors))
- return false;
- if (!this.num_executors.equals(that.num_executors))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_wait_secs = true && (is_set_wait_secs());
- list.add(present_wait_secs);
- if (present_wait_secs)
- list.add(wait_secs);
-
- boolean present_num_workers = true && (is_set_num_workers());
- list.add(present_num_workers);
- if (present_num_workers)
- list.add(num_workers);
-
- boolean present_num_executors = true && (is_set_num_executors());
- list.add(present_num_executors);
- if (present_num_executors)
- list.add(num_executors);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(RebalanceOptions other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_wait_secs()).compareTo(other.is_set_wait_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_wait_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wait_secs, other.wait_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_workers()).compareTo(other.is_set_num_workers());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_workers()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_workers, other.num_workers);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_executors()).compareTo(other.is_set_num_executors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_executors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_executors, other.num_executors);
- 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("RebalanceOptions(");
- boolean first = true;
-
- if (is_set_wait_secs()) {
- sb.append("wait_secs:");
- sb.append(this.wait_secs);
- first = false;
- }
- if (is_set_num_workers()) {
- if (!first) sb.append(", ");
- sb.append("num_workers:");
- sb.append(this.num_workers);
- first = false;
- }
- if (is_set_num_executors()) {
- if (!first) sb.append(", ");
- sb.append("num_executors:");
- if (this.num_executors == null) {
- sb.append("null");
- } else {
- sb.append(this.num_executors);
- }
- 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 RebalanceOptionsStandardSchemeFactory implements SchemeFactory {
- public RebalanceOptionsStandardScheme getScheme() {
- return new RebalanceOptionsStandardScheme();
- }
- }
-
- private static class RebalanceOptionsStandardScheme extends StandardScheme<RebalanceOptions> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, RebalanceOptions 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: // WAIT_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.wait_secs = iprot.readI32();
- struct.set_wait_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // NUM_WORKERS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_workers = iprot.readI32();
- struct.set_num_workers_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // NUM_EXECUTORS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map538 = iprot.readMapBegin();
- struct.num_executors = new HashMap<String,Integer>(2*_map538.size);
- String _key539;
- int _val540;
- for (int _i541 = 0; _i541 < _map538.size; ++_i541)
- {
- _key539 = iprot.readString();
- _val540 = iprot.readI32();
- struct.num_executors.put(_key539, _val540);
- }
- iprot.readMapEnd();
- }
- struct.set_num_executors_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, RebalanceOptions struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.is_set_wait_secs()) {
- oprot.writeFieldBegin(WAIT_SECS_FIELD_DESC);
- oprot.writeI32(struct.wait_secs);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_num_workers()) {
- oprot.writeFieldBegin(NUM_WORKERS_FIELD_DESC);
- oprot.writeI32(struct.num_workers);
- oprot.writeFieldEnd();
- }
- if (struct.num_executors != null) {
- if (struct.is_set_num_executors()) {
- oprot.writeFieldBegin(NUM_EXECUTORS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.num_executors.size()));
- for (Map.Entry<String, Integer> _iter542 : struct.num_executors.entrySet())
- {
- oprot.writeString(_iter542.getKey());
- oprot.writeI32(_iter542.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class RebalanceOptionsTupleSchemeFactory implements SchemeFactory {
- public RebalanceOptionsTupleScheme getScheme() {
- return new RebalanceOptionsTupleScheme();
- }
- }
-
- private static class RebalanceOptionsTupleScheme extends TupleScheme<RebalanceOptions> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, RebalanceOptions struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_wait_secs()) {
- optionals.set(0);
- }
- if (struct.is_set_num_workers()) {
- optionals.set(1);
- }
- if (struct.is_set_num_executors()) {
- optionals.set(2);
- }
- oprot.writeBitSet(optionals, 3);
- if (struct.is_set_wait_secs()) {
- oprot.writeI32(struct.wait_secs);
- }
- if (struct.is_set_num_workers()) {
- oprot.writeI32(struct.num_workers);
- }
- if (struct.is_set_num_executors()) {
- {
- oprot.writeI32(struct.num_executors.size());
- for (Map.Entry<String, Integer> _iter543 : struct.num_executors.entrySet())
- {
- oprot.writeString(_iter543.getKey());
- oprot.writeI32(_iter543.getValue());
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, RebalanceOptions struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(3);
- if (incoming.get(0)) {
- struct.wait_secs = iprot.readI32();
- struct.set_wait_secs_isSet(true);
- }
- if (incoming.get(1)) {
- struct.num_workers = iprot.readI32();
- struct.set_num_workers_isSet(true);
- }
- if (incoming.get(2)) {
- {
- org.apache.thrift.protocol.TMap _map544 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32());
- struct.num_executors = new HashMap<String,Integer>(2*_map544.size);
- String _key545;
- int _val546;
- for (int _i547 = 0; _i547 < _map544.size; ++_i547)
- {
- _key545 = iprot.readString();
- _val546 = iprot.readI32();
- struct.num_executors.put(_key545, _val546);
- }
- }
- struct.set_num_executors_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SettableBlobMeta.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/SettableBlobMeta.java b/storm-core/src/jvm/backtype/storm/generated/SettableBlobMeta.java
deleted file mode 100644
index 349e045..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/SettableBlobMeta.java
+++ /dev/null
@@ -1,567 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class SettableBlobMeta implements org.apache.thrift.TBase<SettableBlobMeta, SettableBlobMeta._Fields>, java.io.Serializable, Cloneable, Comparable<SettableBlobMeta> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SettableBlobMeta");
-
- private static final org.apache.thrift.protocol.TField ACL_FIELD_DESC = new org.apache.thrift.protocol.TField("acl", org.apache.thrift.protocol.TType.LIST, (short)1);
- private static final org.apache.thrift.protocol.TField REPLICATION_FACTOR_FIELD_DESC = new org.apache.thrift.protocol.TField("replication_factor", org.apache.thrift.protocol.TType.I32, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new SettableBlobMetaStandardSchemeFactory());
- schemes.put(TupleScheme.class, new SettableBlobMetaTupleSchemeFactory());
- }
-
- private List<AccessControl> acl; // required
- private int replication_factor; // 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 {
- ACL((short)1, "acl"),
- REPLICATION_FACTOR((short)2, "replication_factor");
-
- 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: // ACL
- return ACL;
- case 2: // REPLICATION_FACTOR
- return REPLICATION_FACTOR;
- 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 __REPLICATION_FACTOR_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.REPLICATION_FACTOR};
- 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.ACL, new org.apache.thrift.meta_data.FieldMetaData("acl", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, AccessControl.class))));
- tmpMap.put(_Fields.REPLICATION_FACTOR, new org.apache.thrift.meta_data.FieldMetaData("replication_factor", 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(SettableBlobMeta.class, metaDataMap);
- }
-
- public SettableBlobMeta() {
- }
-
- public SettableBlobMeta(
- List<AccessControl> acl)
- {
- this();
- this.acl = acl;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public SettableBlobMeta(SettableBlobMeta other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_acl()) {
- List<AccessControl> __this__acl = new ArrayList<AccessControl>(other.acl.size());
- for (AccessControl other_element : other.acl) {
- __this__acl.add(new AccessControl(other_element));
- }
- this.acl = __this__acl;
- }
- this.replication_factor = other.replication_factor;
- }
-
- public SettableBlobMeta deepCopy() {
- return new SettableBlobMeta(this);
- }
-
- @Override
- public void clear() {
- this.acl = null;
- set_replication_factor_isSet(false);
- this.replication_factor = 0;
- }
-
- public int get_acl_size() {
- return (this.acl == null) ? 0 : this.acl.size();
- }
-
- public java.util.Iterator<AccessControl> get_acl_iterator() {
- return (this.acl == null) ? null : this.acl.iterator();
- }
-
- public void add_to_acl(AccessControl elem) {
- if (this.acl == null) {
- this.acl = new ArrayList<AccessControl>();
- }
- this.acl.add(elem);
- }
-
- public List<AccessControl> get_acl() {
- return this.acl;
- }
-
- public void set_acl(List<AccessControl> acl) {
- this.acl = acl;
- }
-
- public void unset_acl() {
- this.acl = null;
- }
-
- /** Returns true if field acl is set (has been assigned a value) and false otherwise */
- public boolean is_set_acl() {
- return this.acl != null;
- }
-
- public void set_acl_isSet(boolean value) {
- if (!value) {
- this.acl = null;
- }
- }
-
- public int get_replication_factor() {
- return this.replication_factor;
- }
-
- public void set_replication_factor(int replication_factor) {
- this.replication_factor = replication_factor;
- set_replication_factor_isSet(true);
- }
-
- public void unset_replication_factor() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REPLICATION_FACTOR_ISSET_ID);
- }
-
- /** Returns true if field replication_factor is set (has been assigned a value) and false otherwise */
- public boolean is_set_replication_factor() {
- return EncodingUtils.testBit(__isset_bitfield, __REPLICATION_FACTOR_ISSET_ID);
- }
-
- public void set_replication_factor_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REPLICATION_FACTOR_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ACL:
- if (value == null) {
- unset_acl();
- } else {
- set_acl((List<AccessControl>)value);
- }
- break;
-
- case REPLICATION_FACTOR:
- if (value == null) {
- unset_replication_factor();
- } else {
- set_replication_factor((Integer)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ACL:
- return get_acl();
-
- case REPLICATION_FACTOR:
- return get_replication_factor();
-
- }
- 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 ACL:
- return is_set_acl();
- case REPLICATION_FACTOR:
- return is_set_replication_factor();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof SettableBlobMeta)
- return this.equals((SettableBlobMeta)that);
- return false;
- }
-
- public boolean equals(SettableBlobMeta that) {
- if (that == null)
- return false;
-
- boolean this_present_acl = true && this.is_set_acl();
- boolean that_present_acl = true && that.is_set_acl();
- if (this_present_acl || that_present_acl) {
- if (!(this_present_acl && that_present_acl))
- return false;
- if (!this.acl.equals(that.acl))
- return false;
- }
-
- boolean this_present_replication_factor = true && this.is_set_replication_factor();
- boolean that_present_replication_factor = true && that.is_set_replication_factor();
- if (this_present_replication_factor || that_present_replication_factor) {
- if (!(this_present_replication_factor && that_present_replication_factor))
- return false;
- if (this.replication_factor != that.replication_factor)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_acl = true && (is_set_acl());
- list.add(present_acl);
- if (present_acl)
- list.add(acl);
-
- boolean present_replication_factor = true && (is_set_replication_factor());
- list.add(present_replication_factor);
- if (present_replication_factor)
- list.add(replication_factor);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(SettableBlobMeta other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_acl()).compareTo(other.is_set_acl());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_acl()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acl, other.acl);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_replication_factor()).compareTo(other.is_set_replication_factor());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_replication_factor()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.replication_factor, other.replication_factor);
- 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("SettableBlobMeta(");
- boolean first = true;
-
- sb.append("acl:");
- if (this.acl == null) {
- sb.append("null");
- } else {
- sb.append(this.acl);
- }
- first = false;
- if (is_set_replication_factor()) {
- if (!first) sb.append(", ");
- sb.append("replication_factor:");
- sb.append(this.replication_factor);
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_acl()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'acl' 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 SettableBlobMetaStandardSchemeFactory implements SchemeFactory {
- public SettableBlobMetaStandardScheme getScheme() {
- return new SettableBlobMetaStandardScheme();
- }
- }
-
- private static class SettableBlobMetaStandardScheme extends StandardScheme<SettableBlobMeta> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, SettableBlobMeta 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: // ACL
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list558 = iprot.readListBegin();
- struct.acl = new ArrayList<AccessControl>(_list558.size);
- AccessControl _elem559;
- for (int _i560 = 0; _i560 < _list558.size; ++_i560)
- {
- _elem559 = new AccessControl();
- _elem559.read(iprot);
- struct.acl.add(_elem559);
- }
- iprot.readListEnd();
- }
- struct.set_acl_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // REPLICATION_FACTOR
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.replication_factor = iprot.readI32();
- struct.set_replication_factor_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, SettableBlobMeta struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.acl != null) {
- oprot.writeFieldBegin(ACL_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.acl.size()));
- for (AccessControl _iter561 : struct.acl)
- {
- _iter561.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.is_set_replication_factor()) {
- oprot.writeFieldBegin(REPLICATION_FACTOR_FIELD_DESC);
- oprot.writeI32(struct.replication_factor);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class SettableBlobMetaTupleSchemeFactory implements SchemeFactory {
- public SettableBlobMetaTupleScheme getScheme() {
- return new SettableBlobMetaTupleScheme();
- }
- }
-
- private static class SettableBlobMetaTupleScheme extends TupleScheme<SettableBlobMeta> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, SettableBlobMeta struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.acl.size());
- for (AccessControl _iter562 : struct.acl)
- {
- _iter562.write(oprot);
- }
- }
- BitSet optionals = new BitSet();
- if (struct.is_set_replication_factor()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_replication_factor()) {
- oprot.writeI32(struct.replication_factor);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, SettableBlobMeta struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TList _list563 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.acl = new ArrayList<AccessControl>(_list563.size);
- AccessControl _elem564;
- for (int _i565 = 0; _i565 < _list563.size; ++_i565)
- {
- _elem564 = new AccessControl();
- _elem564.read(iprot);
- struct.acl.add(_elem564);
- }
- }
- struct.set_acl_isSet(true);
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.replication_factor = iprot.readI32();
- struct.set_replication_factor_isSet(true);
- }
- }
- }
-
-}
-
[57/59] [abbrv] storm git commit: Updating documentation for
Pacemaker-HA
Posted by ka...@apache.org.
Updating documentation for Pacemaker-HA
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/0374aa57
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/0374aa57
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/0374aa57
Branch: refs/heads/1.x-branch
Commit: 0374aa57854b21f41487d3adc2eab2a0907402cc
Parents: ab276fe
Author: Kyle Nusbaum <Ky...@gmail.com>
Authored: Tue Oct 11 14:52:37 2016 -0500
Committer: Kyle Nusbaum <Ky...@gmail.com>
Committed: Tue Oct 11 14:52:37 2016 -0500
----------------------------------------------------------------------
docs/Pacemaker.md | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/0374aa57/docs/Pacemaker.md
----------------------------------------------------------------------
diff --git a/docs/Pacemaker.md b/docs/Pacemaker.md
index 39e3014..63d7482 100644
--- a/docs/Pacemaker.md
+++ b/docs/Pacemaker.md
@@ -16,7 +16,8 @@ The corresponding Pacemaker client is a plugin for the `ClusterState` interface,
### Configuration
- - `pacemaker.host` : The host that the Pacemaker daemon is running on
+ - `pacemaker.host` : (deprecated) The host that the Pacemaker daemon is running on
+ - `pacemaker.servers` : The hosts that the Pacemaker daemons are running on - This supercedes `pacemaker.host`
- `pacemaker.port` : The port that Pacemaker will listen on
- `pacemaker.max.threads` : Maximum number of threads Pacemaker daemon will use to handle requests.
- `pacemaker.childopts` : Any JVM parameters that need to go to the Pacemaker. (used by storm-deploy project)
@@ -29,9 +30,15 @@ To get Pacemaker up and running, set the following option in the cluster config
storm.cluster.state.store: "org.apache.storm.pacemaker.pacemaker_state_factory"
```
-The Pacemaker host also needs to be set on all nodes:
+The Pacemaker servers also need to be set on all nodes:
```
-pacemaker.host: somehost.mycompany.com
+pacemaker.servers:
+ - somehost.mycompany.com
+ - someotherhost.mycompany.com
+```
+The pacemaker.host config still works for a single pacemaker, although it has been deprecated.
+```
+pacemaker.host: single_pacemaker.mycompany.com
```
And then start all of your daemons
@@ -107,7 +114,4 @@ Compared to ZooKeeper, Pacemaker uses less CPU, less memory, and of course no di
On Gigabit networking, there is a theoretical limit of about 6000 nodes. However, the real limit is likely around 2000-3000 nodes. These limits have not yet been tested.
On a 270 supervisor cluster, fully scheduled with topologies, Pacemaker resource utilization was 70% of one core and nearly 1GiB of RAM on a machine with 4 `Intel(R) Xeon(R) CPU E5530 @ 2.40GHz` and 24GiB of RAM.
-
-There is an easy route to HA for Pacemaker. Unlike ZooKeeper, Pacemaker should be able to scale horizontally without overhead. By contrast, with ZooKeeper, there are diminishing returns when adding ZK nodes.
-
-In short, a single Pacemaker node should be able to handle many times the load that a ZooKeeper cluster can, and future HA work allowing horizontal scaling will increase that even farther.
+Pacemaker now supports HA. Multiple Pacemaker instances can be used at once in a storm cluster to allow massive scalability. Just include the names of the Pacemaker hosts in the pacemaker.servers config and workers and Nimbus will start communicating with them. They're fault tolerant as well. The system keeps on working as long as there is at least one pacemaker left running - provided it can handle the load.
[58/59] [abbrv] storm git commit: Merge branch
'Pacemaker-HA-1.x-branch2' of https://github.com/knusbaum/incubator-storm
into STORM-1546-1.x
Posted by ka...@apache.org.
Merge branch 'Pacemaker-HA-1.x-branch2' of https://github.com/knusbaum/incubator-storm into STORM-1546-1.x
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/8b0f8977
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/8b0f8977
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/8b0f8977
Branch: refs/heads/1.x-branch
Commit: 8b0f8977c53efa61f7a49925b9a8b64b5f42f31d
Parents: c069734 0374aa5
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Wed Oct 12 08:49:21 2016 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Wed Oct 12 08:49:21 2016 +0900
----------------------------------------------------------------------
docs/Pacemaker.md | 18 +-
.../storm/pacemaker/pacemaker_state_factory.clj | 253 ++++++++++++++-----
storm-core/src/jvm/org/apache/storm/Config.java | 10 +-
.../apache/storm/messaging/netty/Client.java | 1 -
.../netty/KerberosSaslClientHandler.java | 6 +-
.../netty/KerberosSaslNettyClient.java | 5 +-
.../apache/storm/pacemaker/PacemakerClient.java | 72 +++---
.../pacemaker/PacemakerConnectionException.java | 24 ++
.../pacemaker/codec/ThriftNettyClientCodec.java | 7 +-
.../storm/pacemaker_state_factory_test.clj | 67 ++---
10 files changed, 327 insertions(+), 136 deletions(-)
----------------------------------------------------------------------
[16/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/Nimbus.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/Nimbus.java b/storm-core/src/jvm/backtype/storm/generated/Nimbus.java
deleted file mode 100644
index ba9e66a..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/Nimbus.java
+++ /dev/null
@@ -1,45416 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class Nimbus {
-
- public interface Iface {
-
- public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology) throws AlreadyAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException;
-
- public void submitTopologyWithOpts(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, SubmitOptions options) throws AlreadyAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException;
-
- public void killTopology(String name) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- public void killTopologyWithOpts(String name, KillOptions options) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- public void activate(String name) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- public void deactivate(String name) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- public void rebalance(String name, RebalanceOptions options) throws NotAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException;
-
- public void setLogConfig(String name, LogConfig config) throws org.apache.thrift.TException;
-
- public LogConfig getLogConfig(String name) throws org.apache.thrift.TException;
-
- /**
- * Enable/disable logging the tuples generated in topology via an internal EventLogger bolt. The component name is optional
- * and if null or empty, the debug flag will apply to the entire topology.
- *
- * The 'samplingPercentage' will limit loggging to a percentage of generated tuples.
- *
- *
- * @param name
- * @param component
- * @param enable
- * @param samplingPercentage
- */
- public void debug(String name, String component, boolean enable, double samplingPercentage) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- public void setWorkerProfiler(String id, ProfileRequest profileRequest) throws org.apache.thrift.TException;
-
- public List<ProfileRequest> getComponentPendingProfileActions(String id, String component_id, ProfileAction action) throws org.apache.thrift.TException;
-
- public void uploadNewCredentials(String name, Credentials creds) throws NotAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException;
-
- public String beginCreateBlob(String key, SettableBlobMeta meta) throws AuthorizationException, KeyAlreadyExistsException, org.apache.thrift.TException;
-
- public String beginUpdateBlob(String key) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException;
-
- public void uploadBlobChunk(String session, ByteBuffer chunk) throws AuthorizationException, org.apache.thrift.TException;
-
- public void finishBlobUpload(String session) throws AuthorizationException, org.apache.thrift.TException;
-
- public void cancelBlobUpload(String session) throws AuthorizationException, org.apache.thrift.TException;
-
- public ReadableBlobMeta getBlobMeta(String key) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException;
-
- public void setBlobMeta(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException;
-
- public BeginDownloadResult beginBlobDownload(String key) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException;
-
- public ByteBuffer downloadBlobChunk(String session) throws AuthorizationException, org.apache.thrift.TException;
-
- public void deleteBlob(String key) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException;
-
- public ListBlobsResult listBlobs(String session) throws org.apache.thrift.TException;
-
- public int getBlobReplication(String key) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException;
-
- public int updateBlobReplication(String key, int replication) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException;
-
- public void createStateInZookeeper(String key) throws org.apache.thrift.TException;
-
- public String beginFileUpload() throws AuthorizationException, org.apache.thrift.TException;
-
- public void uploadChunk(String location, ByteBuffer chunk) throws AuthorizationException, org.apache.thrift.TException;
-
- public void finishFileUpload(String location) throws AuthorizationException, org.apache.thrift.TException;
-
- public String beginFileDownload(String file) throws AuthorizationException, org.apache.thrift.TException;
-
- public ByteBuffer downloadChunk(String id) throws AuthorizationException, org.apache.thrift.TException;
-
- public String getNimbusConf() throws AuthorizationException, org.apache.thrift.TException;
-
- public ClusterSummary getClusterInfo() throws AuthorizationException, org.apache.thrift.TException;
-
- public TopologyInfo getTopologyInfo(String id) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- public TopologyInfo getTopologyInfoWithOpts(String id, GetInfoOptions options) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- public TopologyPageInfo getTopologyPageInfo(String id, String window, boolean is_include_sys) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- public SupervisorPageInfo getSupervisorPageInfo(String id, String host, boolean is_include_sys) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- public ComponentPageInfo getComponentPageInfo(String topology_id, String component_id, String window, boolean is_include_sys) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- public String getTopologyConf(String id) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- /**
- * Returns the compiled topology that contains ackers and metrics consumsers. Compare {@link #getUserTopology(String id)}.
- *
- * @param id
- */
- public StormTopology getTopology(String id) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- /**
- * Returns the user specified topology as submitted originally. Compare {@link #getTopology(String id)}.
- *
- * @param id
- */
- public StormTopology getUserTopology(String id) throws NotAliveException, AuthorizationException, org.apache.thrift.TException;
-
- public TopologyHistoryInfo getTopologyHistory(String user) throws AuthorizationException, org.apache.thrift.TException;
-
- }
-
- public interface AsyncIface {
-
- public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void submitTopologyWithOpts(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, SubmitOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void killTopology(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void killTopologyWithOpts(String name, KillOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void activate(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void deactivate(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void rebalance(String name, RebalanceOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void setLogConfig(String name, LogConfig config, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getLogConfig(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void debug(String name, String component, boolean enable, double samplingPercentage, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void setWorkerProfiler(String id, ProfileRequest profileRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getComponentPendingProfileActions(String id, String component_id, ProfileAction action, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void uploadNewCredentials(String name, Credentials creds, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void beginCreateBlob(String key, SettableBlobMeta meta, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void beginUpdateBlob(String key, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void uploadBlobChunk(String session, ByteBuffer chunk, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void finishBlobUpload(String session, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void cancelBlobUpload(String session, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getBlobMeta(String key, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void setBlobMeta(String key, SettableBlobMeta meta, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void beginBlobDownload(String key, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void downloadBlobChunk(String session, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void deleteBlob(String key, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void listBlobs(String session, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getBlobReplication(String key, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void updateBlobReplication(String key, int replication, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void createStateInZookeeper(String key, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void beginFileUpload(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void uploadChunk(String location, ByteBuffer chunk, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void finishFileUpload(String location, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void beginFileDownload(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void downloadChunk(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getNimbusConf(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getClusterInfo(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getTopologyInfo(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getTopologyInfoWithOpts(String id, GetInfoOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getTopologyPageInfo(String id, String window, boolean is_include_sys, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getSupervisorPageInfo(String id, String host, boolean is_include_sys, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getComponentPageInfo(String topology_id, String component_id, String window, boolean is_include_sys, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getTopologyConf(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getTopology(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getUserTopology(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getTopologyHistory(String user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- }
-
- public static class Client extends org.apache.thrift.TServiceClient implements Iface {
- public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
- public Factory() {}
- public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
- return new Client(prot);
- }
- public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
- return new Client(iprot, oprot);
- }
- }
-
- public Client(org.apache.thrift.protocol.TProtocol prot)
- {
- super(prot, prot);
- }
-
- public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
- super(iprot, oprot);
- }
-
- public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology) throws AlreadyAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException
- {
- send_submitTopology(name, uploadedJarLocation, jsonConf, topology);
- recv_submitTopology();
- }
-
- public void send_submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology) throws org.apache.thrift.TException
- {
- submitTopology_args args = new submitTopology_args();
- args.set_name(name);
- args.set_uploadedJarLocation(uploadedJarLocation);
- args.set_jsonConf(jsonConf);
- args.set_topology(topology);
- sendBase("submitTopology", args);
- }
-
- public void recv_submitTopology() throws AlreadyAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException
- {
- submitTopology_result result = new submitTopology_result();
- receiveBase(result, "submitTopology");
- if (result.e != null) {
- throw result.e;
- }
- if (result.ite != null) {
- throw result.ite;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public void submitTopologyWithOpts(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, SubmitOptions options) throws AlreadyAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException
- {
- send_submitTopologyWithOpts(name, uploadedJarLocation, jsonConf, topology, options);
- recv_submitTopologyWithOpts();
- }
-
- public void send_submitTopologyWithOpts(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, SubmitOptions options) throws org.apache.thrift.TException
- {
- submitTopologyWithOpts_args args = new submitTopologyWithOpts_args();
- args.set_name(name);
- args.set_uploadedJarLocation(uploadedJarLocation);
- args.set_jsonConf(jsonConf);
- args.set_topology(topology);
- args.set_options(options);
- sendBase("submitTopologyWithOpts", args);
- }
-
- public void recv_submitTopologyWithOpts() throws AlreadyAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException
- {
- submitTopologyWithOpts_result result = new submitTopologyWithOpts_result();
- receiveBase(result, "submitTopologyWithOpts");
- if (result.e != null) {
- throw result.e;
- }
- if (result.ite != null) {
- throw result.ite;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public void killTopology(String name) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_killTopology(name);
- recv_killTopology();
- }
-
- public void send_killTopology(String name) throws org.apache.thrift.TException
- {
- killTopology_args args = new killTopology_args();
- args.set_name(name);
- sendBase("killTopology", args);
- }
-
- public void recv_killTopology() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- killTopology_result result = new killTopology_result();
- receiveBase(result, "killTopology");
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public void killTopologyWithOpts(String name, KillOptions options) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_killTopologyWithOpts(name, options);
- recv_killTopologyWithOpts();
- }
-
- public void send_killTopologyWithOpts(String name, KillOptions options) throws org.apache.thrift.TException
- {
- killTopologyWithOpts_args args = new killTopologyWithOpts_args();
- args.set_name(name);
- args.set_options(options);
- sendBase("killTopologyWithOpts", args);
- }
-
- public void recv_killTopologyWithOpts() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- killTopologyWithOpts_result result = new killTopologyWithOpts_result();
- receiveBase(result, "killTopologyWithOpts");
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public void activate(String name) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_activate(name);
- recv_activate();
- }
-
- public void send_activate(String name) throws org.apache.thrift.TException
- {
- activate_args args = new activate_args();
- args.set_name(name);
- sendBase("activate", args);
- }
-
- public void recv_activate() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- activate_result result = new activate_result();
- receiveBase(result, "activate");
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public void deactivate(String name) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_deactivate(name);
- recv_deactivate();
- }
-
- public void send_deactivate(String name) throws org.apache.thrift.TException
- {
- deactivate_args args = new deactivate_args();
- args.set_name(name);
- sendBase("deactivate", args);
- }
-
- public void recv_deactivate() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- deactivate_result result = new deactivate_result();
- receiveBase(result, "deactivate");
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public void rebalance(String name, RebalanceOptions options) throws NotAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException
- {
- send_rebalance(name, options);
- recv_rebalance();
- }
-
- public void send_rebalance(String name, RebalanceOptions options) throws org.apache.thrift.TException
- {
- rebalance_args args = new rebalance_args();
- args.set_name(name);
- args.set_options(options);
- sendBase("rebalance", args);
- }
-
- public void recv_rebalance() throws NotAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException
- {
- rebalance_result result = new rebalance_result();
- receiveBase(result, "rebalance");
- if (result.e != null) {
- throw result.e;
- }
- if (result.ite != null) {
- throw result.ite;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public void setLogConfig(String name, LogConfig config) throws org.apache.thrift.TException
- {
- send_setLogConfig(name, config);
- recv_setLogConfig();
- }
-
- public void send_setLogConfig(String name, LogConfig config) throws org.apache.thrift.TException
- {
- setLogConfig_args args = new setLogConfig_args();
- args.set_name(name);
- args.set_config(config);
- sendBase("setLogConfig", args);
- }
-
- public void recv_setLogConfig() throws org.apache.thrift.TException
- {
- setLogConfig_result result = new setLogConfig_result();
- receiveBase(result, "setLogConfig");
- return;
- }
-
- public LogConfig getLogConfig(String name) throws org.apache.thrift.TException
- {
- send_getLogConfig(name);
- return recv_getLogConfig();
- }
-
- public void send_getLogConfig(String name) throws org.apache.thrift.TException
- {
- getLogConfig_args args = new getLogConfig_args();
- args.set_name(name);
- sendBase("getLogConfig", args);
- }
-
- public LogConfig recv_getLogConfig() throws org.apache.thrift.TException
- {
- getLogConfig_result result = new getLogConfig_result();
- receiveBase(result, "getLogConfig");
- if (result.is_set_success()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLogConfig failed: unknown result");
- }
-
- public void debug(String name, String component, boolean enable, double samplingPercentage) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_debug(name, component, enable, samplingPercentage);
- recv_debug();
- }
-
- public void send_debug(String name, String component, boolean enable, double samplingPercentage) throws org.apache.thrift.TException
- {
- debug_args args = new debug_args();
- args.set_name(name);
- args.set_component(component);
- args.set_enable(enable);
- args.set_samplingPercentage(samplingPercentage);
- sendBase("debug", args);
- }
-
- public void recv_debug() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- debug_result result = new debug_result();
- receiveBase(result, "debug");
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public void setWorkerProfiler(String id, ProfileRequest profileRequest) throws org.apache.thrift.TException
- {
- send_setWorkerProfiler(id, profileRequest);
- recv_setWorkerProfiler();
- }
-
- public void send_setWorkerProfiler(String id, ProfileRequest profileRequest) throws org.apache.thrift.TException
- {
- setWorkerProfiler_args args = new setWorkerProfiler_args();
- args.set_id(id);
- args.set_profileRequest(profileRequest);
- sendBase("setWorkerProfiler", args);
- }
-
- public void recv_setWorkerProfiler() throws org.apache.thrift.TException
- {
- setWorkerProfiler_result result = new setWorkerProfiler_result();
- receiveBase(result, "setWorkerProfiler");
- return;
- }
-
- public List<ProfileRequest> getComponentPendingProfileActions(String id, String component_id, ProfileAction action) throws org.apache.thrift.TException
- {
- send_getComponentPendingProfileActions(id, component_id, action);
- return recv_getComponentPendingProfileActions();
- }
-
- public void send_getComponentPendingProfileActions(String id, String component_id, ProfileAction action) throws org.apache.thrift.TException
- {
- getComponentPendingProfileActions_args args = new getComponentPendingProfileActions_args();
- args.set_id(id);
- args.set_component_id(component_id);
- args.set_action(action);
- sendBase("getComponentPendingProfileActions", args);
- }
-
- public List<ProfileRequest> recv_getComponentPendingProfileActions() throws org.apache.thrift.TException
- {
- getComponentPendingProfileActions_result result = new getComponentPendingProfileActions_result();
- receiveBase(result, "getComponentPendingProfileActions");
- if (result.is_set_success()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getComponentPendingProfileActions failed: unknown result");
- }
-
- public void uploadNewCredentials(String name, Credentials creds) throws NotAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException
- {
- send_uploadNewCredentials(name, creds);
- recv_uploadNewCredentials();
- }
-
- public void send_uploadNewCredentials(String name, Credentials creds) throws org.apache.thrift.TException
- {
- uploadNewCredentials_args args = new uploadNewCredentials_args();
- args.set_name(name);
- args.set_creds(creds);
- sendBase("uploadNewCredentials", args);
- }
-
- public void recv_uploadNewCredentials() throws NotAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException
- {
- uploadNewCredentials_result result = new uploadNewCredentials_result();
- receiveBase(result, "uploadNewCredentials");
- if (result.e != null) {
- throw result.e;
- }
- if (result.ite != null) {
- throw result.ite;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public String beginCreateBlob(String key, SettableBlobMeta meta) throws AuthorizationException, KeyAlreadyExistsException, org.apache.thrift.TException
- {
- send_beginCreateBlob(key, meta);
- return recv_beginCreateBlob();
- }
-
- public void send_beginCreateBlob(String key, SettableBlobMeta meta) throws org.apache.thrift.TException
- {
- beginCreateBlob_args args = new beginCreateBlob_args();
- args.set_key(key);
- args.set_meta(meta);
- sendBase("beginCreateBlob", args);
- }
-
- public String recv_beginCreateBlob() throws AuthorizationException, KeyAlreadyExistsException, org.apache.thrift.TException
- {
- beginCreateBlob_result result = new beginCreateBlob_result();
- receiveBase(result, "beginCreateBlob");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- if (result.kae != null) {
- throw result.kae;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "beginCreateBlob failed: unknown result");
- }
-
- public String beginUpdateBlob(String key) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- send_beginUpdateBlob(key);
- return recv_beginUpdateBlob();
- }
-
- public void send_beginUpdateBlob(String key) throws org.apache.thrift.TException
- {
- beginUpdateBlob_args args = new beginUpdateBlob_args();
- args.set_key(key);
- sendBase("beginUpdateBlob", args);
- }
-
- public String recv_beginUpdateBlob() throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- beginUpdateBlob_result result = new beginUpdateBlob_result();
- receiveBase(result, "beginUpdateBlob");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- if (result.knf != null) {
- throw result.knf;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "beginUpdateBlob failed: unknown result");
- }
-
- public void uploadBlobChunk(String session, ByteBuffer chunk) throws AuthorizationException, org.apache.thrift.TException
- {
- send_uploadBlobChunk(session, chunk);
- recv_uploadBlobChunk();
- }
-
- public void send_uploadBlobChunk(String session, ByteBuffer chunk) throws org.apache.thrift.TException
- {
- uploadBlobChunk_args args = new uploadBlobChunk_args();
- args.set_session(session);
- args.set_chunk(chunk);
- sendBase("uploadBlobChunk", args);
- }
-
- public void recv_uploadBlobChunk() throws AuthorizationException, org.apache.thrift.TException
- {
- uploadBlobChunk_result result = new uploadBlobChunk_result();
- receiveBase(result, "uploadBlobChunk");
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public void finishBlobUpload(String session) throws AuthorizationException, org.apache.thrift.TException
- {
- send_finishBlobUpload(session);
- recv_finishBlobUpload();
- }
-
- public void send_finishBlobUpload(String session) throws org.apache.thrift.TException
- {
- finishBlobUpload_args args = new finishBlobUpload_args();
- args.set_session(session);
- sendBase("finishBlobUpload", args);
- }
-
- public void recv_finishBlobUpload() throws AuthorizationException, org.apache.thrift.TException
- {
- finishBlobUpload_result result = new finishBlobUpload_result();
- receiveBase(result, "finishBlobUpload");
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public void cancelBlobUpload(String session) throws AuthorizationException, org.apache.thrift.TException
- {
- send_cancelBlobUpload(session);
- recv_cancelBlobUpload();
- }
-
- public void send_cancelBlobUpload(String session) throws org.apache.thrift.TException
- {
- cancelBlobUpload_args args = new cancelBlobUpload_args();
- args.set_session(session);
- sendBase("cancelBlobUpload", args);
- }
-
- public void recv_cancelBlobUpload() throws AuthorizationException, org.apache.thrift.TException
- {
- cancelBlobUpload_result result = new cancelBlobUpload_result();
- receiveBase(result, "cancelBlobUpload");
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public ReadableBlobMeta getBlobMeta(String key) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- send_getBlobMeta(key);
- return recv_getBlobMeta();
- }
-
- public void send_getBlobMeta(String key) throws org.apache.thrift.TException
- {
- getBlobMeta_args args = new getBlobMeta_args();
- args.set_key(key);
- sendBase("getBlobMeta", args);
- }
-
- public ReadableBlobMeta recv_getBlobMeta() throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- getBlobMeta_result result = new getBlobMeta_result();
- receiveBase(result, "getBlobMeta");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- if (result.knf != null) {
- throw result.knf;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBlobMeta failed: unknown result");
- }
-
- public void setBlobMeta(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- send_setBlobMeta(key, meta);
- recv_setBlobMeta();
- }
-
- public void send_setBlobMeta(String key, SettableBlobMeta meta) throws org.apache.thrift.TException
- {
- setBlobMeta_args args = new setBlobMeta_args();
- args.set_key(key);
- args.set_meta(meta);
- sendBase("setBlobMeta", args);
- }
-
- public void recv_setBlobMeta() throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- setBlobMeta_result result = new setBlobMeta_result();
- receiveBase(result, "setBlobMeta");
- if (result.aze != null) {
- throw result.aze;
- }
- if (result.knf != null) {
- throw result.knf;
- }
- return;
- }
-
- public BeginDownloadResult beginBlobDownload(String key) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- send_beginBlobDownload(key);
- return recv_beginBlobDownload();
- }
-
- public void send_beginBlobDownload(String key) throws org.apache.thrift.TException
- {
- beginBlobDownload_args args = new beginBlobDownload_args();
- args.set_key(key);
- sendBase("beginBlobDownload", args);
- }
-
- public BeginDownloadResult recv_beginBlobDownload() throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- beginBlobDownload_result result = new beginBlobDownload_result();
- receiveBase(result, "beginBlobDownload");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- if (result.knf != null) {
- throw result.knf;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "beginBlobDownload failed: unknown result");
- }
-
- public ByteBuffer downloadBlobChunk(String session) throws AuthorizationException, org.apache.thrift.TException
- {
- send_downloadBlobChunk(session);
- return recv_downloadBlobChunk();
- }
-
- public void send_downloadBlobChunk(String session) throws org.apache.thrift.TException
- {
- downloadBlobChunk_args args = new downloadBlobChunk_args();
- args.set_session(session);
- sendBase("downloadBlobChunk", args);
- }
-
- public ByteBuffer recv_downloadBlobChunk() throws AuthorizationException, org.apache.thrift.TException
- {
- downloadBlobChunk_result result = new downloadBlobChunk_result();
- receiveBase(result, "downloadBlobChunk");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "downloadBlobChunk failed: unknown result");
- }
-
- public void deleteBlob(String key) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- send_deleteBlob(key);
- recv_deleteBlob();
- }
-
- public void send_deleteBlob(String key) throws org.apache.thrift.TException
- {
- deleteBlob_args args = new deleteBlob_args();
- args.set_key(key);
- sendBase("deleteBlob", args);
- }
-
- public void recv_deleteBlob() throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- deleteBlob_result result = new deleteBlob_result();
- receiveBase(result, "deleteBlob");
- if (result.aze != null) {
- throw result.aze;
- }
- if (result.knf != null) {
- throw result.knf;
- }
- return;
- }
-
- public ListBlobsResult listBlobs(String session) throws org.apache.thrift.TException
- {
- send_listBlobs(session);
- return recv_listBlobs();
- }
-
- public void send_listBlobs(String session) throws org.apache.thrift.TException
- {
- listBlobs_args args = new listBlobs_args();
- args.set_session(session);
- sendBase("listBlobs", args);
- }
-
- public ListBlobsResult recv_listBlobs() throws org.apache.thrift.TException
- {
- listBlobs_result result = new listBlobs_result();
- receiveBase(result, "listBlobs");
- if (result.is_set_success()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "listBlobs failed: unknown result");
- }
-
- public int getBlobReplication(String key) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- send_getBlobReplication(key);
- return recv_getBlobReplication();
- }
-
- public void send_getBlobReplication(String key) throws org.apache.thrift.TException
- {
- getBlobReplication_args args = new getBlobReplication_args();
- args.set_key(key);
- sendBase("getBlobReplication", args);
- }
-
- public int recv_getBlobReplication() throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- getBlobReplication_result result = new getBlobReplication_result();
- receiveBase(result, "getBlobReplication");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- if (result.knf != null) {
- throw result.knf;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBlobReplication failed: unknown result");
- }
-
- public int updateBlobReplication(String key, int replication) throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- send_updateBlobReplication(key, replication);
- return recv_updateBlobReplication();
- }
-
- public void send_updateBlobReplication(String key, int replication) throws org.apache.thrift.TException
- {
- updateBlobReplication_args args = new updateBlobReplication_args();
- args.set_key(key);
- args.set_replication(replication);
- sendBase("updateBlobReplication", args);
- }
-
- public int recv_updateBlobReplication() throws AuthorizationException, KeyNotFoundException, org.apache.thrift.TException
- {
- updateBlobReplication_result result = new updateBlobReplication_result();
- receiveBase(result, "updateBlobReplication");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- if (result.knf != null) {
- throw result.knf;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateBlobReplication failed: unknown result");
- }
-
- public void createStateInZookeeper(String key) throws org.apache.thrift.TException
- {
- send_createStateInZookeeper(key);
- recv_createStateInZookeeper();
- }
-
- public void send_createStateInZookeeper(String key) throws org.apache.thrift.TException
- {
- createStateInZookeeper_args args = new createStateInZookeeper_args();
- args.set_key(key);
- sendBase("createStateInZookeeper", args);
- }
-
- public void recv_createStateInZookeeper() throws org.apache.thrift.TException
- {
- createStateInZookeeper_result result = new createStateInZookeeper_result();
- receiveBase(result, "createStateInZookeeper");
- return;
- }
-
- public String beginFileUpload() throws AuthorizationException, org.apache.thrift.TException
- {
- send_beginFileUpload();
- return recv_beginFileUpload();
- }
-
- public void send_beginFileUpload() throws org.apache.thrift.TException
- {
- beginFileUpload_args args = new beginFileUpload_args();
- sendBase("beginFileUpload", args);
- }
-
- public String recv_beginFileUpload() throws AuthorizationException, org.apache.thrift.TException
- {
- beginFileUpload_result result = new beginFileUpload_result();
- receiveBase(result, "beginFileUpload");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "beginFileUpload failed: unknown result");
- }
-
- public void uploadChunk(String location, ByteBuffer chunk) throws AuthorizationException, org.apache.thrift.TException
- {
- send_uploadChunk(location, chunk);
- recv_uploadChunk();
- }
-
- public void send_uploadChunk(String location, ByteBuffer chunk) throws org.apache.thrift.TException
- {
- uploadChunk_args args = new uploadChunk_args();
- args.set_location(location);
- args.set_chunk(chunk);
- sendBase("uploadChunk", args);
- }
-
- public void recv_uploadChunk() throws AuthorizationException, org.apache.thrift.TException
- {
- uploadChunk_result result = new uploadChunk_result();
- receiveBase(result, "uploadChunk");
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public void finishFileUpload(String location) throws AuthorizationException, org.apache.thrift.TException
- {
- send_finishFileUpload(location);
- recv_finishFileUpload();
- }
-
- public void send_finishFileUpload(String location) throws org.apache.thrift.TException
- {
- finishFileUpload_args args = new finishFileUpload_args();
- args.set_location(location);
- sendBase("finishFileUpload", args);
- }
-
- public void recv_finishFileUpload() throws AuthorizationException, org.apache.thrift.TException
- {
- finishFileUpload_result result = new finishFileUpload_result();
- receiveBase(result, "finishFileUpload");
- if (result.aze != null) {
- throw result.aze;
- }
- return;
- }
-
- public String beginFileDownload(String file) throws AuthorizationException, org.apache.thrift.TException
- {
- send_beginFileDownload(file);
- return recv_beginFileDownload();
- }
-
- public void send_beginFileDownload(String file) throws org.apache.thrift.TException
- {
- beginFileDownload_args args = new beginFileDownload_args();
- args.set_file(file);
- sendBase("beginFileDownload", args);
- }
-
- public String recv_beginFileDownload() throws AuthorizationException, org.apache.thrift.TException
- {
- beginFileDownload_result result = new beginFileDownload_result();
- receiveBase(result, "beginFileDownload");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "beginFileDownload failed: unknown result");
- }
-
- public ByteBuffer downloadChunk(String id) throws AuthorizationException, org.apache.thrift.TException
- {
- send_downloadChunk(id);
- return recv_downloadChunk();
- }
-
- public void send_downloadChunk(String id) throws org.apache.thrift.TException
- {
- downloadChunk_args args = new downloadChunk_args();
- args.set_id(id);
- sendBase("downloadChunk", args);
- }
-
- public ByteBuffer recv_downloadChunk() throws AuthorizationException, org.apache.thrift.TException
- {
- downloadChunk_result result = new downloadChunk_result();
- receiveBase(result, "downloadChunk");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "downloadChunk failed: unknown result");
- }
-
- public String getNimbusConf() throws AuthorizationException, org.apache.thrift.TException
- {
- send_getNimbusConf();
- return recv_getNimbusConf();
- }
-
- public void send_getNimbusConf() throws org.apache.thrift.TException
- {
- getNimbusConf_args args = new getNimbusConf_args();
- sendBase("getNimbusConf", args);
- }
-
- public String recv_getNimbusConf() throws AuthorizationException, org.apache.thrift.TException
- {
- getNimbusConf_result result = new getNimbusConf_result();
- receiveBase(result, "getNimbusConf");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getNimbusConf failed: unknown result");
- }
-
- public ClusterSummary getClusterInfo() throws AuthorizationException, org.apache.thrift.TException
- {
- send_getClusterInfo();
- return recv_getClusterInfo();
- }
-
- public void send_getClusterInfo() throws org.apache.thrift.TException
- {
- getClusterInfo_args args = new getClusterInfo_args();
- sendBase("getClusterInfo", args);
- }
-
- public ClusterSummary recv_getClusterInfo() throws AuthorizationException, org.apache.thrift.TException
- {
- getClusterInfo_result result = new getClusterInfo_result();
- receiveBase(result, "getClusterInfo");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getClusterInfo failed: unknown result");
- }
-
- public TopologyInfo getTopologyInfo(String id) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_getTopologyInfo(id);
- return recv_getTopologyInfo();
- }
-
- public void send_getTopologyInfo(String id) throws org.apache.thrift.TException
- {
- getTopologyInfo_args args = new getTopologyInfo_args();
- args.set_id(id);
- sendBase("getTopologyInfo", args);
- }
-
- public TopologyInfo recv_getTopologyInfo() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- getTopologyInfo_result result = new getTopologyInfo_result();
- receiveBase(result, "getTopologyInfo");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTopologyInfo failed: unknown result");
- }
-
- public TopologyInfo getTopologyInfoWithOpts(String id, GetInfoOptions options) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_getTopologyInfoWithOpts(id, options);
- return recv_getTopologyInfoWithOpts();
- }
-
- public void send_getTopologyInfoWithOpts(String id, GetInfoOptions options) throws org.apache.thrift.TException
- {
- getTopologyInfoWithOpts_args args = new getTopologyInfoWithOpts_args();
- args.set_id(id);
- args.set_options(options);
- sendBase("getTopologyInfoWithOpts", args);
- }
-
- public TopologyInfo recv_getTopologyInfoWithOpts() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- getTopologyInfoWithOpts_result result = new getTopologyInfoWithOpts_result();
- receiveBase(result, "getTopologyInfoWithOpts");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTopologyInfoWithOpts failed: unknown result");
- }
-
- public TopologyPageInfo getTopologyPageInfo(String id, String window, boolean is_include_sys) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_getTopologyPageInfo(id, window, is_include_sys);
- return recv_getTopologyPageInfo();
- }
-
- public void send_getTopologyPageInfo(String id, String window, boolean is_include_sys) throws org.apache.thrift.TException
- {
- getTopologyPageInfo_args args = new getTopologyPageInfo_args();
- args.set_id(id);
- args.set_window(window);
- args.set_is_include_sys(is_include_sys);
- sendBase("getTopologyPageInfo", args);
- }
-
- public TopologyPageInfo recv_getTopologyPageInfo() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- getTopologyPageInfo_result result = new getTopologyPageInfo_result();
- receiveBase(result, "getTopologyPageInfo");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTopologyPageInfo failed: unknown result");
- }
-
- public SupervisorPageInfo getSupervisorPageInfo(String id, String host, boolean is_include_sys) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_getSupervisorPageInfo(id, host, is_include_sys);
- return recv_getSupervisorPageInfo();
- }
-
- public void send_getSupervisorPageInfo(String id, String host, boolean is_include_sys) throws org.apache.thrift.TException
- {
- getSupervisorPageInfo_args args = new getSupervisorPageInfo_args();
- args.set_id(id);
- args.set_host(host);
- args.set_is_include_sys(is_include_sys);
- sendBase("getSupervisorPageInfo", args);
- }
-
- public SupervisorPageInfo recv_getSupervisorPageInfo() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- getSupervisorPageInfo_result result = new getSupervisorPageInfo_result();
- receiveBase(result, "getSupervisorPageInfo");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSupervisorPageInfo failed: unknown result");
- }
-
- public ComponentPageInfo getComponentPageInfo(String topology_id, String component_id, String window, boolean is_include_sys) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_getComponentPageInfo(topology_id, component_id, window, is_include_sys);
- return recv_getComponentPageInfo();
- }
-
- public void send_getComponentPageInfo(String topology_id, String component_id, String window, boolean is_include_sys) throws org.apache.thrift.TException
- {
- getComponentPageInfo_args args = new getComponentPageInfo_args();
- args.set_topology_id(topology_id);
- args.set_component_id(component_id);
- args.set_window(window);
- args.set_is_include_sys(is_include_sys);
- sendBase("getComponentPageInfo", args);
- }
-
- public ComponentPageInfo recv_getComponentPageInfo() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- getComponentPageInfo_result result = new getComponentPageInfo_result();
- receiveBase(result, "getComponentPageInfo");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getComponentPageInfo failed: unknown result");
- }
-
- public String getTopologyConf(String id) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_getTopologyConf(id);
- return recv_getTopologyConf();
- }
-
- public void send_getTopologyConf(String id) throws org.apache.thrift.TException
- {
- getTopologyConf_args args = new getTopologyConf_args();
- args.set_id(id);
- sendBase("getTopologyConf", args);
- }
-
- public String recv_getTopologyConf() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- getTopologyConf_result result = new getTopologyConf_result();
- receiveBase(result, "getTopologyConf");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTopologyConf failed: unknown result");
- }
-
- public StormTopology getTopology(String id) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_getTopology(id);
- return recv_getTopology();
- }
-
- public void send_getTopology(String id) throws org.apache.thrift.TException
- {
- getTopology_args args = new getTopology_args();
- args.set_id(id);
- sendBase("getTopology", args);
- }
-
- public StormTopology recv_getTopology() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- getTopology_result result = new getTopology_result();
- receiveBase(result, "getTopology");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTopology failed: unknown result");
- }
-
- public StormTopology getUserTopology(String id) throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- send_getUserTopology(id);
- return recv_getUserTopology();
- }
-
- public void send_getUserTopology(String id) throws org.apache.thrift.TException
- {
- getUserTopology_args args = new getUserTopology_args();
- args.set_id(id);
- sendBase("getUserTopology", args);
- }
-
- public StormTopology recv_getUserTopology() throws NotAliveException, AuthorizationException, org.apache.thrift.TException
- {
- getUserTopology_result result = new getUserTopology_result();
- receiveBase(result, "getUserTopology");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.e != null) {
- throw result.e;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUserTopology failed: unknown result");
- }
-
- public TopologyHistoryInfo getTopologyHistory(String user) throws AuthorizationException, org.apache.thrift.TException
- {
- send_getTopologyHistory(user);
- return recv_getTopologyHistory();
- }
-
- public void send_getTopologyHistory(String user) throws org.apache.thrift.TException
- {
- getTopologyHistory_args args = new getTopologyHistory_args();
- args.set_user(user);
- sendBase("getTopologyHistory", args);
- }
-
- public TopologyHistoryInfo recv_getTopologyHistory() throws AuthorizationException, org.apache.thrift.TException
- {
- getTopologyHistory_result result = new getTopologyHistory_result();
- receiveBase(result, "getTopologyHistory");
- if (result.is_set_success()) {
- return result.success;
- }
- if (result.aze != null) {
- throw result.aze;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTopologyHistory failed: unknown result");
- }
-
- }
- public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
- public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
- private org.apache.thrift.async.TAsyncClientManager clientManager;
- private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
- public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
- this.clientManager = clientManager;
- this.protocolFactory = protocolFactory;
- }
- public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
- return new AsyncClient(protocolFactory, clientManager, transport);
- }
- }
-
- public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
- super(protocolFactory, clientManager, transport);
- }
-
- public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- submitTopology_call method_call = new submitTopology_call(name, uploadedJarLocation, jsonConf, topology, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class submitTopology_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String name;
- private String uploadedJarLocation;
- private String jsonConf;
- private StormTopology topology;
- public submitTopology_call(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.name = name;
- this.uploadedJarLocation = uploadedJarLocation;
- this.jsonConf = jsonConf;
- this.topology = topology;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("submitTopology", org.apache.thrift.protocol.TMessageType.CALL, 0));
- submitTopology_args args = new submitTopology_args();
- args.set_name(name);
- args.set_uploadedJarLocation(uploadedJarLocation);
- args.set_jsonConf(jsonConf);
- args.set_topology(topology);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws AlreadyAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_submitTopology();
- }
- }
-
- public void submitTopologyWithOpts(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, SubmitOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- submitTopologyWithOpts_call method_call = new submitTopologyWithOpts_call(name, uploadedJarLocation, jsonConf, topology, options, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class submitTopologyWithOpts_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String name;
- private String uploadedJarLocation;
- private String jsonConf;
- private StormTopology topology;
- private SubmitOptions options;
- public submitTopologyWithOpts_call(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, SubmitOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.name = name;
- this.uploadedJarLocation = uploadedJarLocation;
- this.jsonConf = jsonConf;
- this.topology = topology;
- this.options = options;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("submitTopologyWithOpts", org.apache.thrift.protocol.TMessageType.CALL, 0));
- submitTopologyWithOpts_args args = new submitTopologyWithOpts_args();
- args.set_name(name);
- args.set_uploadedJarLocation(uploadedJarLocation);
- args.set_jsonConf(jsonConf);
- args.set_topology(topology);
- args.set_options(options);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws AlreadyAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_submitTopologyWithOpts();
- }
- }
-
- public void killTopology(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- killTopology_call method_call = new killTopology_call(name, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class killTopology_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String name;
- public killTopology_call(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.name = name;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("killTopology", org.apache.thrift.protocol.TMessageType.CALL, 0));
- killTopology_args args = new killTopology_args();
- args.set_name(name);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws NotAliveException, AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_killTopology();
- }
- }
-
- public void killTopologyWithOpts(String name, KillOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- killTopologyWithOpts_call method_call = new killTopologyWithOpts_call(name, options, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class killTopologyWithOpts_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String name;
- private KillOptions options;
- public killTopologyWithOpts_call(String name, KillOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.name = name;
- this.options = options;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("killTopologyWithOpts", org.apache.thrift.protocol.TMessageType.CALL, 0));
- killTopologyWithOpts_args args = new killTopologyWithOpts_args();
- args.set_name(name);
- args.set_options(options);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws NotAliveException, AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_killTopologyWithOpts();
- }
- }
-
- public void activate(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- activate_call method_call = new activate_call(name, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class activate_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String name;
- public activate_call(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.name = name;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("activate", org.apache.thrift.protocol.TMessageType.CALL, 0));
- activate_args args = new activate_args();
- args.set_name(name);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws NotAliveException, AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_activate();
- }
- }
-
- public void deactivate(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- deactivate_call method_call = new deactivate_call(name, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class deactivate_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String name;
- public deactivate_call(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.name = name;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deactivate", org.apache.thrift.protocol.TMessageType.CALL, 0));
- deactivate_args args = new deactivate_args();
- args.set_name(name);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws NotAliveException, AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_deactivate();
- }
- }
-
- public void rebalance(String name, RebalanceOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- rebalance_call method_call = new rebalance_call(name, options, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class rebalance_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String name;
- private RebalanceOptions options;
- public rebalance_call(String name, RebalanceOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.name = name;
- this.options = options;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("rebalance", org.apache.thrift.protocol.TMessageType.CALL, 0));
- rebalance_args args = new rebalance_args();
- args.set_name(name);
- args.set_options(options);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws NotAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_rebalance();
- }
- }
-
- public void setLogConfig(String name, LogConfig config, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- setLogConfig_call method_call = new setLogConfig_call(name, config, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class setLogConfig_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String name;
- private LogConfig config;
- public setLogConfig_call(String name, LogConfig config, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.name = name;
- this.config = config;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("setLogConfig", org.apache.thrift.protocol.TMessageType.CALL, 0));
- setLogConfig_args args = new setLogConfig_args();
- args.set_name(name);
- args.set_config(config);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_setLogConfig();
- }
- }
-
- public void getLogConfig(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getLogConfig_call method_call = new getLogConfig_call(name, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getLogConfig_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String name;
- public getLogConfig_call(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.name = name;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getLogConfig", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getLogConfig_args args = new getLogConfig_args();
- args.set_name(name);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public LogConfig getResult() throws org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_getLogConfig();
- }
- }
-
- public void debug(String name, String component, boolean enable, double samplingPercentage, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- debug_call method_call = new debug_call(name, component, enable, samplingPercentage, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class debug_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String name;
- private String component;
- private boolean enable;
- private double samplingPercentage;
- public debug_call(String name, String component, boolean enable, double samplingPercentage, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.name = name;
- this.component = component;
- this.enable = enable;
- this.samplingPercentage = samplingPercentage;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("debug", org.apache.thrift.protocol.TMessageType.CALL, 0));
- debug_args args = new debug_args();
- args.set_name(name);
- args.set_component(component);
- args.set_enable(enable);
- args.set_samplingPercentage(samplingPercentage);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws NotAliveException, AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_debug();
- }
- }
-
- public void setWorkerProfiler(String id, ProfileRequest profileRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- setWorkerProfiler_call method_call = new setWorkerProfiler_call(id, profileRequest, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class setWorkerProfiler_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String id;
- private ProfileRequest profileRequest;
- public setWorkerProfiler_call(String id, ProfileRequest profileRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.id = id;
- this.profileRequest = profileRequest;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("setWorkerProfiler", org.apache.thrift.protocol.TMessageType.CALL, 0));
- setWorkerProfiler_args args = new setWorkerProfiler_args();
- args.set_id(id);
- args.set_profileRequest(profileRequest);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_setWorkerProfiler();
- }
- }
-
- public void getComponentPendingProfileActions(String id, String component_id, ProfileAction action, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getComponentPendingProfileActions_call method_call = new getComponentPendingProfileActions_call(id, component_id, action, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getComponentPendingProfileActions_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String id;
- private String component_id;
- private ProfileAction action;
- public getComponentPendingProfileActions_call(String id, String component_id, ProfileAction action, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.id = id;
- this.component_id = component_id;
- this.action = action;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getComponentPendingProfileActions", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getComponentPendingProfileActions_args args = new getComponentPendingProfileActions_args();
- args.set_id(id);
- args.set_component_id(component_id);
- args.set_action(action);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public List<ProfileRequest> getResult() throws org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_getComponentPendingProfileActions();
- }
- }
-
- public void uploadNewCredentials(String name, Credentials creds, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- uploadNewCredentials_call method_call = new uploadNewCredentials_call(name, creds, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class uploadNewCredentials_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String name;
- private Credentials creds;
- public uploadNewCredentials_call(String name, Credentials creds, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.name = name;
- this.creds = creds;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("uploadNewCredentials", org.apache.thrift.protocol.TMessageType.CALL, 0));
- uploadNewCredentials_args args = new uploadNewCredentials_args();
- args.set_name(name);
- args.set_creds(creds);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws NotAliveException, InvalidTopologyException, AuthorizationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_uploadNewCredentials();
-
<TRUNCATED>
[46/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/nimbus.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj b/storm-core/src/clj/backtype/storm/daemon/nimbus.clj
deleted file mode 100644
index 2732d81..0000000
--- a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj
+++ /dev/null
@@ -1,2514 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.daemon.nimbus
- (:import [org.apache.thrift.server THsHaServer THsHaServer$Args])
- (:import [org.apache.storm.generated KeyNotFoundException])
- (:import [org.apache.storm.blobstore LocalFsBlobStore])
- (:import [org.apache.thrift.protocol TBinaryProtocol TBinaryProtocol$Factory])
- (:import [org.apache.thrift.exception])
- (:import [org.apache.thrift.transport TNonblockingServerTransport TNonblockingServerSocket])
- (:import [org.apache.commons.io FileUtils])
- (:import [javax.security.auth Subject])
- (:import [org.apache.storm.security.auth NimbusPrincipal])
- (:import [java.nio ByteBuffer]
- [java.util Collections List HashMap]
- [org.apache.storm.generated NimbusSummary])
- (:import [java.nio ByteBuffer]
- [java.util Collections List HashMap ArrayList Iterator])
- (:import [org.apache.storm.blobstore AtomicOutputStream BlobStoreAclHandler
- InputStreamWithMeta KeyFilter KeySequenceNumber BlobSynchronizer BlobStoreUtils])
- (:import [java.io File FileOutputStream FileInputStream])
- (:import [java.net InetAddress ServerSocket BindException])
- (:import [java.nio.channels Channels WritableByteChannel])
- (:import [org.apache.storm.security.auth ThriftServer ThriftConnectionType ReqContext AuthUtils])
- (:use [org.apache.storm.scheduler.DefaultScheduler])
- (:import [org.apache.storm.scheduler INimbus SupervisorDetails WorkerSlot TopologyDetails
- Cluster Topologies SchedulerAssignment SchedulerAssignmentImpl DefaultScheduler ExecutorDetails])
- (:import [org.apache.storm.nimbus NimbusInfo])
- (:import [org.apache.storm.scheduler.resource ResourceUtils])
- (:import [org.apache.storm.utils TimeCacheMap TimeCacheMap$ExpiredCallback Utils TupleUtils ThriftTopologyUtils
- BufferFileInputStream BufferInputStream])
- (:import [org.apache.storm.generated NotAliveException AlreadyAliveException StormTopology ErrorInfo
- ExecutorInfo InvalidTopologyException Nimbus$Iface Nimbus$Processor SubmitOptions TopologyInitialStatus
- KillOptions RebalanceOptions ClusterSummary SupervisorSummary TopologySummary TopologyInfo TopologyHistoryInfo
- ExecutorSummary AuthorizationException GetInfoOptions NumErrorsChoice SettableBlobMeta ReadableBlobMeta
- BeginDownloadResult ListBlobsResult ComponentPageInfo TopologyPageInfo LogConfig LogLevel LogLevelAction
- ProfileRequest ProfileAction NodeInfo SupervisorPageInfo WorkerSummary WorkerResources ComponentType])
- (:import [org.apache.storm.daemon Shutdownable])
- (:import [org.apache.storm.cluster ClusterStateContext DaemonType])
- (:use [org.apache.storm util config log timer zookeeper local-state])
- (:require [org.apache.storm [cluster :as cluster]
- [converter :as converter]
- [stats :as stats]])
- (:require [org.apache.storm.ui.core :as ui])
- (:require [clojure.set :as set])
- (:import [org.apache.storm.daemon.common StormBase Assignment])
- (:use [org.apache.storm.daemon common])
- (:use [org.apache.storm config])
- (:import [org.apache.zookeeper data.ACL ZooDefs$Ids ZooDefs$Perms])
- (:import [org.apache.storm.utils VersionInfo Time]
- (org.apache.storm.metric ClusterMetricsConsumerExecutor)
- (org.apache.storm.metric.api IClusterMetricsConsumer$ClusterInfo DataPoint IClusterMetricsConsumer$SupervisorInfo)
- (org.apache.storm Config))
- (:require [clj-time.core :as time])
- (:require [clj-time.coerce :as coerce])
- (:require [metrics.meters :refer [defmeter mark!]])
- (:require [metrics.gauges :refer [defgauge]])
- (:gen-class
- :methods [^{:static true} [launch [org.apache.storm.scheduler.INimbus] void]]))
-
-(defmeter nimbus:num-submitTopologyWithOpts-calls)
-(defmeter nimbus:num-submitTopology-calls)
-(defmeter nimbus:num-killTopologyWithOpts-calls)
-(defmeter nimbus:num-killTopology-calls)
-(defmeter nimbus:num-rebalance-calls)
-(defmeter nimbus:num-activate-calls)
-(defmeter nimbus:num-deactivate-calls)
-(defmeter nimbus:num-debug-calls)
-(defmeter nimbus:num-setWorkerProfiler-calls)
-(defmeter nimbus:num-getComponentPendingProfileActions-calls)
-(defmeter nimbus:num-setLogConfig-calls)
-(defmeter nimbus:num-uploadNewCredentials-calls)
-(defmeter nimbus:num-beginFileUpload-calls)
-(defmeter nimbus:num-uploadChunk-calls)
-(defmeter nimbus:num-finishFileUpload-calls)
-(defmeter nimbus:num-beginFileDownload-calls)
-(defmeter nimbus:num-downloadChunk-calls)
-(defmeter nimbus:num-getNimbusConf-calls)
-(defmeter nimbus:num-getLogConfig-calls)
-(defmeter nimbus:num-getTopologyConf-calls)
-(defmeter nimbus:num-getTopology-calls)
-(defmeter nimbus:num-getUserTopology-calls)
-(defmeter nimbus:num-getClusterInfo-calls)
-(defmeter nimbus:num-getTopologyInfoWithOpts-calls)
-(defmeter nimbus:num-getTopologyInfo-calls)
-(defmeter nimbus:num-getTopologyPageInfo-calls)
-(defmeter nimbus:num-getSupervisorPageInfo-calls)
-(defmeter nimbus:num-getComponentPageInfo-calls)
-(defmeter nimbus:num-shutdown-calls)
-
-(def STORM-VERSION (VersionInfo/getVersion))
-
-(defn file-cache-map [conf]
- (TimeCacheMap.
- (int (conf NIMBUS-FILE-COPY-EXPIRATION-SECS))
- (reify TimeCacheMap$ExpiredCallback
- (expire [this id stream]
- (.close stream)
- ))
- ))
-
-(defn mk-scheduler [conf inimbus]
- (let [forced-scheduler (.getForcedScheduler inimbus)
- scheduler (cond
- forced-scheduler
- (do (log-message "Using forced scheduler from INimbus " (class forced-scheduler))
- forced-scheduler)
-
- (conf STORM-SCHEDULER)
- (do (log-message "Using custom scheduler: " (conf STORM-SCHEDULER))
- (-> (conf STORM-SCHEDULER) new-instance))
-
- :else
- (do (log-message "Using default scheduler")
- (DefaultScheduler.)))]
- (.prepare scheduler conf)
- scheduler
- ))
-
-(defmulti blob-sync cluster-mode)
-
-(defnk is-leader [nimbus :throw-exception true]
- (let [leader-elector (:leader-elector nimbus)]
- (if (.isLeader leader-elector) true
- (if throw-exception
- (let [leader-address (.getLeader leader-elector)]
- (throw (RuntimeException. (str "not a leader, current leader is " leader-address))))))))
-
-(def NIMBUS-ZK-ACLS
- [(first ZooDefs$Ids/CREATOR_ALL_ACL)
- (ACL. (bit-or ZooDefs$Perms/READ ZooDefs$Perms/CREATE) ZooDefs$Ids/ANYONE_ID_UNSAFE)])
-
-(defn mk-blob-cache-map
- "Constructs a TimeCacheMap instance with a blob store timeout whose
- expiration callback invokes cancel on the value held by an expired entry when
- that value is an AtomicOutputStream and calls close otherwise."
- [conf]
- (TimeCacheMap.
- (int (conf NIMBUS-BLOBSTORE-EXPIRATION-SECS))
- (reify TimeCacheMap$ExpiredCallback
- (expire [this id stream]
- (if (instance? AtomicOutputStream stream)
- (.cancel stream)
- (.close stream))))))
-
-(defn mk-bloblist-cache-map
- "Constructs a TimeCacheMap instance with a blobstore timeout and no callback
- function."
- [conf]
- (TimeCacheMap. (int (conf NIMBUS-BLOBSTORE-EXPIRATION-SECS))))
-
-(defn create-tology-action-notifier [conf]
- (when-not (clojure.string/blank? (conf NIMBUS-TOPOLOGY-ACTION-NOTIFIER-PLUGIN))
- (let [instance (new-instance (conf NIMBUS-TOPOLOGY-ACTION-NOTIFIER-PLUGIN))]
- (try
- (.prepare instance conf)
- instance
- (catch Exception e
- (log-warn-error e "Ingoring exception, Could not initialize " (conf NIMBUS-TOPOLOGY-ACTION-NOTIFIER-PLUGIN)))))))
-
-(defn mk-cluster-metrics-consumer-executors [storm-conf]
- (map
- (fn [consumer]
- (ClusterMetricsConsumerExecutor. (get consumer "class")
- (get consumer "argument")))
- (get storm-conf STORM-CLUSTER-METRICS-CONSUMER-REGISTER)))
-
-(defn nimbus-data [conf inimbus]
- (let [forced-scheduler (.getForcedScheduler inimbus)
- blob-store (Utils/getNimbusBlobStore conf (NimbusInfo/fromConf conf))]
- {:conf conf
- :nimbus-host-port-info (NimbusInfo/fromConf conf)
- :inimbus inimbus
- :authorization-handler (mk-authorization-handler (conf NIMBUS-AUTHORIZER) conf)
- :impersonation-authorization-handler (mk-authorization-handler (conf NIMBUS-IMPERSONATION-AUTHORIZER) conf)
- :submitted-count (atom 0)
- :storm-cluster-state (cluster/mk-storm-cluster-state conf :acls (when
- (Utils/isZkAuthenticationConfiguredStormServer
- conf)
- NIMBUS-ZK-ACLS)
- :context (ClusterStateContext. DaemonType/NIMBUS))
- :submit-lock (Object.)
- :cred-update-lock (Object.)
- :log-update-lock (Object.)
- :heartbeats-cache (atom {})
- :downloaders (file-cache-map conf)
- :uploaders (file-cache-map conf)
- :blob-store blob-store
- :blob-downloaders (mk-blob-cache-map conf)
- :blob-uploaders (mk-blob-cache-map conf)
- :blob-listers (mk-bloblist-cache-map conf)
- :uptime (uptime-computer)
- :validator (new-instance (conf NIMBUS-TOPOLOGY-VALIDATOR))
- :timer (mk-timer :kill-fn (fn [t]
- (log-error t "Error when processing event")
- (exit-process! 20 "Error when processing an event")
- ))
- :scheduler (mk-scheduler conf inimbus)
- :leader-elector (zk-leader-elector conf blob-store)
- :id->sched-status (atom {})
- :node-id->resources (atom {}) ;;resources of supervisors
- :id->resources (atom {}) ;;resources of topologies
- :id->worker-resources (atom {}) ; resources of workers per topology
- :cred-renewers (AuthUtils/GetCredentialRenewers conf)
- :topology-history-lock (Object.)
- :topo-history-state (nimbus-topo-history-state conf)
- :nimbus-autocred-plugins (AuthUtils/getNimbusAutoCredPlugins conf)
- :nimbus-topology-action-notifier (create-tology-action-notifier conf)
- :cluster-consumer-executors (mk-cluster-metrics-consumer-executors conf)
- }))
-
-(defn inbox [nimbus]
- (master-inbox (:conf nimbus)))
-
-(defn- get-subject
- []
- (let [req (ReqContext/context)]
- (.subject req)))
-
-(defn- read-storm-conf [conf storm-id blob-store]
- (clojurify-structure
- (Utils/fromCompressedJsonConf
- (.readBlob blob-store (master-stormconf-key storm-id) (get-subject)))))
-
-(declare delay-event)
-(declare mk-assignments)
-
-(defn get-nimbus-subject
- []
- (let [subject (Subject.)
- principal (NimbusPrincipal.)
- principals (.getPrincipals subject)]
- (.add principals principal)
- subject))
-
-(def nimbus-subject
- (get-nimbus-subject))
-
-(defn- get-key-list-from-id
- [conf id]
- (log-debug "set keys id = " id "set = " #{(master-stormcode-key id) (master-stormjar-key id) (master-stormconf-key id)})
- (if (local-mode? conf)
- [(master-stormcode-key id) (master-stormconf-key id)]
- [(master-stormcode-key id) (master-stormjar-key id) (master-stormconf-key id)]))
-
-(defn kill-transition [nimbus storm-id]
- (fn [kill-time]
- (let [delay (if kill-time
- kill-time
- (get (read-storm-conf (:conf nimbus) storm-id (:blob-store nimbus))
- TOPOLOGY-MESSAGE-TIMEOUT-SECS))]
- (delay-event nimbus
- storm-id
- delay
- :remove)
- {
- :status {:type :killed}
- :topology-action-options {:delay-secs delay :action :kill}})
- ))
-
-(defn rebalance-transition [nimbus storm-id status]
- (fn [time num-workers executor-overrides]
- (let [delay (if time
- time
- (get (read-storm-conf (:conf nimbus) storm-id (:blob-store nimbus))
- TOPOLOGY-MESSAGE-TIMEOUT-SECS))]
- (delay-event nimbus
- storm-id
- delay
- :do-rebalance)
- {:status {:type :rebalancing}
- :prev-status status
- :topology-action-options (-> {:delay-secs delay :action :rebalance}
- (assoc-non-nil :num-workers num-workers)
- (assoc-non-nil :component->executors executor-overrides))
- })))
-
-(defn do-rebalance [nimbus storm-id status storm-base]
- (let [rebalance-options (:topology-action-options storm-base)]
- (.update-storm! (:storm-cluster-state nimbus)
- storm-id
- (-> {:topology-action-options nil}
- (assoc-non-nil :component->executors (:component->executors rebalance-options))
- (assoc-non-nil :num-workers (:num-workers rebalance-options)))))
- (mk-assignments nimbus :scratch-topology-id storm-id))
-
-(defn state-transitions [nimbus storm-id status storm-base]
- {:active {:inactivate :inactive
- :activate nil
- :rebalance (rebalance-transition nimbus storm-id status)
- :kill (kill-transition nimbus storm-id)
- }
- :inactive {:activate :active
- :inactivate nil
- :rebalance (rebalance-transition nimbus storm-id status)
- :kill (kill-transition nimbus storm-id)
- }
- :killed {:startup (fn [] (delay-event nimbus
- storm-id
- (-> storm-base
- :topology-action-options
- :delay-secs)
- :remove)
- nil)
- :kill (kill-transition nimbus storm-id)
- :remove (fn []
- (log-message "Killing topology: " storm-id)
- (.remove-storm! (:storm-cluster-state nimbus)
- storm-id)
- (when (instance? LocalFsBlobStore (:blob-store nimbus))
- (doseq [blob-key (get-key-list-from-id (:conf nimbus) storm-id)]
- (.remove-blobstore-key! (:storm-cluster-state nimbus) blob-key)
- (.remove-key-version! (:storm-cluster-state nimbus) blob-key)))
- nil)
- }
- :rebalancing {:startup (fn [] (delay-event nimbus
- storm-id
- (-> storm-base
- :topology-action-options
- :delay-secs)
- :do-rebalance)
- nil)
- :kill (kill-transition nimbus storm-id)
- :do-rebalance (fn []
- (do-rebalance nimbus storm-id status storm-base)
- (:type (:prev-status storm-base)))
- }})
-
-(defn transition!
- ([nimbus storm-id event]
- (transition! nimbus storm-id event false))
- ([nimbus storm-id event error-on-no-transition?]
- (is-leader nimbus)
- (locking (:submit-lock nimbus)
- (let [system-events #{:startup}
- [event & event-args] (if (keyword? event) [event] event)
- storm-base (-> nimbus :storm-cluster-state (.storm-base storm-id nil))
- status (:status storm-base)]
- ;; handles the case where event was scheduled but topology has been removed
- (if-not status
- (log-message "Cannot apply event " event " to " storm-id " because topology no longer exists")
- (let [get-event (fn [m e]
- (if (contains? m e)
- (m e)
- (let [msg (str "No transition for event: " event
- ", status: " status,
- " storm-id: " storm-id)]
- (if error-on-no-transition?
- (throw-runtime msg)
- (do (when-not (contains? system-events event)
- (log-message msg))
- nil))
- )))
- transition (-> (state-transitions nimbus storm-id status storm-base)
- (get (:type status))
- (get-event event))
- transition (if (or (nil? transition)
- (keyword? transition))
- (fn [] transition)
- transition)
- storm-base-updates (apply transition event-args)
- storm-base-updates (if (keyword? storm-base-updates) ;if it's just a symbol, that just indicates new status.
- {:status {:type storm-base-updates}}
- storm-base-updates)]
-
- (when storm-base-updates
- (.update-storm! (:storm-cluster-state nimbus) storm-id storm-base-updates)))))
- )))
-
-(defn transition-name! [nimbus storm-name event & args]
- (let [storm-id (get-storm-id (:storm-cluster-state nimbus) storm-name)]
- (when-not storm-id
- (throw (NotAliveException. storm-name)))
- (apply transition! nimbus storm-id event args)))
-
-(defn delay-event [nimbus storm-id delay-secs event]
- (log-message "Delaying event " event " for " delay-secs " secs for " storm-id)
- (schedule (:timer nimbus)
- delay-secs
- #(try (transition! nimbus storm-id event false)
- (catch Exception e (log-error e "Exception while trying transition for " storm-id " and event " event)))))
-
-;; active -> reassign in X secs
-
-;; killed -> wait kill time then shutdown
-;; active -> reassign in X secs
-;; inactive -> nothing
-;; rebalance -> wait X seconds then rebalance
-;; swap... (need to handle kill during swap, etc.)
-;; event transitions are delayed by timer... anything else that comes through (e.g. a kill) override the transition? or just disable other transitions during the transition?
-
-
-(defmulti setup-jar cluster-mode)
-(defmulti clean-inbox cluster-mode)
-
-;; swapping design
-;; -- need 2 ports per worker (swap port and regular port)
-;; -- topology that swaps in can use all the existing topologies swap ports, + unused worker slots
-;; -- how to define worker resources? port range + number of workers?
-
-
-;; Monitoring (or by checking when nodes go down or heartbeats aren't received):
-;; 1. read assignment
-;; 2. see which executors/nodes are up
-;; 3. make new assignment to fix any problems
-;; 4. if a storm exists but is not taken down fully, ensure that storm takedown is launched (step by step remove executors and finally remove assignments)
-
-(defn- assigned-slots
- "Returns a map from node-id to a set of ports"
- [storm-cluster-state]
-
- (let [assignments (.assignments storm-cluster-state nil)]
- (defaulted
- (apply merge-with set/union
- (for [a assignments
- [_ [node port]] (-> (.assignment-info storm-cluster-state a nil) :executor->node+port)]
- {node #{port}}
- ))
- {})
- ))
-
-;; public for testing
-(defn all-supervisor-info
- ([storm-cluster-state] (all-supervisor-info storm-cluster-state nil))
- ([storm-cluster-state callback]
- (let [supervisor-ids (.supervisors storm-cluster-state callback)]
- (into {}
- (mapcat
- (fn [id]
- (if-let [info (.supervisor-info storm-cluster-state id)]
- [[id info]]
- ))
- supervisor-ids))
- )))
-
-(defn- get-version-for-key [key nimbus-host-port-info conf]
- (let [version (KeySequenceNumber. key nimbus-host-port-info)]
- (.getKeySequenceNumber version conf)))
-
-(defn get-key-seq-from-blob-store [blob-store]
- (let [key-iter (.listKeys blob-store)]
- (iterator-seq key-iter)))
-
-(defn- setup-storm-code [nimbus conf storm-id tmp-jar-location storm-conf topology]
- (let [subject (get-subject)
- storm-cluster-state (:storm-cluster-state nimbus)
- blob-store (:blob-store nimbus)
- jar-key (master-stormjar-key storm-id)
- code-key (master-stormcode-key storm-id)
- conf-key (master-stormconf-key storm-id)
- nimbus-host-port-info (:nimbus-host-port-info nimbus)]
- (when tmp-jar-location ;;in local mode there is no jar
- (.createBlob blob-store jar-key (FileInputStream. tmp-jar-location) (SettableBlobMeta. BlobStoreAclHandler/DEFAULT) subject)
- (if (instance? LocalFsBlobStore blob-store)
- (.setup-blobstore! storm-cluster-state jar-key nimbus-host-port-info (get-version-for-key jar-key nimbus-host-port-info conf))))
- (.createBlob blob-store conf-key (Utils/toCompressedJsonConf storm-conf) (SettableBlobMeta. BlobStoreAclHandler/DEFAULT) subject)
- (if (instance? LocalFsBlobStore blob-store)
- (.setup-blobstore! storm-cluster-state conf-key nimbus-host-port-info (get-version-for-key conf-key nimbus-host-port-info conf)))
- (.createBlob blob-store code-key (Utils/serialize topology) (SettableBlobMeta. BlobStoreAclHandler/DEFAULT) subject)
- (if (instance? LocalFsBlobStore blob-store)
- (.setup-blobstore! storm-cluster-state code-key nimbus-host-port-info (get-version-for-key code-key nimbus-host-port-info conf)))))
-
-(defn- read-storm-topology [storm-id blob-store]
- (Utils/deserialize
- (.readBlob blob-store (master-stormcode-key storm-id) (get-subject)) StormTopology))
-
-(defn get-blob-replication-count
- [blob-key nimbus]
- (if (:blob-store nimbus)
- (-> (:blob-store nimbus)
- (.getBlobReplication blob-key nimbus-subject))))
-
-(defn- wait-for-desired-code-replication [nimbus conf storm-id]
- (let [min-replication-count (conf TOPOLOGY-MIN-REPLICATION-COUNT)
- max-replication-wait-time (conf TOPOLOGY-MAX-REPLICATION-WAIT-TIME-SEC)
- current-replication-count-jar (if (not (local-mode? conf))
- (atom (get-blob-replication-count (master-stormjar-key storm-id) nimbus))
- (atom min-replication-count))
- current-replication-count-code (atom (get-blob-replication-count (master-stormcode-key storm-id) nimbus))
- current-replication-count-conf (atom (get-blob-replication-count (master-stormconf-key storm-id) nimbus))
- total-wait-time (atom 0)]
- (if (:blob-store nimbus)
- (while (and
- (or (> min-replication-count @current-replication-count-jar)
- (> min-replication-count @current-replication-count-code)
- (> min-replication-count @current-replication-count-conf))
- (or (neg? max-replication-wait-time)
- (< @total-wait-time max-replication-wait-time)))
- (sleep-secs 1)
- (log-debug "waiting for desired replication to be achieved.
- min-replication-count = " min-replication-count " max-replication-wait-time = " max-replication-wait-time
- (if (not (local-mode? conf))"current-replication-count for jar key = " @current-replication-count-jar)
- "current-replication-count for code key = " @current-replication-count-code
- "current-replication-count for conf key = " @current-replication-count-conf
- " total-wait-time " @total-wait-time)
- (swap! total-wait-time inc)
- (if (not (local-mode? conf))
- (reset! current-replication-count-jar (get-blob-replication-count (master-stormjar-key storm-id) nimbus)))
- (reset! current-replication-count-code (get-blob-replication-count (master-stormcode-key storm-id) nimbus))
- (reset! current-replication-count-conf (get-blob-replication-count (master-stormconf-key storm-id) nimbus))))
- (if (and (<= min-replication-count @current-replication-count-conf)
- (<= min-replication-count @current-replication-count-code)
- (<= min-replication-count @current-replication-count-jar))
- (log-message "desired replication count " min-replication-count " achieved, "
- "current-replication-count for conf key = " @current-replication-count-conf ", "
- "current-replication-count for code key = " @current-replication-count-code ", "
- "current-replication-count for jar key = " @current-replication-count-jar)
- (log-message "desired replication count of " min-replication-count " not achieved but we have hit the max wait time "
- max-replication-wait-time " so moving on with replication count for conf key = " @current-replication-count-conf
- " for code key = " @current-replication-count-code "for jar key = " @current-replication-count-jar))))
-
-(defn- read-storm-topology-as-nimbus [storm-id blob-store]
- (Utils/deserialize
- (.readBlob blob-store (master-stormcode-key storm-id) nimbus-subject) StormTopology))
-
-(declare compute-executor->component)
-
-(defn read-storm-conf-as-nimbus [storm-id blob-store]
- (clojurify-structure
- (Utils/fromCompressedJsonConf
- (.readBlob blob-store (master-stormconf-key storm-id) nimbus-subject))))
-
-(defn read-topology-details [nimbus storm-id]
- (let [blob-store (:blob-store nimbus)
- storm-base (or
- (.storm-base (:storm-cluster-state nimbus) storm-id nil)
- (throw (NotAliveException. storm-id)))
- topology-conf (read-storm-conf-as-nimbus storm-id blob-store)
- topology (read-storm-topology-as-nimbus storm-id blob-store)
- executor->component (->> (compute-executor->component nimbus storm-id)
- (map-key (fn [[start-task end-task]]
- (ExecutorDetails. (int start-task) (int end-task)))))]
- (TopologyDetails. storm-id
- topology-conf
- topology
- (:num-workers storm-base)
- executor->component
- (:launch-time-secs storm-base))))
-
-;; Does not assume that clocks are synchronized. Executor heartbeat is only used so that
-;; nimbus knows when it's received a new heartbeat. All timing is done by nimbus and
-;; tracked through heartbeat-cache
-(defn- update-executor-cache [curr hb timeout]
- (let [reported-time (:time-secs hb)
- {last-nimbus-time :nimbus-time
- last-reported-time :executor-reported-time} curr
- reported-time (cond reported-time reported-time
- last-reported-time last-reported-time
- :else 0)
- nimbus-time (if (or (not last-nimbus-time)
- (not= last-reported-time reported-time))
- (current-time-secs)
- last-nimbus-time
- )]
- {:is-timed-out (and
- nimbus-time
- (>= (time-delta nimbus-time) timeout))
- :nimbus-time nimbus-time
- :executor-reported-time reported-time
- :heartbeat hb}))
-
-(defn update-heartbeat-cache [cache executor-beats all-executors timeout]
- (let [cache (select-keys cache all-executors)]
- (into {}
- (for [executor all-executors :let [curr (cache executor)]]
- [executor
- (update-executor-cache curr (get executor-beats executor) timeout)]
- ))))
-
-(defn update-heartbeats! [nimbus storm-id all-executors existing-assignment]
- (log-debug "Updating heartbeats for " storm-id " " (pr-str all-executors))
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- executor-beats (.executor-beats storm-cluster-state storm-id (:executor->node+port existing-assignment))
- cache (update-heartbeat-cache (@(:heartbeats-cache nimbus) storm-id)
- executor-beats
- all-executors
- ((:conf nimbus) NIMBUS-TASK-TIMEOUT-SECS))]
- (swap! (:heartbeats-cache nimbus) assoc storm-id cache)))
-
-(defn- update-all-heartbeats! [nimbus existing-assignments topology->executors]
- "update all the heartbeats for all the topologies's executors"
- (doseq [[tid assignment] existing-assignments
- :let [all-executors (topology->executors tid)]]
- (update-heartbeats! nimbus tid all-executors assignment)))
-
-(defn- alive-executors
- [nimbus ^TopologyDetails topology-details all-executors existing-assignment]
- (log-debug "Computing alive executors for " (.getId topology-details) "\n"
- "Executors: " (pr-str all-executors) "\n"
- "Assignment: " (pr-str existing-assignment) "\n"
- "Heartbeat cache: " (pr-str (@(:heartbeats-cache nimbus) (.getId topology-details)))
- )
- ;; TODO: need to consider all executors associated with a dead executor (in same slot) dead as well,
- ;; don't just rely on heartbeat being the same
- (let [conf (:conf nimbus)
- storm-id (.getId topology-details)
- executor-start-times (:executor->start-time-secs existing-assignment)
- heartbeats-cache (@(:heartbeats-cache nimbus) storm-id)]
- (->> all-executors
- (filter (fn [executor]
- (let [start-time (get executor-start-times executor)
- is-timed-out (-> heartbeats-cache (get executor) :is-timed-out)]
- (if (and start-time
- (or
- (< (time-delta start-time)
- (conf NIMBUS-TASK-LAUNCH-SECS))
- (not is-timed-out)
- ))
- true
- (do
- (log-message "Executor " storm-id ":" executor " not alive")
- false))
- )))
- doall)))
-
-
-(defn- to-executor-id [task-ids]
- [(first task-ids) (last task-ids)])
-
-(defn- compute-executors [nimbus storm-id]
- (let [conf (:conf nimbus)
- blob-store (:blob-store nimbus)
- storm-base (.storm-base (:storm-cluster-state nimbus) storm-id nil)
- component->executors (:component->executors storm-base)
- storm-conf (read-storm-conf-as-nimbus storm-id blob-store)
- topology (read-storm-topology-as-nimbus storm-id blob-store)
- task->component (storm-task-info topology storm-conf)]
- (if (nil? component->executors)
- []
- (->> (storm-task-info topology storm-conf)
- reverse-map
- (map-val sort)
- (join-maps component->executors)
- (map-val (partial apply partition-fixed))
- (mapcat second)
- (map to-executor-id)
- ))))
-
-(defn- compute-executor->component [nimbus storm-id]
- (let [conf (:conf nimbus)
- blob-store (:blob-store nimbus)
- executors (compute-executors nimbus storm-id)
- topology (read-storm-topology-as-nimbus storm-id blob-store)
- storm-conf (read-storm-conf-as-nimbus storm-id blob-store)
- task->component (storm-task-info topology storm-conf)
- executor->component (into {} (for [executor executors
- :let [start-task (first executor)
- component (task->component start-task)]]
- {executor component}))]
- executor->component))
-
-(defn- compute-topology->executors [nimbus storm-ids]
- "compute a topology-id -> executors map"
- (into {} (for [tid storm-ids]
- {tid (set (compute-executors nimbus tid))})))
-
-(defn- compute-topology->alive-executors [nimbus existing-assignments topologies topology->executors scratch-topology-id]
- "compute a topology-id -> alive executors map"
- (into {} (for [[tid assignment] existing-assignments
- :let [topology-details (.getById topologies tid)
- all-executors (topology->executors tid)
- alive-executors (if (and scratch-topology-id (= scratch-topology-id tid))
- all-executors
- (set (alive-executors nimbus topology-details all-executors assignment)))]]
- {tid alive-executors})))
-
-(defn- compute-supervisor->dead-ports [nimbus existing-assignments topology->executors topology->alive-executors]
- (let [dead-slots (into [] (for [[tid assignment] existing-assignments
- :let [all-executors (topology->executors tid)
- alive-executors (topology->alive-executors tid)
- dead-executors (set/difference all-executors alive-executors)
- dead-slots (->> (:executor->node+port assignment)
- (filter #(contains? dead-executors (first %)))
- vals)]]
- dead-slots))
- supervisor->dead-ports (->> dead-slots
- (apply concat)
- (map (fn [[sid port]] {sid #{port}}))
- (apply (partial merge-with set/union)))]
- (or supervisor->dead-ports {})))
-
-(defn- compute-topology->scheduler-assignment [nimbus existing-assignments topology->alive-executors]
- "convert assignment information in zk to SchedulerAssignment, so it can be used by scheduler api."
- (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]
- (WorkerSlot. node port 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))
- (get node+port->slot [node port])}
- {})))]]
- {tid (SchedulerAssignmentImpl. tid executor->slot)})))
-
-(defn- read-all-supervisor-details
- [nimbus supervisor->dead-ports topologies missing-assignment-topologies]
- "return a map: {supervisor-id SupervisorDetails}"
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- supervisor-infos (all-supervisor-info storm-cluster-state)
- supervisor-details (for [[id info] supervisor-infos]
- (SupervisorDetails. id (:meta info) (:resources-map info)))
- ;; Note that allSlotsAvailableForScheduling
- ;; only uses the supervisor-details. The rest of the arguments
- ;; are there to satisfy the INimbus interface.
- all-scheduling-slots (->> (.allSlotsAvailableForScheduling
- (:inimbus nimbus)
- supervisor-details
- topologies
- (set missing-assignment-topologies))
- (map (fn [s] {(.getNodeId s) #{(.getPort s)}}))
- (apply merge-with set/union))]
- (into {} (for [[sid supervisor-info] supervisor-infos
- :let [hostname (:hostname supervisor-info)
- scheduler-meta (:scheduler-meta supervisor-info)
- dead-ports (supervisor->dead-ports sid)
- ;; hide the dead-ports from the all-ports
- ;; these dead-ports can be reused in next round of assignments
- all-ports (-> (get all-scheduling-slots sid)
- (set/difference dead-ports)
- (as-> ports (map int ports)))
- supervisor-details (SupervisorDetails. sid hostname scheduler-meta all-ports (:resources-map supervisor-info))]]
- {sid supervisor-details}))))
-
-
-(defn- compute-topology->executor->node+port [scheduler-assignments]
- "convert {topology-id -> SchedulerAssignment} to
- {topology-id -> {executor [node port]}}"
- (map-val (fn [^SchedulerAssignment assignment]
- (->> assignment
- .getExecutorToSlot
- (#(into {} (for [[^ExecutorDetails executor ^WorkerSlot slot] %]
- {[(.getStartTask executor) (.getEndTask executor)]
- [(.getNodeId slot) (.getPort slot)]})))))
- scheduler-assignments))
-
-;; NEW NOTES
-;; only assign to supervisors who are there and haven't timed out
-;; need to reassign workers with executors that have timed out (will this make it brittle?)
-;; need to read in the topology and storm-conf from disk
-;; if no slots available and no slots used by this storm, just skip and do nothing
-;; otherwise, package rest of executors into available slots (up to how much it needs)
-
-;; in the future could allocate executors intelligently (so that "close" tasks reside on same machine)
-
-;; TODO: slots that have dead executor should be reused as long as supervisor is active
-
-
-;; (defn- assigned-slots-from-scheduler-assignments [topology->assignment]
-;; (->> topology->assignment
-;; vals
-;; (map (fn [^SchedulerAssignment a] (.getExecutorToSlot a)))
-;; (mapcat vals)
-;; (map (fn [^WorkerSlot s] {(.getNodeId s) #{(.getPort s)}}))
-;; (apply merge-with set/union)
-;; ))
-
-(defn num-used-workers [^SchedulerAssignment scheduler-assignment]
- (if scheduler-assignment
- (count (.getSlots scheduler-assignment))
- 0 ))
-
-(defn convert-assignments-to-worker->resources [new-scheduler-assignments]
- "convert {topology-id -> SchedulerAssignment} to
- {topology-id -> {[node port] [mem-on-heap mem-off-heap cpu]}}
- Make sure this can deal with other non-RAS schedulers
- later we may further support map-for-any-resources"
- (map-val (fn [^SchedulerAssignment assignment]
- (->> assignment
- .getExecutorToSlot
- .values
- (#(into {} (for [^WorkerSlot slot %]
- {[(.getNodeId slot) (.getPort slot)]
- [(.getAllocatedMemOnHeap slot) (.getAllocatedMemOffHeap slot) (.getAllocatedCpu slot)]
- })))))
- new-scheduler-assignments))
-
-(defn compute-new-topology->executor->node+port [new-scheduler-assignments existing-assignments]
- (let [new-topology->executor->node+port (compute-topology->executor->node+port new-scheduler-assignments)]
- ;; print some useful information.
- (doseq [[topology-id executor->node+port] new-topology->executor->node+port
- :let [old-executor->node+port (-> topology-id
- existing-assignments
- :executor->node+port)
- reassignment (filter (fn [[executor node+port]]
- (and (contains? old-executor->node+port executor)
- (not (= node+port (old-executor->node+port executor)))))
- executor->node+port)]]
- (when-not (empty? reassignment)
- (let [new-slots-cnt (count (set (vals executor->node+port)))
- reassign-executors (keys reassignment)]
- (log-message "Reassigning " topology-id " to " new-slots-cnt " slots")
- (log-message "Reassign executors: " (vec reassign-executors)))))
-
- new-topology->executor->node+port))
-
-(defrecord TopologyResources [requested-mem-on-heap requested-mem-off-heap requested-cpu
- assigned-mem-on-heap assigned-mem-off-heap assigned-cpu])
-
-;; public so it can be mocked out
-(defn compute-new-scheduler-assignments [nimbus existing-assignments topologies scratch-topology-id]
- (let [conf (:conf nimbus)
- storm-cluster-state (:storm-cluster-state nimbus)
- topology->executors (compute-topology->executors nimbus (keys existing-assignments))
- ;; update the executors heartbeats first.
- _ (update-all-heartbeats! nimbus existing-assignments topology->executors)
- topology->alive-executors (compute-topology->alive-executors nimbus
- existing-assignments
- topologies
- topology->executors
- scratch-topology-id)
- supervisor->dead-ports (compute-supervisor->dead-ports nimbus
- existing-assignments
- topology->executors
- topology->alive-executors)
- topology->scheduler-assignment (compute-topology->scheduler-assignment nimbus
- existing-assignments
- topology->alive-executors)
-
- missing-assignment-topologies (->> topologies
- .getTopologies
- (map (memfn getId))
- (filter (fn [t]
- (let [alle (get topology->executors t)
- alivee (get topology->alive-executors t)]
- (or (empty? alle)
- (not= alle alivee)
- (< (-> topology->scheduler-assignment
- (get t)
- num-used-workers )
- (-> topologies (.getById t) .getNumWorkers)))))))
-
- supervisors (read-all-supervisor-details nimbus
- supervisor->dead-ports
- topologies
- missing-assignment-topologies)
- cluster (Cluster. (:inimbus nimbus) supervisors topology->scheduler-assignment conf)]
-
- ;; set the status map with existing topology statuses
- (.setStatusMap cluster (deref (:id->sched-status nimbus)))
- ;; call scheduler.schedule to schedule all the topologies
- ;; the new assignments for all the topologies are in the cluster object.
- (.schedule (:scheduler nimbus) topologies cluster)
-
- ;;merge with existing statuses
- (reset! (:id->sched-status nimbus) (merge (deref (:id->sched-status nimbus)) (.getStatusMap cluster)))
- (reset! (:node-id->resources nimbus) (.getSupervisorsResourcesMap cluster))
-
- (if-not (conf SCHEDULER-DISPLAY-RESOURCE)
- (.updateAssignedMemoryForTopologyAndSupervisor cluster topologies))
-
- ; Remove both of swaps below at first opportunity. This is a hack for non-ras scheduler topology and worker resources.
- (swap! (:id->resources nimbus) merge (into {} (map (fn [[k v]] [k (->TopologyResources (nth v 0) (nth v 1) (nth v 2)
- (nth v 3) (nth v 4) (nth v 5))])
- (.getTopologyResourcesMap cluster))))
- ; Remove this also at first chance
- (swap! (:id->worker-resources nimbus) merge
- (into {} (map (fn [[k v]] [k (map-val #(doto (WorkerResources.)
- (.set_mem_on_heap (nth % 0))
- (.set_mem_off_heap (nth % 1))
- (.set_cpu (nth % 2))) v)])
- (.getWorkerResourcesMap cluster))))
-
- (.getAssignments cluster)))
-
-(defn get-resources-for-topology [nimbus topo-id]
- (or (get @(:id->resources nimbus) topo-id)
- (try
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- topology-details (read-topology-details nimbus topo-id)
- assigned-resources (->> (.assignment-info storm-cluster-state topo-id nil)
- :worker->resources
- (vals)
- ; Default to [[0 0 0]] if there are no values
- (#(or % [[0 0 0]]))
- ; [[on-heap, off-heap, cpu]] -> [[on-heap], [off-heap], [cpu]]
- (apply map vector)
- ; [[on-heap], [off-heap], [cpu]] -> [on-heap-sum, off-heap-sum, cpu-sum]
- (map (partial reduce +)))
- worker-resources (->TopologyResources (.getTotalRequestedMemOnHeap topology-details)
- (.getTotalRequestedMemOffHeap topology-details)
- (.getTotalRequestedCpu topology-details)
- (nth assigned-resources 0)
- (nth assigned-resources 1)
- (nth assigned-resources 2))]
- (swap! (:id->resources nimbus) assoc topo-id worker-resources)
- worker-resources)
- (catch KeyNotFoundException e
- ; This can happen when a topology is first coming up.
- ; It's thrown by the blobstore code.
- (log-error e "Failed to get topology details")
- (->TopologyResources 0 0 0 0 0 0)))))
-
-(defn- get-worker-resources-for-topology [nimbus topo-id]
- (or (get @(:id->worker-resources nimbus) topo-id)
- (try
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- assigned-resources (->> (.assignment-info storm-cluster-state topo-id nil)
- :worker->resources)
- worker-resources (into {} (map #(identity {(WorkerSlot. (first (key %)) (second (key %)))
- (doto (WorkerResources.)
- (.set_mem_on_heap (nth (val %) 0))
- (.set_mem_off_heap (nth (val %) 1))
- (.set_cpu (nth (val %) 2)))}) assigned-resources))]
- (swap! (:id->worker-resources nimbus) assoc topo-id worker-resources)
- worker-resources))))
-
-(defn changed-executors [executor->node+port new-executor->node+port]
- (let [executor->node+port (if executor->node+port (sort executor->node+port) nil)
- new-executor->node+port (if new-executor->node+port (sort new-executor->node+port) nil)
- slot-assigned (reverse-map executor->node+port)
- new-slot-assigned (reverse-map new-executor->node+port)
- brand-new-slots (map-diff slot-assigned new-slot-assigned)]
- (apply concat (vals brand-new-slots))
- ))
-
-(defn newly-added-slots [existing-assignment new-assignment]
- (let [old-slots (-> (:executor->node+port existing-assignment)
- vals
- set)
- new-slots (-> (:executor->node+port new-assignment)
- vals
- set)]
- (set/difference new-slots old-slots)))
-
-
-(defn basic-supervisor-details-map [storm-cluster-state]
- (let [infos (all-supervisor-info storm-cluster-state)]
- (->> infos
- (map (fn [[id info]]
- [id (SupervisorDetails. id (:hostname info) (:scheduler-meta info) nil (:resources-map info))]))
- (into {}))))
-
-(defn- to-worker-slot [[node port]]
- (WorkerSlot. node port))
-
-;; get existing assignment (just the executor->node+port map) -> default to {}
-;; filter out ones which have a executor timeout
-;; figure out available slots on cluster. add to that the used valid slots to get total slots. figure out how many executors should be in each slot (e.g., 4, 4, 4, 5)
-;; only keep existing slots that satisfy one of those slots. for rest, reassign them across remaining slots
-;; edge case for slots with no executor timeout but with supervisor timeout... just treat these as valid slots that can be reassigned to. worst comes to worse the executor will timeout and won't assign here next time around
-(defnk mk-assignments [nimbus :scratch-topology-id nil]
- (if (is-leader nimbus :throw-exception false)
- (let [conf (:conf nimbus)
- storm-cluster-state (:storm-cluster-state nimbus)
- ^INimbus inimbus (:inimbus nimbus)
- ;; read all the topologies
- topology-ids (.active-storms storm-cluster-state)
- topologies (into {} (for [tid topology-ids]
- {tid (read-topology-details nimbus tid)}))
- topologies (Topologies. topologies)
- ;; read all the assignments
- assigned-topology-ids (.assignments storm-cluster-state nil)
- existing-assignments (into {} (for [tid assigned-topology-ids]
- ;; for the topology which wants rebalance (specified by the scratch-topology-id)
- ;; we exclude its assignment, meaning that all the slots occupied by its assignment
- ;; will be treated as free slot in the scheduler code.
- (when (or (nil? scratch-topology-id) (not= tid scratch-topology-id))
- {tid (.assignment-info storm-cluster-state tid nil)})))
- ;; make the new assignments for topologies
- new-scheduler-assignments (compute-new-scheduler-assignments
- nimbus
- existing-assignments
- topologies
- scratch-topology-id)
- topology->executor->node+port (compute-new-topology->executor->node+port new-scheduler-assignments existing-assignments)
-
- topology->executor->node+port (merge (into {} (for [id assigned-topology-ids] {id nil})) topology->executor->node+port)
- new-assigned-worker->resources (convert-assignments-to-worker->resources new-scheduler-assignments)
- now-secs (current-time-secs)
-
- basic-supervisor-details-map (basic-supervisor-details-map storm-cluster-state)
-
- ;; construct the final Assignments by adding start-times etc into it
- new-assignments (into {} (for [[topology-id executor->node+port] topology->executor->node+port
- :let [existing-assignment (get existing-assignments topology-id)
- all-nodes (->> executor->node+port vals (map first) set)
- node->host (->> all-nodes
- (mapcat (fn [node]
- (if-let [host (.getHostName inimbus basic-supervisor-details-map node)]
- [[node host]]
- )))
- (into {}))
- all-node->host (merge (:node->host existing-assignment) node->host)
- reassign-executors (changed-executors (:executor->node+port existing-assignment) executor->node+port)
- start-times (merge (:executor->start-time-secs existing-assignment)
- (into {}
- (for [id reassign-executors]
- [id now-secs]
- )))
- worker->resources (get new-assigned-worker->resources topology-id)]]
- {topology-id (Assignment.
- (conf STORM-LOCAL-DIR)
- (select-keys all-node->host all-nodes)
- executor->node+port
- start-times
- worker->resources)}))]
-
- (when (not= new-assignments existing-assignments)
- (log-debug "RESETTING id->resources and id->worker-resources cache!")
- (reset! (:id->resources nimbus) {})
- (reset! (:id->worker-resources nimbus) {}))
- ;; tasks figure out what tasks to talk to by looking at topology at runtime
- ;; only log/set when there's been a change to the assignment
- (doseq [[topology-id assignment] new-assignments
- :let [existing-assignment (get existing-assignments topology-id)
- topology-details (.getById topologies topology-id)]]
- (if (= existing-assignment assignment)
- (log-debug "Assignment for " topology-id " hasn't changed")
- (do
- (log-message "Setting new assignment for topology id " topology-id ": " (pr-str assignment))
- (.set-assignment! storm-cluster-state topology-id assignment)
- )))
- (->> new-assignments
- (map (fn [[topology-id assignment]]
- (let [existing-assignment (get existing-assignments topology-id)]
- [topology-id (map to-worker-slot (newly-added-slots existing-assignment assignment))]
- )))
- (into {})
- (.assignSlots inimbus topologies)))
- (log-message "not a leader, skipping assignments")))
-
-(defn notify-topology-action-listener [nimbus storm-id action]
- (let [topology-action-notifier (:nimbus-topology-action-notifier nimbus)]
- (when (not-nil? topology-action-notifier)
- (try (.notify topology-action-notifier storm-id action)
- (catch Exception e
- (log-warn-error e "Ignoring exception from Topology action notifier for storm-Id " storm-id))))))
-
-(defn- start-storm [nimbus storm-name storm-id topology-initial-status]
- {:pre [(#{:active :inactive} topology-initial-status)]}
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- conf (:conf nimbus)
- blob-store (:blob-store nimbus)
- storm-conf (read-storm-conf conf storm-id blob-store)
- topology (system-topology! storm-conf (read-storm-topology storm-id blob-store))
- num-executors (->> (all-components topology) (map-val num-start-executors))]
- (log-message "Activating " storm-name ": " storm-id)
- (.activate-storm! storm-cluster-state
- storm-id
- (StormBase. storm-name
- (current-time-secs)
- {:type topology-initial-status}
- (storm-conf TOPOLOGY-WORKERS)
- num-executors
- (storm-conf TOPOLOGY-SUBMITTER-USER)
- nil
- nil
- {}))
- (notify-topology-action-listener nimbus storm-name "activate")))
-
-;; Master:
-;; job submit:
-;; 1. read which nodes are available
-;; 2. set assignments
-;; 3. start storm - necessary in case master goes down, when goes back up can remember to take down the storm (2 states: on or off)
-
-(defn storm-active? [storm-cluster-state storm-name]
- (not-nil? (get-storm-id storm-cluster-state storm-name)))
-
-(defn check-storm-active! [nimbus storm-name active?]
- (if (= (not active?)
- (storm-active? (:storm-cluster-state nimbus)
- storm-name))
- (if active?
- (throw (NotAliveException. (str storm-name " is not alive")))
- (throw (AlreadyAliveException. (str storm-name " is already active"))))
- ))
-
-(defn try-read-storm-conf [conf storm-id blob-store]
- (try-cause
- (read-storm-conf-as-nimbus conf storm-id blob-store)
- (catch KeyNotFoundException e
- (throw (NotAliveException. (str storm-id))))))
-
-(defn try-read-storm-conf-from-name [conf storm-name nimbus]
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- blob-store (:blob-store nimbus)
- id (get-storm-id storm-cluster-state storm-name)]
- (try-read-storm-conf conf id blob-store)))
-
-(defn check-authorization!
- ([nimbus storm-name storm-conf operation context]
- (let [aclHandler (:authorization-handler nimbus)
- impersonation-authorizer (:impersonation-authorization-handler nimbus)
- ctx (or context (ReqContext/context))
- check-conf (if storm-conf storm-conf (if storm-name {TOPOLOGY-NAME storm-name}))]
- (if (.isImpersonating ctx)
- (do
- (log-warn "principal: " (.realPrincipal ctx) " is trying to impersonate principal: " (.principal ctx))
- (if impersonation-authorizer
- (when-not (.permit impersonation-authorizer ctx operation check-conf)
- (log-thrift-access (.requestID ctx) (.remoteAddress ctx) (.principal ctx) operation storm-name "access-denied")
- (throw (AuthorizationException. (str "principal " (.realPrincipal ctx) " is not authorized to impersonate
- principal " (.principal ctx) " from host " (.remoteAddress ctx) " Please see SECURITY.MD to learn
- how to configure impersonation acls."))))
- (log-warn "impersonation attempt but " NIMBUS-IMPERSONATION-AUTHORIZER " has no authorizer configured. potential
- security risk, please see SECURITY.MD to learn how to configure impersonation authorizer."))))
-
- (if aclHandler
- (if-not (.permit aclHandler ctx operation check-conf)
- (do
- (log-thrift-access (.requestID ctx) (.remoteAddress ctx) (.principal ctx) operation storm-name "access-denied")
- (throw (AuthorizationException. (str operation (if storm-name (str " on topology " storm-name)) " is not authorized"))))
- (log-thrift-access (.requestID ctx) (.remoteAddress ctx) (.principal ctx) operation storm-name "access-granted")))))
- ([nimbus storm-name storm-conf operation]
- (check-authorization! nimbus storm-name storm-conf operation (ReqContext/context))))
-
-;; no-throw version of check-authorization!
-(defn is-authorized?
- [nimbus conf blob-store operation topology-id]
- (let [topology-conf (try-read-storm-conf conf topology-id blob-store)
- storm-name (topology-conf TOPOLOGY-NAME)]
- (try (check-authorization! nimbus storm-name topology-conf operation)
- true
- (catch AuthorizationException e false))))
-
-(defn code-ids [blob-store]
- (let [to-id (reify KeyFilter
- (filter [this key] (get-id-from-blob-key key)))]
- (set (.filterAndListKeys blob-store to-id))))
-
-(defn cleanup-storm-ids [storm-cluster-state blob-store]
- (let [heartbeat-ids (set (.heartbeat-storms storm-cluster-state))
- error-ids (set (.error-topologies storm-cluster-state))
- code-ids (code-ids blob-store)
- backpressure-ids (set (.backpressure-topologies storm-cluster-state))
- assigned-ids (set (.active-storms storm-cluster-state))]
- (set/difference (set/union heartbeat-ids error-ids backpressure-ids code-ids) assigned-ids)
- ))
-
-(defn extract-status-str [base]
- (let [t (-> base :status :type)]
- (.toUpperCase (name t))
- ))
-
-(defn mapify-serializations [sers]
- (->> sers
- (map (fn [e] (if (map? e) e {e nil})))
- (apply merge)
- ))
-
-(defn- component-parallelism [storm-conf component]
- (let [storm-conf (merge storm-conf (component-conf component))
- num-tasks (or (storm-conf TOPOLOGY-TASKS) (num-start-executors component))
- max-parallelism (storm-conf TOPOLOGY-MAX-TASK-PARALLELISM)
- ]
- (if max-parallelism
- (min max-parallelism num-tasks)
- num-tasks)))
-
-(defn normalize-topology [storm-conf ^StormTopology topology]
- (let [ret (.deepCopy topology)]
- (doseq [[_ component] (all-components ret)]
- (.set_json_conf
- (.get_common component)
- (->> {TOPOLOGY-TASKS (component-parallelism storm-conf component)}
- (merge (component-conf component))
- to-json )))
- ret ))
-
-(defn normalize-conf [conf storm-conf ^StormTopology topology]
- ;; ensure that serializations are same for all tasks no matter what's on
- ;; the supervisors. this also allows you to declare the serializations as a sequence
- (let [component-confs (map
- #(-> (ThriftTopologyUtils/getComponentCommon topology %)
- .get_json_conf
- from-json)
- (ThriftTopologyUtils/getComponentIds topology))
- total-conf (merge conf storm-conf)
-
- get-merged-conf-val (fn [k merge-fn]
- (merge-fn
- (concat
- (mapcat #(get % k) component-confs)
- (or (get storm-conf k)
- (get conf k)))))]
- ;; topology level serialization registrations take priority
- ;; that way, if there's a conflict, a user can force which serialization to use
- ;; append component conf to storm-conf
- (merge storm-conf
- {TOPOLOGY-KRYO-DECORATORS (get-merged-conf-val TOPOLOGY-KRYO-DECORATORS distinct)
- TOPOLOGY-KRYO-REGISTER (get-merged-conf-val TOPOLOGY-KRYO-REGISTER mapify-serializations)
- TOPOLOGY-ACKER-EXECUTORS (total-conf TOPOLOGY-ACKER-EXECUTORS)
- TOPOLOGY-EVENTLOGGER-EXECUTORS (total-conf TOPOLOGY-EVENTLOGGER-EXECUTORS)
- TOPOLOGY-MAX-TASK-PARALLELISM (total-conf TOPOLOGY-MAX-TASK-PARALLELISM)})))
-
-(defn blob-rm-key [blob-store key storm-cluster-state]
- (try
- (.deleteBlob blob-store key nimbus-subject)
- (if (instance? LocalFsBlobStore blob-store)
- (.remove-blobstore-key! storm-cluster-state key))
- (catch Exception e
- (log-message "Exception" e))))
-
-(defn blob-rm-dependency-jars-in-topology [id blob-store storm-cluster-state]
- (try
- (let [storm-topology (read-storm-topology-as-nimbus id blob-store)
- dependency-jars (.get_dependency_jars ^StormTopology storm-topology)]
- (log-message "Removing dependency jars from blobs - " dependency-jars)
- (when-not (empty? dependency-jars)
- (doseq [key dependency-jars]
- (blob-rm-key blob-store key storm-cluster-state))))
- (catch Exception e
- (log-message "Exception" e))))
-
-(defn blob-rm-topology-keys [id blob-store storm-cluster-state]
- (blob-rm-key blob-store (master-stormjar-key id) storm-cluster-state)
- (blob-rm-key blob-store (master-stormconf-key id) storm-cluster-state)
- (blob-rm-key blob-store (master-stormcode-key id) storm-cluster-state))
-
-(defn force-delete-topo-dist-dir [conf id]
- (rmr (master-stormdist-root conf id)))
-
-(defn do-cleanup [nimbus]
- (if (is-leader nimbus :throw-exception false)
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- conf (:conf nimbus)
- submit-lock (:submit-lock nimbus)
- blob-store (:blob-store nimbus)]
- (let [to-cleanup-ids (locking submit-lock
- (cleanup-storm-ids storm-cluster-state blob-store))]
- (when-not (empty? to-cleanup-ids)
- (doseq [id to-cleanup-ids]
- (log-message "Cleaning up " id)
- (.teardown-heartbeats! storm-cluster-state id)
- (.teardown-topology-errors! storm-cluster-state id)
- (.remove-backpressure! storm-cluster-state id)
- (blob-rm-dependency-jars-in-topology id blob-store storm-cluster-state)
- (force-delete-topo-dist-dir conf id)
- (blob-rm-topology-keys id blob-store storm-cluster-state)
- (swap! (:heartbeats-cache nimbus) dissoc id)))))
- (log-message "not a leader, skipping cleanup")))
-
-(defn- file-older-than? [now seconds file]
- (<= (+ (.lastModified file) (to-millis seconds)) (to-millis now)))
-
-(defn clean-inbox [dir-location seconds]
- "Deletes jar files in dir older than seconds."
- (let [now (current-time-secs)
- pred #(and (.isFile %) (file-older-than? now seconds %))
- files (filter pred (file-seq (File. dir-location)))]
- (doseq [f files]
- (if (.delete f)
- (log-message "Cleaning inbox ... deleted: " (.getName f))
- ;; This should never happen
- (log-error "Cleaning inbox ... error deleting: " (.getName f))))))
-
-(defn clean-topology-history
- "Deletes topologies from history older than minutes."
- [mins nimbus]
- (locking (:topology-history-lock nimbus)
- (let [cutoff-age (- (current-time-secs) (* mins 60))
- topo-history-state (:topo-history-state nimbus)
- curr-history (vec (ls-topo-hist topo-history-state))
- new-history (vec (filter (fn [line]
- (> (line :timestamp) cutoff-age)) curr-history))]
- (ls-topo-hist! topo-history-state new-history))))
-
-(defn setup-blobstore [nimbus]
- "Sets up blobstore state for all current keys."
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- blob-store (:blob-store nimbus)
- local-set-of-keys (set (get-key-seq-from-blob-store blob-store))
- all-keys (set (.active-keys storm-cluster-state))
- locally-available-active-keys (set/intersection local-set-of-keys all-keys)
- keys-to-delete (set/difference local-set-of-keys all-keys)
- conf (:conf nimbus)
- nimbus-host-port-info (:nimbus-host-port-info nimbus)]
- (log-debug "Deleting keys not on the zookeeper" keys-to-delete)
- (doseq [key keys-to-delete]
- (.deleteBlob blob-store key nimbus-subject))
- (log-debug "Creating list of key entries for blobstore inside zookeeper" all-keys "local" locally-available-active-keys)
- (doseq [key locally-available-active-keys]
- (.setup-blobstore! storm-cluster-state key (:nimbus-host-port-info nimbus) (get-version-for-key key nimbus-host-port-info conf)))))
-
-(defn- get-errors [storm-cluster-state storm-id component-id]
- (->> (.errors storm-cluster-state storm-id component-id)
- (map #(doto (ErrorInfo. (:error %) (:time-secs %))
- (.set_host (:host %))
- (.set_port (:port %))))))
-
-(defn- thriftify-executor-id [[first-task-id last-task-id]]
- (ExecutorInfo. (int first-task-id) (int last-task-id)))
-
-(def DISALLOWED-TOPOLOGY-NAME-STRS #{"/" "." ":" "\\"})
-
-(defn validate-topology-name! [name]
- (if (some #(.contains name %) DISALLOWED-TOPOLOGY-NAME-STRS)
- (throw (InvalidTopologyException.
- (str "Topology name cannot contain any of the following: " (pr-str DISALLOWED-TOPOLOGY-NAME-STRS))))
- (if (clojure.string/blank? name)
- (throw (InvalidTopologyException.
- ("Topology name cannot be blank"))))))
-
-;; We will only file at <Storm dist root>/<Topology ID>/<File>
-;; to be accessed via Thrift
-;; ex., storm-local/nimbus/stormdist/aa-1-1377104853/stormjar.jar
-(defn check-file-access [conf file-path]
- (log-debug "check file access:" file-path)
- (try
- (if (not= (.getCanonicalFile (File. (master-stormdist-root conf)))
- (-> (File. file-path) .getCanonicalFile .getParentFile .getParentFile))
- (throw (AuthorizationException. (str "Invalid file path: " file-path))))
- (catch Exception e
- (throw (AuthorizationException. (str "Invalid file path: " file-path))))))
-
-(defn try-read-storm-conf
- [conf storm-id blob-store]
- (try-cause
- (read-storm-conf-as-nimbus storm-id blob-store)
- (catch KeyNotFoundException e
- (throw (NotAliveException. (str storm-id))))))
-
-(defn try-read-storm-conf-from-name
- [conf storm-name nimbus]
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- blob-store (:blob-store nimbus)
- id (get-storm-id storm-cluster-state storm-name)]
- (try-read-storm-conf conf id blob-store)))
-
-(defn try-read-storm-topology
- [storm-id blob-store]
- (try-cause
- (read-storm-topology-as-nimbus storm-id blob-store)
- (catch KeyNotFoundException e
- (throw (NotAliveException. (str storm-id))))))
-
-(defn add-topology-to-history-log
- [storm-id nimbus topology-conf]
- (log-message "Adding topo to history log: " storm-id)
- (locking (:topology-history-lock nimbus)
- (let [topo-history-state (:topo-history-state nimbus)
- users (get-topo-logs-users topology-conf)
- groups (get-topo-logs-groups topology-conf)
- curr-history (vec (ls-topo-hist topo-history-state))
- new-history (conj curr-history {:topoid storm-id :timestamp (current-time-secs)
- :users users :groups groups})]
- (ls-topo-hist! topo-history-state new-history))))
-
-(defn igroup-mapper
- [storm-conf]
- (AuthUtils/GetGroupMappingServiceProviderPlugin storm-conf))
-
-(defn user-groups
- [user storm-conf]
- (if (clojure.string/blank? user) [] (.getGroups (igroup-mapper storm-conf) user)))
-
-(defn does-users-group-intersect?
- "Check to see if any of the users groups intersect with the list of groups passed in"
- [user groups-to-check storm-conf]
- (let [groups (user-groups user storm-conf)]
- (> (.size (set/intersection (set groups) (set groups-to-check))) 0)))
-
-(defn read-topology-history
- [nimbus user admin-users]
- (let [topo-history-state (:topo-history-state nimbus)
- curr-history (vec (ls-topo-hist topo-history-state))
- topo-user-can-access (fn [line user storm-conf]
- (if (nil? user)
- (line :topoid)
- (if (or (some #(= % user) admin-users)
- (does-users-group-intersect? user (line :groups) storm-conf)
- (some #(= % user) (line :users)))
- (line :topoid)
- nil)))]
- (remove nil? (map #(topo-user-can-access % user (:conf nimbus)) curr-history))))
-
-(defn renew-credentials [nimbus]
- (if (is-leader nimbus :throw-exception false)
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- blob-store (:blob-store nimbus)
- renewers (:cred-renewers nimbus)
- update-lock (:cred-update-lock nimbus)
- assigned-ids (set (.active-storms storm-cluster-state))]
- (when-not (empty? assigned-ids)
- (doseq [id assigned-ids]
- (locking update-lock
- (let [orig-creds (.credentials storm-cluster-state id nil)
- topology-conf (try-read-storm-conf (:conf nimbus) id blob-store)]
- (if orig-creds
- (let [new-creds (HashMap. orig-creds)]
- (doseq [renewer renewers]
- (log-message "Renewing Creds For " id " with " renewer)
- (.renew renewer new-creds (Collections/unmodifiableMap topology-conf)))
- (when-not (= orig-creds new-creds)
- (.set-credentials! storm-cluster-state id new-creds topology-conf)
- ))))))))
- (log-message "not a leader, skipping credential renewal.")))
-
-(defn validate-topology-size [topo-conf nimbus-conf topology]
- (let [workers-count (get topo-conf TOPOLOGY-WORKERS)
- workers-allowed (get nimbus-conf NIMBUS-SLOTS-PER-TOPOLOGY)
- num-executors (->> (all-components topology) (map-val num-start-executors))
- executors-count (reduce + (vals num-executors))
- executors-allowed (get nimbus-conf NIMBUS-EXECUTORS-PER-TOPOLOGY)]
- (when (and
- (not (nil? executors-allowed))
- (> executors-count executors-allowed))
- (throw
- (InvalidTopologyException.
- (str "Failed to submit topology. Topology requests more than " executors-allowed " executors."))))
- (when (and
- (not (nil? workers-allowed))
- (> workers-count workers-allowed))
- (throw
- (InvalidTopologyException.
- (str "Failed to submit topology. Topology requests more than " workers-allowed " workers."))))))
-
-(defn- set-logger-timeouts [log-config]
- (let [timeout-secs (.get_reset_log_level_timeout_secs log-config)
- timeout (time/plus (time/now) (time/secs timeout-secs))]
- (if (time/after? timeout (time/now))
- (.set_reset_log_level_timeout_epoch log-config (coerce/to-long timeout))
- (.unset_reset_log_level_timeout_epoch log-config))))
-
-(defmethod blob-sync :distributed [conf nimbus]
- (if (not (is-leader nimbus :throw-exception false))
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- nimbus-host-port-info (:nimbus-host-port-info nimbus)
- blob-store-key-set (set (get-key-seq-from-blob-store (:blob-store nimbus)))
- zk-key-set (set (.blobstore storm-cluster-state (fn [] (blob-sync conf nimbus))))]
- (log-debug "blob-sync " "blob-store-keys " blob-store-key-set "zookeeper-keys " zk-key-set)
- (let [sync-blobs (doto
- (BlobSynchronizer. (:blob-store nimbus) conf)
- (.setNimbusInfo nimbus-host-port-info)
- (.setBlobStoreKeySet blob-store-key-set)
- (.setZookeeperKeySet zk-key-set))]
- (.syncBlobs sync-blobs)))))
-
-(defmethod blob-sync :local [conf nimbus]
- nil)
-
-(defn make-supervisor-summary
- [nimbus id info]
- (let [ports (set (:meta info)) ;;TODO: this is only true for standalone
- sup-sum (SupervisorSummary. (:hostname info)
- (:uptime-secs info)
- (count ports)
- (count (:used-ports info))
- id)]
- (.set_total_resources sup-sum (map-val double (:resources-map info)))
- (when-let [[total-mem total-cpu used-mem used-cpu] (.get @(:node-id->resources nimbus) id)]
- (.set_used_mem sup-sum (or used-mem 0))
- (.set_used_cpu sup-sum (or used-cpu 0)))
- (when-let [version (:version info)] (.set_version sup-sum version))
- sup-sum))
-
-(defn user-and-supervisor-topos
- [nimbus conf blob-store assignments supervisor-id]
- (let [topo-id->supervisors
- (into {} (for [[topo-id assignment] assignments]
- {topo-id (into #{}
- (map #(first (second %))
- (:executor->node+port assignment)))}))
- supervisor-topologies (keys (filter #(get (val %) supervisor-id) topo-id->supervisors))]
- {:supervisor-topologies supervisor-topologies
- :user-topologies (into #{} (filter (partial is-authorized? nimbus
- conf
- blob-store
- "getTopology")
- supervisor-topologies))}))
-
-(defn topology-assignments
- [storm-cluster-state]
- (let [assigned-topology-ids (.assignments storm-cluster-state nil)]
- (into {} (for [tid assigned-topology-ids]
- {tid (.assignment-info storm-cluster-state tid nil)}))))
-
-(defn get-launch-time-secs
- [base storm-id]
- (if base (:launch-time-secs base)
- (throw
- (NotAliveException. (str storm-id)))))
-
-(defn get-cluster-info [nimbus]
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- supervisor-infos (all-supervisor-info storm-cluster-state)
- ;; TODO: need to get the port info about supervisors...
- ;; in standalone just look at metadata, otherwise just say N/A?
- supervisor-summaries (dofor [[id info] supervisor-infos]
- (make-supervisor-summary nimbus id info))
- nimbus-uptime ((:uptime nimbus))
- bases (topology-bases storm-cluster-state)
- nimbuses (.nimbuses storm-cluster-state)
-
- ;;update the isLeader field for each nimbus summary
- _ (let [leader (.getLeader (:leader-elector nimbus))
- leader-host (.getHost leader)
- leader-port (.getPort leader)]
- (doseq [nimbus-summary nimbuses]
- (.set_uptime_secs nimbus-summary (time-delta (.get_uptime_secs nimbus-summary)))
- (.set_isLeader nimbus-summary (and (= leader-host (.get_host nimbus-summary)) (= leader-port (.get_port nimbus-summary))))))
-
- topology-summaries (dofor [[id base] bases :when base]
- (let [assignment (.assignment-info storm-cluster-state id nil)
- topo-summ (TopologySummary. id
- (:storm-name base)
- (->> (:executor->node+port assignment)
- keys
- (mapcat executor-id->tasks)
- count)
- (->> (:executor->node+port assignment)
- keys
- count)
- (->> (:executor->node+port assignment)
- vals
- set
- count)
- (time-delta (:launch-time-secs base))
- (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))
- (when-let [resources (get-resources-for-topology nimbus id)]
- (.set_requested_memonheap topo-summ (:requested-mem-on-heap resources))
- (.set_requested_memoffheap topo-summ (:requested-mem-off-heap resources))
- (.set_requested_cpu topo-summ (:requested-cpu resources))
- (.set_assigned_memonheap topo-summ (:assigned-mem-on-heap resources))
- (.set_assigned_memoffheap topo-summ (:assigned-mem-off-heap resources))
- (.set_assigned_cpu topo-summ (:assigned-cpu resources)))
- (.set_replication_count topo-summ (get-blob-replication-count (master-stormcode-key id) nimbus))
- topo-summ))
- ret (ClusterSummary. supervisor-summaries
- topology-summaries
- nimbuses)
- _ (.set_nimbus_uptime_secs ret nimbus-uptime)]
- ret))
-
-(defn extract-cluster-metrics [^ClusterSummary summ]
- (let [cluster-summ (ui/cluster-summary summ "nimbus")]
- {:cluster-info (IClusterMetricsConsumer$ClusterInfo. (long (Time/currentTimeSecs)))
- :data-points (map
- (fn [[k v]] (DataPoint. k v))
- (select-keys cluster-summ ["supervisors" "topologies" "slotsTotal" "slotsUsed" "slotsFree"
- "executorsTotal" "tasksTotal"]))}))
-
-(defn extract-supervisors-metrics [^ClusterSummary summ]
- (let [sups (.get_supervisors summ)
- supervisors-summ ((ui/supervisor-summary sups) "supervisors")]
- (map (fn [supervisor-summ]
- {:supervisor-info (IClusterMetricsConsumer$SupervisorInfo.
- (supervisor-summ "host")
- (supervisor-summ "id")
- (long (Time/currentTimeSecs)))
- :data-points (map
- (fn [[k v]] (DataPoint. k v))
- (select-keys supervisor-summ ["slotsTotal" "slotsUsed" "totalMem" "totalCpu"
- "usedMem" "usedCpu"]))})
- supervisors-summ)))
-
-(defn send-cluster-metrics-to-executors [nimbus-service nimbus]
- (let [cluster-summary (get-cluster-info nimbus)
- cluster-metrics (extract-cluster-metrics cluster-summary)
- supervisors-metrics (extract-supervisors-metrics cluster-summary)]
- (dofor
- [consumer-executor (:cluster-consumer-executors nimbus)]
- (do
- (.handleDataPoints consumer-executor (:cluster-info cluster-metrics) (:data-points cluster-metrics))
- (dofor
- [supervisor-metrics supervisors-metrics]
- (do
- (.handleDataPoints consumer-executor (:supervisor-info supervisor-metrics) (:data-points supervisor-metrics))))))))
-
-(defn mk-reified-nimbus [nimbus conf blob-store]
- (let [principal-to-local (AuthUtils/GetPrincipalToLocalPlugin conf)
- admin-users (or (.get conf NIMBUS-ADMINS) [])
- get-common-topo-info
- (fn [^String storm-id operation]
- (let [storm-cluster-state (:storm-cluster-state nimbus)
- topology-conf (try-read-storm-conf conf storm-id blob-store)
- storm-name (topology-conf TOPOLOGY-NAME)
- _ (check-authorization! nimbus
- storm-name
- topology-conf
- operation)
- topology (try-read-storm-topology storm-id blob-store)
- task->component (storm-task-info topology topology-conf)
- base (.storm-base storm-cluster-state storm-id nil)
- launch-time-secs (get-launch-time-secs base storm-id)
- assignment (.assignment-info storm-cluster-state storm-id nil)
- beats (map-val :heartbeat (get @(:heartbeats-cache nimbus)
- storm-id))
- all-components (set (vals task->component))]
- {:storm-name storm-name
- :storm-cluster-state storm-cluster-state
- :all-components all-components
- :launch-time-secs launch-time-secs
- :assignment assignment
- :beats beats
- :topology topology
- :topology-conf topology-conf
- :task->component task->component
- :base base}))
- set-resources-default-if-not-set
- (fn [^HashMap component-resources-map component-id topology-conf]
- (let [resource-map (or (.get component-resources-map component-id) (HashMap.))]
- (ResourceUtils/checkIntialization resource-map component-id topology-conf)
- resource-map))
- get-last-error (fn [storm-cluster-state storm-id component-id]
- (if-let [e (.last-error storm-cluster-state
- storm-id
- component-id)]
- (doto (ErrorInfo. (:error e) (:time-secs e))
- (.set_host (:host e))
- (.set_port (:port e)))))]
- (reify Nimbus$Iface
- (^void submitTopologyWithOpts
- [this ^String storm-name ^String uploadedJarLocation ^String serializedConf ^StormTopology topology
- ^SubmitOptions submitOptions]
- (try
- (mark! nimbus:num-submitTopologyWithOpts-calls)
- (is-leader nimbus)
- (assert (not-nil? submitOptions))
- (validate-topology-name! storm-name)
- (check-authorization! nimbus storm-name nil "submitTopology")
- (check-storm-active! nimbus storm-name false)
- (let [topo-conf (from-json serializedConf)]
- (try
- (validate-configs-with-schemas topo-conf)
- (catch IllegalArgumentException ex
- (throw (InvalidTopologyException. (.getMessage ex)))))
- (.validate ^org.apache.storm.nimbus.ITopologyValidator (:validator nimbus)
- storm-name
- topo-conf
- topology))
- (swap! (:submitted-count nimbus) inc)
- (let [storm-id (str storm-name "-" @(:submitted-count nimbus) "-" (current-time-secs))
- credentials (.get_creds submitOptions)
- credentials (when credentials (.get_creds credentials))
- topo-conf (from-json serializedConf)
- storm-conf-submitted (normalize-conf
- conf
- (-> topo-conf
- (assoc STORM-ID storm-id)
- (assoc TOPOLOGY-NAME storm-name))
- topology)
- req (ReqContext/context)
- principal (.principal req)
- submitter-principal (if principal (.toString principal))
- submitter-user (.toLocal principal-to-local principal)
- system-user (System/getProperty "user.name")
- topo-acl (distinct (remove nil? (conj (.get storm-conf-submitted TOPOLOGY-USERS) submitter-principal, submitter-user)))
- storm-conf (-> storm-conf-submitted
-
<TRUNCATED>
[10/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/StormTopology.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/StormTopology.java b/storm-core/src/jvm/backtype/storm/generated/StormTopology.java
deleted file mode 100644
index caec6c6..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/StormTopology.java
+++ /dev/null
@@ -1,1272 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class StormTopology implements org.apache.thrift.TBase<StormTopology, StormTopology._Fields>, java.io.Serializable, Cloneable, Comparable<StormTopology> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StormTopology");
-
- private static final org.apache.thrift.protocol.TField SPOUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("spouts", org.apache.thrift.protocol.TType.MAP, (short)1);
- private static final org.apache.thrift.protocol.TField BOLTS_FIELD_DESC = new org.apache.thrift.protocol.TField("bolts", org.apache.thrift.protocol.TType.MAP, (short)2);
- private static final org.apache.thrift.protocol.TField STATE_SPOUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("state_spouts", org.apache.thrift.protocol.TType.MAP, (short)3);
- private static final org.apache.thrift.protocol.TField WORKER_HOOKS_FIELD_DESC = new org.apache.thrift.protocol.TField("worker_hooks", org.apache.thrift.protocol.TType.LIST, (short)4);
- private static final org.apache.thrift.protocol.TField DEPENDENCY_JARS_FIELD_DESC = new org.apache.thrift.protocol.TField("dependency_jars", org.apache.thrift.protocol.TType.LIST, (short)5);
- private static final org.apache.thrift.protocol.TField DEPENDENCY_ARTIFACTS_FIELD_DESC = new org.apache.thrift.protocol.TField("dependency_artifacts", org.apache.thrift.protocol.TType.LIST, (short)6);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new StormTopologyStandardSchemeFactory());
- schemes.put(TupleScheme.class, new StormTopologyTupleSchemeFactory());
- }
-
- private Map<String,SpoutSpec> spouts; // required
- private Map<String,Bolt> bolts; // required
- private Map<String,StateSpoutSpec> state_spouts; // required
- private List<ByteBuffer> worker_hooks; // optional
- private List<String> dependency_jars; // optional
- private List<String> dependency_artifacts; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SPOUTS((short)1, "spouts"),
- BOLTS((short)2, "bolts"),
- STATE_SPOUTS((short)3, "state_spouts"),
- WORKER_HOOKS((short)4, "worker_hooks"),
- DEPENDENCY_JARS((short)5, "dependency_jars"),
- DEPENDENCY_ARTIFACTS((short)6, "dependency_artifacts");
-
- private static final Map<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: // SPOUTS
- return SPOUTS;
- case 2: // BOLTS
- return BOLTS;
- case 3: // STATE_SPOUTS
- return STATE_SPOUTS;
- case 4: // WORKER_HOOKS
- return WORKER_HOOKS;
- case 5: // DEPENDENCY_JARS
- return DEPENDENCY_JARS;
- case 6: // DEPENDENCY_ARTIFACTS
- return DEPENDENCY_ARTIFACTS;
- 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.WORKER_HOOKS,_Fields.DEPENDENCY_JARS,_Fields.DEPENDENCY_ARTIFACTS};
- 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.SPOUTS, new org.apache.thrift.meta_data.FieldMetaData("spouts", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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, SpoutSpec.class))));
- tmpMap.put(_Fields.BOLTS, new org.apache.thrift.meta_data.FieldMetaData("bolts", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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, Bolt.class))));
- tmpMap.put(_Fields.STATE_SPOUTS, new org.apache.thrift.meta_data.FieldMetaData("state_spouts", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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, StateSpoutSpec.class))));
- tmpMap.put(_Fields.WORKER_HOOKS, new org.apache.thrift.meta_data.FieldMetaData("worker_hooks", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))));
- tmpMap.put(_Fields.DEPENDENCY_JARS, new org.apache.thrift.meta_data.FieldMetaData("dependency_jars", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- tmpMap.put(_Fields.DEPENDENCY_ARTIFACTS, new org.apache.thrift.meta_data.FieldMetaData("dependency_artifacts", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StormTopology.class, metaDataMap);
- }
-
- public StormTopology() {
- }
-
- public StormTopology(
- Map<String,SpoutSpec> spouts,
- Map<String,Bolt> bolts,
- Map<String,StateSpoutSpec> state_spouts)
- {
- this();
- this.spouts = spouts;
- this.bolts = bolts;
- this.state_spouts = state_spouts;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public StormTopology(StormTopology other) {
- if (other.is_set_spouts()) {
- Map<String,SpoutSpec> __this__spouts = new HashMap<String,SpoutSpec>(other.spouts.size());
- for (Map.Entry<String, SpoutSpec> other_element : other.spouts.entrySet()) {
-
- String other_element_key = other_element.getKey();
- SpoutSpec other_element_value = other_element.getValue();
-
- String __this__spouts_copy_key = other_element_key;
-
- SpoutSpec __this__spouts_copy_value = new SpoutSpec(other_element_value);
-
- __this__spouts.put(__this__spouts_copy_key, __this__spouts_copy_value);
- }
- this.spouts = __this__spouts;
- }
- if (other.is_set_bolts()) {
- Map<String,Bolt> __this__bolts = new HashMap<String,Bolt>(other.bolts.size());
- for (Map.Entry<String, Bolt> other_element : other.bolts.entrySet()) {
-
- String other_element_key = other_element.getKey();
- Bolt other_element_value = other_element.getValue();
-
- String __this__bolts_copy_key = other_element_key;
-
- Bolt __this__bolts_copy_value = new Bolt(other_element_value);
-
- __this__bolts.put(__this__bolts_copy_key, __this__bolts_copy_value);
- }
- this.bolts = __this__bolts;
- }
- if (other.is_set_state_spouts()) {
- Map<String,StateSpoutSpec> __this__state_spouts = new HashMap<String,StateSpoutSpec>(other.state_spouts.size());
- for (Map.Entry<String, StateSpoutSpec> other_element : other.state_spouts.entrySet()) {
-
- String other_element_key = other_element.getKey();
- StateSpoutSpec other_element_value = other_element.getValue();
-
- String __this__state_spouts_copy_key = other_element_key;
-
- StateSpoutSpec __this__state_spouts_copy_value = new StateSpoutSpec(other_element_value);
-
- __this__state_spouts.put(__this__state_spouts_copy_key, __this__state_spouts_copy_value);
- }
- this.state_spouts = __this__state_spouts;
- }
- if (other.is_set_worker_hooks()) {
- List<ByteBuffer> __this__worker_hooks = new ArrayList<ByteBuffer>(other.worker_hooks);
- this.worker_hooks = __this__worker_hooks;
- }
- if (other.is_set_dependency_jars()) {
- List<String> __this__dependency_jars = new ArrayList<String>(other.dependency_jars);
- this.dependency_jars = __this__dependency_jars;
- }
- if (other.is_set_dependency_artifacts()) {
- List<String> __this__dependency_artifacts = new ArrayList<String>(other.dependency_artifacts);
- this.dependency_artifacts = __this__dependency_artifacts;
- }
- }
-
- public StormTopology deepCopy() {
- return new StormTopology(this);
- }
-
- @Override
- public void clear() {
- this.spouts = null;
- this.bolts = null;
- this.state_spouts = null;
- this.worker_hooks = null;
- this.dependency_jars = null;
- this.dependency_artifacts = null;
- }
-
- public int get_spouts_size() {
- return (this.spouts == null) ? 0 : this.spouts.size();
- }
-
- public void put_to_spouts(String key, SpoutSpec val) {
- if (this.spouts == null) {
- this.spouts = new HashMap<String,SpoutSpec>();
- }
- this.spouts.put(key, val);
- }
-
- public Map<String,SpoutSpec> get_spouts() {
- return this.spouts;
- }
-
- public void set_spouts(Map<String,SpoutSpec> spouts) {
- this.spouts = spouts;
- }
-
- public void unset_spouts() {
- this.spouts = null;
- }
-
- /** Returns true if field spouts is set (has been assigned a value) and false otherwise */
- public boolean is_set_spouts() {
- return this.spouts != null;
- }
-
- public void set_spouts_isSet(boolean value) {
- if (!value) {
- this.spouts = null;
- }
- }
-
- public int get_bolts_size() {
- return (this.bolts == null) ? 0 : this.bolts.size();
- }
-
- public void put_to_bolts(String key, Bolt val) {
- if (this.bolts == null) {
- this.bolts = new HashMap<String,Bolt>();
- }
- this.bolts.put(key, val);
- }
-
- public Map<String,Bolt> get_bolts() {
- return this.bolts;
- }
-
- public void set_bolts(Map<String,Bolt> bolts) {
- this.bolts = bolts;
- }
-
- public void unset_bolts() {
- this.bolts = null;
- }
-
- /** Returns true if field bolts is set (has been assigned a value) and false otherwise */
- public boolean is_set_bolts() {
- return this.bolts != null;
- }
-
- public void set_bolts_isSet(boolean value) {
- if (!value) {
- this.bolts = null;
- }
- }
-
- public int get_state_spouts_size() {
- return (this.state_spouts == null) ? 0 : this.state_spouts.size();
- }
-
- public void put_to_state_spouts(String key, StateSpoutSpec val) {
- if (this.state_spouts == null) {
- this.state_spouts = new HashMap<String,StateSpoutSpec>();
- }
- this.state_spouts.put(key, val);
- }
-
- public Map<String,StateSpoutSpec> get_state_spouts() {
- return this.state_spouts;
- }
-
- public void set_state_spouts(Map<String,StateSpoutSpec> state_spouts) {
- this.state_spouts = state_spouts;
- }
-
- public void unset_state_spouts() {
- this.state_spouts = null;
- }
-
- /** Returns true if field state_spouts is set (has been assigned a value) and false otherwise */
- public boolean is_set_state_spouts() {
- return this.state_spouts != null;
- }
-
- public void set_state_spouts_isSet(boolean value) {
- if (!value) {
- this.state_spouts = null;
- }
- }
-
- public int get_worker_hooks_size() {
- return (this.worker_hooks == null) ? 0 : this.worker_hooks.size();
- }
-
- public java.util.Iterator<ByteBuffer> get_worker_hooks_iterator() {
- return (this.worker_hooks == null) ? null : this.worker_hooks.iterator();
- }
-
- public void add_to_worker_hooks(ByteBuffer elem) {
- if (this.worker_hooks == null) {
- this.worker_hooks = new ArrayList<ByteBuffer>();
- }
- this.worker_hooks.add(elem);
- }
-
- public List<ByteBuffer> get_worker_hooks() {
- return this.worker_hooks;
- }
-
- public void set_worker_hooks(List<ByteBuffer> worker_hooks) {
- this.worker_hooks = worker_hooks;
- }
-
- public void unset_worker_hooks() {
- this.worker_hooks = null;
- }
-
- /** Returns true if field worker_hooks is set (has been assigned a value) and false otherwise */
- public boolean is_set_worker_hooks() {
- return this.worker_hooks != null;
- }
-
- public void set_worker_hooks_isSet(boolean value) {
- if (!value) {
- this.worker_hooks = null;
- }
- }
-
- public int get_dependency_jars_size() {
- return (this.dependency_jars == null) ? 0 : this.dependency_jars.size();
- }
-
- public java.util.Iterator<String> get_dependency_jars_iterator() {
- return (this.dependency_jars == null) ? null : this.dependency_jars.iterator();
- }
-
- public void add_to_dependency_jars(String elem) {
- if (this.dependency_jars == null) {
- this.dependency_jars = new ArrayList<String>();
- }
- this.dependency_jars.add(elem);
- }
-
- public List<String> get_dependency_jars() {
- return this.dependency_jars;
- }
-
- public void set_dependency_jars(List<String> dependency_jars) {
- this.dependency_jars = dependency_jars;
- }
-
- public void unset_dependency_jars() {
- this.dependency_jars = null;
- }
-
- /** Returns true if field dependency_jars is set (has been assigned a value) and false otherwise */
- public boolean is_set_dependency_jars() {
- return this.dependency_jars != null;
- }
-
- public void set_dependency_jars_isSet(boolean value) {
- if (!value) {
- this.dependency_jars = null;
- }
- }
-
- public int get_dependency_artifacts_size() {
- return (this.dependency_artifacts == null) ? 0 : this.dependency_artifacts.size();
- }
-
- public java.util.Iterator<String> get_dependency_artifacts_iterator() {
- return (this.dependency_artifacts == null) ? null : this.dependency_artifacts.iterator();
- }
-
- public void add_to_dependency_artifacts(String elem) {
- if (this.dependency_artifacts == null) {
- this.dependency_artifacts = new ArrayList<String>();
- }
- this.dependency_artifacts.add(elem);
- }
-
- public List<String> get_dependency_artifacts() {
- return this.dependency_artifacts;
- }
-
- public void set_dependency_artifacts(List<String> dependency_artifacts) {
- this.dependency_artifacts = dependency_artifacts;
- }
-
- public void unset_dependency_artifacts() {
- this.dependency_artifacts = null;
- }
-
- /** Returns true if field dependency_artifacts is set (has been assigned a value) and false otherwise */
- public boolean is_set_dependency_artifacts() {
- return this.dependency_artifacts != null;
- }
-
- public void set_dependency_artifacts_isSet(boolean value) {
- if (!value) {
- this.dependency_artifacts = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SPOUTS:
- if (value == null) {
- unset_spouts();
- } else {
- set_spouts((Map<String,SpoutSpec>)value);
- }
- break;
-
- case BOLTS:
- if (value == null) {
- unset_bolts();
- } else {
- set_bolts((Map<String,Bolt>)value);
- }
- break;
-
- case STATE_SPOUTS:
- if (value == null) {
- unset_state_spouts();
- } else {
- set_state_spouts((Map<String,StateSpoutSpec>)value);
- }
- break;
-
- case WORKER_HOOKS:
- if (value == null) {
- unset_worker_hooks();
- } else {
- set_worker_hooks((List<ByteBuffer>)value);
- }
- break;
-
- case DEPENDENCY_JARS:
- if (value == null) {
- unset_dependency_jars();
- } else {
- set_dependency_jars((List<String>)value);
- }
- break;
-
- case DEPENDENCY_ARTIFACTS:
- if (value == null) {
- unset_dependency_artifacts();
- } else {
- set_dependency_artifacts((List<String>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SPOUTS:
- return get_spouts();
-
- case BOLTS:
- return get_bolts();
-
- case STATE_SPOUTS:
- return get_state_spouts();
-
- case WORKER_HOOKS:
- return get_worker_hooks();
-
- case DEPENDENCY_JARS:
- return get_dependency_jars();
-
- case DEPENDENCY_ARTIFACTS:
- return get_dependency_artifacts();
-
- }
- 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 SPOUTS:
- return is_set_spouts();
- case BOLTS:
- return is_set_bolts();
- case STATE_SPOUTS:
- return is_set_state_spouts();
- case WORKER_HOOKS:
- return is_set_worker_hooks();
- case DEPENDENCY_JARS:
- return is_set_dependency_jars();
- case DEPENDENCY_ARTIFACTS:
- return is_set_dependency_artifacts();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof StormTopology)
- return this.equals((StormTopology)that);
- return false;
- }
-
- public boolean equals(StormTopology that) {
- if (that == null)
- return false;
-
- boolean this_present_spouts = true && this.is_set_spouts();
- boolean that_present_spouts = true && that.is_set_spouts();
- if (this_present_spouts || that_present_spouts) {
- if (!(this_present_spouts && that_present_spouts))
- return false;
- if (!this.spouts.equals(that.spouts))
- return false;
- }
-
- boolean this_present_bolts = true && this.is_set_bolts();
- boolean that_present_bolts = true && that.is_set_bolts();
- if (this_present_bolts || that_present_bolts) {
- if (!(this_present_bolts && that_present_bolts))
- return false;
- if (!this.bolts.equals(that.bolts))
- return false;
- }
-
- boolean this_present_state_spouts = true && this.is_set_state_spouts();
- boolean that_present_state_spouts = true && that.is_set_state_spouts();
- if (this_present_state_spouts || that_present_state_spouts) {
- if (!(this_present_state_spouts && that_present_state_spouts))
- return false;
- if (!this.state_spouts.equals(that.state_spouts))
- return false;
- }
-
- boolean this_present_worker_hooks = true && this.is_set_worker_hooks();
- boolean that_present_worker_hooks = true && that.is_set_worker_hooks();
- if (this_present_worker_hooks || that_present_worker_hooks) {
- if (!(this_present_worker_hooks && that_present_worker_hooks))
- return false;
- if (!this.worker_hooks.equals(that.worker_hooks))
- return false;
- }
-
- boolean this_present_dependency_jars = true && this.is_set_dependency_jars();
- boolean that_present_dependency_jars = true && that.is_set_dependency_jars();
- if (this_present_dependency_jars || that_present_dependency_jars) {
- if (!(this_present_dependency_jars && that_present_dependency_jars))
- return false;
- if (!this.dependency_jars.equals(that.dependency_jars))
- return false;
- }
-
- boolean this_present_dependency_artifacts = true && this.is_set_dependency_artifacts();
- boolean that_present_dependency_artifacts = true && that.is_set_dependency_artifacts();
- if (this_present_dependency_artifacts || that_present_dependency_artifacts) {
- if (!(this_present_dependency_artifacts && that_present_dependency_artifacts))
- return false;
- if (!this.dependency_artifacts.equals(that.dependency_artifacts))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_spouts = true && (is_set_spouts());
- list.add(present_spouts);
- if (present_spouts)
- list.add(spouts);
-
- boolean present_bolts = true && (is_set_bolts());
- list.add(present_bolts);
- if (present_bolts)
- list.add(bolts);
-
- boolean present_state_spouts = true && (is_set_state_spouts());
- list.add(present_state_spouts);
- if (present_state_spouts)
- list.add(state_spouts);
-
- boolean present_worker_hooks = true && (is_set_worker_hooks());
- list.add(present_worker_hooks);
- if (present_worker_hooks)
- list.add(worker_hooks);
-
- boolean present_dependency_jars = true && (is_set_dependency_jars());
- list.add(present_dependency_jars);
- if (present_dependency_jars)
- list.add(dependency_jars);
-
- boolean present_dependency_artifacts = true && (is_set_dependency_artifacts());
- list.add(present_dependency_artifacts);
- if (present_dependency_artifacts)
- list.add(dependency_artifacts);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(StormTopology other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_spouts()).compareTo(other.is_set_spouts());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_spouts()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spouts, other.spouts);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_bolts()).compareTo(other.is_set_bolts());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_bolts()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bolts, other.bolts);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_state_spouts()).compareTo(other.is_set_state_spouts());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_state_spouts()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state_spouts, other.state_spouts);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_worker_hooks()).compareTo(other.is_set_worker_hooks());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_worker_hooks()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.worker_hooks, other.worker_hooks);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_dependency_jars()).compareTo(other.is_set_dependency_jars());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_dependency_jars()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dependency_jars, other.dependency_jars);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_dependency_artifacts()).compareTo(other.is_set_dependency_artifacts());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_dependency_artifacts()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dependency_artifacts, other.dependency_artifacts);
- 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("StormTopology(");
- boolean first = true;
-
- sb.append("spouts:");
- if (this.spouts == null) {
- sb.append("null");
- } else {
- sb.append(this.spouts);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("bolts:");
- if (this.bolts == null) {
- sb.append("null");
- } else {
- sb.append(this.bolts);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("state_spouts:");
- if (this.state_spouts == null) {
- sb.append("null");
- } else {
- sb.append(this.state_spouts);
- }
- first = false;
- if (is_set_worker_hooks()) {
- if (!first) sb.append(", ");
- sb.append("worker_hooks:");
- if (this.worker_hooks == null) {
- sb.append("null");
- } else {
- org.apache.thrift.TBaseHelper.toString(this.worker_hooks, sb);
- }
- first = false;
- }
- if (is_set_dependency_jars()) {
- if (!first) sb.append(", ");
- sb.append("dependency_jars:");
- if (this.dependency_jars == null) {
- sb.append("null");
- } else {
- sb.append(this.dependency_jars);
- }
- first = false;
- }
- if (is_set_dependency_artifacts()) {
- if (!first) sb.append(", ");
- sb.append("dependency_artifacts:");
- if (this.dependency_artifacts == null) {
- sb.append("null");
- } else {
- sb.append(this.dependency_artifacts);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_spouts()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'spouts' is unset! Struct:" + toString());
- }
-
- if (!is_set_bolts()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'bolts' is unset! Struct:" + toString());
- }
-
- if (!is_set_state_spouts()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'state_spouts' 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 StormTopologyStandardSchemeFactory implements SchemeFactory {
- public StormTopologyStandardScheme getScheme() {
- return new StormTopologyStandardScheme();
- }
- }
-
- private static class StormTopologyStandardScheme extends StandardScheme<StormTopology> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, StormTopology 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: // SPOUTS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map44 = iprot.readMapBegin();
- struct.spouts = new HashMap<String,SpoutSpec>(2*_map44.size);
- String _key45;
- SpoutSpec _val46;
- for (int _i47 = 0; _i47 < _map44.size; ++_i47)
- {
- _key45 = iprot.readString();
- _val46 = new SpoutSpec();
- _val46.read(iprot);
- struct.spouts.put(_key45, _val46);
- }
- iprot.readMapEnd();
- }
- struct.set_spouts_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // BOLTS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map48 = iprot.readMapBegin();
- struct.bolts = new HashMap<String,Bolt>(2*_map48.size);
- String _key49;
- Bolt _val50;
- for (int _i51 = 0; _i51 < _map48.size; ++_i51)
- {
- _key49 = iprot.readString();
- _val50 = new Bolt();
- _val50.read(iprot);
- struct.bolts.put(_key49, _val50);
- }
- iprot.readMapEnd();
- }
- struct.set_bolts_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // STATE_SPOUTS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map52 = iprot.readMapBegin();
- struct.state_spouts = new HashMap<String,StateSpoutSpec>(2*_map52.size);
- String _key53;
- StateSpoutSpec _val54;
- for (int _i55 = 0; _i55 < _map52.size; ++_i55)
- {
- _key53 = iprot.readString();
- _val54 = new StateSpoutSpec();
- _val54.read(iprot);
- struct.state_spouts.put(_key53, _val54);
- }
- iprot.readMapEnd();
- }
- struct.set_state_spouts_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // WORKER_HOOKS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list56 = iprot.readListBegin();
- struct.worker_hooks = new ArrayList<ByteBuffer>(_list56.size);
- ByteBuffer _elem57;
- for (int _i58 = 0; _i58 < _list56.size; ++_i58)
- {
- _elem57 = iprot.readBinary();
- struct.worker_hooks.add(_elem57);
- }
- iprot.readListEnd();
- }
- struct.set_worker_hooks_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // DEPENDENCY_JARS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list59 = iprot.readListBegin();
- struct.dependency_jars = new ArrayList<String>(_list59.size);
- String _elem60;
- for (int _i61 = 0; _i61 < _list59.size; ++_i61)
- {
- _elem60 = iprot.readString();
- struct.dependency_jars.add(_elem60);
- }
- iprot.readListEnd();
- }
- struct.set_dependency_jars_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // DEPENDENCY_ARTIFACTS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list62 = iprot.readListBegin();
- struct.dependency_artifacts = new ArrayList<String>(_list62.size);
- String _elem63;
- for (int _i64 = 0; _i64 < _list62.size; ++_i64)
- {
- _elem63 = iprot.readString();
- struct.dependency_artifacts.add(_elem63);
- }
- iprot.readListEnd();
- }
- struct.set_dependency_artifacts_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, StormTopology struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.spouts != null) {
- oprot.writeFieldBegin(SPOUTS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.spouts.size()));
- for (Map.Entry<String, SpoutSpec> _iter65 : struct.spouts.entrySet())
- {
- oprot.writeString(_iter65.getKey());
- _iter65.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.bolts != null) {
- oprot.writeFieldBegin(BOLTS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.bolts.size()));
- for (Map.Entry<String, Bolt> _iter66 : struct.bolts.entrySet())
- {
- oprot.writeString(_iter66.getKey());
- _iter66.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.state_spouts != null) {
- oprot.writeFieldBegin(STATE_SPOUTS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.state_spouts.size()));
- for (Map.Entry<String, StateSpoutSpec> _iter67 : struct.state_spouts.entrySet())
- {
- oprot.writeString(_iter67.getKey());
- _iter67.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.worker_hooks != null) {
- if (struct.is_set_worker_hooks()) {
- oprot.writeFieldBegin(WORKER_HOOKS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.worker_hooks.size()));
- for (ByteBuffer _iter68 : struct.worker_hooks)
- {
- oprot.writeBinary(_iter68);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.dependency_jars != null) {
- if (struct.is_set_dependency_jars()) {
- oprot.writeFieldBegin(DEPENDENCY_JARS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.dependency_jars.size()));
- for (String _iter69 : struct.dependency_jars)
- {
- oprot.writeString(_iter69);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.dependency_artifacts != null) {
- if (struct.is_set_dependency_artifacts()) {
- oprot.writeFieldBegin(DEPENDENCY_ARTIFACTS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.dependency_artifacts.size()));
- for (String _iter70 : struct.dependency_artifacts)
- {
- oprot.writeString(_iter70);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class StormTopologyTupleSchemeFactory implements SchemeFactory {
- public StormTopologyTupleScheme getScheme() {
- return new StormTopologyTupleScheme();
- }
- }
-
- private static class StormTopologyTupleScheme extends TupleScheme<StormTopology> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, StormTopology struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.spouts.size());
- for (Map.Entry<String, SpoutSpec> _iter71 : struct.spouts.entrySet())
- {
- oprot.writeString(_iter71.getKey());
- _iter71.getValue().write(oprot);
- }
- }
- {
- oprot.writeI32(struct.bolts.size());
- for (Map.Entry<String, Bolt> _iter72 : struct.bolts.entrySet())
- {
- oprot.writeString(_iter72.getKey());
- _iter72.getValue().write(oprot);
- }
- }
- {
- oprot.writeI32(struct.state_spouts.size());
- for (Map.Entry<String, StateSpoutSpec> _iter73 : struct.state_spouts.entrySet())
- {
- oprot.writeString(_iter73.getKey());
- _iter73.getValue().write(oprot);
- }
- }
- BitSet optionals = new BitSet();
- if (struct.is_set_worker_hooks()) {
- optionals.set(0);
- }
- if (struct.is_set_dependency_jars()) {
- optionals.set(1);
- }
- if (struct.is_set_dependency_artifacts()) {
- optionals.set(2);
- }
- oprot.writeBitSet(optionals, 3);
- if (struct.is_set_worker_hooks()) {
- {
- oprot.writeI32(struct.worker_hooks.size());
- for (ByteBuffer _iter74 : struct.worker_hooks)
- {
- oprot.writeBinary(_iter74);
- }
- }
- }
- if (struct.is_set_dependency_jars()) {
- {
- oprot.writeI32(struct.dependency_jars.size());
- for (String _iter75 : struct.dependency_jars)
- {
- oprot.writeString(_iter75);
- }
- }
- }
- if (struct.is_set_dependency_artifacts()) {
- {
- oprot.writeI32(struct.dependency_artifacts.size());
- for (String _iter76 : struct.dependency_artifacts)
- {
- oprot.writeString(_iter76);
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, StormTopology struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TMap _map77 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.spouts = new HashMap<String,SpoutSpec>(2*_map77.size);
- String _key78;
- SpoutSpec _val79;
- for (int _i80 = 0; _i80 < _map77.size; ++_i80)
- {
- _key78 = iprot.readString();
- _val79 = new SpoutSpec();
- _val79.read(iprot);
- struct.spouts.put(_key78, _val79);
- }
- }
- struct.set_spouts_isSet(true);
- {
- org.apache.thrift.protocol.TMap _map81 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.bolts = new HashMap<String,Bolt>(2*_map81.size);
- String _key82;
- Bolt _val83;
- for (int _i84 = 0; _i84 < _map81.size; ++_i84)
- {
- _key82 = iprot.readString();
- _val83 = new Bolt();
- _val83.read(iprot);
- struct.bolts.put(_key82, _val83);
- }
- }
- struct.set_bolts_isSet(true);
- {
- org.apache.thrift.protocol.TMap _map85 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.state_spouts = new HashMap<String,StateSpoutSpec>(2*_map85.size);
- String _key86;
- StateSpoutSpec _val87;
- for (int _i88 = 0; _i88 < _map85.size; ++_i88)
- {
- _key86 = iprot.readString();
- _val87 = new StateSpoutSpec();
- _val87.read(iprot);
- struct.state_spouts.put(_key86, _val87);
- }
- }
- struct.set_state_spouts_isSet(true);
- BitSet incoming = iprot.readBitSet(3);
- if (incoming.get(0)) {
- {
- org.apache.thrift.protocol.TList _list89 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.worker_hooks = new ArrayList<ByteBuffer>(_list89.size);
- ByteBuffer _elem90;
- for (int _i91 = 0; _i91 < _list89.size; ++_i91)
- {
- _elem90 = iprot.readBinary();
- struct.worker_hooks.add(_elem90);
- }
- }
- struct.set_worker_hooks_isSet(true);
- }
- if (incoming.get(1)) {
- {
- org.apache.thrift.protocol.TList _list92 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.dependency_jars = new ArrayList<String>(_list92.size);
- String _elem93;
- for (int _i94 = 0; _i94 < _list92.size; ++_i94)
- {
- _elem93 = iprot.readString();
- struct.dependency_jars.add(_elem93);
- }
- }
- struct.set_dependency_jars_isSet(true);
- }
- if (incoming.get(2)) {
- {
- org.apache.thrift.protocol.TList _list95 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.dependency_artifacts = new ArrayList<String>(_list95.size);
- String _elem96;
- for (int _i97 = 0; _i97 < _list95.size; ++_i97)
- {
- _elem96 = iprot.readString();
- struct.dependency_artifacts.add(_elem96);
- }
- }
- struct.set_dependency_artifacts_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/StreamInfo.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/StreamInfo.java b/storm-core/src/jvm/backtype/storm/generated/StreamInfo.java
deleted file mode 100644
index bb78631..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/StreamInfo.java
+++ /dev/null
@@ -1,554 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class StreamInfo implements org.apache.thrift.TBase<StreamInfo, StreamInfo._Fields>, java.io.Serializable, Cloneable, Comparable<StreamInfo> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StreamInfo");
-
- private static final org.apache.thrift.protocol.TField OUTPUT_FIELDS_FIELD_DESC = new org.apache.thrift.protocol.TField("output_fields", org.apache.thrift.protocol.TType.LIST, (short)1);
- private static final org.apache.thrift.protocol.TField DIRECT_FIELD_DESC = new org.apache.thrift.protocol.TField("direct", org.apache.thrift.protocol.TType.BOOL, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new StreamInfoStandardSchemeFactory());
- schemes.put(TupleScheme.class, new StreamInfoTupleSchemeFactory());
- }
-
- private List<String> output_fields; // required
- private boolean direct; // 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 {
- OUTPUT_FIELDS((short)1, "output_fields"),
- DIRECT((short)2, "direct");
-
- 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: // OUTPUT_FIELDS
- return OUTPUT_FIELDS;
- case 2: // DIRECT
- return DIRECT;
- 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 __DIRECT_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- 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.OUTPUT_FIELDS, new org.apache.thrift.meta_data.FieldMetaData("output_fields", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- tmpMap.put(_Fields.DIRECT, new org.apache.thrift.meta_data.FieldMetaData("direct", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StreamInfo.class, metaDataMap);
- }
-
- public StreamInfo() {
- }
-
- public StreamInfo(
- List<String> output_fields,
- boolean direct)
- {
- this();
- this.output_fields = output_fields;
- this.direct = direct;
- set_direct_isSet(true);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public StreamInfo(StreamInfo other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_output_fields()) {
- List<String> __this__output_fields = new ArrayList<String>(other.output_fields);
- this.output_fields = __this__output_fields;
- }
- this.direct = other.direct;
- }
-
- public StreamInfo deepCopy() {
- return new StreamInfo(this);
- }
-
- @Override
- public void clear() {
- this.output_fields = null;
- set_direct_isSet(false);
- this.direct = false;
- }
-
- public int get_output_fields_size() {
- return (this.output_fields == null) ? 0 : this.output_fields.size();
- }
-
- public java.util.Iterator<String> get_output_fields_iterator() {
- return (this.output_fields == null) ? null : this.output_fields.iterator();
- }
-
- public void add_to_output_fields(String elem) {
- if (this.output_fields == null) {
- this.output_fields = new ArrayList<String>();
- }
- this.output_fields.add(elem);
- }
-
- public List<String> get_output_fields() {
- return this.output_fields;
- }
-
- public void set_output_fields(List<String> output_fields) {
- this.output_fields = output_fields;
- }
-
- public void unset_output_fields() {
- this.output_fields = null;
- }
-
- /** Returns true if field output_fields is set (has been assigned a value) and false otherwise */
- public boolean is_set_output_fields() {
- return this.output_fields != null;
- }
-
- public void set_output_fields_isSet(boolean value) {
- if (!value) {
- this.output_fields = null;
- }
- }
-
- public boolean is_direct() {
- return this.direct;
- }
-
- public void set_direct(boolean direct) {
- this.direct = direct;
- set_direct_isSet(true);
- }
-
- public void unset_direct() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DIRECT_ISSET_ID);
- }
-
- /** Returns true if field direct is set (has been assigned a value) and false otherwise */
- public boolean is_set_direct() {
- return EncodingUtils.testBit(__isset_bitfield, __DIRECT_ISSET_ID);
- }
-
- public void set_direct_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DIRECT_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case OUTPUT_FIELDS:
- if (value == null) {
- unset_output_fields();
- } else {
- set_output_fields((List<String>)value);
- }
- break;
-
- case DIRECT:
- if (value == null) {
- unset_direct();
- } else {
- set_direct((Boolean)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case OUTPUT_FIELDS:
- return get_output_fields();
-
- case DIRECT:
- return is_direct();
-
- }
- 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 OUTPUT_FIELDS:
- return is_set_output_fields();
- case DIRECT:
- return is_set_direct();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof StreamInfo)
- return this.equals((StreamInfo)that);
- return false;
- }
-
- public boolean equals(StreamInfo that) {
- if (that == null)
- return false;
-
- boolean this_present_output_fields = true && this.is_set_output_fields();
- boolean that_present_output_fields = true && that.is_set_output_fields();
- if (this_present_output_fields || that_present_output_fields) {
- if (!(this_present_output_fields && that_present_output_fields))
- return false;
- if (!this.output_fields.equals(that.output_fields))
- return false;
- }
-
- boolean this_present_direct = true;
- boolean that_present_direct = true;
- if (this_present_direct || that_present_direct) {
- if (!(this_present_direct && that_present_direct))
- return false;
- if (this.direct != that.direct)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_output_fields = true && (is_set_output_fields());
- list.add(present_output_fields);
- if (present_output_fields)
- list.add(output_fields);
-
- boolean present_direct = true;
- list.add(present_direct);
- if (present_direct)
- list.add(direct);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(StreamInfo other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_output_fields()).compareTo(other.is_set_output_fields());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_output_fields()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.output_fields, other.output_fields);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_direct()).compareTo(other.is_set_direct());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_direct()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.direct, other.direct);
- 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("StreamInfo(");
- boolean first = true;
-
- sb.append("output_fields:");
- if (this.output_fields == null) {
- sb.append("null");
- } else {
- sb.append(this.output_fields);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("direct:");
- sb.append(this.direct);
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_output_fields()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'output_fields' is unset! Struct:" + toString());
- }
-
- if (!is_set_direct()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'direct' 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 StreamInfoStandardSchemeFactory implements SchemeFactory {
- public StreamInfoStandardScheme getScheme() {
- return new StreamInfoStandardScheme();
- }
- }
-
- private static class StreamInfoStandardScheme extends StandardScheme<StreamInfo> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, StreamInfo 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: // OUTPUT_FIELDS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
- struct.output_fields = new ArrayList<String>(_list16.size);
- String _elem17;
- for (int _i18 = 0; _i18 < _list16.size; ++_i18)
- {
- _elem17 = iprot.readString();
- struct.output_fields.add(_elem17);
- }
- iprot.readListEnd();
- }
- struct.set_output_fields_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // DIRECT
- if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
- struct.direct = iprot.readBool();
- struct.set_direct_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, StreamInfo struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.output_fields != null) {
- oprot.writeFieldBegin(OUTPUT_FIELDS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.output_fields.size()));
- for (String _iter19 : struct.output_fields)
- {
- oprot.writeString(_iter19);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(DIRECT_FIELD_DESC);
- oprot.writeBool(struct.direct);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class StreamInfoTupleSchemeFactory implements SchemeFactory {
- public StreamInfoTupleScheme getScheme() {
- return new StreamInfoTupleScheme();
- }
- }
-
- private static class StreamInfoTupleScheme extends TupleScheme<StreamInfo> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, StreamInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.output_fields.size());
- for (String _iter20 : struct.output_fields)
- {
- oprot.writeString(_iter20);
- }
- }
- oprot.writeBool(struct.direct);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, StreamInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.output_fields = new ArrayList<String>(_list21.size);
- String _elem22;
- for (int _i23 = 0; _i23 < _list21.size; ++_i23)
- {
- _elem22 = iprot.readString();
- struct.output_fields.add(_elem22);
- }
- }
- struct.set_output_fields_isSet(true);
- struct.direct = iprot.readBool();
- struct.set_direct_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SubmitOptions.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/SubmitOptions.java b/storm-core/src/jvm/backtype/storm/generated/SubmitOptions.java
deleted file mode 100644
index 2287244..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/SubmitOptions.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class SubmitOptions implements org.apache.thrift.TBase<SubmitOptions, SubmitOptions._Fields>, java.io.Serializable, Cloneable, Comparable<SubmitOptions> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SubmitOptions");
-
- private static final org.apache.thrift.protocol.TField INITIAL_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("initial_status", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new SubmitOptionsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new SubmitOptionsTupleSchemeFactory());
- }
-
- private TopologyInitialStatus initial_status; // required
- private Credentials creds; // 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 TopologyInitialStatus
- */
- INITIAL_STATUS((short)1, "initial_status"),
- CREDS((short)2, "creds");
-
- 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: // INITIAL_STATUS
- return INITIAL_STATUS;
- case 2: // CREDS
- return CREDS;
- 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.CREDS};
- 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.INITIAL_STATUS, new org.apache.thrift.meta_data.FieldMetaData("initial_status", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TopologyInitialStatus.class)));
- tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Credentials.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SubmitOptions.class, metaDataMap);
- }
-
- public SubmitOptions() {
- }
-
- public SubmitOptions(
- TopologyInitialStatus initial_status)
- {
- this();
- this.initial_status = initial_status;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public SubmitOptions(SubmitOptions other) {
- if (other.is_set_initial_status()) {
- this.initial_status = other.initial_status;
- }
- if (other.is_set_creds()) {
- this.creds = new Credentials(other.creds);
- }
- }
-
- public SubmitOptions deepCopy() {
- return new SubmitOptions(this);
- }
-
- @Override
- public void clear() {
- this.initial_status = null;
- this.creds = null;
- }
-
- /**
- *
- * @see TopologyInitialStatus
- */
- public TopologyInitialStatus get_initial_status() {
- return this.initial_status;
- }
-
- /**
- *
- * @see TopologyInitialStatus
- */
- public void set_initial_status(TopologyInitialStatus initial_status) {
- this.initial_status = initial_status;
- }
-
- public void unset_initial_status() {
- this.initial_status = null;
- }
-
- /** Returns true if field initial_status is set (has been assigned a value) and false otherwise */
- public boolean is_set_initial_status() {
- return this.initial_status != null;
- }
-
- public void set_initial_status_isSet(boolean value) {
- if (!value) {
- this.initial_status = null;
- }
- }
-
- public Credentials get_creds() {
- return this.creds;
- }
-
- public void set_creds(Credentials creds) {
- this.creds = creds;
- }
-
- public void unset_creds() {
- this.creds = null;
- }
-
- /** Returns true if field creds is set (has been assigned a value) and false otherwise */
- public boolean is_set_creds() {
- return this.creds != null;
- }
-
- public void set_creds_isSet(boolean value) {
- if (!value) {
- this.creds = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case INITIAL_STATUS:
- if (value == null) {
- unset_initial_status();
- } else {
- set_initial_status((TopologyInitialStatus)value);
- }
- break;
-
- case CREDS:
- if (value == null) {
- unset_creds();
- } else {
- set_creds((Credentials)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case INITIAL_STATUS:
- return get_initial_status();
-
- case CREDS:
- return get_creds();
-
- }
- 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 INITIAL_STATUS:
- return is_set_initial_status();
- case CREDS:
- return is_set_creds();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof SubmitOptions)
- return this.equals((SubmitOptions)that);
- return false;
- }
-
- public boolean equals(SubmitOptions that) {
- if (that == null)
- return false;
-
- boolean this_present_initial_status = true && this.is_set_initial_status();
- boolean that_present_initial_status = true && that.is_set_initial_status();
- if (this_present_initial_status || that_present_initial_status) {
- if (!(this_present_initial_status && that_present_initial_status))
- return false;
- if (!this.initial_status.equals(that.initial_status))
- return false;
- }
-
- boolean this_present_creds = true && this.is_set_creds();
- boolean that_present_creds = true && that.is_set_creds();
- if (this_present_creds || that_present_creds) {
- if (!(this_present_creds && that_present_creds))
- return false;
- if (!this.creds.equals(that.creds))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_initial_status = true && (is_set_initial_status());
- list.add(present_initial_status);
- if (present_initial_status)
- list.add(initial_status.getValue());
-
- boolean present_creds = true && (is_set_creds());
- list.add(present_creds);
- if (present_creds)
- list.add(creds);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(SubmitOptions other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_initial_status()).compareTo(other.is_set_initial_status());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_initial_status()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.initial_status, other.initial_status);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_creds()).compareTo(other.is_set_creds());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_creds()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creds, other.creds);
- 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("SubmitOptions(");
- boolean first = true;
-
- sb.append("initial_status:");
- if (this.initial_status == null) {
- sb.append("null");
- } else {
- sb.append(this.initial_status);
- }
- first = false;
- if (is_set_creds()) {
- if (!first) sb.append(", ");
- sb.append("creds:");
- if (this.creds == null) {
- sb.append("null");
- } else {
- sb.append(this.creds);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_initial_status()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'initial_status' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- if (creds != null) {
- creds.validate();
- }
- }
-
- 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 SubmitOptionsStandardSchemeFactory implements SchemeFactory {
- public SubmitOptionsStandardScheme getScheme() {
- return new SubmitOptionsStandardScheme();
- }
- }
-
- private static class SubmitOptionsStandardScheme extends StandardScheme<SubmitOptions> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, SubmitOptions 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: // INITIAL_STATUS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.initial_status = org.apache.storm.generated.TopologyInitialStatus.findByValue(iprot.readI32());
- struct.set_initial_status_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // CREDS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.creds = new Credentials();
- struct.creds.read(iprot);
- struct.set_creds_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, SubmitOptions struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.initial_status != null) {
- oprot.writeFieldBegin(INITIAL_STATUS_FIELD_DESC);
- oprot.writeI32(struct.initial_status.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.creds != null) {
- if (struct.is_set_creds()) {
- oprot.writeFieldBegin(CREDS_FIELD_DESC);
- struct.creds.write(oprot);
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class SubmitOptionsTupleSchemeFactory implements SchemeFactory {
- public SubmitOptionsTupleScheme getScheme() {
- return new SubmitOptionsTupleScheme();
- }
- }
-
- private static class SubmitOptionsTupleScheme extends TupleScheme<SubmitOptions> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, SubmitOptions struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeI32(struct.initial_status.getValue());
- BitSet optionals = new BitSet();
- if (struct.is_set_creds()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_creds()) {
- struct.creds.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, SubmitOptions struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.initial_status = org.apache.storm.generated.TopologyInitialStatus.findByValue(iprot.readI32());
- struct.set_initial_status_isSet(true);
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.creds = new Credentials();
- struct.creds.read(iprot);
- struct.set_creds_isSet(true);
- }
- }
- }
-
-}
-
[39/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/Config.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/Config.java b/storm-core/src/jvm/backtype/storm/Config.java
deleted file mode 100644
index 80a2a5d..0000000
--- a/storm-core/src/jvm/backtype/storm/Config.java
+++ /dev/null
@@ -1,2473 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.storm;
-
-import org.apache.storm.scheduler.resource.strategies.eviction.IEvictionStrategy;
-import org.apache.storm.scheduler.resource.strategies.priority.ISchedulingPriorityStrategy;
-import org.apache.storm.scheduler.resource.strategies.scheduling.IStrategy;
-import org.apache.storm.serialization.IKryoDecorator;
-import org.apache.storm.serialization.IKryoFactory;
-import org.apache.storm.validation.ConfigValidationAnnotations.*;
-import org.apache.storm.validation.ConfigValidation.*;
-import com.esotericsoftware.kryo.Serializer;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Topology configs are specified as a plain old map. This class provides a
- * convenient way to create a topology config map by providing setter methods for
- * all the configs that can be set. It also makes it easier to do things like add
- * serializations.
- *
- * This class also provides constants for all the configurations possible on
- * a Storm cluster and Storm topology. Each constant is paired with an annotation
- * that defines the validity criterion of the corresponding field. Default
- * values for these configs can be found in defaults.yaml.
- *
- * Note that you may put other configurations in any of the configs. Storm
- * will ignore anything it doesn't recognize, but your topologies are free to make
- * use of them by reading them in the prepare method of Bolts or the open method of
- * Spouts.
- */
-public class Config extends HashMap<String, Object> {
-
- //DO NOT CHANGE UNLESS WE ADD IN STATE NOT STORED IN THE PARENT CLASS
- private static final long serialVersionUID = -1550278723792864455L;
-
- /**
- * This is part of a temporary workaround to a ZK bug, it is the 'scheme:acl' for
- * the user Nimbus and Supervisors use to authenticate with ZK.
- */
- @isString
- public static final String STORM_ZOOKEEPER_SUPERACL = "storm.zookeeper.superACL";
-
- /**
- * The transporter for communication among Storm tasks
- */
- @isString
- public static final String STORM_MESSAGING_TRANSPORT = "storm.messaging.transport";
-
- /**
- * Netty based messaging: The buffer size for send/recv buffer
- */
- @isInteger
- @isPositiveNumber
- public static final String STORM_MESSAGING_NETTY_BUFFER_SIZE = "storm.messaging.netty.buffer_size";
-
- /**
- * Netty based messaging: Sets the backlog value to specify when the channel binds to a local address
- */
- @isInteger
- @isPositiveNumber
- public static final String STORM_MESSAGING_NETTY_SOCKET_BACKLOG = "storm.messaging.netty.socket.backlog";
-
- /**
- * Netty based messaging: The max # of retries that a peer will perform when a remote is not accessible
- *@deprecated "Since netty clients should never stop reconnecting - this does not make sense anymore.
- */
- @Deprecated
- @isInteger
- public static final String STORM_MESSAGING_NETTY_MAX_RETRIES = "storm.messaging.netty.max_retries";
-
- /**
- * Netty based messaging: The min # of milliseconds that a peer will wait.
- */
- @isInteger
- @isPositiveNumber(includeZero = true)
- public static final String STORM_MESSAGING_NETTY_MIN_SLEEP_MS = "storm.messaging.netty.min_wait_ms";
-
- /**
- * Netty based messaging: The max # of milliseconds that a peer will wait.
- */
- @isInteger
- @isPositiveNumber(includeZero = true)
- public static final String STORM_MESSAGING_NETTY_MAX_SLEEP_MS = "storm.messaging.netty.max_wait_ms";
-
- /**
- * Netty based messaging: The # of worker threads for the server.
- */
- @isInteger
- @isPositiveNumber(includeZero = true)
- public static final String STORM_MESSAGING_NETTY_SERVER_WORKER_THREADS = "storm.messaging.netty.server_worker_threads";
-
- /**
- * Netty based messaging: The # of worker threads for the client.
- */
- @isInteger
- public static final String STORM_MESSAGING_NETTY_CLIENT_WORKER_THREADS = "storm.messaging.netty.client_worker_threads";
-
- /**
- * If the Netty messaging layer is busy, the Netty client will try to batch message as more as possible up to the size of STORM_NETTY_MESSAGE_BATCH_SIZE bytes
- */
- @isInteger
- public static final String STORM_NETTY_MESSAGE_BATCH_SIZE = "storm.messaging.netty.transfer.batch.size";
-
- /**
- * We check with this interval that whether the Netty channel is writable and try to write pending messages
- */
- @isInteger
- public static final String STORM_NETTY_FLUSH_CHECK_INTERVAL_MS = "storm.messaging.netty.flush.check.interval.ms";
-
- /**
- * Netty based messaging: Is authentication required for Netty messaging from client worker process to server worker process.
- */
- @isBoolean
- public static final String STORM_MESSAGING_NETTY_AUTHENTICATION = "storm.messaging.netty.authentication";
-
- /**
- * The delegate for serializing metadata, should be used for serialized objects stored in zookeeper and on disk.
- * This is NOT used for compressing serialized tuples sent between topologies.
- */
- @isString
- public static final String STORM_META_SERIALIZATION_DELEGATE = "storm.meta.serialization.delegate";
-
- /**
- * A list of daemon metrics reporter plugin class names.
- * These plugins must implement {@link org.apache.storm.daemon.metrics.reporters.PreparableReporter} interface.
- */
- @isStringList
- public static final String STORM_DAEMON_METRICS_REPORTER_PLUGINS = "storm.daemon.metrics.reporter.plugins";
-
- /**
- * A specify Locale for daemon metrics reporter plugin.
- * Use the specified IETF BCP 47 language tag string for a Locale.
- */
- @isString
- public static final String STORM_DAEMON_METRICS_REPORTER_PLUGIN_LOCALE = "storm.daemon.metrics.reporter.plugin.locale";
-
- /**
- * A specify domain for daemon metrics reporter plugin to limit reporting to specific domain.
- */
- @isString
- public static final String STORM_DAEMON_METRICS_REPORTER_PLUGIN_DOMAIN = "storm.daemon.metrics.reporter.plugin.domain";
-
- /**
- * A specify rate-unit in TimeUnit to specify reporting frequency for daemon metrics reporter plugin.
- */
- @isString
- public static final String STORM_DAEMON_METRICS_REPORTER_PLUGIN_RATE_UNIT = "storm.daemon.metrics.reporter.plugin.rate.unit";
-
- /**
- * A specify duration-unit in TimeUnit to specify reporting window for daemon metrics reporter plugin.
- */
- @isString
- public static final String STORM_DAEMON_METRICS_REPORTER_PLUGIN_DURATION_UNIT = "storm.daemon.metrics.reporter.plugin.duration.unit";
-
-
- /**
- * A specify csv reporter directory for CvsPreparableReporter daemon metrics reporter.
- */
- @isString
- public static final String STORM_DAEMON_METRICS_REPORTER_CSV_LOG_DIR = "storm.daemon.metrics.reporter.csv.log.dir";
-
- /**
- * A list of hosts of ZooKeeper servers used to manage the cluster.
- */
- @isStringList
- public static final String STORM_ZOOKEEPER_SERVERS = "storm.zookeeper.servers";
-
- /**
- * The port Storm will use to connect to each of the ZooKeeper servers.
- */
- @isInteger
- @isPositiveNumber
- public static final String STORM_ZOOKEEPER_PORT = "storm.zookeeper.port";
-
- /**
- * A list of hosts of Exhibitor servers used to discover/maintain connection to ZooKeeper cluster.
- * Any configured ZooKeeper servers will be used for the curator/exhibitor backup connection string.
- */
- @isStringList
- public static final String STORM_EXHIBITOR_SERVERS = "storm.exhibitor.servers";
-
- /**
- * The port Storm will use to connect to each of the exhibitor servers.
- */
- @isInteger
- @isPositiveNumber
- public static final String STORM_EXHIBITOR_PORT = "storm.exhibitor.port";
-
- /**
- * A directory on the local filesystem used by Storm for any local
- * filesystem usage it needs. The directory must exist and the Storm daemons must
- * have permission to read/write from this location.
- */
- @isString
- public static final String STORM_LOCAL_DIR = "storm.local.dir";
-
- /**
- * A directory that holds configuration files for log4j2.
- * It can be either a relative or an absolute directory.
- * If relative, it is relative to the storm's home directory.
- */
- @isString
- public static final String STORM_LOG4J2_CONF_DIR = "storm.log4j2.conf.dir";
-
- /**
- * A global task scheduler used to assign topologies's tasks to supervisors' workers.
- *
- * If this is not set, a default system scheduler will be used.
- */
- @isString
- public static final String STORM_SCHEDULER = "storm.scheduler";
-
- /**
- * Whether we want to display all the resource capacity and scheduled usage on the UI page.
- * We suggest to have this variable set if you are using any kind of resource-related scheduler.
- *
- * If this is not set, we will not display resource capacity and usage on the UI.
- */
- @isBoolean
- public static final String SCHEDULER_DISPLAY_RESOURCE = "scheduler.display.resource";
-
- /**
- * The mode this Storm cluster is running in. Either "distributed" or "local".
- */
- @isString
- public static final String STORM_CLUSTER_MODE = "storm.cluster.mode";
-
- /**
- * What Network Topography detection classes should we use.
- * Given a list of supervisor hostnames (or IP addresses), this class would return a list of
- * rack names that correspond to the supervisors. This information is stored in Cluster.java, and
- * is used in the resource aware scheduler.
- */
- @NotNull
- @isImplementationOfClass(implementsClass = org.apache.storm.networktopography.DNSToSwitchMapping.class)
- public static final String STORM_NETWORK_TOPOGRAPHY_PLUGIN = "storm.network.topography.plugin";
-
- /**
- * The hostname the supervisors/workers should report to nimbus. If unset, Storm will
- * get the hostname to report by calling <code>InetAddress.getLocalHost().getCanonicalHostName()</code>.
- *
- * You should set this config when you don't have a DNS which supervisors/workers
- * can utilize to find each other based on hostname got from calls to
- * <code>InetAddress.getLocalHost().getCanonicalHostName()</code>.
- */
- @isString
- public static final String STORM_LOCAL_HOSTNAME = "storm.local.hostname";
-
- /**
- * The plugin that will convert a principal to a local user.
- */
- @isString
- public static final String STORM_PRINCIPAL_TO_LOCAL_PLUGIN = "storm.principal.tolocal";
-
- /**
- * The plugin that will provide user groups service
- */
- @isString
- public static final String STORM_GROUP_MAPPING_SERVICE_PROVIDER_PLUGIN = "storm.group.mapping.service";
-
- /**
- * Max no.of seconds group mapping service will cache user groups
- */
- @isInteger
- public static final String STORM_GROUP_MAPPING_SERVICE_CACHE_DURATION_SECS = "storm.group.mapping.service.cache.duration.secs";
-
- /**
- * Initialization parameters for the group mapping service plugin.
- * Provides a way for a @link{STORM_GROUP_MAPPING_SERVICE_PROVIDER_PLUGIN}
- * implementation to access optional settings.
- */
- @isType(type=Map.class)
- public static final String STORM_GROUP_MAPPING_SERVICE_PARAMS = "storm.group.mapping.service.params";
-
- /**
- * The default transport plug-in for Thrift client/server communication
- */
- @isString
- public static final String STORM_THRIFT_TRANSPORT_PLUGIN = "storm.thrift.transport";
-
- /**
- * The serializer class for ListDelegate (tuple payload).
- * The default serializer will be ListDelegateSerializer
- */
- @isString
- public static final String TOPOLOGY_TUPLE_SERIALIZER = "topology.tuple.serializer";
-
- /**
- * Disable load aware grouping support.
- */
- @isBoolean
- @NotNull
- public static final String TOPOLOGY_DISABLE_LOADAWARE_MESSAGING = "topology.disable.loadaware.messaging";
-
- /**
- * Try to serialize all tuples, even for local transfers. This should only be used
- * for testing, as a sanity check that all of your tuples are setup properly.
- */
- @isBoolean
- public static final String TOPOLOGY_TESTING_ALWAYS_TRY_SERIALIZE = "topology.testing.always.try.serialize";
-
- /**
- * Whether or not to use ZeroMQ for messaging in local mode. If this is set
- * to false, then Storm will use a pure-Java messaging system. The purpose
- * of this flag is to make it easy to run Storm in local mode by eliminating
- * the need for native dependencies, which can be difficult to install.
- *
- * Defaults to false.
- */
- @isBoolean
- public static final String STORM_LOCAL_MODE_ZMQ = "storm.local.mode.zmq";
-
- /**
- * The root location at which Storm stores data in ZooKeeper.
- */
- @isString
- public static final String STORM_ZOOKEEPER_ROOT = "storm.zookeeper.root";
-
- /**
- * The session timeout for clients to ZooKeeper.
- */
- @isInteger
- public static final String STORM_ZOOKEEPER_SESSION_TIMEOUT = "storm.zookeeper.session.timeout";
-
- /**
- * The connection timeout for clients to ZooKeeper.
- */
- @isInteger
- public static final String STORM_ZOOKEEPER_CONNECTION_TIMEOUT = "storm.zookeeper.connection.timeout";
-
- /**
- * The number of times to retry a Zookeeper operation.
- */
- @isInteger
- public static final String STORM_ZOOKEEPER_RETRY_TIMES="storm.zookeeper.retry.times";
-
- /**
- * The interval between retries of a Zookeeper operation.
- */
- @isInteger
- public static final String STORM_ZOOKEEPER_RETRY_INTERVAL="storm.zookeeper.retry.interval";
-
- /**
- * The ceiling of the interval between retries of a Zookeeper operation.
- */
- @isInteger
- public static final String STORM_ZOOKEEPER_RETRY_INTERVAL_CEILING="storm.zookeeper.retry.intervalceiling.millis";
-
- /**
- * The cluster Zookeeper authentication scheme to use, e.g. "digest". Defaults to no authentication.
- */
- @isString
- public static final String STORM_ZOOKEEPER_AUTH_SCHEME="storm.zookeeper.auth.scheme";
-
- /**
- * A string representing the payload for cluster Zookeeper authentication.
- * It gets serialized using UTF-8 encoding during authentication.
- * Note that if this is set to something with a secret (as when using
- * digest authentication) then it should only be set in the
- * storm-cluster-auth.yaml file.
- * This file storm-cluster-auth.yaml should then be protected with
- * appropriate permissions that deny access from workers.
- */
- @isString
- public static final String STORM_ZOOKEEPER_AUTH_PAYLOAD="storm.zookeeper.auth.payload";
-
- /**
- * The topology Zookeeper authentication scheme to use, e.g. "digest". Defaults to no authentication.
- */
- @isString
- public static final String STORM_ZOOKEEPER_TOPOLOGY_AUTH_SCHEME="storm.zookeeper.topology.auth.scheme";
-
- /**
- * A string representing the payload for topology Zookeeper authentication. It gets serialized using UTF-8 encoding during authentication.
- */
- @isString
- public static final String STORM_ZOOKEEPER_TOPOLOGY_AUTH_PAYLOAD="storm.zookeeper.topology.auth.payload";
-
- /*
- * How often to poll Exhibitor cluster in millis.
- */
- @isString
- public static final String STORM_EXHIBITOR_URIPATH="storm.exhibitor.poll.uripath";
-
- /**
- * How often to poll Exhibitor cluster in millis.
- */
- @isInteger
- public static final String STORM_EXHIBITOR_POLL="storm.exhibitor.poll.millis";
-
- /**
- * The number of times to retry an Exhibitor operation.
- */
- @isInteger
- public static final String STORM_EXHIBITOR_RETRY_TIMES="storm.exhibitor.retry.times";
-
- /**
- * The interval between retries of an Exhibitor operation.
- */
- @isInteger
- public static final String STORM_EXHIBITOR_RETRY_INTERVAL="storm.exhibitor.retry.interval";
-
- /**
- * The ceiling of the interval between retries of an Exhibitor operation.
- */
- @isInteger
- public static final String STORM_EXHIBITOR_RETRY_INTERVAL_CEILING="storm.exhibitor.retry.intervalceiling.millis";
-
- /**
- * The id assigned to a running topology. The id is the storm name with a unique nonce appended.
- */
- @isString
- public static final String STORM_ID = "storm.id";
-
- /**
- * The workers-artifacts directory (where we place all workers' logs), can be either absolute or relative.
- * By default, ${storm.log.dir}/workers-artifacts is where worker logs go.
- * If the setting is a relative directory, it is relative to storm.log.dir.
- */
- @isString
- public static final String STORM_WORKERS_ARTIFACTS_DIR = "storm.workers.artifacts.dir";
-
- /**
- * The directory where storm's health scripts go.
- */
- @isString
- public static final String STORM_HEALTH_CHECK_DIR = "storm.health.check.dir";
-
- /**
- * The time to allow any given healthcheck script to run before it
- * is marked failed due to timeout
- */
- @isNumber
- public static final String STORM_HEALTH_CHECK_TIMEOUT_MS = "storm.health.check.timeout.ms";
-
- /**
- * The number of times to retry a Nimbus operation.
- */
- @isNumber
- public static final String STORM_NIMBUS_RETRY_TIMES="storm.nimbus.retry.times";
-
- /**
- * The starting interval between exponential backoff retries of a Nimbus operation.
- */
- @isNumber
- public static final String STORM_NIMBUS_RETRY_INTERVAL="storm.nimbus.retry.interval.millis";
-
- /**
- * The ceiling of the interval between retries of a client connect to Nimbus operation.
- */
- @isNumber
- public static final String STORM_NIMBUS_RETRY_INTERVAL_CEILING="storm.nimbus.retry.intervalceiling.millis";
-
- /**
- * The ClusterState factory that worker will use to create a ClusterState
- * to store state in. Defaults to ZooKeeper.
- */
- @isString
- public static final String STORM_CLUSTER_STATE_STORE = "storm.cluster.state.store";
-
- /**
- * The Nimbus transport plug-in for Thrift client/server communication
- */
- @isString
- public static final String NIMBUS_THRIFT_TRANSPORT_PLUGIN = "nimbus.thrift.transport";
-
- /**
- * The host that the master server is running on, added only for backward compatibility,
- * the usage deprecated in favor of nimbus.seeds config.
- */
- @Deprecated
- @isString
- public static final String NIMBUS_HOST = "nimbus.host";
-
- /**
- * List of seed nimbus hosts to use for leader nimbus discovery.
- */
- @isStringList
- public static final String NIMBUS_SEEDS = "nimbus.seeds";
-
- /**
- * Which port the Thrift interface of Nimbus should run on. Clients should
- * connect to this port to upload jars and submit topologies.
- */
- @isInteger
- @isPositiveNumber
- public static final String NIMBUS_THRIFT_PORT = "nimbus.thrift.port";
-
- /**
- * The number of threads that should be used by the nimbus thrift server.
- */
- @isInteger
- @isPositiveNumber
- public static final String NIMBUS_THRIFT_THREADS = "nimbus.thrift.threads";
-
- /**
- * A list of users that are cluster admins and can run any command. To use this set
- * nimbus.authorizer to org.apache.storm.security.auth.authorizer.SimpleACLAuthorizer
- */
- @isStringList
- public static final String NIMBUS_ADMINS = "nimbus.admins";
-
- /**
- * A list of users that are the only ones allowed to run user operation on storm cluster.
- * To use this set nimbus.authorizer to org.apache.storm.security.auth.authorizer.SimpleACLAuthorizer
- */
- @isStringList
- public static final String NIMBUS_USERS = "nimbus.users";
-
- /**
- * A list of groups , users belong to these groups are the only ones allowed to run user operation on storm cluster.
- * To use this set nimbus.authorizer to org.apache.storm.security.auth.authorizer.SimpleACLAuthorizer
- */
- @isStringList
- public static final String NIMBUS_GROUPS = "nimbus.groups";
-
- /**
- * A list of users that run the supervisors and should be authorized to interact with
- * nimbus as a supervisor would. To use this set
- * nimbus.authorizer to org.apache.storm.security.auth.authorizer.SimpleACLAuthorizer
- */
- @isStringList
- public static final String NIMBUS_SUPERVISOR_USERS = "nimbus.supervisor.users";
-
- /**
- * This is the user that the Nimbus daemon process is running as. May be used when security
- * is enabled to authorize actions in the cluster.
- */
- @isString
- public static final String NIMBUS_DAEMON_USER = "nimbus.daemon.user";
-
- /**
- * The maximum buffer size thrift should use when reading messages.
- * @deprecated As SimpleTrasportPlugin is deprecated, no other thrift transport plugin uses this configuration.
- */
- @Deprecated
- @isInteger
- @isPositiveNumber
- public static final String NIMBUS_THRIFT_MAX_BUFFER_SIZE = "nimbus.thrift.max_buffer_size";
-
- /**
- * This parameter is used by the storm-deploy project to configure the
- * jvm options for the nimbus daemon.
- */
- @isString
- public static final String NIMBUS_CHILDOPTS = "nimbus.childopts";
-
-
- /**
- * How long without heartbeating a task can go before nimbus will consider the
- * task dead and reassign it to another location.
- */
- @isInteger
- @isPositiveNumber
- public static final String NIMBUS_TASK_TIMEOUT_SECS = "nimbus.task.timeout.secs";
-
-
- /**
- * How often nimbus should wake up to check heartbeats and do reassignments. Note
- * that if a machine ever goes down Nimbus will immediately wake up and take action.
- * This parameter is for checking for failures when there's no explicit event like that
- * occurring.
- */
- @isInteger
- @isPositiveNumber
- public static final String NIMBUS_MONITOR_FREQ_SECS = "nimbus.monitor.freq.secs";
-
- /**
- * How often nimbus should wake the cleanup thread to clean the inbox.
- * @see #NIMBUS_INBOX_JAR_EXPIRATION_SECS
- */
- @isInteger
- @isPositiveNumber
- public static final String NIMBUS_CLEANUP_INBOX_FREQ_SECS = "nimbus.cleanup.inbox.freq.secs";
-
- /**
- * The length of time a jar file lives in the inbox before being deleted by the cleanup thread.
- *
- * Probably keep this value greater than or equal to NIMBUS_CLEANUP_INBOX_JAR_EXPIRATION_SECS.
- * Note that the time it takes to delete an inbox jar file is going to be somewhat more than
- * NIMBUS_CLEANUP_INBOX_JAR_EXPIRATION_SECS (depending on how often NIMBUS_CLEANUP_FREQ_SECS
- * is set to).
- * @see #NIMBUS_CLEANUP_INBOX_FREQ_SECS
- */
- @isInteger
- public static final String NIMBUS_INBOX_JAR_EXPIRATION_SECS = "nimbus.inbox.jar.expiration.secs";
-
- /**
- * How long before a supervisor can go without heartbeating before nimbus considers it dead
- * and stops assigning new work to it.
- */
- @isInteger
- @isPositiveNumber
- public static final String NIMBUS_SUPERVISOR_TIMEOUT_SECS = "nimbus.supervisor.timeout.secs";
-
- /**
- * A special timeout used when a task is initially launched. During launch, this is the timeout
- * used until the first heartbeat, overriding nimbus.task.timeout.secs.
- *
- * <p>A separate timeout exists for launch because there can be quite a bit of overhead
- * to launching new JVM's and configuring them.</p>
- */
- @isInteger
- @isPositiveNumber
- public static final String NIMBUS_TASK_LAUNCH_SECS = "nimbus.task.launch.secs";
-
- /**
- * During upload/download with the master, how long an upload or download connection is idle
- * before nimbus considers it dead and drops the connection.
- */
- @isInteger
- public static final String NIMBUS_FILE_COPY_EXPIRATION_SECS = "nimbus.file.copy.expiration.secs";
-
- /**
- * A custom class that implements ITopologyValidator that is run whenever a
- * topology is submitted. Can be used to provide business-specific logic for
- * whether topologies are allowed to run or not.
- */
- @isString
- public static final String NIMBUS_TOPOLOGY_VALIDATOR = "nimbus.topology.validator";
-
- /**
- * Class name for authorization plugin for Nimbus
- */
- @isString
- public static final String NIMBUS_AUTHORIZER = "nimbus.authorizer";
-
- /**
- * Impersonation user ACL config entries.
- */
- @isString
- public static final String NIMBUS_IMPERSONATION_AUTHORIZER = "nimbus.impersonation.authorizer";
-
- /**
- * Impersonation user ACL config entries.
- */
- @isMapEntryCustom(keyValidatorClasses = {StringValidator.class}, valueValidatorClasses = {ImpersonationAclUserEntryValidator.class})
- public static final String NIMBUS_IMPERSONATION_ACL = "nimbus.impersonation.acl";
-
- /**
- * How often nimbus should wake up to renew credentials if needed.
- */
- @isInteger
- @isPositiveNumber
- public static final String NIMBUS_CREDENTIAL_RENEW_FREQ_SECS = "nimbus.credential.renewers.freq.secs";
-
- /**
- * A list of credential renewers that nimbus should load.
- */
- @isStringList
- public static final String NIMBUS_CREDENTIAL_RENEWERS = "nimbus.credential.renewers.classes";
-
- /**
- * A list of plugins that nimbus should load during submit topology to populate
- * credentials on user's behalf.
- */
- @isStringList
- public static final String NIMBUS_AUTO_CRED_PLUGINS = "nimbus.autocredential.plugins.classes";
-
- /**
- * Nimbus thrift server queue size, default is 100000. This is the request queue size , when there are more requests
- * than number of threads to serve the requests, those requests will be queued to this queue. If the request queue
- * size > this config, then the incoming requests will be rejected.
- */
- @isInteger
- @isPositiveNumber
- public static final String NIMBUS_QUEUE_SIZE = "nimbus.queue.size";
-
- /**
- * FQCN of a class that implements {@code ISubmitterHook} @see ISubmitterHook for details.
- */
-
- @isString
- public static final String STORM_TOPOLOGY_SUBMISSION_NOTIFIER_PLUGIN = "storm.topology.submission.notifier.plugin.class";
-
- /**
- * FQCN of a class that implements {@code I} @see org.apache.storm.nimbus.ITopologyActionNotifierPlugin for details.
- */
- public static final String NIMBUS_TOPOLOGY_ACTION_NOTIFIER_PLUGIN = "nimbus.topology.action.notifier.plugin.class";
- public static final Object NIMBUS_TOPOLOGY_ACTION_NOTIFIER_PLUGIN_SCHEMA = String.class;
-
- /**
- * Storm UI binds to this host/interface.
- */
- @isString
- public static final String UI_HOST = "ui.host";
-
- /**
- * Storm UI binds to this port.
- */
- @isInteger
- @isPositiveNumber
- public static final String UI_PORT = "ui.port";
-
- /**
- * Storm UI Project BUGTRACKER Link for reporting issue.
- */
- @isString
- public static final String UI_PROJECT_BUGTRACKER_URL = "ui.project.bugtracker.url";
-
- /**
- * Storm UI Central Logging URL.
- */
- @isString
- public static final String UI_CENTRAL_LOGGING_URL = "ui.central.logging.url";
-
- /**
- * HTTP UI port for log viewer
- */
- @isInteger
- @isPositiveNumber
- public static final String LOGVIEWER_PORT = "logviewer.port";
-
- /**
- * Childopts for log viewer java process.
- */
- @isString
- public static final String LOGVIEWER_CHILDOPTS = "logviewer.childopts";
-
- /**
- * How often to clean up old log files
- */
- @isInteger
- @isPositiveNumber
- public static final String LOGVIEWER_CLEANUP_INTERVAL_SECS = "logviewer.cleanup.interval.secs";
-
- /**
- * How many minutes since a log was last modified for the log to be considered for clean-up
- */
- @isInteger
- @isPositiveNumber
- public static final String LOGVIEWER_CLEANUP_AGE_MINS = "logviewer.cleanup.age.mins";
-
- /**
- * The maximum number of bytes all worker log files can take up in MB
- */
- @isPositiveNumber
- public static final String LOGVIEWER_MAX_SUM_WORKER_LOGS_SIZE_MB = "logviewer.max.sum.worker.logs.size.mb";
-
- /**
- * The maximum number of bytes per worker's files can take up in MB
- */
- @isPositiveNumber
- public static final String LOGVIEWER_MAX_PER_WORKER_LOGS_SIZE_MB = "logviewer.max.per.worker.logs.size.mb";
-
- /**
- * Storm Logviewer HTTPS port
- */
- @isInteger
- @isPositiveNumber
- public static final String LOGVIEWER_HTTPS_PORT = "logviewer.https.port";
-
- /**
- * Path to the keystore containing the certs used by Storm Logviewer for HTTPS communications
- */
- @isString
- public static final String LOGVIEWER_HTTPS_KEYSTORE_PATH = "logviewer.https.keystore.path";
-
- /**
- * Password for the keystore for HTTPS for Storm Logviewer
- */
- @isString
- public static final String LOGVIEWER_HTTPS_KEYSTORE_PASSWORD = "logviewer.https.keystore.password";
-
- /**
- * Type of the keystore for HTTPS for Storm Logviewer.
- * see http://docs.oracle.com/javase/8/docs/api/java/security/KeyStore.html for more details.
- */
- @isString
- public static final String LOGVIEWER_HTTPS_KEYSTORE_TYPE = "logviewer.https.keystore.type";
-
- /**
- * Password to the private key in the keystore for setting up HTTPS (SSL).
- */
- @isString
- public static final String LOGVIEWER_HTTPS_KEY_PASSWORD = "logviewer.https.key.password";
-
- /**
- * Path to the truststore containing the certs used by Storm Logviewer for HTTPS communications
- */
- @isString
- public static final String LOGVIEWER_HTTPS_TRUSTSTORE_PATH = "logviewer.https.truststore.path";
-
- /**
- * Password for the truststore for HTTPS for Storm Logviewer
- */
- @isString
- public static final String LOGVIEWER_HTTPS_TRUSTSTORE_PASSWORD = "logviewer.https.truststore.password";
-
- /**
- * Type of the truststore for HTTPS for Storm Logviewer.
- * see http://docs.oracle.com/javase/8/docs/api/java/security/Truststore.html for more details.
- */
- @isString
- public static final String LOGVIEWER_HTTPS_TRUSTSTORE_TYPE = "logviewer.https.truststore.type";
-
- /**
- * Password to the truststore used by Storm Logviewer setting up HTTPS (SSL).
- */
- @isBoolean
- public static final String LOGVIEWER_HTTPS_WANT_CLIENT_AUTH = "logviewer.https.want.client.auth";
-
- @isBoolean
- public static final String LOGVIEWER_HTTPS_NEED_CLIENT_AUTH = "logviewer.https.need.client.auth";
-
- /**
- * A list of users allowed to view logs via the Log Viewer
- */
- @isStringList
- public static final String LOGS_USERS = "logs.users";
-
- /**
- * A list of groups allowed to view logs via the Log Viewer
- */
- @isStringList
- public static final String LOGS_GROUPS = "logs.groups";
-
- /**
- * Appender name used by log viewer to determine log directory.
- */
- @isString
- public static final String LOGVIEWER_APPENDER_NAME = "logviewer.appender.name";
-
- /**
- * Childopts for Storm UI Java process.
- */
- @isString
- public static final String UI_CHILDOPTS = "ui.childopts";
-
- /**
- * A class implementing javax.servlet.Filter for authenticating/filtering UI requests
- */
- @isString
- public static final String UI_FILTER = "ui.filter";
-
- /**
- * Initialization parameters for the javax.servlet.Filter
- */
- @isMapEntryType(keyType = String.class, valueType = String.class)
- public static final String UI_FILTER_PARAMS = "ui.filter.params";
-
- /**
- * The size of the header buffer for the UI in bytes
- */
- @isInteger
- @isPositiveNumber
- public static final String UI_HEADER_BUFFER_BYTES = "ui.header.buffer.bytes";
-
- /**
- * This port is used by Storm DRPC for receiving HTTPS (SSL) DPRC requests from clients.
- */
- @isInteger
- @isPositiveNumber
- public static final String UI_HTTPS_PORT = "ui.https.port";
-
- /**
- * Path to the keystore used by Storm UI for setting up HTTPS (SSL).
- */
- @isString
- public static final String UI_HTTPS_KEYSTORE_PATH = "ui.https.keystore.path";
-
- /**
- * Password to the keystore used by Storm UI for setting up HTTPS (SSL).
- */
- @isString
- public static final String UI_HTTPS_KEYSTORE_PASSWORD = "ui.https.keystore.password";
-
- /**
- * Type of keystore used by Storm UI for setting up HTTPS (SSL).
- * see http://docs.oracle.com/javase/7/docs/api/java/security/KeyStore.html for more details.
- */
- @isString
- public static final String UI_HTTPS_KEYSTORE_TYPE = "ui.https.keystore.type";
-
- /**
- * Password to the private key in the keystore for setting up HTTPS (SSL).
- */
- @isString
- public static final String UI_HTTPS_KEY_PASSWORD = "ui.https.key.password";
-
- /**
- * Path to the truststore used by Storm UI setting up HTTPS (SSL).
- */
- @isString
- public static final String UI_HTTPS_TRUSTSTORE_PATH = "ui.https.truststore.path";
-
- /**
- * Password to the truststore used by Storm UI setting up HTTPS (SSL).
- */
- @isString
- public static final String UI_HTTPS_TRUSTSTORE_PASSWORD = "ui.https.truststore.password";
-
- /**
- * Type of truststore used by Storm UI for setting up HTTPS (SSL).
- * see http://docs.oracle.com/javase/7/docs/api/java/security/KeyStore.html for more details.
- */
- @isString
- public static final String UI_HTTPS_TRUSTSTORE_TYPE = "ui.https.truststore.type";
-
- /**
- * Password to the truststore used by Storm DRPC setting up HTTPS (SSL).
- */
- @isBoolean
- public static final String UI_HTTPS_WANT_CLIENT_AUTH = "ui.https.want.client.auth";
-
- @isBoolean
- public static final String UI_HTTPS_NEED_CLIENT_AUTH = "ui.https.need.client.auth";
-
- /**
- * Value of X-FRAME-OPTIONS HTTP Header option used by Storm UI.
- */
- @isString
- public static final String UI_HTTP_X_FRAME_OPTIONS = "ui.http.x-frame-options";
-
- /**
- * The hosts that Pacemaker is running on.
- */
- @isStringList
- public static final String PACEMAKER_SERVERS = "pacemaker.servers";
-
- /**
- * The port Pacemaker should run on. Clients should
- * connect to this port to submit or read heartbeats.
- */
- @isNumber
- @isPositiveNumber
- public static final String PACEMAKER_PORT = "pacemaker.port";
-
- /**
- * The maximum number of threads that should be used by the Pacemaker.
- * When Pacemaker gets loaded it will spawn new threads, up to
- * this many total, to handle the load.
- */
- @isNumber
- @isPositiveNumber
- public static final String PACEMAKER_MAX_THREADS = "pacemaker.max.threads";
-
- /**
- * This parameter is used by the storm-deploy project to configure the
- * jvm options for the pacemaker daemon.
- */
- @isString
- public static final String PACEMAKER_CHILDOPTS = "pacemaker.childopts";
-
- /**
- * This should be one of "DIGEST", "KERBEROS", or "NONE"
- * Determines the mode of authentication the pacemaker server and client use.
- * The client must either match the server, or be NONE. In the case of NONE,
- * no authentication is performed for the client, and if the server is running with
- * DIGEST or KERBEROS, the client can only write to the server (no reads).
- * This is intended to provide a primitive form of access-control.
- */
- @CustomValidator(validatorClass=PacemakerAuthTypeValidator.class)
- public static final String PACEMAKER_AUTH_METHOD = "pacemaker.auth.method";
-
- /**
- * List of DRPC servers so that the DRPCSpout knows who to talk to.
- */
- @isStringList
- public static final String DRPC_SERVERS = "drpc.servers";
-
- /**
- * This port is used by Storm DRPC for receiving HTTP DPRC requests from clients.
- */
- @isInteger
- public static final String DRPC_HTTP_PORT = "drpc.http.port";
-
- /**
- * This port is used by Storm DRPC for receiving HTTPS (SSL) DPRC requests from clients.
- */
- @isInteger
- public static final String DRPC_HTTPS_PORT = "drpc.https.port";
-
- /**
- * Path to the keystore used by Storm DRPC for setting up HTTPS (SSL).
- */
- @isString
- public static final String DRPC_HTTPS_KEYSTORE_PATH = "drpc.https.keystore.path";
-
- /**
- * Password to the keystore used by Storm DRPC for setting up HTTPS (SSL).
- */
- @isString
- public static final String DRPC_HTTPS_KEYSTORE_PASSWORD = "drpc.https.keystore.password";
-
- /**
- * Type of keystore used by Storm DRPC for setting up HTTPS (SSL).
- * see http://docs.oracle.com/javase/7/docs/api/java/security/KeyStore.html for more details.
- */
- @isString
- public static final String DRPC_HTTPS_KEYSTORE_TYPE = "drpc.https.keystore.type";
-
- /**
- * Password to the private key in the keystore for setting up HTTPS (SSL).
- */
- @isString
- public static final String DRPC_HTTPS_KEY_PASSWORD = "drpc.https.key.password";
-
- /**
- * Path to the truststore used by Storm DRPC setting up HTTPS (SSL).
- */
- @isString
- public static final String DRPC_HTTPS_TRUSTSTORE_PATH = "drpc.https.truststore.path";
-
- /**
- * Password to the truststore used by Storm DRPC setting up HTTPS (SSL).
- */
- @isString
- public static final String DRPC_HTTPS_TRUSTSTORE_PASSWORD = "drpc.https.truststore.password";
-
- /**
- * Type of truststore used by Storm DRPC for setting up HTTPS (SSL).
- * see http://docs.oracle.com/javase/7/docs/api/java/security/KeyStore.html for more details.
- */
- @isString
- public static final String DRPC_HTTPS_TRUSTSTORE_TYPE = "drpc.https.truststore.type";
-
- /**
- * Password to the truststore used by Storm DRPC setting up HTTPS (SSL).
- */
- @isBoolean
- public static final String DRPC_HTTPS_WANT_CLIENT_AUTH = "drpc.https.want.client.auth";
-
- @isBoolean
- public static final String DRPC_HTTPS_NEED_CLIENT_AUTH = "drpc.https.need.client.auth";
-
- /**
- * The DRPC transport plug-in for Thrift client/server communication
- */
- @isString
- public static final String DRPC_THRIFT_TRANSPORT_PLUGIN = "drpc.thrift.transport";
-
- /**
- * This port is used by Storm DRPC for receiving DPRC requests from clients.
- */
- @isInteger
- @isPositiveNumber
- public static final String DRPC_PORT = "drpc.port";
-
- /**
- * Class name for authorization plugin for DRPC client
- */
- @isString
- public static final String DRPC_AUTHORIZER = "drpc.authorizer";
-
- /**
- * The Access Control List for the DRPC Authorizer.
- * @see org.apache.storm.security.auth.authorizer.DRPCSimpleACLAuthorizer
- */
- @isType(type=Map.class)
- public static final String DRPC_AUTHORIZER_ACL = "drpc.authorizer.acl";
-
- /**
- * File name of the DRPC Authorizer ACL.
- * @see org.apache.storm.security.auth.authorizer.DRPCSimpleACLAuthorizer
- */
- @isString
- public static final String DRPC_AUTHORIZER_ACL_FILENAME = "drpc.authorizer.acl.filename";
-
- /**
- * Whether the DRPCSimpleAclAuthorizer should deny requests for operations
- * involving functions that have no explicit ACL entry. When set to false
- * (the default) DRPC functions that have no entry in the ACL will be
- * permitted, which is appropriate for a development environment. When set
- * to true, explicit ACL entries are required for every DRPC function, and
- * any request for functions will be denied.
- * @see org.apache.storm.security.auth.authorizer.DRPCSimpleACLAuthorizer
- */
- @isBoolean
- public static final String DRPC_AUTHORIZER_ACL_STRICT = "drpc.authorizer.acl.strict";
-
- /**
- * DRPC thrift server worker threads
- */
- @isInteger
- @isPositiveNumber
- public static final String DRPC_WORKER_THREADS = "drpc.worker.threads";
-
- /**
- * The maximum buffer size thrift should use when reading messages for DRPC.
- * @deprecated As SimpleTrasportPlugin is deprecated, no other thrift transport plugin uses this configuration.
- */
- @Deprecated
- @isNumber
- @isPositiveNumber
- public static final String DRPC_MAX_BUFFER_SIZE = "drpc.max_buffer_size";
-
- /**
- * DRPC thrift server queue size
- */
- @isInteger
- @isPositiveNumber
- public static final String DRPC_QUEUE_SIZE = "drpc.queue.size";
-
- /**
- * The DRPC invocations transport plug-in for Thrift client/server communication
- */
- @isString
- public static final String DRPC_INVOCATIONS_THRIFT_TRANSPORT_PLUGIN = "drpc.invocations.thrift.transport";
-
- /**
- * This port on Storm DRPC is used by DRPC topologies to receive function invocations and send results back.
- */
- @isInteger
- @isPositiveNumber
- public static final String DRPC_INVOCATIONS_PORT = "drpc.invocations.port";
-
- /**
- * DRPC invocations thrift server worker threads
- */
- @isInteger
- @isPositiveNumber
- public static final String DRPC_INVOCATIONS_THREADS = "drpc.invocations.threads";
-
- /**
- * The timeout on DRPC requests within the DRPC server. Defaults to 10 minutes. Note that requests can also
- * timeout based on the socket timeout on the DRPC client, and separately based on the topology message
- * timeout for the topology implementing the DRPC function.
- */
-
- @isInteger
- @isPositiveNumber
- @NotNull
- public static final String DRPC_REQUEST_TIMEOUT_SECS = "drpc.request.timeout.secs";
-
- /**
- * Childopts for Storm DRPC Java process.
- */
- @isString
- public static final String DRPC_CHILDOPTS = "drpc.childopts";
-
- /**
- * Class name of the HTTP credentials plugin for the UI.
- */
- @isString
- public static final String UI_HTTP_CREDS_PLUGIN = "ui.http.creds.plugin";
-
- /**
- * Class name of the HTTP credentials plugin for DRPC.
- */
- @isString
- public static final String DRPC_HTTP_CREDS_PLUGIN = "drpc.http.creds.plugin";
-
- /**
- * the metadata configured on the supervisor
- */
- @isType(type=Map.class)
- public static final String SUPERVISOR_SCHEDULER_META = "supervisor.scheduler.meta";
-
- /**
- * A list of ports that can run workers on this supervisor. Each worker uses one port, and
- * the supervisor will only run one worker per port. Use this configuration to tune
- * how many workers run on each machine.
- */
- @isNoDuplicateInList
- @NotNull
- @isListEntryCustom(entryValidatorClasses={IntegerValidator.class,PositiveNumberValidator.class})
- public static final String SUPERVISOR_SLOTS_PORTS = "supervisor.slots.ports";
-
- /**
- * What blobstore implementation the supervisor should use.
- */
- @isString
- public static final String SUPERVISOR_BLOBSTORE = "supervisor.blobstore.class";
-
- /**
- * The distributed cache target size in MB. This is a soft limit to the size of the distributed
- * cache contents.
- */
- @isPositiveNumber
- @isInteger
- public static final String SUPERVISOR_LOCALIZER_CACHE_TARGET_SIZE_MB = "supervisor.localizer.cache.target.size.mb";
-
- /**
- * The distributed cache cleanup interval. Controls how often it scans to attempt to cleanup
- * anything over the cache target size.
- */
- @isPositiveNumber
- @isInteger
- public static final String SUPERVISOR_LOCALIZER_CACHE_CLEANUP_INTERVAL_MS = "supervisor.localizer.cleanup.interval.ms";
-
- /**
- * What blobstore implementation the storm client should use.
- */
- @isString
- public static final String CLIENT_BLOBSTORE = "client.blobstore.class";
-
- /**
- * What blobstore download parallelism the supervisor should use.
- */
- @isPositiveNumber
- @isInteger
- public static final String SUPERVISOR_BLOBSTORE_DOWNLOAD_THREAD_COUNT = "supervisor.blobstore.download.thread.count";
-
- /**
- * Maximum number of retries a supervisor is allowed to make for downloading a blob.
- */
- @isPositiveNumber
- @isInteger
- public static final String SUPERVISOR_BLOBSTORE_DOWNLOAD_MAX_RETRIES = "supervisor.blobstore.download.max_retries";
-
- /**
- * The blobstore super user has all read/write/admin permissions to all blobs - user running
- * the blobstore.
- */
- @isString
- public static final String BLOBSTORE_SUPERUSER = "blobstore.superuser";
-
- /**
- * What directory to use for the blobstore. The directory is expected to be an
- * absolute path when using HDFS blobstore, for LocalFsBlobStore it could be either
- * absolute or relative.
- */
- @isString
- public static final String BLOBSTORE_DIR = "blobstore.dir";
-
- /**
- * What buffer size to use for the blobstore uploads.
- */
- @isPositiveNumber
- @isInteger
- public static final String STORM_BLOBSTORE_INPUTSTREAM_BUFFER_SIZE_BYTES = "storm.blobstore.inputstream.buffer.size.bytes";
-
- /**
- * Enable the blobstore cleaner. Certain blobstores may only want to run the cleaner
- * on one daemon. Currently Nimbus handles setting this.
- */
- @isBoolean
- public static final String BLOBSTORE_CLEANUP_ENABLE = "blobstore.cleanup.enable";
-
- /**
- * principal for nimbus/supervisor to use to access secure hdfs for the blobstore.
- */
- @isString
- public static final String BLOBSTORE_HDFS_PRINCIPAL = "blobstore.hdfs.principal";
-
- /**
- * keytab for nimbus/supervisor to use to access secure hdfs for the blobstore.
- */
- @isString
- public static final String BLOBSTORE_HDFS_KEYTAB = "blobstore.hdfs.keytab";
-
- /**
- * Set replication factor for a blob in HDFS Blobstore Implementation
- */
- @isPositiveNumber
- @isInteger
- public static final String STORM_BLOBSTORE_REPLICATION_FACTOR = "storm.blobstore.replication.factor";
-
- /**
- * For secure mode we would want to turn on this config
- * By default this is turned off assuming the default is insecure
- */
- @isBoolean
- public static final String STORM_BLOBSTORE_ACL_VALIDATION_ENABLED = "storm.blobstore.acl.validation.enabled";
-
- /**
- * What blobstore implementation nimbus should use.
- */
- @isString
- public static final String NIMBUS_BLOBSTORE = "nimbus.blobstore.class";
-
- /**
- * During operations with the blob store, via master, how long a connection
- * is idle before nimbus considers it dead and drops the session and any
- * associated connections.
- */
- @isPositiveNumber
- @isInteger
- public static final String NIMBUS_BLOBSTORE_EXPIRATION_SECS = "nimbus.blobstore.expiration.secs";
-
- /**
- * A map with blobstore keys mapped to each filename the worker will have access to in the
- * launch directory to the blob by local file name and uncompress flag. Both localname and
- * uncompress flag are optional. It uses the key is localname is not specified. Each topology
- * will have different map of blobs. Example: topology.blobstore.map: {"blobstorekey" :
- * {"localname": "myblob", "uncompress": false}, "blobstorearchivekey" :
- * {"localname": "myarchive", "uncompress": true}}
- */
- @CustomValidator(validatorClass = MapOfStringToMapOfStringToObjectValidator.class)
- public static final String TOPOLOGY_BLOBSTORE_MAP = "topology.blobstore.map";
-
- /**
- * A number representing the maximum number of workers any single topology can acquire.
- */
- @isInteger
- @isPositiveNumber(includeZero = true)
- public static final String NIMBUS_SLOTS_PER_TOPOLOGY = "nimbus.slots.perTopology";
-
- /**
- * A class implementing javax.servlet.Filter for DRPC HTTP requests
- */
- @isString
- public static final String DRPC_HTTP_FILTER = "drpc.http.filter";
-
- /**
- * Initialization parameters for the javax.servlet.Filter of the DRPC HTTP
- * service
- */
- @isMapEntryType(keyType = String.class, valueType = String.class)
- public static final String DRPC_HTTP_FILTER_PARAMS = "drpc.http.filter.params";
-
- /**
- * A number representing the maximum number of executors any single topology can acquire.
- */
- @isInteger
- @isPositiveNumber(includeZero = true)
- public static final String NIMBUS_EXECUTORS_PER_TOPOLOGY = "nimbus.executors.perTopology";
-
- /**
- * This parameter is used by the storm-deploy project to configure the
- * jvm options for the supervisor daemon.
- */
- @isString
- public static final String SUPERVISOR_CHILDOPTS = "supervisor.childopts";
-
- /**
- * How long a worker can go without heartbeating before the supervisor tries to
- * restart the worker process.
- */
- @isInteger
- @isPositiveNumber
- @NotNull
- public static final String SUPERVISOR_WORKER_TIMEOUT_SECS = "supervisor.worker.timeout.secs";
-
- /**
- * How many seconds to sleep for before shutting down threads on worker
- */
- @isInteger
- @isPositiveNumber
- public static final String SUPERVISOR_WORKER_SHUTDOWN_SLEEP_SECS = "supervisor.worker.shutdown.sleep.secs";
-
- /**
- * How long a worker can go without heartbeating during the initial launch before
- * the supervisor tries to restart the worker process. This value override
- * supervisor.worker.timeout.secs during launch because there is additional
- * overhead to starting and configuring the JVM on launch.
- */
- @isInteger
- @isPositiveNumber
- @NotNull
- public static final String SUPERVISOR_WORKER_START_TIMEOUT_SECS = "supervisor.worker.start.timeout.secs";
-
- /**
- * Whether or not the supervisor should launch workers assigned to it. Defaults
- * to true -- and you should probably never change this value. This configuration
- * is used in the Storm unit tests.
- */
- @isBoolean
- public static final String SUPERVISOR_ENABLE = "supervisor.enable";
-
- /**
- * how often the supervisor sends a heartbeat to the master.
- */
- @isInteger
- public static final String SUPERVISOR_HEARTBEAT_FREQUENCY_SECS = "supervisor.heartbeat.frequency.secs";
-
-
- /**
- * How often the supervisor checks the worker heartbeats to see if any of them
- * need to be restarted.
- */
- @isInteger
- @isPositiveNumber
- public static final String SUPERVISOR_MONITOR_FREQUENCY_SECS = "supervisor.monitor.frequency.secs";
-
- /**
- * Should the supervior try to run the worker as the lauching user or not. Defaults to false.
- */
- @isBoolean
- public static final String SUPERVISOR_RUN_WORKER_AS_USER = "supervisor.run.worker.as.user";
-
- /**
- * Full path to the worker-laucher executable that will be used to lauch workers when
- * SUPERVISOR_RUN_WORKER_AS_USER is set to true.
- */
- @isString
- public static final String SUPERVISOR_WORKER_LAUNCHER = "supervisor.worker.launcher";
-
- /**
- * The total amount of memory (in MiB) a supervisor is allowed to give to its workers.
- * A default value will be set for this config if user does not override
- */
- @isPositiveNumber
- public static final String SUPERVISOR_MEMORY_CAPACITY_MB = "supervisor.memory.capacity.mb";
-
- /**
- * The total amount of CPU resources a supervisor is allowed to give to its workers.
- * By convention 1 cpu core should be about 100, but this can be adjusted if needed
- * using 100 makes it simple to set the desired value to the capacity measurement
- * for single threaded bolts. A default value will be set for this config if user does not override
- */
- @isPositiveNumber
- 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%",
- * "%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
- */
- @isInteger
- @isPositiveNumber
- public static final String WORKER_HEAP_MEMORY_MB = "worker.heap.memory.mb";
-
- /**
- * The jvm profiler opts provided to workers launched by this supervisor.
- */
- @isStringOrStringList
- public static final String WORKER_PROFILER_CHILDOPTS = "worker.profiler.childopts";
-
- /**
- * Enable profiling of worker JVMs using Oracle's Java Flight Recorder.
- * Unlocking commercial features requires a special license from Oracle.
- * See http://www.oracle.com/technetwork/java/javase/terms/products/index.html
- */
- @isBoolean
- public static final String WORKER_PROFILER_ENABLED = "worker.profiler.enabled";
-
- /**
- * The command launched supervisor with worker arguments
- * pid, action and [target_directory]
- * Where action is - start profile, stop profile, jstack, heapdump and kill against pid
- *
- */
- @isString
- public static final String WORKER_PROFILER_COMMAND = "worker.profiler.command";
-
- /**
- * 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.
- */
- @isStringOrStringList
- public static final String WORKER_GC_CHILDOPTS = "worker.gc.childopts";
-
- /**
- * How often this worker should heartbeat to the supervisor.
- */
- @isInteger
- @isPositiveNumber
- public static final String WORKER_HEARTBEAT_FREQUENCY_SECS = "worker.heartbeat.frequency.secs";
-
- /**
- * How often a task should heartbeat its status to the master.
- */
- @isInteger
- @isPositiveNumber
- public static final String TASK_HEARTBEAT_FREQUENCY_SECS = "task.heartbeat.frequency.secs";
-
- /**
- * How often a task should sync its connections with other tasks (if a task is
- * reassigned, the other tasks sending messages to it need to refresh their connections).
- * In general though, when a reassignment happens other tasks will be notified
- * almost immediately. This configuration is here just in case that notification doesn't
- * come through.
- */
- @isInteger
- @isPositiveNumber
- public static final String TASK_REFRESH_POLL_SECS = "task.refresh.poll.secs";
-
- /**
- * How often a worker should check dynamic log level timeouts for expiration.
- * For expired logger settings, the clean up polling task will reset the log levels
- * to the original levels (detected at startup), and will clean up the timeout map
- */
- @isInteger
- @isPositiveNumber
- public static final String WORKER_LOG_LEVEL_RESET_POLL_SECS = "worker.log.level.reset.poll.secs";
-
- /**
- * How often a task should sync credentials, worst case.
- */
- @isInteger
- @isPositiveNumber
- public static final String TASK_CREDENTIALS_POLL_SECS = "task.credentials.poll.secs";
-
- /**
- * How often to poll for changed topology backpressure flag from ZK
- */
- @isInteger
- @isPositiveNumber
- public static final String TASK_BACKPRESSURE_POLL_SECS = "task.backpressure.poll.secs";
-
- /**
- * Whether to enable backpressure in for a certain topology
- */
- @isBoolean
- public static final String TOPOLOGY_BACKPRESSURE_ENABLE = "topology.backpressure.enable";
-
- /**
- * This signifies the tuple congestion in a disruptor queue.
- * When the used ratio of a disruptor queue is higher than the high watermark,
- * the backpressure scheme, if enabled, should slow down the tuple sending speed of
- * the spouts until reaching the low watermark.
- */
- @isPositiveNumber
- public static final String BACKPRESSURE_DISRUPTOR_HIGH_WATERMARK="backpressure.disruptor.high.watermark";
-
- /**
- * This signifies a state that a disruptor queue has left the congestion.
- * If the used ratio of a disruptor queue is lower than the low watermark,
- * it will unset the backpressure flag.
- */
- @isPositiveNumber
- public static final String BACKPRESSURE_DISRUPTOR_LOW_WATERMARK="backpressure.disruptor.low.watermark";
-
- /**
- * A list of classes implementing IClusterMetricsConsumer (See storm.yaml.example for exact config format).
- * Each listed class will be routed cluster related metrics data.
- * Each listed class maps 1:1 to a ClusterMetricsConsumerExecutor and they're executed in Nimbus.
- * Only consumers which run in leader Nimbus receives metrics data.
- */
- @isListEntryCustom(entryValidatorClasses={ClusterMetricRegistryValidator.class})
- public static final String STORM_CLUSTER_METRICS_CONSUMER_REGISTER = "storm.cluster.metrics.consumer.register";
-
- /**
- * How often cluster metrics data is published to metrics consumer.
- */
- @NotNull
- @isPositiveNumber
- public static final String STORM_CLUSTER_METRICS_CONSUMER_PUBLISH_INTERVAL_SECS = "storm.cluster.metrics.consumer.publish.interval.secs";
-
- /**
- * A list of users that are allowed to interact with the topology. To use this set
- * nimbus.authorizer to org.apache.storm.security.auth.authorizer.SimpleACLAuthorizer
- */
- @isStringList
- public static final String TOPOLOGY_USERS = "topology.users";
-
- /**
- * A list of groups that are allowed to interact with the topology. To use this set
- * nimbus.authorizer to org.apache.storm.security.auth.authorizer.SimpleACLAuthorizer
- */
- @isStringList
- public static final String TOPOLOGY_GROUPS = "topology.groups";
-
- /**
- * True if Storm should timeout messages or not. Defaults to true. This is meant to be used
- * in unit tests to prevent tuples from being accidentally timed out during the test.
- */
- @isBoolean
- public static final String TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS = "topology.enable.message.timeouts";
-
- /**
- * When set to true, Storm will log every message that's emitted.
- */
- @isBoolean
- public static final String TOPOLOGY_DEBUG = "topology.debug";
-
- /**
- * The serializer for communication between shell components and non-JVM
- * processes
- */
- @isString
- public static final String TOPOLOGY_MULTILANG_SERIALIZER = "topology.multilang.serializer";
-
- /**
- * How many processes should be spawned around the cluster to execute this
- * topology. Each process will execute some number of tasks as threads within
- * them. This parameter should be used in conjunction with the parallelism hints
- * on each component in the topology to tune the performance of a topology.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_WORKERS = "topology.workers";
-
- /**
- * How many instances to create for a spout/bolt. A task runs on a thread with zero or more
- * other tasks for the same spout/bolt. The number of tasks for a spout/bolt is always
- * the same throughout the lifetime of a topology, but the number of executors (threads) for
- * a spout/bolt can change over time. This allows a topology to scale to more or less resources
- * without redeploying the topology or violating the constraints of Storm (such as a fields grouping
- * guaranteeing that the same value goes to the same task).
- */
- @isInteger
- @isPositiveNumber(includeZero = true)
- public static final String TOPOLOGY_TASKS = "topology.tasks";
-
- /**
- * The maximum amount of memory an instance of a spout/bolt will take on heap. This enables the scheduler
- * to allocate slots on machines with enough available memory. A default value will be set for this config if user does not override
- */
- @isPositiveNumber(includeZero = true)
- public static final String TOPOLOGY_COMPONENT_RESOURCES_ONHEAP_MEMORY_MB = "topology.component.resources.onheap.memory.mb";
-
- /**
- * The maximum amount of memory an instance of a spout/bolt will take off heap. This enables the scheduler
- * to allocate slots on machines with enough available memory. A default value will be set for this config if user does not override
- */
- @isPositiveNumber(includeZero = true)
- public static final String TOPOLOGY_COMPONENT_RESOURCES_OFFHEAP_MEMORY_MB = "topology.component.resources.offheap.memory.mb";
-
- /**
- * The config indicates the percentage of cpu for a core an instance(executor) of a component will use.
- * Assuming the a core value to be 100, a value of 10 indicates 10% of the core.
- * The P in PCORE represents the term "physical". A default value will be set for this config if user does not override
- */
- @isPositiveNumber(includeZero = true)
- public static final String TOPOLOGY_COMPONENT_CPU_PCORE_PERCENT = "topology.component.cpu.pcore.percent";
-
- /**
- * The class name of the {@link org.apache.storm.state.StateProvider} implementation. If not specified
- * defaults to {@link org.apache.storm.state.InMemoryKeyValueStateProvider}. This can be overridden
- * at the component level.
- */
- @isString
- public static final String TOPOLOGY_STATE_PROVIDER = "topology.state.provider";
-
- /**
- * The configuration specific to the {@link org.apache.storm.state.StateProvider} implementation.
- * This can be overridden at the component level. The value and the interpretation of this config
- * is based on the state provider implementation. For e.g. this could be just a config file name
- * which contains the config for the state provider implementation.
- */
- @isString
- public static final String TOPOLOGY_STATE_PROVIDER_CONFIG = "topology.state.provider.config";
-
- /**
- * Topology configuration to specify the checkpoint interval (in millis) at which the
- * topology state is saved when {@link org.apache.storm.topology.IStatefulBolt} bolts are involved.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_STATE_CHECKPOINT_INTERVAL = "topology.state.checkpoint.interval.ms";
-
- /**
- * A per topology config that specifies the maximum amount of memory a worker can use for that specific topology
- */
- @isPositiveNumber
- public static final String TOPOLOGY_WORKER_MAX_HEAP_SIZE_MB = "topology.worker.max.heap.size.mb";
-
- /**
- * The strategy to use when scheduling a topology with Resource Aware Scheduler
- */
- @NotNull
- @isImplementationOfClass(implementsClass = IStrategy.class)
- public static final String TOPOLOGY_SCHEDULER_STRATEGY = "topology.scheduler.strategy";
-
- /**
- * How many executors to spawn for ackers.
- *
- * <p>By not setting this variable or setting it as null, Storm will set the number of acker executors
- * to be equal to the number of workers configured for this topology. If this variable is set to 0,
- * then Storm will immediately ack tuples as soon as they come off the spout, effectively disabling reliability.</p>
- */
- @isInteger
- @isPositiveNumber(includeZero = true)
- public static final String TOPOLOGY_ACKER_EXECUTORS = "topology.acker.executors";
-
- /**
- * How many executors to spawn for event logger.
- *
- * <p>By not setting this variable or setting it as null, Storm will set the number of eventlogger executors
- * to be equal to the number of workers configured for this topology. If this variable is set to 0,
- * event logging will be disabled.</p>
- */
- @isInteger
- @isPositiveNumber(includeZero = true)
- public static final String TOPOLOGY_EVENTLOGGER_EXECUTORS = "topology.eventlogger.executors";
-
- /**
- * The maximum amount of time given to the topology to fully process a message
- * emitted by a spout. If the message is not acked within this time frame, Storm
- * will fail the message on the spout. Some spouts implementations will then replay
- * the message at a later time.
- */
- @isInteger
- @isPositiveNumber
- @NotNull
- public static final String TOPOLOGY_MESSAGE_TIMEOUT_SECS = "topology.message.timeout.secs";
-
- /**
- * A list of serialization registrations for Kryo ( https://github.com/EsotericSoftware/kryo ),
- * the underlying serialization framework for Storm. A serialization can either
- * be the name of a class (in which case Kryo will automatically create a serializer for the class
- * that saves all the object's fields), or an implementation of com.esotericsoftware.kryo.Serializer.
- *
- * See Kryo's documentation for more information about writing custom serializers.
- */
- @isKryoReg
- public static final String TOPOLOGY_KRYO_REGISTER = "topology.kryo.register";
-
- /**
- * A list of classes that customize storm's kryo instance during start-up.
- * Each listed class name must implement IKryoDecorator. During start-up the
- * listed class is instantiated with 0 arguments, then its 'decorate' method
- * is called with storm's kryo instance as the only argument.
- */
- @isStringList
- public static final String TOPOLOGY_KRYO_DECORATORS = "topology.kryo.decorators";
-
- /**
- * Class that specifies how to create a Kryo instance for serialization. Storm will then apply
- * topology.kryo.register and topology.kryo.decorators on top of this. The default implementation
- * implements topology.fall.back.on.java.serialization and turns references off.
- */
- @isString
- public static final String TOPOLOGY_KRYO_FACTORY = "topology.kryo.factory";
-
- /**
- * Whether or not Storm should skip the loading of kryo registrations for which it
- * does not know the class or have the serializer implementation. Otherwise, the task will
- * fail to load and will throw an error at runtime. The use case of this is if you want to
- * declare your serializations on the storm.yaml files on the cluster rather than every single
- * time you submit a topology. Different applications may use different serializations and so
- * a single application may not have the code for the other serializers used by other apps.
- * By setting this config to true, Storm will ignore that it doesn't have those other serializations
- * rather than throw an error.
- */
- @isBoolean
- public static final String TOPOLOGY_SKIP_MISSING_KRYO_REGISTRATIONS= "topology.skip.missing.kryo.registrations";
-
- /**
- * A list of classes implementing IMetricsConsumer (See storm.yaml.example for exact config format).
- * Each listed class will be routed all the metrics data generated by the storm metrics API.
- * Each listed class maps 1:1 to a system bolt named __metrics_ClassName#N, and it's parallelism is configurable.
- */
- @isListEntryCustom(entryValidatorClasses={MetricRegistryValidator.class})
- public static final String TOPOLOGY_METRICS_CONSUMER_REGISTER = "topology.metrics.consumer.register";
-
- /**
- * A map of metric name to class name implementing IMetric that will be created once per worker JVM
- */
- @isMapEntryType(keyType = String.class, valueType = String.class)
- public static final String TOPOLOGY_WORKER_METRICS = "topology.worker.metrics";
-
- /**
- * A map of metric name to class name implementing IMetric that will be created once per worker JVM
- */
- @isMapEntryType(keyType = String.class, valueType = String.class)
- public static final String WORKER_METRICS = "worker.metrics";
-
- /**
- * The maximum parallelism allowed for a component in this topology. This configuration is
- * typically used in testing to limit the number of threads spawned in local mode.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_MAX_TASK_PARALLELISM="topology.max.task.parallelism";
-
- /**
- * The maximum number of tuples that can be pending on a spout task at any given time.
- * This config applies to individual tasks, not to spouts or topologies as a whole.
- *
- * A pending tuple is one that has been emitted from a spout but has not been acked or failed yet.
- * Note that this config parameter has no effect for unreliable spouts that don't tag
- * their tuples with a message id.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_MAX_SPOUT_PENDING="topology.max.spout.pending";
-
- /**
- * A class that implements a strategy for what to do when a spout needs to wait. Waiting is
- * triggered in one of two conditions:
- *
- * 1. nextTuple emits no tuples
- * 2. The spout has hit maxSpoutPending and can't emit any more tuples
- */
- @isString
- public static final String TOPOLOGY_SPOUT_WAIT_STRATEGY="topology.spout.wait.strategy";
-
- /**
- * The amount of milliseconds the SleepEmptyEmitStrategy should sleep for.
- */
- @isInteger
- @isPositiveNumber(includeZero = true)
- public static final String TOPOLOGY_SLEEP_SPOUT_WAIT_STRATEGY_TIME_MS="topology.sleep.spout.wait.strategy.time.ms";
-
- /**
- * The maximum amount of time a component gives a source of state to synchronize before it requests
- * synchronization again.
- */
- @isInteger
- @isPositiveNumber
- @NotNull
- public static final String TOPOLOGY_STATE_SYNCHRONIZATION_TIMEOUT_SECS="topology.state.synchronization.timeout.secs";
-
- /**
- * The percentage of tuples to sample to produce stats for a task.
- */
- @isPositiveNumber
- public static final String TOPOLOGY_STATS_SAMPLE_RATE="topology.stats.sample.rate";
-
- /**
- * The time period that builtin metrics data in bucketed into.
- */
- @isInteger
- public static final String TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS="topology.builtin.metrics.bucket.size.secs";
-
- /**
- * Whether or not to use Java serialization in a topology.
- */
- @isBoolean
- public static final String TOPOLOGY_FALL_BACK_ON_JAVA_SERIALIZATION="topology.fall.back.on.java.serialization";
-
- /**
- * Topology-specific options for the worker child process. This is used in addition to WORKER_CHILDOPTS.
- */
- @isStringOrStringList
- public static final String TOPOLOGY_WORKER_CHILDOPTS="topology.worker.childopts";
-
- /**
- * Topology-specific options GC for the worker child process. This overrides WORKER_GC_CHILDOPTS.
- */
- @isStringOrStringList
- public static final String TOPOLOGY_WORKER_GC_CHILDOPTS="topology.worker.gc.childopts";
-
- /**
- * Topology-specific options for the logwriter process of a worker.
- */
- @isStringOrStringList
- public static final String TOPOLOGY_WORKER_LOGWRITER_CHILDOPTS="topology.worker.logwriter.childopts";
-
- /**
- * Topology-specific classpath for the worker child process. This is combined to the usual classpath.
- */
- @isStringOrStringList
- public static final String TOPOLOGY_CLASSPATH="topology.classpath";
-
- /**
- * Topology-specific environment variables for the worker child process.
- * This is added to the existing environment (that of the supervisor)
- */
- @isMapEntryType(keyType = String.class, valueType = String.class)
- public static final String TOPOLOGY_ENVIRONMENT="topology.environment";
-
- /*
- * Topology-specific option to disable/enable bolt's outgoing overflow buffer.
- * Enabling this option ensures that the bolt can always clear the incoming messages,
- * preventing live-lock for the topology with cyclic flow.
- * The overflow buffer can fill degrading the performance gradually,
- * eventually running out of memory.
- */
- @isBoolean
- public static final String TOPOLOGY_BOLTS_OUTGOING_OVERFLOW_BUFFER_ENABLE="topology.bolts.outgoing.overflow.buffer.enable";
-
- /*
- * Bolt-specific configuration for windowed bolts to specify the window length as a count of number of tuples
- * in the window.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_BOLTS_WINDOW_LENGTH_COUNT = "topology.bolts.window.length.count";
-
- /*
- * Bolt-specific configuration for windowed bolts to specify the window length in time duration.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_BOLTS_WINDOW_LENGTH_DURATION_MS = "topology.bolts.window.length.duration.ms";
-
- /*
- * Bolt-specific configuration for windowed bolts to specify the sliding interval as a count of number of tuples.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_BOLTS_SLIDING_INTERVAL_COUNT = "topology.bolts.window.sliding.interval.count";
-
- /*
- * Bolt-specific configuration for windowed bolts to specify the sliding interval in time duration.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_BOLTS_SLIDING_INTERVAL_DURATION_MS = "topology.bolts.window.sliding.interval.duration.ms";
-
- /*
- * Bolt-specific configuration for windowed bolts to specify the name of the field in the tuple that holds
- * the timestamp (e.g. the ts when the tuple was actually generated). If this config is specified and the
- * field is not present in the incoming tuple, a java.lang.IllegalArgumentException will be thrown.
- */
- @isString
- public static final String TOPOLOGY_BOLTS_TUPLE_TIMESTAMP_FIELD_NAME = "topology.bolts.tuple.timestamp.field.name";
-
- /**
- * Bolt-specific configuration for windowed bolts to specify the name of the stream on which late tuples are
- * going to be emitted. This configuration should only be used from the BaseWindowedBolt.withLateTupleStream builder
- * method, and not as global parameter, otherwise IllegalArgumentException is going to be thrown.
- */
- @isString
- public static final String TOPOLOGY_BOLTS_LATE_TUPLE_STREAM = "topology.bolts.late.tuple.stream";
-
- /*
- * Bolt-specific configuration for windowed bolts to specify the maximum time lag of the tuple timestamp
- * in milliseconds. It means that the tuple timestamps cannot be out of order by more than this amount.
- * This config will be effective only if the TOPOLOGY_BOLTS_TUPLE_TIMESTAMP_FIELD_NAME is also specified.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_BOLTS_TUPLE_TIMESTAMP_MAX_LAG_MS = "topology.bolts.tuple.timestamp.max.lag.ms";
-
- /*
- * Bolt-specific configuration for windowed bolts to specify the time interval for generating
- * watermark events. Watermark event tracks the progress of time when tuple timestamp is used.
- * This config is effective only if TOPOLOGY_BOLTS_TUPLE_TIMESTAMP_FIELD_NAME is also specified.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_BOLTS_WATERMARK_EVENT_INTERVAL_MS = "topology.bolts.watermark.event.interval.ms";
-
- /*
- * Bolt-specific configuration for windowed bolts to specify the name of the field in the tuple that holds
- * the message id. This is used to track the windowing boundaries and avoid re-evaluating the windows
- * during recovery of IStatefulWindowedBolt
- */
- @isString
- public static final String TOPOLOGY_BOLTS_MESSAGE_ID_FIELD_NAME = "topology.bolts.message.id.field.name";
-
- /**
- * This config is available for TransactionalSpouts, and contains the id ( a String) for
- * the transactional topology. This id is used to store the state of the transactional
- * topology in Zookeeper.
- */
- @isString
- public static final String TOPOLOGY_TRANSACTIONAL_ID="topology.transactional.id";
-
- /**
- * A list of task hooks that are automatically added to every spout and bolt in the topology. An example
- * of when you'd do this is to add a hook that integrates with your internal
- * monitoring system. These hooks are instantiated using the zero-arg constructor.
- */
- @isStringList
- public static final String TOPOLOGY_AUTO_TASK_HOOKS="topology.auto.task.hooks";
-
- /**
- * The size of the Disruptor receive queue for each executor. Must be a power of 2.
- */
- @isPowerOf2
- public static final String TOPOLOGY_EXECUTOR_RECEIVE_BUFFER_SIZE="topology.executor.receive.buffer.size";
-
- /**
- * The size of the Disruptor send queue for each executor. Must be a power of 2.
- */
- @isPowerOf2
- public static final String TOPOLOGY_EXECUTOR_SEND_BUFFER_SIZE="topology.executor.send.buffer.size";
-
- /**
- * The size of the Disruptor transfer queue for each worker.
- */
- @isInteger
- @isPowerOf2
- public static final String TOPOLOGY_TRANSFER_BUFFER_SIZE="topology.transfer.buffer.size";
-
- /**
- * How often a tick tuple from the "__system" component and "__tick" stream should be sent
- * to tasks. Meant to be used as a component-specific configuration.
- */
- @isInteger
- public static final String TOPOLOGY_TICK_TUPLE_FREQ_SECS="topology.tick.tuple.freq.secs";
-
- /**
- * @deprecated this is no longer supported
- * Configure the wait strategy used for internal queuing. Can be used to tradeoff latency
- * vs. throughput
- */
- @Deprecated
- @isString
- public static final String TOPOLOGY_DISRUPTOR_WAIT_STRATEGY="topology.disruptor.wait.strategy";
-
- /**
- * The size of the shared thread pool for worker tasks to make use of. The thread pool can be accessed
- * via the TopologyContext.
- */
- @isInteger
- public static final String TOPOLOGY_WORKER_SHARED_THREAD_POOL_SIZE="topology.worker.shared.thread.pool.size";
-
- /**
- * The interval in seconds to use for determining whether to throttle error reported to Zookeeper. For example,
- * an interval of 10 seconds with topology.max.error.report.per.interval set to 5 will only allow 5 errors to be
- * reported to Zookeeper per task for every 10 second interval of time.
- */
- @isInteger
- public static final String TOPOLOGY_ERROR_THROTTLE_INTERVAL_SECS="topology.error.throttle.interval.secs";
-
- /**
- * See doc for TOPOLOGY_ERROR_THROTTLE_INTERVAL_SECS
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_MAX_ERROR_REPORT_PER_INTERVAL="topology.max.error.report.per.interval";
-
- /**
- * How often a batch can be emitted in a Trident topology.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_TRIDENT_BATCH_EMIT_INTERVAL_MILLIS="topology.trident.batch.emit.interval.millis";
-
- /**
- * Maximum number of tuples that can be stored inmemory cache in windowing operators for fast access without fetching
- * them from store.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_TRIDENT_WINDOWING_INMEMORY_CACHE_LIMIT="topology.trident.windowing.cache.tuple.limit";
-
- /**
- * Name of the topology. This config is automatically set by Storm when the topology is submitted.
- */
- @isString
- public final static String TOPOLOGY_NAME="topology.name";
-
- /**
- * The principal who submitted a topology
- */
- @isString
- public final static String TOPOLOGY_SUBMITTER_PRINCIPAL = "topology.submitter.principal";
-
- /**
- * The local user name of the user who submitted a topology.
- */
- @isString
- public static final String TOPOLOGY_SUBMITTER_USER = "topology.submitter.user";
-
- /**
- * Array of components that scheduler should try to place on separate hosts.
- */
- @isStringList
- public static final String TOPOLOGY_SPREAD_COMPONENTS = "topology.spread.components";
-
- /**
- * A list of IAutoCredentials that the topology should load and use.
- */
- @isStringList
- public static final String TOPOLOGY_AUTO_CREDENTIALS = "topology.auto-credentials";
-
- /**
- * Max pending tuples in one ShellBolt
- */
- @NotNull
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_SHELLBOLT_MAX_PENDING="topology.shellbolt.max.pending";
-
- /**
- * How long a subprocess can go without heartbeating before the ShellSpout/ShellBolt tries to
- * suicide itself.
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_SUBPROCESS_TIMEOUT_SECS = "topology.subprocess.timeout.secs";
-
- /**
- * Topology central logging sensitivity to determine who has access to logs in central logging system.
- * The possible values are:
- * S0 - Public (open to all users on grid)
- * S1 - Restricted
- * S2 - Confidential
- * S3 - Secret (default.)
- */
- @isString(acceptedValues = {"S0", "S1", "S2", "S3"})
- public static final String TOPOLOGY_LOGGING_SENSITIVITY="topology.logging.sensitivity";
-
- /**
- * Sets the priority for a topology
- */
- @isInteger
- @isPositiveNumber(includeZero = true)
- public static final String TOPOLOGY_PRIORITY = "topology.priority";
-
- /**
- * The root directory in ZooKeeper for metadata about TransactionalSpouts.
- */
- @isString
- public static final String TRANSACTIONAL_ZOOKEEPER_ROOT="transactional.zookeeper.root";
-
- /**
- * The list of zookeeper servers in which to keep the transactional state. If null (which is default),
- * will use storm.zookeeper.servers
- */
- @isStringList
- public static final String TRANSACTIONAL_ZOOKEEPER_SERVERS="transactional.zookeeper.servers";
-
- /**
- * The port to use to connect to the transactional zookeeper servers. If null (which is default),
- * will use storm.zookeeper.port
- */
- @isInteger
- @isPositiveNumber
- public static final String TRANSACTIONAL_ZOOKEEPER_PORT="transactional.zookeeper.port";
-
- /**
- * The user as which the nimbus client should be acquired to perform the operation.
- */
- @isString
- public static final String STORM_DO_AS_USER="storm.doAsUser";
-
- /**
- * The number of threads that should be used by the zeromq context in each worker process.
- */
- @Deprecated
- @isInteger
- public static final String ZMQ_THREADS = "zmq.threads";
-
- /**
- * How long a connection should retry sending messages to a target host when
- * the connection is closed. This is an advanced configuration and can almost
- * certainly be ignored.
- */
- @Deprecated
- @isInteger
- public static final String ZMQ_LINGER_MILLIS = "zmq.linger.millis";
-
- /**
- * The high water for the ZeroMQ push sockets used for networking. Use this config to prevent buffer explosion
- * on the networking layer.
- */
- @Deprecated
- @isInteger
- public static final String ZMQ_HWM = "zmq.hwm";
-
- /**
- * This value is passed to spawned JVMs (e.g., Nimbus, Supervisor, and Workers)
- * for the java.library.path value. java.library.path tells the JVM where
- * to look for native libraries. It is necessary to set this config correctly since
- * Storm uses the ZeroMQ and JZMQ native libs.
- */
- @isString
- public static final String JAVA_LIBRARY_PATH = "java.library.path";
-
- /**
- * The path to use as the zookeeper dir when running a zookeeper server via
- * "storm dev-zookeeper". This zookeeper instance is only intended for development;
- * it is not a production grade zookeeper setup.
- */
- @isString
- public static final String DEV_ZOOKEEPER_PATH = "dev.zookeeper.path";
-
- /**
- * A map from topology name to the number of machines that should be dedicated for that topology. Set storm.scheduler
- * to org.apache.storm.scheduler.IsolationScheduler to make use of the isolation scheduler.
- */
- @isMapEntryType(keyType = String.class, valueType = Number.class)
- public static final String ISOLATION_SCHEDULER_MACHINES = "isolation.scheduler.machines";
-
- /**
- * A map from the user name to the number of machines that should that user is allowed to use. Set storm.scheduler
- * to org.apache.storm.scheduler.multitenant.MultitenantScheduler
- */
- @isMapEntryType(keyType = String.class, valueType = Number.class)
- public static final String MULTITENANT_SCHEDULER_USER_POOLS = "multitenant.scheduler.user.pools";
-
- /**
- * A map of users to another map of the resource guarantees of the user. Used by Resource Aware Scheduler to ensure
- * per user resource guarantees.
- */
- @isMapEntryCustom(keyValidatorClasses = {StringValidator.class}, valueValidatorClasses = {UserResourcePoolEntryValidator.class})
- public static final String RESOURCE_AWARE_SCHEDULER_USER_POOLS = "resource.aware.scheduler.user.pools";
-
- /**
- * The class that specifies the eviction strategy to use in ResourceAwareScheduler
- */
- @NotNull
- @isImplementationOfClass(implementsClass = IEvictionStrategy.class)
- public static final String RESOURCE_AWARE_SCHEDULER_EVICTION_STRATEGY = "resource.aware.scheduler.eviction.strategy";
-
- /**
- * the class that specifies the scheduling priority strategy to use in ResourceAwareScheduler
- */
- @NotNull
- @isImplementationOfClass(implementsClass = ISchedulingPriorityStrategy.class)
- public static final String RESOURCE_AWARE_SCHEDULER_PRIORITY_STRATEGY = "resource.aware.scheduler.priority.strategy";
-
- /**
- * The number of machines that should be used by this topology to isolate it from all others. Set storm.scheduler
- * to org.apache.storm.scheduler.multitenant.MultitenantScheduler
- */
- @isInteger
- @isPositiveNumber
- public static final String TOPOLOGY_ISOLATED_MACHINES = "topology.isolate.machines";
-
- /**
- * Configure timeout milliseconds used for disruptor queue wait strategy. Can be used to tradeoff latency
- * vs. CPU usage
- */
- @isInteger
- @NotNull
- public static final String TOPOLOGY_DISRUPTOR_WAIT_TIMEOUT_MILLIS="topology.disruptor.wait.timeout.millis";
-
- /**
- * The number of tuples to batch before sending to the next thread. This number is just an initial suggestion and
- * the code may adjust it as your topology runs.
- */
- @isInteger
- @isPositiveNumber
- @NotNull
- public static final String TOPOLOGY_DISRUPTOR_BATCH_SIZE="topology.disruptor.batch.size";
-
- /**
- * The maximum age in milliseconds a batch can be before being sent to the next thread. This number is just an
- * initial suggestion and the code may adjust it as your topology runs.
- */
- @isInteger
- @isPo
<TRUNCATED>
[22/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/HBMessage.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/HBMessage.java b/storm-core/src/jvm/backtype/storm/generated/HBMessage.java
deleted file mode 100644
index 29d3b21..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.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class HBMessage implements org.apache.thrift.TBase<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 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 = org.apache.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 = org.apache.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);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/HBMessageData.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/HBMessageData.java b/storm-core/src/jvm/backtype/storm/generated/HBMessageData.java
deleted file mode 100644
index b100da1..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/HBMessageData.java
+++ /dev/null
@@ -1,640 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-public class HBMessageData extends org.apache.thrift.TUnion<HBMessageData, HBMessageData._Fields> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HBMessageData");
- private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField PULSE_FIELD_DESC = new org.apache.thrift.protocol.TField("pulse", org.apache.thrift.protocol.TType.STRUCT, (short)2);
- private static final org.apache.thrift.protocol.TField BOOLVAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolval", org.apache.thrift.protocol.TType.BOOL, (short)3);
- private static final org.apache.thrift.protocol.TField RECORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("records", org.apache.thrift.protocol.TType.STRUCT, (short)4);
- private static final org.apache.thrift.protocol.TField NODES_FIELD_DESC = new org.apache.thrift.protocol.TField("nodes", org.apache.thrift.protocol.TType.STRUCT, (short)5);
- private static final org.apache.thrift.protocol.TField MESSAGE_BLOB_FIELD_DESC = new org.apache.thrift.protocol.TField("message_blob", org.apache.thrift.protocol.TType.STRING, (short)7);
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- PATH((short)1, "path"),
- PULSE((short)2, "pulse"),
- BOOLVAL((short)3, "boolval"),
- RECORDS((short)4, "records"),
- NODES((short)5, "nodes"),
- MESSAGE_BLOB((short)7, "message_blob");
-
- 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: // PATH
- return PATH;
- case 2: // PULSE
- return PULSE;
- case 3: // BOOLVAL
- return BOOLVAL;
- case 4: // RECORDS
- return RECORDS;
- case 5: // NODES
- return NODES;
- case 7: // MESSAGE_BLOB
- return MESSAGE_BLOB;
- 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;
- }
- }
-
- 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.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.PULSE, new org.apache.thrift.meta_data.FieldMetaData("pulse", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HBPulse.class)));
- tmpMap.put(_Fields.BOOLVAL, new org.apache.thrift.meta_data.FieldMetaData("boolval", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
- tmpMap.put(_Fields.RECORDS, new org.apache.thrift.meta_data.FieldMetaData("records", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HBRecords.class)));
- tmpMap.put(_Fields.NODES, new org.apache.thrift.meta_data.FieldMetaData("nodes", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HBNodes.class)));
- tmpMap.put(_Fields.MESSAGE_BLOB, new org.apache.thrift.meta_data.FieldMetaData("message_blob", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HBMessageData.class, metaDataMap);
- }
-
- public HBMessageData() {
- super();
- }
-
- public HBMessageData(_Fields setField, Object value) {
- super(setField, value);
- }
-
- public HBMessageData(HBMessageData other) {
- super(other);
- }
- public HBMessageData deepCopy() {
- return new HBMessageData(this);
- }
-
- public static HBMessageData path(String value) {
- HBMessageData x = new HBMessageData();
- x.set_path(value);
- return x;
- }
-
- public static HBMessageData pulse(HBPulse value) {
- HBMessageData x = new HBMessageData();
- x.set_pulse(value);
- return x;
- }
-
- public static HBMessageData boolval(boolean value) {
- HBMessageData x = new HBMessageData();
- x.set_boolval(value);
- return x;
- }
-
- public static HBMessageData records(HBRecords value) {
- HBMessageData x = new HBMessageData();
- x.set_records(value);
- return x;
- }
-
- public static HBMessageData nodes(HBNodes value) {
- HBMessageData x = new HBMessageData();
- x.set_nodes(value);
- return x;
- }
-
- public static HBMessageData message_blob(ByteBuffer value) {
- HBMessageData x = new HBMessageData();
- x.set_message_blob(value);
- return x;
- }
-
- public static HBMessageData message_blob(byte[] value) {
- HBMessageData x = new HBMessageData();
- x.set_message_blob(ByteBuffer.wrap(Arrays.copyOf(value, value.length)));
- return x;
- }
-
-
- @Override
- protected void checkType(_Fields setField, Object value) throws ClassCastException {
- switch (setField) {
- case PATH:
- if (value instanceof String) {
- break;
- }
- throw new ClassCastException("Was expecting value of type String for field 'path', but got " + value.getClass().getSimpleName());
- case PULSE:
- if (value instanceof HBPulse) {
- break;
- }
- throw new ClassCastException("Was expecting value of type HBPulse for field 'pulse', but got " + value.getClass().getSimpleName());
- case BOOLVAL:
- if (value instanceof Boolean) {
- break;
- }
- throw new ClassCastException("Was expecting value of type Boolean for field 'boolval', but got " + value.getClass().getSimpleName());
- case RECORDS:
- if (value instanceof HBRecords) {
- break;
- }
- throw new ClassCastException("Was expecting value of type HBRecords for field 'records', but got " + value.getClass().getSimpleName());
- case NODES:
- if (value instanceof HBNodes) {
- break;
- }
- throw new ClassCastException("Was expecting value of type HBNodes for field 'nodes', but got " + value.getClass().getSimpleName());
- case MESSAGE_BLOB:
- if (value instanceof ByteBuffer) {
- break;
- }
- throw new ClassCastException("Was expecting value of type ByteBuffer for field 'message_blob', but got " + value.getClass().getSimpleName());
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(field.id);
- if (setField != null) {
- switch (setField) {
- case PATH:
- if (field.type == PATH_FIELD_DESC.type) {
- String path;
- path = iprot.readString();
- return path;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case PULSE:
- if (field.type == PULSE_FIELD_DESC.type) {
- HBPulse pulse;
- pulse = new HBPulse();
- pulse.read(iprot);
- return pulse;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case BOOLVAL:
- if (field.type == BOOLVAL_FIELD_DESC.type) {
- Boolean boolval;
- boolval = iprot.readBool();
- return boolval;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case RECORDS:
- if (field.type == RECORDS_FIELD_DESC.type) {
- HBRecords records;
- records = new HBRecords();
- records.read(iprot);
- return records;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case NODES:
- if (field.type == NODES_FIELD_DESC.type) {
- HBNodes nodes;
- nodes = new HBNodes();
- nodes.read(iprot);
- return nodes;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case MESSAGE_BLOB:
- if (field.type == MESSAGE_BLOB_FIELD_DESC.type) {
- ByteBuffer message_blob;
- message_blob = iprot.readBinary();
- return message_blob;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- }
-
- @Override
- protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case PATH:
- String path = (String)value_;
- oprot.writeString(path);
- return;
- case PULSE:
- HBPulse pulse = (HBPulse)value_;
- pulse.write(oprot);
- return;
- case BOOLVAL:
- Boolean boolval = (Boolean)value_;
- oprot.writeBool(boolval);
- return;
- case RECORDS:
- HBRecords records = (HBRecords)value_;
- records.write(oprot);
- return;
- case NODES:
- HBNodes nodes = (HBNodes)value_;
- nodes.write(oprot);
- return;
- case MESSAGE_BLOB:
- ByteBuffer message_blob = (ByteBuffer)value_;
- oprot.writeBinary(message_blob);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(fieldID);
- if (setField != null) {
- switch (setField) {
- case PATH:
- String path;
- path = iprot.readString();
- return path;
- case PULSE:
- HBPulse pulse;
- pulse = new HBPulse();
- pulse.read(iprot);
- return pulse;
- case BOOLVAL:
- Boolean boolval;
- boolval = iprot.readBool();
- return boolval;
- case RECORDS:
- HBRecords records;
- records = new HBRecords();
- records.read(iprot);
- return records;
- case NODES:
- HBNodes nodes;
- nodes = new HBNodes();
- nodes.read(iprot);
- return nodes;
- case MESSAGE_BLOB:
- ByteBuffer message_blob;
- message_blob = iprot.readBinary();
- return message_blob;
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- throw new TProtocolException("Couldn't find a field with field id " + fieldID);
- }
- }
-
- @Override
- protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case PATH:
- String path = (String)value_;
- oprot.writeString(path);
- return;
- case PULSE:
- HBPulse pulse = (HBPulse)value_;
- pulse.write(oprot);
- return;
- case BOOLVAL:
- Boolean boolval = (Boolean)value_;
- oprot.writeBool(boolval);
- return;
- case RECORDS:
- HBRecords records = (HBRecords)value_;
- records.write(oprot);
- return;
- case NODES:
- HBNodes nodes = (HBNodes)value_;
- nodes.write(oprot);
- return;
- case MESSAGE_BLOB:
- ByteBuffer message_blob = (ByteBuffer)value_;
- oprot.writeBinary(message_blob);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) {
- switch (setField) {
- case PATH:
- return PATH_FIELD_DESC;
- case PULSE:
- return PULSE_FIELD_DESC;
- case BOOLVAL:
- return BOOLVAL_FIELD_DESC;
- case RECORDS:
- return RECORDS_FIELD_DESC;
- case NODES:
- return NODES_FIELD_DESC;
- case MESSAGE_BLOB:
- return MESSAGE_BLOB_FIELD_DESC;
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TStruct getStructDesc() {
- return STRUCT_DESC;
- }
-
- @Override
- protected _Fields enumForId(short id) {
- return _Fields.findByThriftIdOrThrow(id);
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
-
- public String get_path() {
- if (getSetField() == _Fields.PATH) {
- return (String)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'path' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_path(String value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.PATH;
- value_ = value;
- }
-
- public HBPulse get_pulse() {
- if (getSetField() == _Fields.PULSE) {
- return (HBPulse)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'pulse' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_pulse(HBPulse value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.PULSE;
- value_ = value;
- }
-
- public boolean get_boolval() {
- if (getSetField() == _Fields.BOOLVAL) {
- return (Boolean)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'boolval' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_boolval(boolean value) {
- setField_ = _Fields.BOOLVAL;
- value_ = value;
- }
-
- public HBRecords get_records() {
- if (getSetField() == _Fields.RECORDS) {
- return (HBRecords)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'records' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_records(HBRecords value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.RECORDS;
- value_ = value;
- }
-
- public HBNodes get_nodes() {
- if (getSetField() == _Fields.NODES) {
- return (HBNodes)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'nodes' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_nodes(HBNodes value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.NODES;
- value_ = value;
- }
-
- public byte[] get_message_blob() {
- set_message_blob(org.apache.thrift.TBaseHelper.rightSize(buffer_for_message_blob()));
- ByteBuffer b = buffer_for_message_blob();
- return b == null ? null : b.array();
- }
-
- public ByteBuffer buffer_for_message_blob() {
- if (getSetField() == _Fields.MESSAGE_BLOB) {
- return org.apache.thrift.TBaseHelper.copyBinary((ByteBuffer)getFieldValue());
- } else {
- throw new RuntimeException("Cannot get field 'message_blob' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_message_blob(byte[] value) {
- set_message_blob(ByteBuffer.wrap(Arrays.copyOf(value, value.length)));
- }
-
- public void set_message_blob(ByteBuffer value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.MESSAGE_BLOB;
- value_ = value;
- }
-
- public boolean is_set_path() {
- return setField_ == _Fields.PATH;
- }
-
-
- public boolean is_set_pulse() {
- return setField_ == _Fields.PULSE;
- }
-
-
- public boolean is_set_boolval() {
- return setField_ == _Fields.BOOLVAL;
- }
-
-
- public boolean is_set_records() {
- return setField_ == _Fields.RECORDS;
- }
-
-
- public boolean is_set_nodes() {
- return setField_ == _Fields.NODES;
- }
-
-
- public boolean is_set_message_blob() {
- return setField_ == _Fields.MESSAGE_BLOB;
- }
-
-
- public boolean equals(Object other) {
- if (other instanceof HBMessageData) {
- return equals((HBMessageData)other);
- } else {
- return false;
- }
- }
-
- public boolean equals(HBMessageData other) {
- return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue());
- }
-
- @Override
- public int compareTo(HBMessageData other) {
- int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField());
- if (lastComparison == 0) {
- return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue());
- }
- return lastComparison;
- }
-
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
- list.add(this.getClass().getName());
- org.apache.thrift.TFieldIdEnum setField = getSetField();
- if (setField != null) {
- list.add(setField.getThriftFieldId());
- Object value = getFieldValue();
- if (value instanceof org.apache.thrift.TEnum) {
- list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
- } else {
- list.add(value);
- }
- }
- return list.hashCode();
- }
- 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);
- }
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/HBNodes.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/HBNodes.java b/storm-core/src/jvm/backtype/storm/generated/HBNodes.java
deleted file mode 100644
index c5c7407..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/HBNodes.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class HBNodes implements org.apache.thrift.TBase<HBNodes, HBNodes._Fields>, java.io.Serializable, Cloneable, Comparable<HBNodes> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HBNodes");
-
- private static final org.apache.thrift.protocol.TField PULSE_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("pulseIds", org.apache.thrift.protocol.TType.LIST, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new HBNodesStandardSchemeFactory());
- schemes.put(TupleScheme.class, new HBNodesTupleSchemeFactory());
- }
-
- private List<String> pulseIds; // 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 {
- PULSE_IDS((short)1, "pulseIds");
-
- 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: // PULSE_IDS
- return PULSE_IDS;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.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.PULSE_IDS, new org.apache.thrift.meta_data.FieldMetaData("pulseIds", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HBNodes.class, metaDataMap);
- }
-
- public HBNodes() {
- }
-
- public HBNodes(
- List<String> pulseIds)
- {
- this();
- this.pulseIds = pulseIds;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public HBNodes(HBNodes other) {
- if (other.is_set_pulseIds()) {
- List<String> __this__pulseIds = new ArrayList<String>(other.pulseIds);
- this.pulseIds = __this__pulseIds;
- }
- }
-
- public HBNodes deepCopy() {
- return new HBNodes(this);
- }
-
- @Override
- public void clear() {
- this.pulseIds = null;
- }
-
- public int get_pulseIds_size() {
- return (this.pulseIds == null) ? 0 : this.pulseIds.size();
- }
-
- public java.util.Iterator<String> get_pulseIds_iterator() {
- return (this.pulseIds == null) ? null : this.pulseIds.iterator();
- }
-
- public void add_to_pulseIds(String elem) {
- if (this.pulseIds == null) {
- this.pulseIds = new ArrayList<String>();
- }
- this.pulseIds.add(elem);
- }
-
- public List<String> get_pulseIds() {
- return this.pulseIds;
- }
-
- public void set_pulseIds(List<String> pulseIds) {
- this.pulseIds = pulseIds;
- }
-
- public void unset_pulseIds() {
- this.pulseIds = null;
- }
-
- /** Returns true if field pulseIds is set (has been assigned a value) and false otherwise */
- public boolean is_set_pulseIds() {
- return this.pulseIds != null;
- }
-
- public void set_pulseIds_isSet(boolean value) {
- if (!value) {
- this.pulseIds = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case PULSE_IDS:
- if (value == null) {
- unset_pulseIds();
- } else {
- set_pulseIds((List<String>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case PULSE_IDS:
- return get_pulseIds();
-
- }
- 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 PULSE_IDS:
- return is_set_pulseIds();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof HBNodes)
- return this.equals((HBNodes)that);
- return false;
- }
-
- public boolean equals(HBNodes that) {
- if (that == null)
- return false;
-
- boolean this_present_pulseIds = true && this.is_set_pulseIds();
- boolean that_present_pulseIds = true && that.is_set_pulseIds();
- if (this_present_pulseIds || that_present_pulseIds) {
- if (!(this_present_pulseIds && that_present_pulseIds))
- return false;
- if (!this.pulseIds.equals(that.pulseIds))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_pulseIds = true && (is_set_pulseIds());
- list.add(present_pulseIds);
- if (present_pulseIds)
- list.add(pulseIds);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(HBNodes other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_pulseIds()).compareTo(other.is_set_pulseIds());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_pulseIds()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pulseIds, other.pulseIds);
- 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("HBNodes(");
- boolean first = true;
-
- sb.append("pulseIds:");
- if (this.pulseIds == null) {
- sb.append("null");
- } else {
- sb.append(this.pulseIds);
- }
- 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 {
- 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 HBNodesStandardSchemeFactory implements SchemeFactory {
- public HBNodesStandardScheme getScheme() {
- return new HBNodesStandardScheme();
- }
- }
-
- private static class HBNodesStandardScheme extends StandardScheme<HBNodes> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, HBNodes 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: // PULSE_IDS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list800 = iprot.readListBegin();
- struct.pulseIds = new ArrayList<String>(_list800.size);
- String _elem801;
- for (int _i802 = 0; _i802 < _list800.size; ++_i802)
- {
- _elem801 = iprot.readString();
- struct.pulseIds.add(_elem801);
- }
- iprot.readListEnd();
- }
- struct.set_pulseIds_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, HBNodes struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.pulseIds != null) {
- oprot.writeFieldBegin(PULSE_IDS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.pulseIds.size()));
- for (String _iter803 : struct.pulseIds)
- {
- oprot.writeString(_iter803);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class HBNodesTupleSchemeFactory implements SchemeFactory {
- public HBNodesTupleScheme getScheme() {
- return new HBNodesTupleScheme();
- }
- }
-
- private static class HBNodesTupleScheme extends TupleScheme<HBNodes> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, HBNodes struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_pulseIds()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_pulseIds()) {
- {
- oprot.writeI32(struct.pulseIds.size());
- for (String _iter804 : struct.pulseIds)
- {
- oprot.writeString(_iter804);
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, HBNodes struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- {
- org.apache.thrift.protocol.TList _list805 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.pulseIds = new ArrayList<String>(_list805.size);
- String _elem806;
- for (int _i807 = 0; _i807 < _list805.size; ++_i807)
- {
- _elem806 = iprot.readString();
- struct.pulseIds.add(_elem806);
- }
- }
- struct.set_pulseIds_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/HBPulse.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/HBPulse.java b/storm-core/src/jvm/backtype/storm/generated/HBPulse.java
deleted file mode 100644
index 574857d..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/HBPulse.java
+++ /dev/null
@@ -1,522 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class HBPulse implements org.apache.thrift.TBase<HBPulse, HBPulse._Fields>, java.io.Serializable, Cloneable, Comparable<HBPulse> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HBPulse");
-
- private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField DETAILS_FIELD_DESC = new org.apache.thrift.protocol.TField("details", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new HBPulseStandardSchemeFactory());
- schemes.put(TupleScheme.class, new HBPulseTupleSchemeFactory());
- }
-
- private String id; // required
- private ByteBuffer details; // 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 {
- ID((short)1, "id"),
- DETAILS((short)2, "details");
-
- 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: // ID
- return ID;
- case 2: // DETAILS
- return DETAILS;
- 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.DETAILS, new org.apache.thrift.meta_data.FieldMetaData("details", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HBPulse.class, metaDataMap);
- }
-
- public HBPulse() {
- }
-
- public HBPulse(
- String id,
- ByteBuffer details)
- {
- this();
- this.id = id;
- this.details = org.apache.thrift.TBaseHelper.copyBinary(details);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public HBPulse(HBPulse other) {
- if (other.is_set_id()) {
- this.id = other.id;
- }
- if (other.is_set_details()) {
- this.details = org.apache.thrift.TBaseHelper.copyBinary(other.details);
- }
- }
-
- public HBPulse deepCopy() {
- return new HBPulse(this);
- }
-
- @Override
- public void clear() {
- this.id = null;
- this.details = null;
- }
-
- public String get_id() {
- return this.id;
- }
-
- public void set_id(String id) {
- this.id = id;
- }
-
- public void unset_id() {
- this.id = null;
- }
-
- /** Returns true if field id is set (has been assigned a value) and false otherwise */
- public boolean is_set_id() {
- return this.id != null;
- }
-
- public void set_id_isSet(boolean value) {
- if (!value) {
- this.id = null;
- }
- }
-
- public byte[] get_details() {
- set_details(org.apache.thrift.TBaseHelper.rightSize(details));
- return details == null ? null : details.array();
- }
-
- public ByteBuffer buffer_for_details() {
- return org.apache.thrift.TBaseHelper.copyBinary(details);
- }
-
- public void set_details(byte[] details) {
- this.details = details == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(details, details.length));
- }
-
- public void set_details(ByteBuffer details) {
- this.details = org.apache.thrift.TBaseHelper.copyBinary(details);
- }
-
- public void unset_details() {
- this.details = null;
- }
-
- /** Returns true if field details is set (has been assigned a value) and false otherwise */
- public boolean is_set_details() {
- return this.details != null;
- }
-
- public void set_details_isSet(boolean value) {
- if (!value) {
- this.details = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ID:
- if (value == null) {
- unset_id();
- } else {
- set_id((String)value);
- }
- break;
-
- case DETAILS:
- if (value == null) {
- unset_details();
- } else {
- set_details((ByteBuffer)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ID:
- return get_id();
-
- case DETAILS:
- return get_details();
-
- }
- 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 ID:
- return is_set_id();
- case DETAILS:
- return is_set_details();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof HBPulse)
- return this.equals((HBPulse)that);
- return false;
- }
-
- public boolean equals(HBPulse that) {
- if (that == null)
- return false;
-
- boolean this_present_id = true && this.is_set_id();
- boolean that_present_id = true && that.is_set_id();
- if (this_present_id || that_present_id) {
- if (!(this_present_id && that_present_id))
- return false;
- if (!this.id.equals(that.id))
- return false;
- }
-
- boolean this_present_details = true && this.is_set_details();
- boolean that_present_details = true && that.is_set_details();
- if (this_present_details || that_present_details) {
- if (!(this_present_details && that_present_details))
- return false;
- if (!this.details.equals(that.details))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_id = true && (is_set_id());
- list.add(present_id);
- if (present_id)
- list.add(id);
-
- boolean present_details = true && (is_set_details());
- list.add(present_details);
- if (present_details)
- list.add(details);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(HBPulse other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_id()).compareTo(other.is_set_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_details()).compareTo(other.is_set_details());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_details()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.details, other.details);
- 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("HBPulse(");
- boolean first = true;
-
- sb.append("id:");
- if (this.id == null) {
- sb.append("null");
- } else {
- sb.append(this.id);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("details:");
- if (this.details == null) {
- sb.append("null");
- } else {
- org.apache.thrift.TBaseHelper.toString(this.details, sb);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' 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 HBPulseStandardSchemeFactory implements SchemeFactory {
- public HBPulseStandardScheme getScheme() {
- return new HBPulseStandardScheme();
- }
- }
-
- private static class HBPulseStandardScheme extends StandardScheme<HBPulse> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, HBPulse 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: // ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.id = iprot.readString();
- struct.set_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // DETAILS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.details = iprot.readBinary();
- struct.set_details_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, HBPulse struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.id != null) {
- oprot.writeFieldBegin(ID_FIELD_DESC);
- oprot.writeString(struct.id);
- oprot.writeFieldEnd();
- }
- if (struct.details != null) {
- oprot.writeFieldBegin(DETAILS_FIELD_DESC);
- oprot.writeBinary(struct.details);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class HBPulseTupleSchemeFactory implements SchemeFactory {
- public HBPulseTupleScheme getScheme() {
- return new HBPulseTupleScheme();
- }
- }
-
- private static class HBPulseTupleScheme extends TupleScheme<HBPulse> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, HBPulse struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.id);
- BitSet optionals = new BitSet();
- if (struct.is_set_details()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_details()) {
- oprot.writeBinary(struct.details);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, HBPulse struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.id = iprot.readString();
- struct.set_id_isSet(true);
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.details = iprot.readBinary();
- struct.set_details_isSet(true);
- }
- }
- }
-
-}
-
[50/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/cluster.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/cluster.clj b/storm-core/src/clj/backtype/storm/cluster.clj
deleted file mode 100644
index 914fa5b..0000000
--- a/storm-core/src/clj/backtype/storm/cluster.clj
+++ /dev/null
@@ -1,708 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.cluster
- (:import [org.apache.zookeeper.data Stat ACL Id]
- [org.apache.storm.generated SupervisorInfo Assignment StormBase ClusterWorkerHeartbeat ErrorInfo Credentials NimbusSummary
- LogConfig ProfileAction ProfileRequest NodeInfo]
- [java.io Serializable])
- (:import [org.apache.zookeeper KeeperException KeeperException$NoNodeException ZooDefs ZooDefs$Ids ZooDefs$Perms])
- (:import [org.apache.curator.framework CuratorFramework])
- (:import [org.apache.storm.utils Utils])
- (:import [org.apache.storm.cluster ClusterState ClusterStateContext ClusterStateListener ConnectionState])
- (:import [java.security MessageDigest])
- (:import [org.apache.zookeeper.server.auth DigestAuthenticationProvider])
- (:import [org.apache.storm.nimbus NimbusInfo])
- (:use [org.apache.storm util log config converter])
- (:require [org.apache.storm [zookeeper :as zk]])
- (:require [org.apache.storm.daemon [common :as common]]))
-
-(defn mk-topo-only-acls
- [topo-conf]
- (let [payload (.get topo-conf STORM-ZOOKEEPER-TOPOLOGY-AUTH-PAYLOAD)]
- (when (Utils/isZkAuthenticationConfiguredTopology topo-conf)
- [(first ZooDefs$Ids/CREATOR_ALL_ACL)
- (ACL. ZooDefs$Perms/READ (Id. "digest" (DigestAuthenticationProvider/generateDigest payload)))])))
-
-(defnk mk-distributed-cluster-state
- [conf :auth-conf nil :acls nil :context (ClusterStateContext.)]
- (let [clazz (Class/forName (or (conf STORM-CLUSTER-STATE-STORE)
- "org.apache.storm.cluster_state.zookeeper_state_factory"))
- state-instance (.newInstance clazz)]
- (log-debug "Creating cluster state: " (.toString clazz))
- (or (.mkState state-instance conf auth-conf acls context)
- nil)))
-
-(defprotocol StormClusterState
- (assignments [this callback])
- (assignment-info [this storm-id callback])
- (assignment-info-with-version [this storm-id callback])
- (assignment-version [this storm-id callback])
- ;returns key information under /storm/blobstore/key
- (blobstore-info [this blob-key])
- ;returns list of nimbus summaries stored under /stormroot/nimbuses/<nimbus-ids> -> <data>
- (nimbuses [this])
- ;adds the NimbusSummary to /stormroot/nimbuses/nimbus-id
- (add-nimbus-host! [this nimbus-id nimbus-summary])
-
- (active-storms [this])
- (storm-base [this storm-id callback])
- (get-worker-heartbeat [this storm-id node port])
- (get-worker-profile-requests [this storm-id nodeinfo thrift?])
- (get-topology-profile-requests [this storm-id thrift?])
- (set-worker-profile-request [this storm-id profile-request])
- (delete-topology-profile-requests [this storm-id profile-request])
- (executor-beats [this storm-id executor->node+port])
- (supervisors [this callback])
- (supervisor-info [this supervisor-id]) ;; returns nil if doesn't exist
- (setup-heartbeats! [this storm-id])
- (teardown-heartbeats! [this storm-id])
- (teardown-topology-errors! [this storm-id])
- (heartbeat-storms [this])
- (error-topologies [this])
- (backpressure-topologies [this])
- (set-topology-log-config! [this storm-id log-config])
- (topology-log-config [this storm-id cb])
- (worker-heartbeat! [this storm-id node port info])
- (remove-worker-heartbeat! [this storm-id node port])
- (supervisor-heartbeat! [this supervisor-id info])
- (worker-backpressure! [this storm-id node port info])
- (topology-backpressure [this storm-id callback])
- (setup-backpressure! [this storm-id])
- (remove-backpressure! [this storm-id])
- (remove-worker-backpressure! [this storm-id node port])
- (activate-storm! [this storm-id storm-base])
- (update-storm! [this storm-id new-elems])
- (remove-storm-base! [this storm-id])
- (set-assignment! [this storm-id info])
- ;; sets up information related to key consisting of nimbus
- ;; host:port and version info of the blob
- (setup-blobstore! [this key nimbusInfo versionInfo])
- (active-keys [this])
- (blobstore [this callback])
- (remove-storm! [this storm-id])
- (remove-blobstore-key! [this blob-key])
- (remove-key-version! [this blob-key])
- (report-error [this storm-id component-id node port error])
- (errors [this storm-id component-id])
- (last-error [this storm-id component-id])
- (set-credentials! [this storm-id creds topo-conf])
- (credentials [this storm-id callback])
- (disconnect [this]))
-
-(def ASSIGNMENTS-ROOT "assignments")
-(def CODE-ROOT "code")
-(def STORMS-ROOT "storms")
-(def SUPERVISORS-ROOT "supervisors")
-(def WORKERBEATS-ROOT "workerbeats")
-(def BACKPRESSURE-ROOT "backpressure")
-(def ERRORS-ROOT "errors")
-(def BLOBSTORE-ROOT "blobstore")
-; Stores the latest update sequence for a blob
-(def BLOBSTORE-MAX-KEY-SEQUENCE-NUMBER-ROOT "blobstoremaxkeysequencenumber")
-(def NIMBUSES-ROOT "nimbuses")
-(def CREDENTIALS-ROOT "credentials")
-(def LOGCONFIG-ROOT "logconfigs")
-(def PROFILERCONFIG-ROOT "profilerconfigs")
-
-(def ASSIGNMENTS-SUBTREE (str "/" ASSIGNMENTS-ROOT))
-(def STORMS-SUBTREE (str "/" STORMS-ROOT))
-(def SUPERVISORS-SUBTREE (str "/" SUPERVISORS-ROOT))
-(def WORKERBEATS-SUBTREE (str "/" WORKERBEATS-ROOT))
-(def BACKPRESSURE-SUBTREE (str "/" BACKPRESSURE-ROOT))
-(def ERRORS-SUBTREE (str "/" ERRORS-ROOT))
-;; Blobstore subtree /storm/blobstore
-(def BLOBSTORE-SUBTREE (str "/" BLOBSTORE-ROOT))
-(def BLOBSTORE-MAX-KEY-SEQUENCE-NUMBER-SUBTREE (str "/" BLOBSTORE-MAX-KEY-SEQUENCE-NUMBER-ROOT))
-(def NIMBUSES-SUBTREE (str "/" NIMBUSES-ROOT))
-(def CREDENTIALS-SUBTREE (str "/" CREDENTIALS-ROOT))
-(def LOGCONFIG-SUBTREE (str "/" LOGCONFIG-ROOT))
-(def PROFILERCONFIG-SUBTREE (str "/" PROFILERCONFIG-ROOT))
-
-(defn supervisor-path
- [id]
- (str SUPERVISORS-SUBTREE "/" id))
-
-(defn assignment-path
- [id]
- (str ASSIGNMENTS-SUBTREE "/" id))
-
-(defn blobstore-path
- [key]
- (str BLOBSTORE-SUBTREE "/" key))
-
-(defn blobstore-max-key-sequence-number-path
- [key]
- (str BLOBSTORE-MAX-KEY-SEQUENCE-NUMBER-SUBTREE "/" key))
-
-(defn nimbus-path
- [id]
- (str NIMBUSES-SUBTREE "/" id))
-
-(defn storm-path
- [id]
- (str STORMS-SUBTREE "/" id))
-
-(defn workerbeat-storm-root
- [storm-id]
- (str WORKERBEATS-SUBTREE "/" storm-id))
-
-(defn workerbeat-path
- [storm-id node port]
- (str (workerbeat-storm-root storm-id) "/" node "-" port))
-
-(defn backpressure-storm-root
- [storm-id]
- (str BACKPRESSURE-SUBTREE "/" storm-id))
-
-(defn backpressure-path
- [storm-id node port]
- (str (backpressure-storm-root storm-id) "/" node "-" port))
-
-(defn error-storm-root
- [storm-id]
- (str ERRORS-SUBTREE "/" storm-id))
-
-(defn error-path
- [storm-id component-id]
- (str (error-storm-root storm-id) "/" (url-encode component-id)))
-
-(def last-error-path-seg "last-error")
-
-(defn last-error-path
- [storm-id component-id]
- (str (error-storm-root storm-id)
- "/"
- (url-encode component-id)
- "-"
- last-error-path-seg))
-
-(defn credentials-path
- [storm-id]
- (str CREDENTIALS-SUBTREE "/" storm-id))
-
-(defn log-config-path
- [storm-id]
- (str LOGCONFIG-SUBTREE "/" storm-id))
-
-(defn profiler-config-path
- ([storm-id]
- (str PROFILERCONFIG-SUBTREE "/" storm-id))
- ([storm-id host port request-type]
- (str (profiler-config-path storm-id) "/" host "_" port "_" request-type)))
-
-(defn- issue-callback!
- [cb-atom]
- (let [cb @cb-atom]
- (reset! cb-atom nil)
- (when cb
- (cb))))
-
-(defn- issue-map-callback!
- [cb-atom id]
- (let [cb (@cb-atom id)]
- (swap! cb-atom dissoc id)
- (when cb
- (cb id))))
-
-(defn- maybe-deserialize
- [ser clazz]
- (when ser
- (Utils/deserialize ser clazz)))
-
-(defrecord TaskError [error time-secs host port])
-
-(defn- parse-error-path
- [^String p]
- (Long/parseLong (.substring p 1)))
-
-(defn convert-executor-beats
- "Ensures that we only return heartbeats for executors assigned to
- this worker."
- [executors worker-hb]
- (let [executor-stats (:executor-stats worker-hb)]
- (->> executors
- (map (fn [t]
- (if (contains? executor-stats t)
- {t {:time-secs (:time-secs worker-hb)
- :uptime (:uptime worker-hb)
- :stats (get executor-stats t)}})))
- (into {}))))
-
-;; Watches should be used for optimization. When ZK is reconnecting, they're not guaranteed to be called.
-(defnk mk-storm-cluster-state
- [cluster-state-spec :acls nil :context (ClusterStateContext.)]
- (let [[solo? cluster-state] (if (instance? ClusterState cluster-state-spec)
- [false cluster-state-spec]
- [true (mk-distributed-cluster-state cluster-state-spec :auth-conf cluster-state-spec :acls acls :context context)])
- assignment-info-callback (atom {})
- assignment-info-with-version-callback (atom {})
- assignment-version-callback (atom {})
- supervisors-callback (atom nil)
- backpressure-callback (atom {}) ;; we want to reigister a topo directory getChildren callback for all workers of this dir
- assignments-callback (atom nil)
- storm-base-callback (atom {})
- blobstore-callback (atom nil)
- credentials-callback (atom {})
- log-config-callback (atom {})
- state-id (.register
- cluster-state
- (fn [type path]
- (let [[subtree & args] (tokenize-path path)]
- (condp = subtree
- ASSIGNMENTS-ROOT (if (empty? args)
- (issue-callback! assignments-callback)
- (do
- (issue-map-callback! assignment-info-callback (first args))
- (issue-map-callback! assignment-version-callback (first args))
- (issue-map-callback! assignment-info-with-version-callback (first args))))
- SUPERVISORS-ROOT (issue-callback! supervisors-callback)
- BLOBSTORE-ROOT (issue-callback! blobstore-callback) ;; callback register for blobstore
- STORMS-ROOT (issue-map-callback! storm-base-callback (first args))
- CREDENTIALS-ROOT (issue-map-callback! credentials-callback (first args))
- LOGCONFIG-ROOT (issue-map-callback! log-config-callback (first args))
- BACKPRESSURE-ROOT (issue-map-callback! backpressure-callback (first args))
- ;; this should never happen
- (exit-process! 30 "Unknown callback for subtree " subtree args)))))]
- (doseq [p [ASSIGNMENTS-SUBTREE STORMS-SUBTREE SUPERVISORS-SUBTREE WORKERBEATS-SUBTREE ERRORS-SUBTREE BLOBSTORE-SUBTREE NIMBUSES-SUBTREE
- LOGCONFIG-SUBTREE BACKPRESSURE-SUBTREE]]
- (.mkdirs cluster-state p acls))
- (reify
- StormClusterState
-
- (assignments
- [this callback]
- (when callback
- (reset! assignments-callback callback))
- (.get_children cluster-state ASSIGNMENTS-SUBTREE (not-nil? callback)))
-
- (assignment-info
- [this storm-id callback]
- (when callback
- (swap! assignment-info-callback assoc storm-id callback))
- (clojurify-assignment (maybe-deserialize (.get_data cluster-state (assignment-path storm-id) (not-nil? callback)) Assignment)))
-
- (assignment-info-with-version
- [this storm-id callback]
- (when callback
- (swap! assignment-info-with-version-callback assoc storm-id callback))
- (let [{data :data version :version}
- (.get_data_with_version cluster-state (assignment-path storm-id) (not-nil? callback))]
- {:data (clojurify-assignment (maybe-deserialize data Assignment))
- :version version}))
-
- (assignment-version
- [this storm-id callback]
- (when callback
- (swap! assignment-version-callback assoc storm-id callback))
- (.get_version cluster-state (assignment-path storm-id) (not-nil? callback)))
-
- ;; blobstore state
- (blobstore
- [this callback]
- (when callback
- (reset! blobstore-callback callback))
- (.sync_path cluster-state BLOBSTORE-SUBTREE)
- (.get_children cluster-state BLOBSTORE-SUBTREE (not-nil? callback)))
-
- (nimbuses
- [this]
- (map #(maybe-deserialize (.get_data cluster-state (nimbus-path %1) false) NimbusSummary)
- (.get_children cluster-state NIMBUSES-SUBTREE false)))
-
- (add-nimbus-host!
- [this nimbus-id nimbus-summary]
- ;explicit delete for ephmeral node to ensure this session creates the entry.
- (.delete_node cluster-state (nimbus-path nimbus-id))
-
- (.add_listener cluster-state (reify ClusterStateListener
- (^void stateChanged[this ^ConnectionState newState]
- (log-message "Connection state listener invoked, zookeeper connection state has changed to " newState)
- (if (.equals newState ConnectionState/RECONNECTED)
- (do
- (log-message "Connection state has changed to reconnected so setting nimbuses entry one more time")
- ;explicit delete for ephmeral node to ensure this session creates the entry.
- (.delete_node cluster-state (nimbus-path nimbus-id))
- (.set_ephemeral_node cluster-state (nimbus-path nimbus-id) (Utils/serialize nimbus-summary) acls))))))
-
- (.set_ephemeral_node cluster-state (nimbus-path nimbus-id) (Utils/serialize nimbus-summary) acls))
-
- (setup-blobstore!
- [this key nimbusInfo versionInfo]
- (let [path (str (blobstore-path key) "/" (.toHostPortString nimbusInfo) "-" versionInfo)]
- (log-message "setup-path" path)
- (.mkdirs cluster-state (blobstore-path key) acls)
- ;we delete the node first to ensure the node gets created as part of this session only.
- (.delete_node_blobstore cluster-state (str (blobstore-path key)) (.toHostPortString nimbusInfo))
- (.set_ephemeral_node cluster-state path nil acls)))
-
- (blobstore-info
- [this blob-key]
- (let [path (blobstore-path blob-key)]
- (.sync_path cluster-state path)
- (.get_children cluster-state path false)))
-
- (active-storms
- [this]
- (.get_children cluster-state STORMS-SUBTREE false))
-
- (active-keys
- [this]
- (.get_children cluster-state BLOBSTORE-SUBTREE false))
-
- (heartbeat-storms
- [this]
- (.get_worker_hb_children cluster-state WORKERBEATS-SUBTREE false))
-
- (error-topologies
- [this]
- (.get_children cluster-state ERRORS-SUBTREE false))
-
- (backpressure-topologies
- [this]
- (.get_children cluster-state BACKPRESSURE-SUBTREE false))
-
- (get-worker-heartbeat
- [this storm-id node port]
- (let [worker-hb (.get_worker_hb cluster-state (workerbeat-path storm-id node port) false)]
- (if worker-hb
- (-> worker-hb
- (maybe-deserialize ClusterWorkerHeartbeat)
- clojurify-zk-worker-hb))))
-
- (executor-beats
- [this storm-id executor->node+port]
- ;; need to take executor->node+port in explicitly so that we don't run into a situation where a
- ;; long dead worker with a skewed clock overrides all the timestamps. By only checking heartbeats
- ;; with an assigned node+port, and only reading executors from that heartbeat that are actually assigned,
- ;; we avoid situations like that
- (let [node+port->executors (reverse-map executor->node+port)
- all-heartbeats (for [[[node port] executors] node+port->executors]
- (->> (get-worker-heartbeat this storm-id node port)
- (convert-executor-beats executors)
- ))]
- (apply merge all-heartbeats)))
-
- (supervisors
- [this callback]
- (when callback
- (reset! supervisors-callback callback))
- (.get_children cluster-state SUPERVISORS-SUBTREE (not-nil? callback)))
-
- (supervisor-info
- [this supervisor-id]
- (clojurify-supervisor-info (maybe-deserialize (.get_data cluster-state (supervisor-path supervisor-id) false) SupervisorInfo)))
-
- (topology-log-config
- [this storm-id cb]
- (when cb
- (swap! log-config-callback assoc storm-id cb))
- (maybe-deserialize (.get_data cluster-state (log-config-path storm-id) (not-nil? cb)) LogConfig))
-
- (set-topology-log-config!
- [this storm-id log-config]
- (.set_data cluster-state (log-config-path storm-id) (Utils/serialize log-config) acls))
-
- (set-worker-profile-request
- [this storm-id profile-request]
- (let [request-type (.get_action profile-request)
- host (.get_node (.get_nodeInfo profile-request))
- port (first (.get_port (.get_nodeInfo profile-request)))]
- (.set_data cluster-state
- (profiler-config-path storm-id host port request-type)
- (Utils/serialize profile-request)
- acls)))
-
- (get-topology-profile-requests
- [this storm-id thrift?]
- (let [path (profiler-config-path storm-id)
- requests (if (.node_exists cluster-state path false)
- (dofor [c (.get_children cluster-state path false)]
- (let [raw (.get_data cluster-state (str path "/" c) false)
- request (maybe-deserialize raw ProfileRequest)]
- (if thrift?
- request
- (clojurify-profile-request request)))))]
- requests))
-
- (delete-topology-profile-requests
- [this storm-id profile-request]
- (let [profile-request-inst (thriftify-profile-request profile-request)
- action (:action profile-request)
- host (:host profile-request)
- port (:port profile-request)]
- (.delete_node cluster-state
- (profiler-config-path storm-id host port action))))
-
- (get-worker-profile-requests
- [this storm-id node-info thrift?]
- (let [host (:host node-info)
- port (:port node-info)
- profile-requests (get-topology-profile-requests this storm-id thrift?)]
- (if thrift?
- (filter #(and (= host (.get_node (.get_nodeInfo %))) (= port (first (.get_port (.get_nodeInfo %)))))
- profile-requests)
- (filter #(and (= host (:host %)) (= port (:port %)))
- profile-requests))))
-
- (worker-heartbeat!
- [this storm-id node port info]
- (let [thrift-worker-hb (thriftify-zk-worker-hb info)]
- (if thrift-worker-hb
- (.set_worker_hb cluster-state (workerbeat-path storm-id node port) (Utils/serialize thrift-worker-hb) acls))))
-
- (remove-worker-heartbeat!
- [this storm-id node port]
- (.delete_worker_hb cluster-state (workerbeat-path storm-id node port)))
-
- (setup-heartbeats!
- [this storm-id]
- (.mkdirs cluster-state (workerbeat-storm-root storm-id) acls))
-
- (teardown-heartbeats!
- [this storm-id]
- (try-cause
- (.delete_worker_hb cluster-state (workerbeat-storm-root storm-id))
- (catch KeeperException e
- (log-warn-error e "Could not teardown heartbeats for " storm-id))))
-
- (worker-backpressure!
- [this storm-id node port on?]
- "if znode exists and to be not on?, delete; if exists and on?, do nothing;
- if not exists and to be on?, create; if not exists and not on?, do nothing"
- (let [path (backpressure-path storm-id node port)
- existed (.node_exists cluster-state path false)]
- (if existed
- (if (not on?)
- (.delete_node cluster-state path)) ;; delete the znode since the worker is not congested
- (if on?
- (.set_ephemeral_node cluster-state path nil acls))))) ;; create the znode since worker is congested
-
- (topology-backpressure
- [this storm-id callback]
- "if the backpresure/storm-id dir is not empty, this topology has throttle-on, otherwise throttle-off.
- The backpressure/storm-id dir may not exist if nimbus has shutdown the topology"
- (when callback
- (swap! backpressure-callback assoc storm-id callback))
- (let [path (backpressure-storm-root storm-id)
- children (if (.node_exists cluster-state path false)
- (.get_children cluster-state path (not-nil? callback))) ]
- (> (count children) 0)))
-
- (setup-backpressure!
- [this storm-id]
- (.mkdirs cluster-state (backpressure-storm-root storm-id) acls))
-
- (remove-backpressure!
- [this storm-id]
- (.delete_node cluster-state (backpressure-storm-root storm-id)))
-
- (remove-worker-backpressure!
- [this storm-id node port]
- (let [path (backpressure-path storm-id node port)
- existed (.node_exists cluster-state path false)]
- (if existed
- (.delete_node cluster-state (backpressure-path storm-id node port)))))
-
- (teardown-topology-errors!
- [this storm-id]
- (try-cause
- (.delete_node cluster-state (error-storm-root storm-id))
- (catch KeeperException e
- (log-warn-error e "Could not teardown errors for " storm-id))))
-
- (supervisor-heartbeat!
- [this supervisor-id info]
- (let [thrift-supervisor-info (thriftify-supervisor-info info)]
- (.set_ephemeral_node cluster-state (supervisor-path supervisor-id) (Utils/serialize thrift-supervisor-info) acls)))
-
- (activate-storm!
- [this storm-id storm-base]
- (let [thrift-storm-base (thriftify-storm-base storm-base)]
- (.set_data cluster-state (storm-path storm-id) (Utils/serialize thrift-storm-base) acls)))
-
- (update-storm!
- [this storm-id new-elems]
- (let [base (storm-base this storm-id nil)
- executors (:component->executors base)
- component->debug (:component->debug base)
- new-elems (update new-elems :component->executors (partial merge executors))
- new-elems (update new-elems :component->debug (partial merge-with merge component->debug))]
- (.set_data cluster-state (storm-path storm-id)
- (-> base
- (merge new-elems)
- thriftify-storm-base
- Utils/serialize)
- acls)))
-
- (storm-base
- [this storm-id callback]
- (when callback
- (swap! storm-base-callback assoc storm-id callback))
- (clojurify-storm-base (maybe-deserialize (.get_data cluster-state (storm-path storm-id) (not-nil? callback)) StormBase)))
-
- (remove-storm-base!
- [this storm-id]
- (.delete_node cluster-state (storm-path storm-id)))
-
- (set-assignment!
- [this storm-id info]
- (let [thrift-assignment (thriftify-assignment info)]
- (.set_data cluster-state (assignment-path storm-id) (Utils/serialize thrift-assignment) acls)))
-
- (remove-blobstore-key!
- [this blob-key]
- (log-debug "removing key" blob-key)
- (.delete_node cluster-state (blobstore-path blob-key)))
-
- (remove-key-version!
- [this blob-key]
- (.delete_node cluster-state (blobstore-max-key-sequence-number-path blob-key)))
-
- (remove-storm!
- [this storm-id]
- (.delete_node cluster-state (assignment-path storm-id))
- (.delete_node cluster-state (credentials-path storm-id))
- (.delete_node cluster-state (log-config-path storm-id))
- (.delete_node cluster-state (profiler-config-path storm-id))
- (remove-storm-base! this storm-id))
-
- (set-credentials!
- [this storm-id creds topo-conf]
- (let [topo-acls (mk-topo-only-acls topo-conf)
- path (credentials-path storm-id)
- thriftified-creds (thriftify-credentials creds)]
- (.set_data cluster-state path (Utils/serialize thriftified-creds) topo-acls)))
-
- (credentials
- [this storm-id callback]
- (when callback
- (swap! credentials-callback assoc storm-id callback))
- (clojurify-crdentials (maybe-deserialize (.get_data cluster-state (credentials-path storm-id) (not-nil? callback)) Credentials)))
-
- (report-error
- [this storm-id component-id node port error]
- (let [path (error-path storm-id component-id)
- last-error-path (last-error-path storm-id component-id)
- data (thriftify-error {:time-secs (current-time-secs) :error (stringify-error error) :host node :port port})
- _ (.mkdirs cluster-state path acls)
- ser-data (Utils/serialize data)
- _ (.mkdirs cluster-state path acls)
- _ (.create_sequential cluster-state (str path "/e") ser-data acls)
- _ (.set_data cluster-state last-error-path ser-data acls)
- to-kill (->> (.get_children cluster-state path false)
- (sort-by parse-error-path)
- reverse
- (drop 10))]
- (doseq [k to-kill]
- (.delete_node cluster-state (str path "/" k)))))
-
- (errors
- [this storm-id component-id]
- (let [path (error-path storm-id component-id)
- errors (if (.node_exists cluster-state path false)
- (dofor [c (.get_children cluster-state path false)]
- (if-let [data (-> (.get_data cluster-state
- (str path "/" c)
- false)
- (maybe-deserialize ErrorInfo)
- clojurify-error)]
- (map->TaskError data)))
- ())]
- (->> (filter not-nil? errors)
- (sort-by (comp - :time-secs)))))
-
- (last-error
- [this storm-id component-id]
- (let [path (last-error-path storm-id component-id)]
- (if (.node_exists cluster-state path false)
- (if-let [data (-> (.get_data cluster-state path false)
- (maybe-deserialize ErrorInfo)
- clojurify-error)]
- (map->TaskError data)))))
-
- (disconnect
- [this]
- (.unregister cluster-state state-id)
- (when solo?
- (.close cluster-state))))))
-
-;; daemons have a single thread that will respond to events
-;; start with initialize event
-;; callbacks add events to the thread's queue
-
-;; keeps in memory cache of the state, only for what client subscribes to. Any subscription is automatically kept in sync, and when there are changes, client is notified.
-;; master gives orders through state, and client records status in state (ephemerally)
-
-;; master tells nodes what workers to launch
-
-;; master writes this. supervisors and workers subscribe to this to understand complete topology. each storm is a map from nodes to workers to tasks to ports whenever topology changes everyone will be notified
-;; master includes timestamp of each assignment so that appropriate time can be given to each worker to start up
-;; /assignments/{storm id}
-
-;; which tasks they talk to, etc. (immutable until shutdown)
-;; everyone reads this in full to understand structure
-;; /tasks/{storm id}/{task id} ; just contains bolt id
-
-;; supervisors send heartbeats here, master doesn't subscribe but checks asynchronously
-;; /supervisors/status/{ephemeral node ids} ;; node metadata such as port ranges are kept here
-
-;; tasks send heartbeats here, master doesn't subscribe, just checks asynchronously
-;; /taskbeats/{storm id}/{ephemeral task id}
-
-;; contains data about whether it's started or not, tasks and workers subscribe to specific storm here to know when to shutdown
-;; master manipulates
-;; /storms/{storm id}
-
-;; Zookeeper flows:
-
-;; Master:
-;; job submit:
-;; 1. read which nodes are available
-;; 2. set up the worker/{storm}/{task} stuff (static)
-;; 3. set assignments
-;; 4. start storm - necessary in case master goes down, when goes back up can remember to take down the storm (2 states: on or off)
-
-;; Monitoring (or by checking when nodes go down or heartbeats aren't received):
-;; 1. read assignment
-;; 2. see which tasks/nodes are up
-;; 3. make new assignment to fix any problems
-;; 4. if a storm exists but is not taken down fully, ensure that storm takedown is launched (step by step remove tasks and finally remove assignments)
-
-;; masters only possible watches is on ephemeral nodes and tasks, and maybe not even
-
-;; Supervisor:
-;; 1. monitor /storms/* and assignments
-;; 2. local state about which workers are local
-;; 3. when storm is on, check that workers are running locally & start/kill if different than assignments
-;; 4. when storm is off, monitor tasks for workers - when they all die or don't hearbeat, kill the process and cleanup
-
-;; Worker:
-;; 1. On startup, start the tasks if the storm is on
-
-;; Task:
-;; 1. monitor assignments, reroute when assignments change
-;; 2. monitor storm (when storm turns off, error if assignments change) - take down tasks as master turns them off
-
-;; locally on supervisor: workers write pids locally on startup, supervisor deletes it on shutdown (associates pid with worker name)
-;; supervisor periodically checks to make sure processes are alive
-;; {rootdir}/workers/{storm id}/{worker id} ;; contains pid inside
-
-;; all tasks in a worker share the same cluster state
-;; workers, supervisors, and tasks subscribes to storm to know when it's started or stopped
-;; on stopped, master removes records in order (tasks need to subscribe to themselves to see if they disappear)
-;; when a master removes a worker, the supervisor should kill it (and escalate to kill -9)
-;; on shutdown, tasks subscribe to tasks that send data to them to wait for them to die. when node disappears, they can die
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/cluster_state/zookeeper_state_factory.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/cluster_state/zookeeper_state_factory.clj b/storm-core/src/clj/backtype/storm/cluster_state/zookeeper_state_factory.clj
deleted file mode 100644
index 061c9e8..0000000
--- a/storm-core/src/clj/backtype/storm/cluster_state/zookeeper_state_factory.clj
+++ /dev/null
@@ -1,165 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.cluster-state.zookeeper-state-factory
- (:import [org.apache.curator.framework.state ConnectionStateListener])
- (:import [org.apache.zookeeper KeeperException$NoNodeException KeeperException$NodeExistsException]
- [org.apache.storm.cluster ClusterState DaemonType])
- (:import [org.apache.storm.utils StormConnectionStateConverter])
- (:use [org.apache.storm cluster config log util])
- (:require [org.apache.storm [zookeeper :as zk]])
- (:gen-class
- :implements [org.apache.storm.cluster.ClusterStateFactory]))
-
-(defn -mkState [this conf auth-conf acls context]
- (let [zk (zk/mk-client conf (conf STORM-ZOOKEEPER-SERVERS) (conf STORM-ZOOKEEPER-PORT) :auth-conf auth-conf)]
- (zk/mkdirs zk (conf STORM-ZOOKEEPER-ROOT) acls)
- (.close zk))
- (let [callbacks (atom {})
- active (atom true)
- zk-writer (zk/mk-client conf
- (conf STORM-ZOOKEEPER-SERVERS)
- (conf STORM-ZOOKEEPER-PORT)
- :auth-conf auth-conf
- :root (conf STORM-ZOOKEEPER-ROOT)
- :watcher (fn [state type path]
- (when @active
- (when-not (= :connected state)
- (log-warn "Received event " state ":" type ":" path " with disconnected Writer Zookeeper."))
- (when-not (= :none type)
- (doseq [callback (vals @callbacks)]
- (callback type path))))))
- is-nimbus? (= (.getDaemonType context) DaemonType/NIMBUS)
- zk-reader (if is-nimbus?
- (zk/mk-client conf
- (conf STORM-ZOOKEEPER-SERVERS)
- (conf STORM-ZOOKEEPER-PORT)
- :auth-conf auth-conf
- :root (conf STORM-ZOOKEEPER-ROOT)
- :watcher (fn [state type path]
- (when @active
- (when-not (= :connected state)
- (log-warn "Received event " state ":" type ":" path " with disconnected Reader Zookeeper."))
- (when-not (= :none type)
- (doseq [callback (vals @callbacks)]
- (callback type path))))))
- zk-writer)]
- (reify
- ClusterState
-
- (register
- [this callback]
- (let [id (uuid)]
- (swap! callbacks assoc id callback)
- id))
-
- (unregister
- [this id]
- (swap! callbacks dissoc id))
-
- (set-ephemeral-node
- [this path data acls]
- (zk/mkdirs zk-writer (parent-path path) acls)
- (if (zk/exists zk-writer path false)
- (try-cause
- (zk/set-data zk-writer path data) ; should verify that it's ephemeral
- (catch KeeperException$NoNodeException e
- (log-warn-error e "Ephemeral node disappeared between checking for existing and setting data")
- (zk/create-node zk-writer path data :ephemeral acls)))
- (zk/create-node zk-writer path data :ephemeral acls)))
-
- (create-sequential
- [this path data acls]
- (zk/create-node zk-writer path data :sequential acls))
-
- (set-data
- [this path data acls]
- ;; note: this does not turn off any existing watches
- (if (zk/exists zk-writer path false)
- (zk/set-data zk-writer path data)
- (do
- (zk/mkdirs zk-writer (parent-path path) acls)
- (try-cause
- (zk/create-node zk-writer path data :persistent acls)
- (catch KeeperException$NodeExistsException e
- (zk/set-data zk-writer path data))))))
-
- (set-worker-hb
- [this path data acls]
- (.set_data this path data acls))
-
- (delete-node
- [this path]
- (zk/delete-node zk-writer path))
-
- (delete-worker-hb
- [this path]
- (.delete_node this path))
-
- (get-data
- [this path watch?]
- (zk/get-data zk-reader path watch?))
-
- (get-data-with-version
- [this path watch?]
- (zk/get-data-with-version zk-reader path watch?))
-
- (get-version
- [this path watch?]
- (zk/get-version zk-reader path watch?))
-
- (get-worker-hb
- [this path watch?]
- (.get_data this path watch?))
-
- (get-children
- [this path watch?]
- (zk/get-children zk-reader path watch?))
-
- (get-worker-hb-children
- [this path watch?]
- (.get_children this path watch?))
-
- (mkdirs
- [this path acls]
- (zk/mkdirs zk-writer path acls))
-
- (node-exists
- [this path watch?]
- (zk/exists-node? zk-reader path watch?))
-
- (add-listener
- [this listener]
- (let [curator-listener (reify ConnectionStateListener
- (stateChanged
- [this client newState]
- (.stateChanged listener (StormConnectionStateConverter/convert newState))))]
- (zk/add-listener zk-reader curator-listener)))
-
- (sync-path
- [this path]
- (zk/sync-path zk-writer path))
-
- (delete-node-blobstore
- [this path nimbus-host-port-info]
- (zk/delete-node-blobstore zk-writer path nimbus-host-port-info))
-
- (close
- [this]
- (reset! active false)
- (.close zk-writer)
- (if is-nimbus?
- (.close zk-reader))))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/activate.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/activate.clj b/storm-core/src/clj/backtype/storm/command/activate.clj
deleted file mode 100644
index dc452e8..0000000
--- a/storm-core/src/clj/backtype/storm/command/activate.clj
+++ /dev/null
@@ -1,24 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.activate
- (:use [org.apache.storm thrift log])
- (:gen-class))
-
-(defn -main [name]
- (with-configured-nimbus-connection nimbus
- (.activate nimbus name)
- (log-message "Activated topology: " name)
- ))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/blobstore.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/blobstore.clj b/storm-core/src/clj/backtype/storm/command/blobstore.clj
deleted file mode 100644
index b1496db..0000000
--- a/storm-core/src/clj/backtype/storm/command/blobstore.clj
+++ /dev/null
@@ -1,162 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.blobstore
- (:import [java.io InputStream OutputStream]
- [org.apache.storm.generated SettableBlobMeta AccessControl AuthorizationException
- KeyNotFoundException]
- [org.apache.storm.blobstore BlobStoreAclHandler])
- (:use [org.apache.storm config]
- [clojure.string :only [split]]
- [clojure.tools.cli :only [cli]]
- [clojure.java.io :only [copy input-stream output-stream]]
- [org.apache.storm blobstore log util])
- (:gen-class))
-
-(defn update-blob-from-stream
- "Update a blob in the blob store from an InputStream"
- [key ^InputStream in]
- (with-configured-blob-client blobstore
- (let [out (.updateBlob blobstore key)]
- (try
- (copy in out)
- (.close out)
- (catch Exception e
- (log-message e)
- (.cancel out)
- (throw e))))))
-
-(defn create-blob-from-stream
- "Create a blob in the blob store from an InputStream"
- [key ^InputStream in ^SettableBlobMeta meta]
- (with-configured-blob-client blobstore
- (let [out (.createBlob blobstore key meta)]
- (try
- (copy in out)
- (.close out)
- (catch Exception e
- (.cancel out)
- (throw e))))))
-
-(defn read-blob
- "Read a blob in the blob store and write to an OutputStream"
- [key ^OutputStream out]
- (with-configured-blob-client blobstore
- (with-open [in (.getBlob blobstore key)]
- (copy in out))))
-
-(defn as-access-control
- "Convert a parameter to an AccessControl object"
- [param]
- (BlobStoreAclHandler/parseAccessControl (str param)))
-
-(defn as-acl
- [param]
- (map as-access-control (split param #",")))
-
-(defn access-control-str
- [^AccessControl acl]
- (BlobStoreAclHandler/accessControlToString acl))
-
-(defn read-cli [args]
- (let [[{file :file} [key] _] (cli args ["-f" "--file" :default nil])]
- (if file
- (with-open [f (output-stream file)]
- (read-blob key f))
- (read-blob key System/out))))
-
-(defn update-cli [args]
- (let [[{file :file} [key] _] (cli args ["-f" "--file" :default nil])]
- (if file
- (with-open [f (input-stream file)]
- (update-blob-from-stream key f))
- (update-blob-from-stream key System/in))
- (log-message "Successfully updated " key)))
-
-(defn create-cli [args]
- (let [[{file :file acl :acl replication-factor :replication-factor} [key] _] (cli args ["-f" "--file" :default nil]
- ["-a" "--acl" :default [] :parse-fn as-acl]
- ["-r" "--replication-factor" :default -1 :parse-fn parse-int])
- meta (doto (SettableBlobMeta. acl)
- (.set_replication_factor replication-factor))]
- (validate-key-name! key)
- (log-message "Creating " key " with ACL " (pr-str (map access-control-str acl)))
- (if file
- (with-open [f (input-stream file)]
- (create-blob-from-stream key f meta))
- (create-blob-from-stream key System/in meta))
- (log-message "Successfully created " key)))
-
-(defn delete-cli [args]
- (with-configured-blob-client blobstore
- (doseq [key args]
- (.deleteBlob blobstore key)
- (log-message "deleted " key))))
-
-(defn list-cli [args]
- (with-configured-blob-client blobstore
- (let [keys (if (empty? args) (iterator-seq (.listKeys blobstore)) args)]
- (doseq [key keys]
- (try
- (let [meta (.getBlobMeta blobstore key)
- version (.get_version meta)
- acl (.get_acl (.get_settable meta))]
- (log-message key " " version " " (pr-str (map access-control-str acl))))
- (catch AuthorizationException ae
- (if-not (empty? args) (log-error "ACCESS DENIED to key: " key)))
- (catch KeyNotFoundException knf
- (if-not (empty? args) (log-error key " NOT FOUND"))))))))
-
-(defn set-acl-cli [args]
- (let [[{set-acl :set} [key] _]
- (cli args ["-s" "--set" :default [] :parse-fn as-acl])]
- (with-configured-blob-client blobstore
- (let [meta (.getBlobMeta blobstore key)
- acl (.get_acl (.get_settable meta))
- new-acl (if set-acl set-acl acl)
- new-meta (SettableBlobMeta. new-acl)]
- (log-message "Setting ACL for " key " to " (pr-str (map access-control-str new-acl)))
- (.setBlobMeta blobstore key new-meta)))))
-
-(defn rep-cli [args]
- (let [sub-command (first args)
- new-args (rest args)]
- (with-configured-blob-client blobstore
- (condp = sub-command
- "--read" (let [key (first new-args)
- blob-replication (.getBlobReplication blobstore key)]
- (log-message "Current replication factor " blob-replication)
- blob-replication)
- "--update" (let [[{replication-factor :replication-factor} [key] _]
- (cli new-args ["-r" "--replication-factor" :parse-fn parse-int])]
- (if (nil? replication-factor)
- (throw (RuntimeException. (str "Please set the replication factor")))
- (let [blob-replication (.updateBlobReplication blobstore key replication-factor)]
- (log-message "Replication factor is set to " blob-replication)
- blob-replication)))
- :else (throw (RuntimeException. (str sub-command " is not a supported blobstore command")))))))
-
-(defn -main [& args]
- (let [command (first args)
- new-args (rest args)]
- (condp = command
- "cat" (read-cli new-args)
- "create" (create-cli new-args)
- "update" (update-cli new-args)
- "delete" (delete-cli new-args)
- "list" (list-cli new-args)
- "set-acl" (set-acl-cli new-args)
- "replication" (rep-cli new-args)
- :else (throw (RuntimeException. (str command " is not a supported blobstore command"))))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/config_value.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/config_value.clj b/storm-core/src/clj/backtype/storm/command/config_value.clj
deleted file mode 100644
index 9bc3e92..0000000
--- a/storm-core/src/clj/backtype/storm/command/config_value.clj
+++ /dev/null
@@ -1,24 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.config-value
- (:use [org.apache.storm config log])
- (:gen-class))
-
-
-(defn -main [^String name]
- (let [conf (read-storm-config)]
- (println "VALUE:" (conf name))
- ))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/deactivate.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/deactivate.clj b/storm-core/src/clj/backtype/storm/command/deactivate.clj
deleted file mode 100644
index 4fd2c85..0000000
--- a/storm-core/src/clj/backtype/storm/command/deactivate.clj
+++ /dev/null
@@ -1,24 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.deactivate
- (:use [org.apache.storm thrift log])
- (:gen-class))
-
-(defn -main [name]
- (with-configured-nimbus-connection nimbus
- (.deactivate nimbus name)
- (log-message "Deactivated topology: " name)
- ))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/dev_zookeeper.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/dev_zookeeper.clj b/storm-core/src/clj/backtype/storm/command/dev_zookeeper.clj
deleted file mode 100644
index 96de02d..0000000
--- a/storm-core/src/clj/backtype/storm/command/dev_zookeeper.clj
+++ /dev/null
@@ -1,26 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.dev-zookeeper
- (:use [org.apache.storm zookeeper util config])
- (:gen-class))
-
-(defn -main [& args]
- (let [conf (read-storm-config)
- port (conf STORM-ZOOKEEPER-PORT)
- localpath (conf DEV-ZOOKEEPER-PATH)]
- (rmr localpath)
- (mk-inprocess-zookeeper localpath :port port)
- ))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/get_errors.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/get_errors.clj b/storm-core/src/clj/backtype/storm/command/get_errors.clj
deleted file mode 100644
index c267390..0000000
--- a/storm-core/src/clj/backtype/storm/command/get_errors.clj
+++ /dev/null
@@ -1,52 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.get-errors
- (:use [clojure.tools.cli :only [cli]])
- (:use [org.apache.storm thrift log])
- (:use [org.apache.storm util])
- (:require [org.apache.storm.daemon
- [nimbus :as nimbus]
- [common :as common]])
- (:import [org.apache.storm.generated GetInfoOptions NumErrorsChoice
- TopologySummary ErrorInfo])
- (:gen-class))
-
-(defn get-topology-id [name topologies]
- (let [topology (first (filter #(= (.get_name %1) name) topologies))]
- (when (not-nil? topology) (.get_id topology))))
-
-(defn get-component-errors
- [topology-errors]
- (apply hash-map (remove nil?
- (flatten (for [[comp-name comp-errors] topology-errors]
- (let [latest-error (when (not (empty? comp-errors)) (first comp-errors))]
- (if latest-error [comp-name (.get_error ^ErrorInfo latest-error)])))))))
-
-(defn -main [name]
- (with-configured-nimbus-connection nimbus
- (let [opts (doto (GetInfoOptions.)
- (.set_num_err_choice NumErrorsChoice/ONE))
- cluster-info (.getClusterInfo nimbus)
- topologies (.get_topologies cluster-info)
- topo-id (get-topology-id name topologies)
- topo-info (when (not-nil? topo-id) (.getTopologyInfoWithOpts nimbus topo-id opts))]
- (if (or (nil? topo-id) (nil? topo-info))
- (println (to-json {"Failure" (str "No topologies running with name " name)}))
- (let [topology-name (.get_name topo-info)
- topology-errors (.get_errors topo-info)]
- (println (to-json (hash-map
- "Topology Name" topology-name
- "Comp-Errors" (get-component-errors topology-errors)))))))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/healthcheck.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/healthcheck.clj b/storm-core/src/clj/backtype/storm/command/healthcheck.clj
deleted file mode 100644
index d96d7b3..0000000
--- a/storm-core/src/clj/backtype/storm/command/healthcheck.clj
+++ /dev/null
@@ -1,88 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.healthcheck
- (:require [org.apache.storm
- [config :refer :all]
- [log :refer :all]]
- [clojure.java [io :as io]]
- [clojure [string :refer [split]]])
- (:gen-class))
-
-(defn interrupter
- "Interrupt a given thread after ms milliseconds."
- [thread ms]
- (let [interrupter (Thread.
- (fn []
- (try
- (Thread/sleep ms)
- (.interrupt thread)
- (catch InterruptedException e))))]
- (.start interrupter)
- interrupter))
-
-(defn check-output [lines]
- (if (some #(.startsWith % "ERROR") lines)
- :failed
- :success))
-
-(defn process-script [conf script]
- (let [script-proc (. (Runtime/getRuntime) (exec script))
- curthread (Thread/currentThread)
- interrupter-thread (interrupter curthread
- (conf STORM-HEALTH-CHECK-TIMEOUT-MS))]
- (try
- (.waitFor script-proc)
- (.interrupt interrupter-thread)
- (if (not (= (.exitValue script-proc) 0))
- :failed_with_exit_code
- (check-output (split
- (slurp (.getInputStream script-proc))
- #"\n+")))
- (catch InterruptedException e
- (println "Script" script "timed out.")
- :timeout)
- (catch Exception e
- (println "Script failed with exception: " e)
- :failed_with_exception)
- (finally (.interrupt interrupter-thread)))))
-
-(defn health-check [conf]
- (let [health-dir (absolute-healthcheck-dir conf)
- health-files (file-seq (io/file health-dir))
- health-scripts (filter #(and (.canExecute %)
- (not (.isDirectory %)))
- health-files)
- results (->> health-scripts
- (map #(.getAbsolutePath %))
- (map (partial process-script conf)))]
- (log-message
- (pr-str (map #'vector
- (map #(.getAbsolutePath %) health-scripts)
- results)))
- ; failed_with_exit_code is OK. We're mimicing Hadoop's health checks.
- ; We treat non-zero exit codes as indicators that the scripts failed
- ; to execute properly, not that the system is unhealthy, in which case
- ; we don't want to start killing things.
- (if (every? #(or (= % :failed_with_exit_code)
- (= % :success))
- results)
- 0
- 1)))
-
-(defn -main [& args]
- (let [conf (read-storm-config)]
- (System/exit
- (health-check conf))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/heartbeats.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/heartbeats.clj b/storm-core/src/clj/backtype/storm/command/heartbeats.clj
deleted file mode 100644
index ff28cba..0000000
--- a/storm-core/src/clj/backtype/storm/command/heartbeats.clj
+++ /dev/null
@@ -1,52 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.heartbeats
- (:require [org.apache.storm
- [config :refer :all]
- [log :refer :all]
- [cluster :refer :all]
- [converter :refer :all]]
- [clojure.string :refer :all])
- (:import [org.apache.storm.generated ClusterWorkerHeartbeat]
- [org.apache.storm.utils Utils])
- (:gen-class))
-
-(defn -main [command path & args]
- (let [conf (read-storm-config)
- cluster (mk-distributed-cluster-state conf :auth-conf conf)]
- (println "Command: [" command "]")
- (condp = command
- "list"
- (let [message (join " \n" (.get_worker_hb_children cluster path false))]
- (log-message "list " path ":\n"
- message "\n"))
- "get"
- (log-message
- (if-let [hb (.get_worker_hb cluster path false)]
- (clojurify-zk-worker-hb
- (Utils/deserialize
- hb
- ClusterWorkerHeartbeat))
- "Nothing"))
-
- (log-message "Usage: heartbeats [list|get] path"))
-
- (try
- (.close cluster)
- (catch Exception e
- (log-message "Caught exception: " e " on close."))))
- (System/exit 0))
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/kill_topology.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/kill_topology.clj b/storm-core/src/clj/backtype/storm/command/kill_topology.clj
deleted file mode 100644
index 84e0a64..0000000
--- a/storm-core/src/clj/backtype/storm/command/kill_topology.clj
+++ /dev/null
@@ -1,29 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.kill-topology
- (:use [clojure.tools.cli :only [cli]])
- (:use [org.apache.storm thrift config log])
- (:import [org.apache.storm.generated KillOptions])
- (:gen-class))
-
-(defn -main [& args]
- (let [[{wait :wait} [name] _] (cli args ["-w" "--wait" :default nil :parse-fn #(Integer/parseInt %)])
- opts (KillOptions.)]
- (if wait (.set_wait_secs opts wait))
- (with-configured-nimbus-connection nimbus
- (.killTopologyWithOpts nimbus name opts)
- (log-message "Killed topology: " name)
- )))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/kill_workers.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/kill_workers.clj b/storm-core/src/clj/backtype/storm/command/kill_workers.clj
deleted file mode 100644
index 2670735..0000000
--- a/storm-core/src/clj/backtype/storm/command/kill_workers.clj
+++ /dev/null
@@ -1,33 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.kill-workers
- (:import [java.io File])
- (:use [org.apache.storm.daemon common])
- (:use [org.apache.storm util config])
- (:require [org.apache.storm.daemon
- [supervisor :as supervisor]])
- (:gen-class))
-
-(defn -main
- "Construct the supervisor-data from scratch and kill the workers on this supervisor"
- [& args]
- (let [conf (read-storm-config)
- conf (assoc conf STORM-LOCAL-DIR (. (File. (conf STORM-LOCAL-DIR)) getCanonicalPath))
- isupervisor (supervisor/standalone-supervisor)
- supervisor-data (supervisor/supervisor-data conf nil isupervisor)
- ids (supervisor/my-worker-ids conf)]
- (doseq [id ids]
- (supervisor/shutdown-worker supervisor-data id))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/list.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/list.clj b/storm-core/src/clj/backtype/storm/command/list.clj
deleted file mode 100644
index 87975cd..0000000
--- a/storm-core/src/clj/backtype/storm/command/list.clj
+++ /dev/null
@@ -1,38 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.list
- (:use [org.apache.storm thrift log])
- (:import [org.apache.storm.generated TopologySummary])
- (:gen-class))
-
-(defn -main []
- (with-configured-nimbus-connection nimbus
- (let [cluster-info (.getClusterInfo nimbus)
- topologies (.get_topologies cluster-info)
- msg-format "%-20s %-10s %-10s %-12s %-10s"]
- (if (or (nil? topologies) (empty? topologies))
- (println "No topologies running.")
- (do
- (println (format msg-format "Topology_name" "Status" "Num_tasks" "Num_workers" "Uptime_secs"))
- (println "-------------------------------------------------------------------")
- (doseq [^TopologySummary topology topologies]
- (let [topology-name (.get_name topology)
- topology-status (.get_status topology)
- topology-num-tasks (.get_num_tasks topology)
- topology-num-workers (.get_num_workers topology)
- topology-uptime-secs (.get_uptime_secs topology)]
- (println (format msg-format topology-name topology-status topology-num-tasks
- topology-num-workers topology-uptime-secs)))))))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/monitor.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/monitor.clj b/storm-core/src/clj/backtype/storm/command/monitor.clj
deleted file mode 100644
index 7fa9b2a..0000000
--- a/storm-core/src/clj/backtype/storm/command/monitor.clj
+++ /dev/null
@@ -1,37 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.monitor
- (:use [clojure.tools.cli :only [cli]])
- (:use [org.apache.storm.thrift :only [with-configured-nimbus-connection]])
- (:import [org.apache.storm.utils Monitor])
- (:gen-class)
- )
-
-(defn -main [& args]
- (let [[{interval :interval component :component stream :stream watch :watch} [name] _]
- (cli args ["-i" "--interval" :default 4 :parse-fn #(Integer/parseInt %)]
- ["-m" "--component" :default nil]
- ["-s" "--stream" :default "default"]
- ["-w" "--watch" :default "emitted"])
- mon (Monitor.)]
- (if interval (.set_interval mon interval))
- (if name (.set_topology mon name))
- (if component (.set_component mon component))
- (if stream (.set_stream mon stream))
- (if watch (.set_watch mon watch))
- (with-configured-nimbus-connection nimbus
- (.metrics mon nimbus)
- )))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/rebalance.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/rebalance.clj b/storm-core/src/clj/backtype/storm/command/rebalance.clj
deleted file mode 100644
index 3868091..0000000
--- a/storm-core/src/clj/backtype/storm/command/rebalance.clj
+++ /dev/null
@@ -1,46 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.rebalance
- (:use [clojure.tools.cli :only [cli]])
- (:use [org.apache.storm thrift config log])
- (:import [org.apache.storm.generated RebalanceOptions])
- (:gen-class))
-
-(defn- parse-executor [^String s]
- (let [eq-pos (.lastIndexOf s "=")
- name (.substring s 0 eq-pos)
- amt (.substring s (inc eq-pos))]
- {name (Integer/parseInt amt)}
- ))
-
-(defn -main [& args]
- (let [[{wait :wait executor :executor num-workers :num-workers} [name] _]
- (cli args ["-w" "--wait" :default nil :parse-fn #(Integer/parseInt %)]
- ["-n" "--num-workers" :default nil :parse-fn #(Integer/parseInt %)]
- ["-e" "--executor" :parse-fn parse-executor
- :assoc-fn (fn [previous key val]
- (assoc previous key
- (if-let [oldval (get previous key)]
- (merge oldval val)
- val)))])
- opts (RebalanceOptions.)]
- (if wait (.set_wait_secs opts wait))
- (if executor (.set_num_executors opts executor))
- (if num-workers (.set_num_workers opts num-workers))
- (with-configured-nimbus-connection nimbus
- (.rebalance nimbus name opts)
- (log-message "Topology " name " is rebalancing")
- )))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/set_log_level.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/set_log_level.clj b/storm-core/src/clj/backtype/storm/command/set_log_level.clj
deleted file mode 100644
index 7e1c3c5..0000000
--- a/storm-core/src/clj/backtype/storm/command/set_log_level.clj
+++ /dev/null
@@ -1,75 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.set-log-level
- (:use [clojure.tools.cli :only [cli]])
- (:use [org.apache.storm thrift log])
- (:import [org.apache.logging.log4j Level])
- (:import [org.apache.storm.generated LogConfig LogLevel LogLevelAction])
- (:gen-class))
-
-(defn- get-storm-id
- "Get topology id for a running topology from the topology name."
- [nimbus name]
- (let [info (.getClusterInfo nimbus)
- topologies (.get_topologies info)
- topology (first (filter (fn [topo] (= name (.get_name topo))) topologies))]
- (if topology
- (.get_id topology)
- (throw (.IllegalArgumentException (str name " is not a running topology"))))))
-
-(defn- parse-named-log-levels [action]
- "Parses [logger name]=[level string]:[optional timeout],[logger name2]...
-
- e.g. ROOT=DEBUG:30
- root logger, debug for 30 seconds
-
- org.apache.foo=WARN
- org.apache.foo set to WARN indefinitely"
- (fn [^String s]
- (let [log-args (re-find #"(.*)=([A-Z]+):?(\d*)" s)
- name (if (= action LogLevelAction/REMOVE) s (nth log-args 1))
- level (Level/toLevel (nth log-args 2))
- timeout-str (nth log-args 3)
- log-level (LogLevel.)]
- (if (= action LogLevelAction/REMOVE)
- (.set_action log-level action)
- (do
- (.set_action log-level action)
- (.set_target_log_level log-level (.toString level))
- (.set_reset_log_level_timeout_secs log-level
- (Integer. (if (= timeout-str "") "0" timeout-str)))))
- {name log-level})))
-
-(defn- merge-together [previous key val]
- (assoc previous key
- (if-let [oldval (get previous key)]
- (merge oldval val)
- val)))
-
-(defn -main [& args]
- (let [[{log-setting :log-setting remove-log-setting :remove-log-setting} [name] _]
- (cli args ["-l" "--log-setting"
- :parse-fn (parse-named-log-levels LogLevelAction/UPDATE)
- :assoc-fn merge-together]
- ["-r" "--remove-log-setting"
- :parse-fn (parse-named-log-levels LogLevelAction/REMOVE)
- :assoc-fn merge-together])
- log-config (LogConfig.)]
- (doseq [[log-name log-val] (merge log-setting remove-log-setting)]
- (.put_to_named_logger_level log-config log-name log-val))
- (log-message "Sent log config " log-config " for topology " name)
- (with-configured-nimbus-connection nimbus
- (.setLogConfig nimbus (get-storm-id nimbus name) log-config))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/shell_submission.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/shell_submission.clj b/storm-core/src/clj/backtype/storm/command/shell_submission.clj
deleted file mode 100644
index 887ab3b..0000000
--- a/storm-core/src/clj/backtype/storm/command/shell_submission.clj
+++ /dev/null
@@ -1,34 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.shell-submission
- (:import [org.apache.storm StormSubmitter])
- (:use [org.apache.storm thrift util config log zookeeper])
- (:require [clojure.string :as str])
- (:gen-class))
-
-
-(defn -main [^String tmpjarpath & args]
- (let [conf (read-storm-config)
- ; since this is not a purpose to add to leader lock queue, passing nil as blob-store is ok
- zk-leader-elector (zk-leader-elector conf nil)
- leader-nimbus (.getLeader zk-leader-elector)
- host (.getHost leader-nimbus)
- port (.getPort leader-nimbus)
- no-op (.close zk-leader-elector)
- jarpath (StormSubmitter/submitJar conf tmpjarpath)
- args (concat args [host port jarpath])]
- (exec-command! (str/join " " args))
- ))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/command/upload_credentials.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/command/upload_credentials.clj b/storm-core/src/clj/backtype/storm/command/upload_credentials.clj
deleted file mode 100644
index f63bde4..0000000
--- a/storm-core/src/clj/backtype/storm/command/upload_credentials.clj
+++ /dev/null
@@ -1,35 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.command.upload-credentials
- (:use [clojure.tools.cli :only [cli]])
- (:use [org.apache.storm log util])
- (:import [org.apache.storm StormSubmitter])
- (:import [java.util Properties])
- (:import [java.io FileReader])
- (:gen-class))
-
-(defn read-map [file-name]
- (let [props (Properties. )
- _ (.load props (FileReader. file-name))]
- (clojurify-structure props)))
-
-(defn -main [& args]
- (let [[{cred-file :file} [name & rawCreds]] (cli args ["-f" "--file" :default nil])
- _ (when (and rawCreds (not (even? (.size rawCreds)))) (throw (RuntimeException. "Need an even number of arguments to make a map")))
- mapping (if rawCreds (apply assoc {} rawCreds) {})
- file-mapping (if (nil? cred-file) {} (read-map cred-file))]
- (StormSubmitter/pushCredentials name {} (merge file-mapping mapping))
- (log-message "Uploaded new creds to topology: " name)))
[13/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ShellComponent.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ShellComponent.java b/storm-core/src/jvm/backtype/storm/generated/ShellComponent.java
deleted file mode 100644
index 6941cb2..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ShellComponent.java
+++ /dev/null
@@ -1,516 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, ShellComponent._Fields>, java.io.Serializable, Cloneable, Comparable<ShellComponent> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ShellComponent");
-
- private static final org.apache.thrift.protocol.TField EXECUTION_COMMAND_FIELD_DESC = new org.apache.thrift.protocol.TField("execution_command", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField SCRIPT_FIELD_DESC = new org.apache.thrift.protocol.TField("script", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ShellComponentStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ShellComponentTupleSchemeFactory());
- }
-
- private String execution_command; // required
- private String script; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- EXECUTION_COMMAND((short)1, "execution_command"),
- SCRIPT((short)2, "script");
-
- private static final Map<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: // EXECUTION_COMMAND
- return EXECUTION_COMMAND;
- case 2: // SCRIPT
- return SCRIPT;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _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.EXECUTION_COMMAND, new org.apache.thrift.meta_data.FieldMetaData("execution_command", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.SCRIPT, new org.apache.thrift.meta_data.FieldMetaData("script", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ShellComponent.class, metaDataMap);
- }
-
- public ShellComponent() {
- }
-
- public ShellComponent(
- String execution_command,
- String script)
- {
- this();
- this.execution_command = execution_command;
- this.script = script;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ShellComponent(ShellComponent other) {
- if (other.is_set_execution_command()) {
- this.execution_command = other.execution_command;
- }
- if (other.is_set_script()) {
- this.script = other.script;
- }
- }
-
- public ShellComponent deepCopy() {
- return new ShellComponent(this);
- }
-
- @Override
- public void clear() {
- this.execution_command = null;
- this.script = null;
- }
-
- public String get_execution_command() {
- return this.execution_command;
- }
-
- public void set_execution_command(String execution_command) {
- this.execution_command = execution_command;
- }
-
- public void unset_execution_command() {
- this.execution_command = null;
- }
-
- /** Returns true if field execution_command is set (has been assigned a value) and false otherwise */
- public boolean is_set_execution_command() {
- return this.execution_command != null;
- }
-
- public void set_execution_command_isSet(boolean value) {
- if (!value) {
- this.execution_command = null;
- }
- }
-
- public String get_script() {
- return this.script;
- }
-
- public void set_script(String script) {
- this.script = script;
- }
-
- public void unset_script() {
- this.script = null;
- }
-
- /** Returns true if field script is set (has been assigned a value) and false otherwise */
- public boolean is_set_script() {
- return this.script != null;
- }
-
- public void set_script_isSet(boolean value) {
- if (!value) {
- this.script = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case EXECUTION_COMMAND:
- if (value == null) {
- unset_execution_command();
- } else {
- set_execution_command((String)value);
- }
- break;
-
- case SCRIPT:
- if (value == null) {
- unset_script();
- } else {
- set_script((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case EXECUTION_COMMAND:
- return get_execution_command();
-
- case SCRIPT:
- return get_script();
-
- }
- 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 EXECUTION_COMMAND:
- return is_set_execution_command();
- case SCRIPT:
- return is_set_script();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ShellComponent)
- return this.equals((ShellComponent)that);
- return false;
- }
-
- public boolean equals(ShellComponent that) {
- if (that == null)
- return false;
-
- boolean this_present_execution_command = true && this.is_set_execution_command();
- boolean that_present_execution_command = true && that.is_set_execution_command();
- if (this_present_execution_command || that_present_execution_command) {
- if (!(this_present_execution_command && that_present_execution_command))
- return false;
- if (!this.execution_command.equals(that.execution_command))
- return false;
- }
-
- boolean this_present_script = true && this.is_set_script();
- boolean that_present_script = true && that.is_set_script();
- if (this_present_script || that_present_script) {
- if (!(this_present_script && that_present_script))
- return false;
- if (!this.script.equals(that.script))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_execution_command = true && (is_set_execution_command());
- list.add(present_execution_command);
- if (present_execution_command)
- list.add(execution_command);
-
- boolean present_script = true && (is_set_script());
- list.add(present_script);
- if (present_script)
- list.add(script);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ShellComponent other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_execution_command()).compareTo(other.is_set_execution_command());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_execution_command()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.execution_command, other.execution_command);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_script()).compareTo(other.is_set_script());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_script()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.script, other.script);
- 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("ShellComponent(");
- boolean first = true;
-
- sb.append("execution_command:");
- if (this.execution_command == null) {
- sb.append("null");
- } else {
- sb.append(this.execution_command);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("script:");
- if (this.script == null) {
- sb.append("null");
- } else {
- sb.append(this.script);
- }
- 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 {
- 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 ShellComponentStandardSchemeFactory implements SchemeFactory {
- public ShellComponentStandardScheme getScheme() {
- return new ShellComponentStandardScheme();
- }
- }
-
- private static class ShellComponentStandardScheme extends StandardScheme<ShellComponent> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ShellComponent 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: // EXECUTION_COMMAND
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.execution_command = iprot.readString();
- struct.set_execution_command_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // SCRIPT
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.script = iprot.readString();
- struct.set_script_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, ShellComponent struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.execution_command != null) {
- oprot.writeFieldBegin(EXECUTION_COMMAND_FIELD_DESC);
- oprot.writeString(struct.execution_command);
- oprot.writeFieldEnd();
- }
- if (struct.script != null) {
- oprot.writeFieldBegin(SCRIPT_FIELD_DESC);
- oprot.writeString(struct.script);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ShellComponentTupleSchemeFactory implements SchemeFactory {
- public ShellComponentTupleScheme getScheme() {
- return new ShellComponentTupleScheme();
- }
- }
-
- private static class ShellComponentTupleScheme extends TupleScheme<ShellComponent> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ShellComponent struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_execution_command()) {
- optionals.set(0);
- }
- if (struct.is_set_script()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.is_set_execution_command()) {
- oprot.writeString(struct.execution_command);
- }
- if (struct.is_set_script()) {
- oprot.writeString(struct.script);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ShellComponent struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.execution_command = iprot.readString();
- struct.set_execution_command_isSet(true);
- }
- if (incoming.get(1)) {
- struct.script = iprot.readString();
- struct.set_script_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SpecificAggregateStats.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/SpecificAggregateStats.java b/storm-core/src/jvm/backtype/storm/generated/SpecificAggregateStats.java
deleted file mode 100644
index 22bff71..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/SpecificAggregateStats.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-public class SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAggregateStats, SpecificAggregateStats._Fields> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpecificAggregateStats");
- private static final org.apache.thrift.protocol.TField BOLT_FIELD_DESC = new org.apache.thrift.protocol.TField("bolt", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField SPOUT_FIELD_DESC = new org.apache.thrift.protocol.TField("spout", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- BOLT((short)1, "bolt"),
- SPOUT((short)2, "spout");
-
- 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: // BOLT
- return BOLT;
- case 2: // SPOUT
- return SPOUT;
- 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;
- }
- }
-
- 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.BOLT, new org.apache.thrift.meta_data.FieldMetaData("bolt", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BoltAggregateStats.class)));
- tmpMap.put(_Fields.SPOUT, new org.apache.thrift.meta_data.FieldMetaData("spout", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SpoutAggregateStats.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SpecificAggregateStats.class, metaDataMap);
- }
-
- public SpecificAggregateStats() {
- super();
- }
-
- public SpecificAggregateStats(_Fields setField, Object value) {
- super(setField, value);
- }
-
- public SpecificAggregateStats(SpecificAggregateStats other) {
- super(other);
- }
- public SpecificAggregateStats deepCopy() {
- return new SpecificAggregateStats(this);
- }
-
- public static SpecificAggregateStats bolt(BoltAggregateStats value) {
- SpecificAggregateStats x = new SpecificAggregateStats();
- x.set_bolt(value);
- return x;
- }
-
- public static SpecificAggregateStats spout(SpoutAggregateStats value) {
- SpecificAggregateStats x = new SpecificAggregateStats();
- x.set_spout(value);
- return x;
- }
-
-
- @Override
- protected void checkType(_Fields setField, Object value) throws ClassCastException {
- switch (setField) {
- case BOLT:
- if (value instanceof BoltAggregateStats) {
- break;
- }
- throw new ClassCastException("Was expecting value of type BoltAggregateStats for field 'bolt', but got " + value.getClass().getSimpleName());
- case SPOUT:
- if (value instanceof SpoutAggregateStats) {
- break;
- }
- throw new ClassCastException("Was expecting value of type SpoutAggregateStats for field 'spout', but got " + value.getClass().getSimpleName());
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(field.id);
- if (setField != null) {
- switch (setField) {
- case BOLT:
- if (field.type == BOLT_FIELD_DESC.type) {
- BoltAggregateStats bolt;
- bolt = new BoltAggregateStats();
- bolt.read(iprot);
- return bolt;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case SPOUT:
- if (field.type == SPOUT_FIELD_DESC.type) {
- SpoutAggregateStats spout;
- spout = new SpoutAggregateStats();
- spout.read(iprot);
- return spout;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- }
-
- @Override
- protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case BOLT:
- BoltAggregateStats bolt = (BoltAggregateStats)value_;
- bolt.write(oprot);
- return;
- case SPOUT:
- SpoutAggregateStats spout = (SpoutAggregateStats)value_;
- spout.write(oprot);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(fieldID);
- if (setField != null) {
- switch (setField) {
- case BOLT:
- BoltAggregateStats bolt;
- bolt = new BoltAggregateStats();
- bolt.read(iprot);
- return bolt;
- case SPOUT:
- SpoutAggregateStats spout;
- spout = new SpoutAggregateStats();
- spout.read(iprot);
- return spout;
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- throw new TProtocolException("Couldn't find a field with field id " + fieldID);
- }
- }
-
- @Override
- protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case BOLT:
- BoltAggregateStats bolt = (BoltAggregateStats)value_;
- bolt.write(oprot);
- return;
- case SPOUT:
- SpoutAggregateStats spout = (SpoutAggregateStats)value_;
- spout.write(oprot);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) {
- switch (setField) {
- case BOLT:
- return BOLT_FIELD_DESC;
- case SPOUT:
- return SPOUT_FIELD_DESC;
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TStruct getStructDesc() {
- return STRUCT_DESC;
- }
-
- @Override
- protected _Fields enumForId(short id) {
- return _Fields.findByThriftIdOrThrow(id);
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
-
- public BoltAggregateStats get_bolt() {
- if (getSetField() == _Fields.BOLT) {
- return (BoltAggregateStats)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'bolt' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_bolt(BoltAggregateStats value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.BOLT;
- value_ = value;
- }
-
- public SpoutAggregateStats get_spout() {
- if (getSetField() == _Fields.SPOUT) {
- return (SpoutAggregateStats)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'spout' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_spout(SpoutAggregateStats value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.SPOUT;
- value_ = value;
- }
-
- public boolean is_set_bolt() {
- return setField_ == _Fields.BOLT;
- }
-
-
- public boolean is_set_spout() {
- return setField_ == _Fields.SPOUT;
- }
-
-
- public boolean equals(Object other) {
- if (other instanceof SpecificAggregateStats) {
- return equals((SpecificAggregateStats)other);
- } else {
- return false;
- }
- }
-
- public boolean equals(SpecificAggregateStats other) {
- return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue());
- }
-
- @Override
- public int compareTo(SpecificAggregateStats other) {
- int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField());
- if (lastComparison == 0) {
- return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue());
- }
- return lastComparison;
- }
-
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
- list.add(this.getClass().getName());
- org.apache.thrift.TFieldIdEnum setField = getSetField();
- if (setField != null) {
- list.add(setField.getThriftFieldId());
- Object value = getFieldValue();
- if (value instanceof org.apache.thrift.TEnum) {
- list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
- } else {
- list.add(value);
- }
- }
- return list.hashCode();
- }
- 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);
- }
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SpoutAggregateStats.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/SpoutAggregateStats.java b/storm-core/src/jvm/backtype/storm/generated/SpoutAggregateStats.java
deleted file mode 100644
index 712bc35..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/SpoutAggregateStats.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggregateStats, SpoutAggregateStats._Fields>, java.io.Serializable, Cloneable, Comparable<SpoutAggregateStats> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpoutAggregateStats");
-
- private static final org.apache.thrift.protocol.TField COMPLETE_LATENCY_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("complete_latency_ms", org.apache.thrift.protocol.TType.DOUBLE, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new SpoutAggregateStatsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new SpoutAggregateStatsTupleSchemeFactory());
- }
-
- private double complete_latency_ms; // 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 {
- COMPLETE_LATENCY_MS((short)1, "complete_latency_ms");
-
- 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: // COMPLETE_LATENCY_MS
- return COMPLETE_LATENCY_MS;
- 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 __COMPLETE_LATENCY_MS_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.COMPLETE_LATENCY_MS};
- 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.COMPLETE_LATENCY_MS, new org.apache.thrift.meta_data.FieldMetaData("complete_latency_ms", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SpoutAggregateStats.class, metaDataMap);
- }
-
- public SpoutAggregateStats() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public SpoutAggregateStats(SpoutAggregateStats other) {
- __isset_bitfield = other.__isset_bitfield;
- this.complete_latency_ms = other.complete_latency_ms;
- }
-
- public SpoutAggregateStats deepCopy() {
- return new SpoutAggregateStats(this);
- }
-
- @Override
- public void clear() {
- set_complete_latency_ms_isSet(false);
- this.complete_latency_ms = 0.0;
- }
-
- public double get_complete_latency_ms() {
- return this.complete_latency_ms;
- }
-
- public void set_complete_latency_ms(double complete_latency_ms) {
- this.complete_latency_ms = complete_latency_ms;
- set_complete_latency_ms_isSet(true);
- }
-
- public void unset_complete_latency_ms() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COMPLETE_LATENCY_MS_ISSET_ID);
- }
-
- /** Returns true if field complete_latency_ms is set (has been assigned a value) and false otherwise */
- public boolean is_set_complete_latency_ms() {
- return EncodingUtils.testBit(__isset_bitfield, __COMPLETE_LATENCY_MS_ISSET_ID);
- }
-
- public void set_complete_latency_ms_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COMPLETE_LATENCY_MS_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case COMPLETE_LATENCY_MS:
- if (value == null) {
- unset_complete_latency_ms();
- } else {
- set_complete_latency_ms((Double)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case COMPLETE_LATENCY_MS:
- return get_complete_latency_ms();
-
- }
- 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 COMPLETE_LATENCY_MS:
- return is_set_complete_latency_ms();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof SpoutAggregateStats)
- return this.equals((SpoutAggregateStats)that);
- return false;
- }
-
- public boolean equals(SpoutAggregateStats that) {
- if (that == null)
- return false;
-
- boolean this_present_complete_latency_ms = true && this.is_set_complete_latency_ms();
- boolean that_present_complete_latency_ms = true && that.is_set_complete_latency_ms();
- if (this_present_complete_latency_ms || that_present_complete_latency_ms) {
- if (!(this_present_complete_latency_ms && that_present_complete_latency_ms))
- return false;
- if (this.complete_latency_ms != that.complete_latency_ms)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_complete_latency_ms = true && (is_set_complete_latency_ms());
- list.add(present_complete_latency_ms);
- if (present_complete_latency_ms)
- list.add(complete_latency_ms);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(SpoutAggregateStats other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_complete_latency_ms()).compareTo(other.is_set_complete_latency_ms());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_complete_latency_ms()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.complete_latency_ms, other.complete_latency_ms);
- 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("SpoutAggregateStats(");
- boolean first = true;
-
- if (is_set_complete_latency_ms()) {
- sb.append("complete_latency_ms:");
- sb.append(this.complete_latency_ms);
- 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 SpoutAggregateStatsStandardSchemeFactory implements SchemeFactory {
- public SpoutAggregateStatsStandardScheme getScheme() {
- return new SpoutAggregateStatsStandardScheme();
- }
- }
-
- private static class SpoutAggregateStatsStandardScheme extends StandardScheme<SpoutAggregateStats> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, SpoutAggregateStats 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: // COMPLETE_LATENCY_MS
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.complete_latency_ms = iprot.readDouble();
- struct.set_complete_latency_ms_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, SpoutAggregateStats struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.is_set_complete_latency_ms()) {
- oprot.writeFieldBegin(COMPLETE_LATENCY_MS_FIELD_DESC);
- oprot.writeDouble(struct.complete_latency_ms);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class SpoutAggregateStatsTupleSchemeFactory implements SchemeFactory {
- public SpoutAggregateStatsTupleScheme getScheme() {
- return new SpoutAggregateStatsTupleScheme();
- }
- }
-
- private static class SpoutAggregateStatsTupleScheme extends TupleScheme<SpoutAggregateStats> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, SpoutAggregateStats struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_complete_latency_ms()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.is_set_complete_latency_ms()) {
- oprot.writeDouble(struct.complete_latency_ms);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, SpoutAggregateStats struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.complete_latency_ms = iprot.readDouble();
- struct.set_complete_latency_ms_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/SpoutSpec.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/SpoutSpec.java b/storm-core/src/jvm/backtype/storm/generated/SpoutSpec.java
deleted file mode 100644
index bb7919e..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/SpoutSpec.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._Fields>, java.io.Serializable, Cloneable, Comparable<SpoutSpec> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpoutSpec");
-
- private static final org.apache.thrift.protocol.TField SPOUT_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("spout_object", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField COMMON_FIELD_DESC = new org.apache.thrift.protocol.TField("common", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new SpoutSpecStandardSchemeFactory());
- schemes.put(TupleScheme.class, new SpoutSpecTupleSchemeFactory());
- }
-
- private ComponentObject spout_object; // required
- private ComponentCommon common; // 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 {
- SPOUT_OBJECT((short)1, "spout_object"),
- COMMON((short)2, "common");
-
- 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: // SPOUT_OBJECT
- return SPOUT_OBJECT;
- case 2: // COMMON
- return COMMON;
- 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.SPOUT_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("spout_object", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentObject.class)));
- tmpMap.put(_Fields.COMMON, new org.apache.thrift.meta_data.FieldMetaData("common", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentCommon.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SpoutSpec.class, metaDataMap);
- }
-
- public SpoutSpec() {
- }
-
- public SpoutSpec(
- ComponentObject spout_object,
- ComponentCommon common)
- {
- this();
- this.spout_object = spout_object;
- this.common = common;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public SpoutSpec(SpoutSpec other) {
- if (other.is_set_spout_object()) {
- this.spout_object = new ComponentObject(other.spout_object);
- }
- if (other.is_set_common()) {
- this.common = new ComponentCommon(other.common);
- }
- }
-
- public SpoutSpec deepCopy() {
- return new SpoutSpec(this);
- }
-
- @Override
- public void clear() {
- this.spout_object = null;
- this.common = null;
- }
-
- public ComponentObject get_spout_object() {
- return this.spout_object;
- }
-
- public void set_spout_object(ComponentObject spout_object) {
- this.spout_object = spout_object;
- }
-
- public void unset_spout_object() {
- this.spout_object = null;
- }
-
- /** Returns true if field spout_object is set (has been assigned a value) and false otherwise */
- public boolean is_set_spout_object() {
- return this.spout_object != null;
- }
-
- public void set_spout_object_isSet(boolean value) {
- if (!value) {
- this.spout_object = null;
- }
- }
-
- public ComponentCommon get_common() {
- return this.common;
- }
-
- public void set_common(ComponentCommon common) {
- this.common = common;
- }
-
- public void unset_common() {
- this.common = null;
- }
-
- /** Returns true if field common is set (has been assigned a value) and false otherwise */
- public boolean is_set_common() {
- return this.common != null;
- }
-
- public void set_common_isSet(boolean value) {
- if (!value) {
- this.common = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SPOUT_OBJECT:
- if (value == null) {
- unset_spout_object();
- } else {
- set_spout_object((ComponentObject)value);
- }
- break;
-
- case COMMON:
- if (value == null) {
- unset_common();
- } else {
- set_common((ComponentCommon)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SPOUT_OBJECT:
- return get_spout_object();
-
- case COMMON:
- return get_common();
-
- }
- 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 SPOUT_OBJECT:
- return is_set_spout_object();
- case COMMON:
- return is_set_common();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof SpoutSpec)
- return this.equals((SpoutSpec)that);
- return false;
- }
-
- public boolean equals(SpoutSpec that) {
- if (that == null)
- return false;
-
- boolean this_present_spout_object = true && this.is_set_spout_object();
- boolean that_present_spout_object = true && that.is_set_spout_object();
- if (this_present_spout_object || that_present_spout_object) {
- if (!(this_present_spout_object && that_present_spout_object))
- return false;
- if (!this.spout_object.equals(that.spout_object))
- return false;
- }
-
- boolean this_present_common = true && this.is_set_common();
- boolean that_present_common = true && that.is_set_common();
- if (this_present_common || that_present_common) {
- if (!(this_present_common && that_present_common))
- return false;
- if (!this.common.equals(that.common))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_spout_object = true && (is_set_spout_object());
- list.add(present_spout_object);
- if (present_spout_object)
- list.add(spout_object);
-
- boolean present_common = true && (is_set_common());
- list.add(present_common);
- if (present_common)
- list.add(common);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(SpoutSpec other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_spout_object()).compareTo(other.is_set_spout_object());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_spout_object()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spout_object, other.spout_object);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_common()).compareTo(other.is_set_common());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_common()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.common, other.common);
- 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("SpoutSpec(");
- boolean first = true;
-
- sb.append("spout_object:");
- if (this.spout_object == null) {
- sb.append("null");
- } else {
- sb.append(this.spout_object);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("common:");
- if (this.common == null) {
- sb.append("null");
- } else {
- sb.append(this.common);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_spout_object()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'spout_object' is unset! Struct:" + toString());
- }
-
- if (!is_set_common()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'common' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- if (common != null) {
- common.validate();
- }
- }
-
- 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 SpoutSpecStandardSchemeFactory implements SchemeFactory {
- public SpoutSpecStandardScheme getScheme() {
- return new SpoutSpecStandardScheme();
- }
- }
-
- private static class SpoutSpecStandardScheme extends StandardScheme<SpoutSpec> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, SpoutSpec 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: // SPOUT_OBJECT
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.spout_object = new ComponentObject();
- struct.spout_object.read(iprot);
- struct.set_spout_object_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // COMMON
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.common = new ComponentCommon();
- struct.common.read(iprot);
- struct.set_common_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, SpoutSpec struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.spout_object != null) {
- oprot.writeFieldBegin(SPOUT_OBJECT_FIELD_DESC);
- struct.spout_object.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.common != null) {
- oprot.writeFieldBegin(COMMON_FIELD_DESC);
- struct.common.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class SpoutSpecTupleSchemeFactory implements SchemeFactory {
- public SpoutSpecTupleScheme getScheme() {
- return new SpoutSpecTupleScheme();
- }
- }
-
- private static class SpoutSpecTupleScheme extends TupleScheme<SpoutSpec> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, SpoutSpec struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- struct.spout_object.write(oprot);
- struct.common.write(oprot);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, SpoutSpec struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.spout_object = new ComponentObject();
- struct.spout_object.read(iprot);
- struct.set_spout_object_isSet(true);
- struct.common = new ComponentCommon();
- struct.common.read(iprot);
- struct.set_common_isSet(true);
- }
- }
-
-}
-
[11/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/StormBase.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/StormBase.java b/storm-core/src/jvm/backtype/storm/generated/StormBase.java
deleted file mode 100644
index 34b2358..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/StormBase.java
+++ /dev/null
@@ -1,1382 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class StormBase implements org.apache.thrift.TBase<StormBase, StormBase._Fields>, java.io.Serializable, Cloneable, Comparable<StormBase> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StormBase");
-
- private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)3);
- private static final org.apache.thrift.protocol.TField COMPONENT_EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("component_executors", org.apache.thrift.protocol.TType.MAP, (short)4);
- private static final org.apache.thrift.protocol.TField LAUNCH_TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("launch_time_secs", org.apache.thrift.protocol.TType.I32, (short)5);
- private static final org.apache.thrift.protocol.TField OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)6);
- private static final org.apache.thrift.protocol.TField TOPOLOGY_ACTION_OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_action_options", org.apache.thrift.protocol.TType.STRUCT, (short)7);
- private static final org.apache.thrift.protocol.TField PREV_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("prev_status", org.apache.thrift.protocol.TType.I32, (short)8);
- private static final org.apache.thrift.protocol.TField COMPONENT_DEBUG_FIELD_DESC = new org.apache.thrift.protocol.TField("component_debug", org.apache.thrift.protocol.TType.MAP, (short)9);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new StormBaseStandardSchemeFactory());
- schemes.put(TupleScheme.class, new StormBaseTupleSchemeFactory());
- }
-
- private String name; // required
- private TopologyStatus status; // required
- private int num_workers; // required
- private Map<String,Integer> component_executors; // optional
- private int launch_time_secs; // optional
- private String owner; // optional
- private TopologyActionOptions topology_action_options; // optional
- private TopologyStatus prev_status; // optional
- private Map<String,DebugOptions> component_debug; // 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 {
- NAME((short)1, "name"),
- /**
- *
- * @see TopologyStatus
- */
- STATUS((short)2, "status"),
- NUM_WORKERS((short)3, "num_workers"),
- COMPONENT_EXECUTORS((short)4, "component_executors"),
- LAUNCH_TIME_SECS((short)5, "launch_time_secs"),
- OWNER((short)6, "owner"),
- TOPOLOGY_ACTION_OPTIONS((short)7, "topology_action_options"),
- /**
- *
- * @see TopologyStatus
- */
- PREV_STATUS((short)8, "prev_status"),
- COMPONENT_DEBUG((short)9, "component_debug");
-
- 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: // NAME
- return NAME;
- case 2: // STATUS
- return STATUS;
- case 3: // NUM_WORKERS
- return NUM_WORKERS;
- case 4: // COMPONENT_EXECUTORS
- return COMPONENT_EXECUTORS;
- case 5: // LAUNCH_TIME_SECS
- return LAUNCH_TIME_SECS;
- case 6: // OWNER
- return OWNER;
- case 7: // TOPOLOGY_ACTION_OPTIONS
- return TOPOLOGY_ACTION_OPTIONS;
- case 8: // PREV_STATUS
- return PREV_STATUS;
- case 9: // COMPONENT_DEBUG
- return COMPONENT_DEBUG;
- 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 __NUM_WORKERS_ISSET_ID = 0;
- private static final int __LAUNCH_TIME_SECS_ISSET_ID = 1;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.COMPONENT_EXECUTORS,_Fields.LAUNCH_TIME_SECS,_Fields.OWNER,_Fields.TOPOLOGY_ACTION_OPTIONS,_Fields.PREV_STATUS,_Fields.COMPONENT_DEBUG};
- 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.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TopologyStatus.class)));
- tmpMap.put(_Fields.NUM_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("num_workers", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.COMPONENT_EXECUTORS, new org.apache.thrift.meta_data.FieldMetaData("component_executors", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
- tmpMap.put(_Fields.LAUNCH_TIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("launch_time_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- 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.TOPOLOGY_ACTION_OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("topology_action_options", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TopologyActionOptions.class)));
- tmpMap.put(_Fields.PREV_STATUS, new org.apache.thrift.meta_data.FieldMetaData("prev_status", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TopologyStatus.class)));
- tmpMap.put(_Fields.COMPONENT_DEBUG, new org.apache.thrift.meta_data.FieldMetaData("component_debug", 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, DebugOptions.class))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StormBase.class, metaDataMap);
- }
-
- public StormBase() {
- }
-
- public StormBase(
- String name,
- TopologyStatus status,
- int num_workers)
- {
- this();
- this.name = name;
- this.status = status;
- this.num_workers = num_workers;
- set_num_workers_isSet(true);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public StormBase(StormBase other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_name()) {
- this.name = other.name;
- }
- if (other.is_set_status()) {
- this.status = other.status;
- }
- this.num_workers = other.num_workers;
- if (other.is_set_component_executors()) {
- Map<String,Integer> __this__component_executors = new HashMap<String,Integer>(other.component_executors);
- this.component_executors = __this__component_executors;
- }
- this.launch_time_secs = other.launch_time_secs;
- if (other.is_set_owner()) {
- this.owner = other.owner;
- }
- if (other.is_set_topology_action_options()) {
- this.topology_action_options = new TopologyActionOptions(other.topology_action_options);
- }
- if (other.is_set_prev_status()) {
- this.prev_status = other.prev_status;
- }
- if (other.is_set_component_debug()) {
- Map<String,DebugOptions> __this__component_debug = new HashMap<String,DebugOptions>(other.component_debug.size());
- for (Map.Entry<String, DebugOptions> other_element : other.component_debug.entrySet()) {
-
- String other_element_key = other_element.getKey();
- DebugOptions other_element_value = other_element.getValue();
-
- String __this__component_debug_copy_key = other_element_key;
-
- DebugOptions __this__component_debug_copy_value = new DebugOptions(other_element_value);
-
- __this__component_debug.put(__this__component_debug_copy_key, __this__component_debug_copy_value);
- }
- this.component_debug = __this__component_debug;
- }
- }
-
- public StormBase deepCopy() {
- return new StormBase(this);
- }
-
- @Override
- public void clear() {
- this.name = null;
- this.status = null;
- set_num_workers_isSet(false);
- this.num_workers = 0;
- this.component_executors = null;
- set_launch_time_secs_isSet(false);
- this.launch_time_secs = 0;
- this.owner = null;
- this.topology_action_options = null;
- this.prev_status = null;
- this.component_debug = 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;
- }
- }
-
- /**
- *
- * @see TopologyStatus
- */
- public TopologyStatus get_status() {
- return this.status;
- }
-
- /**
- *
- * @see TopologyStatus
- */
- public void set_status(TopologyStatus status) {
- this.status = status;
- }
-
- public void unset_status() {
- this.status = null;
- }
-
- /** Returns true if field status is set (has been assigned a value) and false otherwise */
- public boolean is_set_status() {
- return this.status != null;
- }
-
- public void set_status_isSet(boolean value) {
- if (!value) {
- this.status = null;
- }
- }
-
- public int get_num_workers() {
- return this.num_workers;
- }
-
- public void set_num_workers(int num_workers) {
- this.num_workers = num_workers;
- set_num_workers_isSet(true);
- }
-
- public void unset_num_workers() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID);
- }
-
- /** Returns true if field num_workers is set (has been assigned a value) and false otherwise */
- public boolean is_set_num_workers() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID);
- }
-
- public void set_num_workers_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_WORKERS_ISSET_ID, value);
- }
-
- public int get_component_executors_size() {
- return (this.component_executors == null) ? 0 : this.component_executors.size();
- }
-
- public void put_to_component_executors(String key, int val) {
- if (this.component_executors == null) {
- this.component_executors = new HashMap<String,Integer>();
- }
- this.component_executors.put(key, val);
- }
-
- public Map<String,Integer> get_component_executors() {
- return this.component_executors;
- }
-
- public void set_component_executors(Map<String,Integer> component_executors) {
- this.component_executors = component_executors;
- }
-
- public void unset_component_executors() {
- this.component_executors = null;
- }
-
- /** Returns true if field component_executors is set (has been assigned a value) and false otherwise */
- public boolean is_set_component_executors() {
- return this.component_executors != null;
- }
-
- public void set_component_executors_isSet(boolean value) {
- if (!value) {
- this.component_executors = null;
- }
- }
-
- public int get_launch_time_secs() {
- return this.launch_time_secs;
- }
-
- public void set_launch_time_secs(int launch_time_secs) {
- this.launch_time_secs = launch_time_secs;
- set_launch_time_secs_isSet(true);
- }
-
- public void unset_launch_time_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LAUNCH_TIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field launch_time_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_launch_time_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __LAUNCH_TIME_SECS_ISSET_ID);
- }
-
- public void set_launch_time_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LAUNCH_TIME_SECS_ISSET_ID, value);
- }
-
- public String get_owner() {
- return this.owner;
- }
-
- public void set_owner(String owner) {
- this.owner = owner;
- }
-
- public void unset_owner() {
- this.owner = null;
- }
-
- /** Returns true if field owner is set (has been assigned a value) and false otherwise */
- public boolean is_set_owner() {
- return this.owner != null;
- }
-
- public void set_owner_isSet(boolean value) {
- if (!value) {
- this.owner = null;
- }
- }
-
- public TopologyActionOptions get_topology_action_options() {
- return this.topology_action_options;
- }
-
- public void set_topology_action_options(TopologyActionOptions topology_action_options) {
- this.topology_action_options = topology_action_options;
- }
-
- public void unset_topology_action_options() {
- this.topology_action_options = null;
- }
-
- /** Returns true if field topology_action_options is set (has been assigned a value) and false otherwise */
- public boolean is_set_topology_action_options() {
- return this.topology_action_options != null;
- }
-
- public void set_topology_action_options_isSet(boolean value) {
- if (!value) {
- this.topology_action_options = null;
- }
- }
-
- /**
- *
- * @see TopologyStatus
- */
- public TopologyStatus get_prev_status() {
- return this.prev_status;
- }
-
- /**
- *
- * @see TopologyStatus
- */
- public void set_prev_status(TopologyStatus prev_status) {
- this.prev_status = prev_status;
- }
-
- public void unset_prev_status() {
- this.prev_status = null;
- }
-
- /** Returns true if field prev_status is set (has been assigned a value) and false otherwise */
- public boolean is_set_prev_status() {
- return this.prev_status != null;
- }
-
- public void set_prev_status_isSet(boolean value) {
- if (!value) {
- this.prev_status = null;
- }
- }
-
- public int get_component_debug_size() {
- return (this.component_debug == null) ? 0 : this.component_debug.size();
- }
-
- public void put_to_component_debug(String key, DebugOptions val) {
- if (this.component_debug == null) {
- this.component_debug = new HashMap<String,DebugOptions>();
- }
- this.component_debug.put(key, val);
- }
-
- public Map<String,DebugOptions> get_component_debug() {
- return this.component_debug;
- }
-
- public void set_component_debug(Map<String,DebugOptions> component_debug) {
- this.component_debug = component_debug;
- }
-
- public void unset_component_debug() {
- this.component_debug = null;
- }
-
- /** Returns true if field component_debug is set (has been assigned a value) and false otherwise */
- public boolean is_set_component_debug() {
- return this.component_debug != null;
- }
-
- public void set_component_debug_isSet(boolean value) {
- if (!value) {
- this.component_debug = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case NAME:
- if (value == null) {
- unset_name();
- } else {
- set_name((String)value);
- }
- break;
-
- case STATUS:
- if (value == null) {
- unset_status();
- } else {
- set_status((TopologyStatus)value);
- }
- break;
-
- case NUM_WORKERS:
- if (value == null) {
- unset_num_workers();
- } else {
- set_num_workers((Integer)value);
- }
- break;
-
- case COMPONENT_EXECUTORS:
- if (value == null) {
- unset_component_executors();
- } else {
- set_component_executors((Map<String,Integer>)value);
- }
- break;
-
- case LAUNCH_TIME_SECS:
- if (value == null) {
- unset_launch_time_secs();
- } else {
- set_launch_time_secs((Integer)value);
- }
- break;
-
- case OWNER:
- if (value == null) {
- unset_owner();
- } else {
- set_owner((String)value);
- }
- break;
-
- case TOPOLOGY_ACTION_OPTIONS:
- if (value == null) {
- unset_topology_action_options();
- } else {
- set_topology_action_options((TopologyActionOptions)value);
- }
- break;
-
- case PREV_STATUS:
- if (value == null) {
- unset_prev_status();
- } else {
- set_prev_status((TopologyStatus)value);
- }
- break;
-
- case COMPONENT_DEBUG:
- if (value == null) {
- unset_component_debug();
- } else {
- set_component_debug((Map<String,DebugOptions>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case NAME:
- return get_name();
-
- case STATUS:
- return get_status();
-
- case NUM_WORKERS:
- return get_num_workers();
-
- case COMPONENT_EXECUTORS:
- return get_component_executors();
-
- case LAUNCH_TIME_SECS:
- return get_launch_time_secs();
-
- case OWNER:
- return get_owner();
-
- case TOPOLOGY_ACTION_OPTIONS:
- return get_topology_action_options();
-
- case PREV_STATUS:
- return get_prev_status();
-
- case COMPONENT_DEBUG:
- return get_component_debug();
-
- }
- 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 NAME:
- return is_set_name();
- case STATUS:
- return is_set_status();
- case NUM_WORKERS:
- return is_set_num_workers();
- case COMPONENT_EXECUTORS:
- return is_set_component_executors();
- case LAUNCH_TIME_SECS:
- return is_set_launch_time_secs();
- case OWNER:
- return is_set_owner();
- case TOPOLOGY_ACTION_OPTIONS:
- return is_set_topology_action_options();
- case PREV_STATUS:
- return is_set_prev_status();
- case COMPONENT_DEBUG:
- return is_set_component_debug();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof StormBase)
- return this.equals((StormBase)that);
- return false;
- }
-
- public boolean equals(StormBase that) {
- if (that == null)
- 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_status = true && this.is_set_status();
- boolean that_present_status = true && that.is_set_status();
- if (this_present_status || that_present_status) {
- if (!(this_present_status && that_present_status))
- return false;
- if (!this.status.equals(that.status))
- return false;
- }
-
- boolean this_present_num_workers = true;
- boolean that_present_num_workers = true;
- if (this_present_num_workers || that_present_num_workers) {
- if (!(this_present_num_workers && that_present_num_workers))
- return false;
- if (this.num_workers != that.num_workers)
- return false;
- }
-
- boolean this_present_component_executors = true && this.is_set_component_executors();
- boolean that_present_component_executors = true && that.is_set_component_executors();
- if (this_present_component_executors || that_present_component_executors) {
- if (!(this_present_component_executors && that_present_component_executors))
- return false;
- if (!this.component_executors.equals(that.component_executors))
- return false;
- }
-
- boolean this_present_launch_time_secs = true && this.is_set_launch_time_secs();
- boolean that_present_launch_time_secs = true && that.is_set_launch_time_secs();
- if (this_present_launch_time_secs || that_present_launch_time_secs) {
- if (!(this_present_launch_time_secs && that_present_launch_time_secs))
- return false;
- if (this.launch_time_secs != that.launch_time_secs)
- return false;
- }
-
- boolean this_present_owner = true && this.is_set_owner();
- boolean that_present_owner = true && that.is_set_owner();
- if (this_present_owner || that_present_owner) {
- if (!(this_present_owner && that_present_owner))
- return false;
- if (!this.owner.equals(that.owner))
- return false;
- }
-
- boolean this_present_topology_action_options = true && this.is_set_topology_action_options();
- boolean that_present_topology_action_options = true && that.is_set_topology_action_options();
- if (this_present_topology_action_options || that_present_topology_action_options) {
- if (!(this_present_topology_action_options && that_present_topology_action_options))
- return false;
- if (!this.topology_action_options.equals(that.topology_action_options))
- return false;
- }
-
- boolean this_present_prev_status = true && this.is_set_prev_status();
- boolean that_present_prev_status = true && that.is_set_prev_status();
- if (this_present_prev_status || that_present_prev_status) {
- if (!(this_present_prev_status && that_present_prev_status))
- return false;
- if (!this.prev_status.equals(that.prev_status))
- return false;
- }
-
- boolean this_present_component_debug = true && this.is_set_component_debug();
- boolean that_present_component_debug = true && that.is_set_component_debug();
- if (this_present_component_debug || that_present_component_debug) {
- if (!(this_present_component_debug && that_present_component_debug))
- return false;
- if (!this.component_debug.equals(that.component_debug))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_name = true && (is_set_name());
- list.add(present_name);
- if (present_name)
- list.add(name);
-
- boolean present_status = true && (is_set_status());
- list.add(present_status);
- if (present_status)
- list.add(status.getValue());
-
- boolean present_num_workers = true;
- list.add(present_num_workers);
- if (present_num_workers)
- list.add(num_workers);
-
- boolean present_component_executors = true && (is_set_component_executors());
- list.add(present_component_executors);
- if (present_component_executors)
- list.add(component_executors);
-
- boolean present_launch_time_secs = true && (is_set_launch_time_secs());
- list.add(present_launch_time_secs);
- if (present_launch_time_secs)
- list.add(launch_time_secs);
-
- boolean present_owner = true && (is_set_owner());
- list.add(present_owner);
- if (present_owner)
- list.add(owner);
-
- boolean present_topology_action_options = true && (is_set_topology_action_options());
- list.add(present_topology_action_options);
- if (present_topology_action_options)
- list.add(topology_action_options);
-
- boolean present_prev_status = true && (is_set_prev_status());
- list.add(present_prev_status);
- if (present_prev_status)
- list.add(prev_status.getValue());
-
- boolean present_component_debug = true && (is_set_component_debug());
- list.add(present_component_debug);
- if (present_component_debug)
- list.add(component_debug);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(StormBase other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- 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_status()).compareTo(other.is_set_status());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_status()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_num_workers()).compareTo(other.is_set_num_workers());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_num_workers()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_workers, other.num_workers);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_component_executors()).compareTo(other.is_set_component_executors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_component_executors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.component_executors, other.component_executors);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_launch_time_secs()).compareTo(other.is_set_launch_time_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_launch_time_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.launch_time_secs, other.launch_time_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_owner()).compareTo(other.is_set_owner());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_owner()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, other.owner);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_topology_action_options()).compareTo(other.is_set_topology_action_options());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topology_action_options()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology_action_options, other.topology_action_options);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_prev_status()).compareTo(other.is_set_prev_status());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_prev_status()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prev_status, other.prev_status);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_component_debug()).compareTo(other.is_set_component_debug());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_component_debug()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.component_debug, other.component_debug);
- 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("StormBase(");
- boolean first = true;
-
- sb.append("name:");
- if (this.name == null) {
- sb.append("null");
- } else {
- sb.append(this.name);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("status:");
- if (this.status == null) {
- sb.append("null");
- } else {
- sb.append(this.status);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("num_workers:");
- sb.append(this.num_workers);
- first = false;
- if (is_set_component_executors()) {
- if (!first) sb.append(", ");
- sb.append("component_executors:");
- if (this.component_executors == null) {
- sb.append("null");
- } else {
- sb.append(this.component_executors);
- }
- first = false;
- }
- if (is_set_launch_time_secs()) {
- if (!first) sb.append(", ");
- sb.append("launch_time_secs:");
- sb.append(this.launch_time_secs);
- first = false;
- }
- if (is_set_owner()) {
- if (!first) sb.append(", ");
- sb.append("owner:");
- if (this.owner == null) {
- sb.append("null");
- } else {
- sb.append(this.owner);
- }
- first = false;
- }
- if (is_set_topology_action_options()) {
- if (!first) sb.append(", ");
- sb.append("topology_action_options:");
- if (this.topology_action_options == null) {
- sb.append("null");
- } else {
- sb.append(this.topology_action_options);
- }
- first = false;
- }
- if (is_set_prev_status()) {
- if (!first) sb.append(", ");
- sb.append("prev_status:");
- if (this.prev_status == null) {
- sb.append("null");
- } else {
- sb.append(this.prev_status);
- }
- first = false;
- }
- if (is_set_component_debug()) {
- if (!first) sb.append(", ");
- sb.append("component_debug:");
- if (this.component_debug == null) {
- sb.append("null");
- } else {
- sb.append(this.component_debug);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_name()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' is unset! Struct:" + toString());
- }
-
- if (!is_set_status()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString());
- }
-
- if (!is_set_num_workers()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_workers' 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 StormBaseStandardSchemeFactory implements SchemeFactory {
- public StormBaseStandardScheme getScheme() {
- return new StormBaseStandardScheme();
- }
- }
-
- private static class StormBaseStandardScheme extends StandardScheme<StormBase> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, StormBase 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: // 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 2: // STATUS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.status = org.apache.storm.generated.TopologyStatus.findByValue(iprot.readI32());
- struct.set_status_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // NUM_WORKERS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.num_workers = iprot.readI32();
- struct.set_num_workers_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // COMPONENT_EXECUTORS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map674 = iprot.readMapBegin();
- struct.component_executors = new HashMap<String,Integer>(2*_map674.size);
- String _key675;
- int _val676;
- for (int _i677 = 0; _i677 < _map674.size; ++_i677)
- {
- _key675 = iprot.readString();
- _val676 = iprot.readI32();
- struct.component_executors.put(_key675, _val676);
- }
- iprot.readMapEnd();
- }
- struct.set_component_executors_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // LAUNCH_TIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.launch_time_secs = iprot.readI32();
- struct.set_launch_time_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // OWNER
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.owner = iprot.readString();
- struct.set_owner_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // TOPOLOGY_ACTION_OPTIONS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.topology_action_options = new TopologyActionOptions();
- struct.topology_action_options.read(iprot);
- struct.set_topology_action_options_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 8: // PREV_STATUS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.prev_status = org.apache.storm.generated.TopologyStatus.findByValue(iprot.readI32());
- struct.set_prev_status_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 9: // COMPONENT_DEBUG
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map678 = iprot.readMapBegin();
- struct.component_debug = new HashMap<String,DebugOptions>(2*_map678.size);
- String _key679;
- DebugOptions _val680;
- for (int _i681 = 0; _i681 < _map678.size; ++_i681)
- {
- _key679 = iprot.readString();
- _val680 = new DebugOptions();
- _val680.read(iprot);
- struct.component_debug.put(_key679, _val680);
- }
- iprot.readMapEnd();
- }
- struct.set_component_debug_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, StormBase struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.name != null) {
- oprot.writeFieldBegin(NAME_FIELD_DESC);
- oprot.writeString(struct.name);
- oprot.writeFieldEnd();
- }
- if (struct.status != null) {
- oprot.writeFieldBegin(STATUS_FIELD_DESC);
- oprot.writeI32(struct.status.getValue());
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(NUM_WORKERS_FIELD_DESC);
- oprot.writeI32(struct.num_workers);
- oprot.writeFieldEnd();
- if (struct.component_executors != null) {
- if (struct.is_set_component_executors()) {
- oprot.writeFieldBegin(COMPONENT_EXECUTORS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.component_executors.size()));
- for (Map.Entry<String, Integer> _iter682 : struct.component_executors.entrySet())
- {
- oprot.writeString(_iter682.getKey());
- oprot.writeI32(_iter682.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_launch_time_secs()) {
- oprot.writeFieldBegin(LAUNCH_TIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.launch_time_secs);
- oprot.writeFieldEnd();
- }
- if (struct.owner != null) {
- if (struct.is_set_owner()) {
- oprot.writeFieldBegin(OWNER_FIELD_DESC);
- oprot.writeString(struct.owner);
- oprot.writeFieldEnd();
- }
- }
- if (struct.topology_action_options != null) {
- if (struct.is_set_topology_action_options()) {
- oprot.writeFieldBegin(TOPOLOGY_ACTION_OPTIONS_FIELD_DESC);
- struct.topology_action_options.write(oprot);
- oprot.writeFieldEnd();
- }
- }
- if (struct.prev_status != null) {
- if (struct.is_set_prev_status()) {
- oprot.writeFieldBegin(PREV_STATUS_FIELD_DESC);
- oprot.writeI32(struct.prev_status.getValue());
- oprot.writeFieldEnd();
- }
- }
- if (struct.component_debug != null) {
- if (struct.is_set_component_debug()) {
- oprot.writeFieldBegin(COMPONENT_DEBUG_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.component_debug.size()));
- for (Map.Entry<String, DebugOptions> _iter683 : struct.component_debug.entrySet())
- {
- oprot.writeString(_iter683.getKey());
- _iter683.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class StormBaseTupleSchemeFactory implements SchemeFactory {
- public StormBaseTupleScheme getScheme() {
- return new StormBaseTupleScheme();
- }
- }
-
- private static class StormBaseTupleScheme extends TupleScheme<StormBase> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, StormBase struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.name);
- oprot.writeI32(struct.status.getValue());
- oprot.writeI32(struct.num_workers);
- BitSet optionals = new BitSet();
- if (struct.is_set_component_executors()) {
- optionals.set(0);
- }
- if (struct.is_set_launch_time_secs()) {
- optionals.set(1);
- }
- if (struct.is_set_owner()) {
- optionals.set(2);
- }
- if (struct.is_set_topology_action_options()) {
- optionals.set(3);
- }
- if (struct.is_set_prev_status()) {
- optionals.set(4);
- }
- if (struct.is_set_component_debug()) {
- optionals.set(5);
- }
- oprot.writeBitSet(optionals, 6);
- if (struct.is_set_component_executors()) {
- {
- oprot.writeI32(struct.component_executors.size());
- for (Map.Entry<String, Integer> _iter684 : struct.component_executors.entrySet())
- {
- oprot.writeString(_iter684.getKey());
- oprot.writeI32(_iter684.getValue());
- }
- }
- }
- if (struct.is_set_launch_time_secs()) {
- oprot.writeI32(struct.launch_time_secs);
- }
- if (struct.is_set_owner()) {
- oprot.writeString(struct.owner);
- }
- if (struct.is_set_topology_action_options()) {
- struct.topology_action_options.write(oprot);
- }
- if (struct.is_set_prev_status()) {
- oprot.writeI32(struct.prev_status.getValue());
- }
- if (struct.is_set_component_debug()) {
- {
- oprot.writeI32(struct.component_debug.size());
- for (Map.Entry<String, DebugOptions> _iter685 : struct.component_debug.entrySet())
- {
- oprot.writeString(_iter685.getKey());
- _iter685.getValue().write(oprot);
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, StormBase struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.name = iprot.readString();
- struct.set_name_isSet(true);
- struct.status = org.apache.storm.generated.TopologyStatus.findByValue(iprot.readI32());
- struct.set_status_isSet(true);
- struct.num_workers = iprot.readI32();
- struct.set_num_workers_isSet(true);
- BitSet incoming = iprot.readBitSet(6);
- if (incoming.get(0)) {
- {
- org.apache.thrift.protocol.TMap _map686 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32());
- struct.component_executors = new HashMap<String,Integer>(2*_map686.size);
- String _key687;
- int _val688;
- for (int _i689 = 0; _i689 < _map686.size; ++_i689)
- {
- _key687 = iprot.readString();
- _val688 = iprot.readI32();
- struct.component_executors.put(_key687, _val688);
- }
- }
- struct.set_component_executors_isSet(true);
- }
- if (incoming.get(1)) {
- struct.launch_time_secs = iprot.readI32();
- struct.set_launch_time_secs_isSet(true);
- }
- if (incoming.get(2)) {
- struct.owner = iprot.readString();
- struct.set_owner_isSet(true);
- }
- if (incoming.get(3)) {
- struct.topology_action_options = new TopologyActionOptions();
- struct.topology_action_options.read(iprot);
- struct.set_topology_action_options_isSet(true);
- }
- if (incoming.get(4)) {
- struct.prev_status = org.apache.storm.generated.TopologyStatus.findByValue(iprot.readI32());
- struct.set_prev_status_isSet(true);
- }
- if (incoming.get(5)) {
- {
- org.apache.thrift.protocol.TMap _map690 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.component_debug = new HashMap<String,DebugOptions>(2*_map690.size);
- String _key691;
- DebugOptions _val692;
- for (int _i693 = 0; _i693 < _map690.size; ++_i693)
- {
- _key691 = iprot.readString();
- _val692 = new DebugOptions();
- _val692.read(iprot);
- struct.component_debug.put(_key691, _val692);
- }
- }
- struct.set_component_debug_isSet(true);
- }
- }
- }
-
-}
-
[42/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/testing.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/testing.clj b/storm-core/src/clj/backtype/storm/testing.clj
deleted file mode 100644
index 565d1b9..0000000
--- a/storm-core/src/clj/backtype/storm/testing.clj
+++ /dev/null
@@ -1,702 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.testing
- (:require [org.apache.storm.daemon
- [nimbus :as nimbus]
- [supervisor :as supervisor]
- [common :as common]
- [worker :as worker]
- [executor :as executor]])
- (:require [org.apache.storm [process-simulator :as psim]])
- (:import [org.apache.commons.io FileUtils])
- (:import [java.io File])
- (:import [java.util HashMap ArrayList])
- (:import [java.util.concurrent.atomic AtomicInteger])
- (:import [java.util.concurrent ConcurrentHashMap])
- (:import [org.apache.storm.utils Time Utils RegisteredGlobalState])
- (:import [org.apache.storm.tuple Fields Tuple TupleImpl])
- (:import [org.apache.storm.task TopologyContext])
- (:import [org.apache.storm.generated GlobalStreamId Bolt KillOptions])
- (:import [org.apache.storm.testing FeederSpout FixedTupleSpout FixedTuple
- TupleCaptureBolt SpoutTracker BoltTracker NonRichBoltTracker
- TestWordSpout MemoryTransactionalSpout])
- (:import [org.apache.storm.security.auth ThriftServer ThriftConnectionType ReqContext AuthUtils])
- (:import [org.apache.storm.generated NotAliveException AlreadyAliveException StormTopology ErrorInfo
- ExecutorInfo InvalidTopologyException Nimbus$Iface Nimbus$Processor SubmitOptions TopologyInitialStatus
- KillOptions RebalanceOptions ClusterSummary SupervisorSummary TopologySummary TopologyInfo
- ExecutorSummary AuthorizationException GetInfoOptions NumErrorsChoice])
- (:import [org.apache.storm.transactional TransactionalSpoutCoordinator])
- (:import [org.apache.storm.transactional.partitioned PartitionedTransactionalSpoutExecutor])
- (:import [org.apache.storm.tuple Tuple])
- (:import [org.apache.storm.generated StormTopology])
- (:import [org.apache.storm.task TopologyContext])
- (:require [org.apache.storm [zookeeper :as zk]])
- (:require [org.apache.storm.messaging.loader :as msg-loader])
- (:require [org.apache.storm.daemon.acker :as acker])
- (:use [org.apache.storm cluster util thrift config log local-state]))
-
-(defn feeder-spout
- [fields]
- (FeederSpout. (Fields. fields)))
-
-(defn local-temp-path
- []
- (str (System/getProperty "java.io.tmpdir") (if-not on-windows? "/") (uuid)))
-
-(defn delete-all
- [paths]
- (dorun
- (for [t paths]
- (if (.exists (File. t))
- (try
- (FileUtils/forceDelete (File. t))
- (catch Exception e
- (log-message (.getMessage e))))))))
-
-(defmacro with-local-tmp
- [[& tmp-syms] & body]
- (let [tmp-paths (mapcat (fn [t] [t `(local-temp-path)]) tmp-syms)]
- `(let [~@tmp-paths]
- (try
- ~@body
- (finally
- (delete-all ~(vec tmp-syms)))))))
-
-(defn start-simulating-time!
- []
- (Time/startSimulating))
-
-(defn stop-simulating-time!
- []
- (Time/stopSimulating))
-
- (defmacro with-simulated-time
- [& body]
- `(try
- (start-simulating-time!)
- ~@body
- (finally
- (stop-simulating-time!))))
-
-(defn advance-time-ms! [ms]
- (Time/advanceTime ms))
-
-(defn advance-time-secs! [secs]
- (advance-time-ms! (* (long secs) 1000)))
-
-(defnk add-supervisor
- [cluster-map :ports 2 :conf {} :id nil]
- (let [tmp-dir (local-temp-path)
- port-ids (if (sequential? ports)
- ports
- (doall (repeatedly ports (:port-counter cluster-map))))
- supervisor-conf (merge (:daemon-conf cluster-map)
- conf
- {STORM-LOCAL-DIR tmp-dir
- SUPERVISOR-SLOTS-PORTS port-ids})
- id-fn (if id (fn [] id) supervisor/generate-supervisor-id)
- daemon (with-var-roots [supervisor/generate-supervisor-id id-fn] (supervisor/mk-supervisor supervisor-conf (:shared-context cluster-map) (supervisor/standalone-supervisor)))]
- (swap! (:supervisors cluster-map) conj daemon)
- (swap! (:tmp-dirs cluster-map) conj tmp-dir)
- daemon))
-
-(defn mk-shared-context [conf]
- (if-not (conf STORM-LOCAL-MODE-ZMQ)
- (msg-loader/mk-local-context)))
-
-(defn start-nimbus-daemon [conf nimbus]
- (let [server (ThriftServer. conf (Nimbus$Processor. nimbus)
- ThriftConnectionType/NIMBUS)
- nimbus-thread (Thread. (fn [] (.serve server)))]
- (log-message "Starting Nimbus server...")
- (.start nimbus-thread)
- server))
-
-
-;; returns map containing cluster info
-;; local dir is always overridden in maps
-;; can customize the supervisors (except for ports) by passing in map for :supervisors parameter
-;; if need to customize amt of ports more, can use add-supervisor calls afterwards
-(defnk mk-local-storm-cluster [:supervisors 2 :ports-per-supervisor 3 :daemon-conf {} :inimbus nil :supervisor-slot-port-min 1024 :nimbus-daemon false]
- (let [zk-tmp (local-temp-path)
- [zk-port zk-handle] (if-not (contains? daemon-conf STORM-ZOOKEEPER-SERVERS)
- (zk/mk-inprocess-zookeeper zk-tmp))
- daemon-conf (merge (read-storm-config)
- {TOPOLOGY-SKIP-MISSING-KRYO-REGISTRATIONS true
- ZMQ-LINGER-MILLIS 0
- TOPOLOGY-ENABLE-MESSAGE-TIMEOUTS false
- TOPOLOGY-TRIDENT-BATCH-EMIT-INTERVAL-MILLIS 50
- STORM-CLUSTER-MODE "local"
- BLOBSTORE-SUPERUSER (System/getProperty "user.name")}
- (if-not (contains? daemon-conf STORM-ZOOKEEPER-SERVERS)
- {STORM-ZOOKEEPER-PORT zk-port
- STORM-ZOOKEEPER-SERVERS ["localhost"]})
- daemon-conf)
- nimbus-tmp (local-temp-path)
- port-counter (mk-counter supervisor-slot-port-min)
- nimbus (nimbus/service-handler
- (assoc daemon-conf STORM-LOCAL-DIR nimbus-tmp)
- (if inimbus inimbus (nimbus/standalone-nimbus)))
- context (mk-shared-context daemon-conf)
- nimbus-thrift-server (if nimbus-daemon (start-nimbus-daemon daemon-conf nimbus) nil)
- cluster-map {:nimbus nimbus
- :port-counter port-counter
- :daemon-conf daemon-conf
- :supervisors (atom [])
- :state (mk-distributed-cluster-state daemon-conf)
- :storm-cluster-state (mk-storm-cluster-state daemon-conf)
- :tmp-dirs (atom [nimbus-tmp zk-tmp])
- :zookeeper (if (not-nil? zk-handle) zk-handle)
- :shared-context context
- :nimbus-thrift-server nimbus-thrift-server}
- supervisor-confs (if (sequential? supervisors)
- supervisors
- (repeat supervisors {}))]
-
- (doseq [sc supervisor-confs]
- (add-supervisor cluster-map :ports ports-per-supervisor :conf sc))
- cluster-map))
-
-(defn get-supervisor [cluster-map supervisor-id]
- (let [finder-fn #(= (.get-id %) supervisor-id)]
- (find-first finder-fn @(:supervisors cluster-map))))
-
-(defn kill-supervisor [cluster-map supervisor-id]
- (let [finder-fn #(= (.get-id %) supervisor-id)
- supervisors @(:supervisors cluster-map)
- sup (find-first finder-fn
- supervisors)]
- ;; tmp-dir will be taken care of by shutdown
- (reset! (:supervisors cluster-map) (remove-first finder-fn supervisors))
- (.shutdown sup)))
-
-(defn kill-local-storm-cluster [cluster-map]
- (.shutdown (:nimbus cluster-map))
- (if (not-nil? (:nimbus-thrift-server cluster-map))
- (do
- (log-message "shutting down thrift server")
- (try
- (.stop (:nimbus-thrift-server cluster-map))
- (catch Exception e (log-message "failed to stop thrift")))
- ))
- (.close (:state cluster-map))
- (.disconnect (:storm-cluster-state cluster-map))
- (doseq [s @(:supervisors cluster-map)]
- (.shutdown-all-workers s)
- ;; race condition here? will it launch the workers again?
- (supervisor/kill-supervisor s))
- (psim/kill-all-processes)
- (if (not-nil? (:zookeeper cluster-map))
- (do
- (log-message "Shutting down in process zookeeper")
- (zk/shutdown-inprocess-zookeeper (:zookeeper cluster-map))
- (log-message "Done shutting down in process zookeeper")))
- (doseq [t @(:tmp-dirs cluster-map)]
- (log-message "Deleting temporary path " t)
- (try
- (rmr t)
- ;; on windows, the host process still holds lock on the logfile
- (catch Exception e (log-message (.getMessage e)))) ))
-
-(def TEST-TIMEOUT-MS
- (let [timeout (System/getenv "STORM_TEST_TIMEOUT_MS")]
- (parse-int (if timeout timeout "10000"))))
-
-(defmacro while-timeout [timeout-ms condition & body]
- `(let [end-time# (+ (System/currentTimeMillis) ~timeout-ms)]
- (log-debug "Looping until " '~condition)
- (while ~condition
- (when (> (System/currentTimeMillis) end-time#)
- (let [thread-dump# (Utils/threadDump)]
- (log-message "Condition " '~condition " not met in " ~timeout-ms "ms")
- (log-message thread-dump#)
- (throw (AssertionError. (str "Test timed out (" ~timeout-ms "ms) " '~condition)))))
- ~@body)
- (log-debug "Condition met " '~condition)))
-
-(defn wait-for-condition
- ([apredicate]
- (wait-for-condition TEST-TIMEOUT-MS apredicate))
- ([timeout-ms apredicate]
- (while-timeout timeout-ms (not (apredicate))
- (Time/sleep 100))))
-
-(defn wait-until-cluster-waiting
- "Wait until the cluster is idle. Should be used with time simulation."
- ([cluster-map] (wait-until-cluster-waiting cluster-map TEST-TIMEOUT-MS))
- ([cluster-map timeout-ms]
- ;; wait until all workers, supervisors, and nimbus is waiting
- (let [supervisors @(:supervisors cluster-map)
- workers (filter (partial satisfies? common/DaemonCommon) (psim/all-processes))
- daemons (concat
- [(:nimbus cluster-map)]
- supervisors
- ; because a worker may already be dead
- workers)]
- (while-timeout timeout-ms (not (every? (memfn waiting?) daemons))
- (Thread/sleep (rand-int 20))
- ;; (doseq [d daemons]
- ;; (if-not ((memfn waiting?) d)
- ;; (println d)))
- ))))
-
-(defn advance-cluster-time
- ([cluster-map secs increment-secs]
- (loop [left secs]
- (when (> left 0)
- (let [diff (min left increment-secs)]
- (advance-time-secs! diff)
- (wait-until-cluster-waiting cluster-map)
- (recur (- left diff))))))
- ([cluster-map secs]
- (advance-cluster-time cluster-map secs 1)))
-
-(defmacro with-local-cluster
- [[cluster-sym & args] & body]
- `(let [~cluster-sym (mk-local-storm-cluster ~@args)]
- (try
- ~@body
- (catch Throwable t#
- (log-error t# "Error in cluster")
- (throw t#))
- (finally
- (let [keep-waiting?# (atom true)
- f# (future (while @keep-waiting?# (simulate-wait ~cluster-sym)))]
- (kill-local-storm-cluster ~cluster-sym)
- (reset! keep-waiting?# false)
- @f#)))))
-
-(defmacro with-simulated-time-local-cluster
- [& args]
- `(with-simulated-time
- (with-local-cluster ~@args)))
-
-(defmacro with-inprocess-zookeeper
- [port-sym & body]
- `(with-local-tmp [tmp#]
- (let [[~port-sym zks#] (zk/mk-inprocess-zookeeper tmp#)]
- (try
- ~@body
- (finally
- (zk/shutdown-inprocess-zookeeper zks#))))))
-
-(defn submit-local-topology
- [nimbus storm-name conf topology]
- (when-not (Utils/isValidConf conf)
- (throw (IllegalArgumentException. "Topology conf is not json-serializable")))
- (.submitTopology nimbus storm-name nil (to-json conf) topology))
-
-(defn submit-local-topology-with-opts
- [nimbus storm-name conf topology submit-opts]
- (when-not (Utils/isValidConf conf)
- (throw (IllegalArgumentException. "Topology conf is not json-serializable")))
- (.submitTopologyWithOpts nimbus storm-name nil (to-json conf) topology submit-opts))
-
-(defn mocked-convert-assignments-to-worker->resources [storm-cluster-state storm-name worker->resources]
- (fn [existing-assignments]
- (let [topology-id (common/get-storm-id storm-cluster-state storm-name)
- existing-assignments (into {} (for [[tid assignment] existing-assignments]
- {tid (:worker->resources assignment)}))
- new-assignments (assoc existing-assignments topology-id worker->resources)]
- new-assignments)))
-
-(defn mocked-compute-new-topology->executor->node+port [storm-cluster-state storm-name executor->node+port]
- (fn [new-scheduler-assignments existing-assignments]
- (let [topology-id (common/get-storm-id storm-cluster-state storm-name)
- existing-assignments (into {} (for [[tid assignment] existing-assignments]
- {tid (:executor->node+port assignment)}))
- new-assignments (assoc existing-assignments topology-id executor->node+port)]
- new-assignments)))
-
-(defn mocked-compute-new-scheduler-assignments []
- (fn [nimbus existing-assignments topologies scratch-topology-id]
- existing-assignments))
-
-(defn submit-mocked-assignment
- [nimbus storm-cluster-state storm-name conf topology task->component executor->node+port worker->resources]
- (with-var-roots [common/storm-task-info (fn [& ignored] task->component)
- nimbus/compute-new-scheduler-assignments (mocked-compute-new-scheduler-assignments)
- nimbus/convert-assignments-to-worker->resources (mocked-convert-assignments-to-worker->resources
- storm-cluster-state
- storm-name
- worker->resources)
- nimbus/compute-new-topology->executor->node+port (mocked-compute-new-topology->executor->node+port
- storm-cluster-state
- storm-name
- executor->node+port)]
- (submit-local-topology nimbus storm-name conf topology)))
-
-(defn mk-capture-launch-fn [capture-atom]
- (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] [])]
- (set-worker-user! conf worker-id "")
- (swap! capture-atom assoc [supervisor-id port] (conj existing storm-id)))))
-
-(defn find-worker-id
- [supervisor-conf port]
- (let [supervisor-state (supervisor-state supervisor-conf)
- worker->port (ls-approved-workers supervisor-state)]
- (first ((reverse-map worker->port) port))))
-
-(defn find-worker-port
- [supervisor-conf worker-id]
- (let [supervisor-state (supervisor-state supervisor-conf)
- worker->port (ls-approved-workers supervisor-state)]
- (worker->port worker-id)))
-
-(defn mk-capture-shutdown-fn
- [capture-atom]
- (let [existing-fn supervisor/shutdown-worker]
- (fn [supervisor worker-id]
- (let [conf (:conf supervisor)
- supervisor-id (:supervisor-id supervisor)
- port (find-worker-port conf worker-id)
- existing (get @capture-atom [supervisor-id port] 0)]
- (swap! capture-atom assoc [supervisor-id port] (inc existing))
- (existing-fn supervisor worker-id)))))
-
-(defmacro capture-changed-workers
- [& body]
- `(let [launch-captured# (atom {})
- shutdown-captured# (atom {})]
- (with-var-roots [supervisor/launch-worker (mk-capture-launch-fn launch-captured#)
- supervisor/shutdown-worker (mk-capture-shutdown-fn shutdown-captured#)]
- ~@body
- {:launched @launch-captured#
- :shutdown @shutdown-captured#})))
-
-(defmacro capture-launched-workers
- [& body]
- `(:launched (capture-changed-workers ~@body)))
-
-(defmacro capture-shutdown-workers
- [& body]
- `(:shutdown (capture-changed-workers ~@body)))
-
-(defnk aggregated-stat
- [cluster-map storm-name stat-key :component-ids nil]
- (let [state (:storm-cluster-state cluster-map)
- nimbus (:nimbus cluster-map)
- storm-id (common/get-storm-id state storm-name)
- component->tasks (reverse-map
- (common/storm-task-info
- (.getUserTopology nimbus storm-id)
- (from-json (.getTopologyConf nimbus storm-id))))
- component->tasks (if component-ids
- (select-keys component->tasks component-ids)
- component->tasks)
- task-ids (apply concat (vals component->tasks))
- assignment (.assignment-info state storm-id nil)
- taskbeats (.taskbeats state storm-id (:task->node+port assignment))
- heartbeats (dofor [id task-ids] (get taskbeats id))
- stats (dofor [hb heartbeats] (if hb (stat-key (:stats hb)) 0))]
- (reduce + stats)))
-
-(defn emitted-spout-tuples
- [cluster-map topology storm-name]
- (aggregated-stat
- cluster-map
- storm-name
- :emitted
- :component-ids (keys (.get_spouts topology))))
-
-(defn transferred-tuples
- [cluster-map storm-name]
- (aggregated-stat cluster-map storm-name :transferred))
-
-(defn acked-tuples
- [cluster-map storm-name]
- (aggregated-stat cluster-map storm-name :acked))
-
-(defn simulate-wait
- [cluster-map]
- (if (Time/isSimulating)
- (advance-cluster-time cluster-map 10)
- (Thread/sleep 100)))
-
-(defprotocol CompletableSpout
- (exhausted?
- [this]
- "Whether all the tuples for this spout have been completed.")
- (cleanup
- [this]
- "Cleanup any global state kept")
- (startup
- [this]
- "Prepare the spout (globally) before starting the topology"))
-
-(extend-type FixedTupleSpout
- CompletableSpout
- (exhausted? [this]
- (= (-> this .getSourceTuples count)
- (.getCompleted this)))
- (cleanup [this]
- (.cleanup this))
- (startup [this]))
-
-(extend-type TransactionalSpoutCoordinator
- CompletableSpout
- (exhausted? [this]
- (exhausted? (.getSpout this)))
- (cleanup [this]
- (cleanup (.getSpout this)))
- (startup [this]
- (startup (.getSpout this))))
-
-(extend-type PartitionedTransactionalSpoutExecutor
- CompletableSpout
- (exhausted? [this]
- (exhausted? (.getPartitionedSpout this)))
- (cleanup [this]
- (cleanup (.getPartitionedSpout this)))
- (startup [this]
- (startup (.getPartitionedSpout this))))
-
-(extend-type MemoryTransactionalSpout
- CompletableSpout
- (exhausted? [this]
- (.isExhaustedTuples this))
- (cleanup [this]
- (.cleanup this))
- (startup [this]
- (.startup this)))
-
-(defn spout-objects [spec-map]
- (for [[_ spout-spec] spec-map]
- (-> spout-spec
- .get_spout_object
- deserialized-component-object)))
-
-(defn capture-topology
- [topology]
- (let [topology (.deepCopy topology)
- spouts (.get_spouts topology)
- bolts (.get_bolts topology)
- all-streams (apply concat
- (for [[id spec] (merge (clojurify-structure spouts)
- (clojurify-structure bolts))]
- (for [[stream info] (.. spec get_common get_streams)]
- [(GlobalStreamId. id stream) (.is_direct info)])))
- capturer (TupleCaptureBolt.)]
- (.set_bolts topology
- (assoc (clojurify-structure bolts)
- (uuid)
- (Bolt.
- (serialize-component-object capturer)
- (mk-plain-component-common (into {} (for [[id direct?] all-streams]
- [id (if direct?
- (mk-direct-grouping)
- (mk-global-grouping))]))
- {}
- nil))))
- {:topology topology
- :capturer capturer}))
-
-;; TODO: mock-sources needs to be able to mock out state spouts as well
-(defnk complete-topology
- [cluster-map topology
- :mock-sources {}
- :storm-conf {}
- :cleanup-state true
- :topology-name nil
- :timeout-ms TEST-TIMEOUT-MS]
- ;; TODO: the idea of mocking for transactional topologies should be done an
- ;; abstraction level above... should have a complete-transactional-topology for this
- (let [{topology :topology capturer :capturer} (capture-topology topology)
- storm-name (or topology-name (str "topologytest-" (uuid)))
- state (:storm-cluster-state cluster-map)
- spouts (.get_spouts topology)
- replacements (map-val (fn [v]
- (FixedTupleSpout.
- (for [tup v]
- (if (map? tup)
- (FixedTuple. (:stream tup) (:values tup))
- tup))))
- mock-sources)]
- (doseq [[id spout] replacements]
- (let [spout-spec (get spouts id)]
- (.set_spout_object spout-spec (serialize-component-object spout))))
- (doseq [spout (spout-objects spouts)]
- (when-not (extends? CompletableSpout (.getClass spout))
- (throw (RuntimeException. (str "Cannot complete topology unless every spout is a CompletableSpout (or mocked to be); failed by " spout)))))
-
- (doseq [spout (spout-objects spouts)]
- (startup spout))
-
- (submit-local-topology (:nimbus cluster-map) storm-name storm-conf topology)
- (when (Time/isSimulating)
- (advance-cluster-time cluster-map 11))
-
- (let [storm-id (common/get-storm-id state storm-name)]
- ;;Give the topology time to come up without using it to wait for the spouts to complete
- (simulate-wait cluster-map)
-
- (while-timeout timeout-ms (not (every? exhausted? (spout-objects spouts)))
- (simulate-wait cluster-map))
-
- (.killTopologyWithOpts (:nimbus cluster-map) storm-name (doto (KillOptions.) (.set_wait_secs 0)))
- (while-timeout timeout-ms (.assignment-info state storm-id nil)
- (simulate-wait cluster-map))
- (when cleanup-state
- (doseq [spout (spout-objects spouts)]
- (cleanup spout))))
-
- (if cleanup-state
- (.getAndRemoveResults capturer)
- (.getAndClearResults capturer))))
-
-(defn read-tuples
- ([results component-id stream-id]
- (let [fixed-tuples (get results component-id [])]
- (mapcat
- (fn [ft]
- (if (= stream-id (. ft stream))
- [(vec (. ft values))]))
- fixed-tuples)
- ))
- ([results component-id]
- (read-tuples results component-id Utils/DEFAULT_STREAM_ID)))
-
-(defn ms=
- [& args]
- (apply = (map multi-set args)))
-
-(def TRACKER-BOLT-ID "+++tracker-bolt")
-
-;; TODO: should override system-topology! and wrap everything there
-(defn mk-tracked-topology
- ([tracked-cluster topology]
- (let [track-id (::track-id tracked-cluster)
- ret (.deepCopy topology)]
- (dofor [[_ bolt] (.get_bolts ret)
- :let [obj (deserialized-component-object (.get_bolt_object bolt))]]
- (.set_bolt_object bolt (serialize-component-object
- (BoltTracker. obj track-id))))
- (dofor [[_ spout] (.get_spouts ret)
- :let [obj (deserialized-component-object (.get_spout_object spout))]]
- (.set_spout_object spout (serialize-component-object
- (SpoutTracker. obj track-id))))
- {:topology ret
- :last-spout-emit (atom 0)
- :cluster tracked-cluster})))
-
-(defn assoc-track-id
- [cluster track-id]
- (assoc cluster ::track-id track-id))
-
-(defn increment-global!
- [id key amt]
- (-> (RegisteredGlobalState/getState id)
- (get key)
- (.addAndGet amt)))
-
-(defn global-amt
- [id key]
- (-> (RegisteredGlobalState/getState id)
- (get key)
- .get))
-
-(defmacro with-tracked-cluster
- [[cluster-sym & cluster-args] & body]
- `(let [id# (uuid)]
- (RegisteredGlobalState/setState
- id#
- (doto (ConcurrentHashMap.)
- (.put "spout-emitted" (AtomicInteger. 0))
- (.put "transferred" (AtomicInteger. 0))
- (.put "processed" (AtomicInteger. 0))))
- (with-var-roots
- [acker/mk-acker-bolt
- (let [old# acker/mk-acker-bolt]
- (fn [& args#] (NonRichBoltTracker. (apply old# args#) id#)))
- ;; critical that this particular function is overridden here,
- ;; since the transferred stat needs to be incremented at the moment
- ;; of tuple emission (and not on a separate thread later) for
- ;; topologies to be tracked correctly. This is because "transferred" *must*
- ;; be incremented before "processing".
- executor/mk-executor-transfer-fn
- (let [old# executor/mk-executor-transfer-fn]
- (fn [& args#]
- (let [transferrer# (apply old# args#)]
- (fn [& args2#]
- ;; (log-message "Transferring: " transfer-args#)
- (increment-global! id# "transferred" 1)
- (apply transferrer# args2#)))))]
- (with-simulated-time-local-cluster [~cluster-sym ~@cluster-args]
- (let [~cluster-sym (assoc-track-id ~cluster-sym id#)]
- ~@body)))
- (RegisteredGlobalState/clearState id#)))
-
-(defn tracked-wait
- "Waits until topology is idle and 'amt' more tuples have been emitted by spouts."
- ([tracked-topology]
- (tracked-wait tracked-topology 1 TEST-TIMEOUT-MS))
- ([tracked-topology amt]
- (tracked-wait tracked-topology amt TEST-TIMEOUT-MS))
- ([tracked-topology amt timeout-ms]
- (let [target (+ amt @(:last-spout-emit tracked-topology))
- track-id (-> tracked-topology :cluster ::track-id)
- waiting? (fn []
- (or (not= target (global-amt track-id "spout-emitted"))
- (not= (global-amt track-id "transferred")
- (global-amt track-id "processed"))))]
- (while-timeout timeout-ms (waiting?)
- ;; (println "Spout emitted: " (global-amt track-id "spout-emitted"))
- ;; (println "Processed: " (global-amt track-id "processed"))
- ;; (println "Transferred: " (global-amt track-id "transferred"))
- (Thread/sleep (rand-int 200)))
- (reset! (:last-spout-emit tracked-topology) target))))
-
-(defnk test-tuple
- [values
- :stream Utils/DEFAULT_STREAM_ID
- :component "component"
- :fields nil]
- (let [fields (or fields
- (->> (iterate inc 1)
- (take (count values))
- (map #(str "field" %))))
- spout-spec (mk-spout-spec* (TestWordSpout.)
- {stream fields})
- topology (StormTopology. {component spout-spec} {} {})
- context (TopologyContext.
- topology
- (read-storm-config)
- {(int 1) component}
- {component [(int 1)]}
- {component {stream (Fields. fields)}}
- "test-storm-id"
- nil
- nil
- (int 1)
- nil
- [(int 1)]
- {}
- {}
- (HashMap.)
- (HashMap.)
- (atom false))]
- (TupleImpl. context values 1 stream)))
-
-(defmacro with-timeout
- [millis unit & body]
- `(let [f# (future ~@body)]
- (try
- (.get f# ~millis ~unit)
- (finally (future-cancel f#)))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/testing4j.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/testing4j.clj b/storm-core/src/clj/backtype/storm/testing4j.clj
deleted file mode 100644
index b2acffc..0000000
--- a/storm-core/src/clj/backtype/storm/testing4j.clj
+++ /dev/null
@@ -1,186 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.testing4j
- (:import [java.util Map List Collection ArrayList])
- (:require [org.apache.storm [LocalCluster :as LocalCluster]])
- (:import [org.apache.storm Config ILocalCluster LocalCluster])
- (:import [org.apache.storm.generated StormTopology])
- (:import [org.apache.storm.daemon nimbus])
- (:import [org.apache.storm.testing TestJob MockedSources TrackedTopology
- MkClusterParam CompleteTopologyParam MkTupleParam])
- (:import [org.apache.storm.utils Utils])
- (:use [org.apache.storm testing util log])
- (:gen-class
- :name org.apache.storm.Testing
- :methods [^:static [completeTopology
- [org.apache.storm.ILocalCluster org.apache.storm.generated.StormTopology
- org.apache.storm.testing.CompleteTopologyParam]
- java.util.Map]
- ^:static [completeTopology
- [org.apache.storm.ILocalCluster org.apache.storm.generated.StormTopology]
- java.util.Map]
- ^:static [withSimulatedTime [Runnable] void]
- ^:static [withLocalCluster [org.apache.storm.testing.TestJob] void]
- ^:static [withLocalCluster [org.apache.storm.testing.MkClusterParam org.apache.storm.testing.TestJob] void]
- ^:static [getLocalCluster [java.util.Map] org.apache.storm.ILocalCluster]
- ^:static [withSimulatedTimeLocalCluster [org.apache.storm.testing.TestJob] void]
- ^:static [withSimulatedTimeLocalCluster [org.apache.storm.testing.MkClusterParam org.apache.storm.testing.TestJob] void]
- ^:static [withTrackedCluster [org.apache.storm.testing.TestJob] void]
- ^:static [withTrackedCluster [org.apache.storm.testing.MkClusterParam org.apache.storm.testing.TestJob] void]
- ^:static [readTuples [java.util.Map String String] java.util.List]
- ^:static [readTuples [java.util.Map String] java.util.List]
- ^:static [mkTrackedTopology [org.apache.storm.ILocalCluster org.apache.storm.generated.StormTopology] org.apache.storm.testing.TrackedTopology]
- ^:static [trackedWait [org.apache.storm.testing.TrackedTopology] void]
- ^:static [trackedWait [org.apache.storm.testing.TrackedTopology Integer] void]
- ^:static [trackedWait [org.apache.storm.testing.TrackedTopology Integer Integer] void]
- ^:static [advanceClusterTime [org.apache.storm.ILocalCluster Integer Integer] void]
- ^:static [advanceClusterTime [org.apache.storm.ILocalCluster Integer] void]
- ^:static [multiseteq [java.util.Collection java.util.Collection] boolean]
- ^:static [multiseteq [java.util.Map java.util.Map] boolean]
- ^:static [testTuple [java.util.List] org.apache.storm.tuple.Tuple]
- ^:static [testTuple [java.util.List org.apache.storm.testing.MkTupleParam] org.apache.storm.tuple.Tuple]]))
-
-(defn -completeTopology
- ([^ILocalCluster cluster ^StormTopology topology ^CompleteTopologyParam completeTopologyParam]
- (let [mocked-sources (or (-> completeTopologyParam .getMockedSources .getData) {})
- storm-conf (or (.getStormConf completeTopologyParam) {})
- cleanup-state (or (.getCleanupState completeTopologyParam) true)
- topology-name (.getTopologyName completeTopologyParam)
- timeout-ms (or (.getTimeoutMs completeTopologyParam) TEST-TIMEOUT-MS)]
- (complete-topology (.getState cluster) topology
- :mock-sources mocked-sources
- :storm-conf storm-conf
- :cleanup-state cleanup-state
- :topology-name topology-name
- :timeout-ms timeout-ms)))
- ([^ILocalCluster cluster ^StormTopology topology]
- (-completeTopology cluster topology (CompleteTopologyParam.))))
-
-
-(defn -withSimulatedTime
- [^Runnable code]
- (with-simulated-time
- (.run code)))
-
-(defmacro with-cluster
- [cluster-type mkClusterParam code]
- `(let [supervisors# (or (.getSupervisors ~mkClusterParam) 2)
- ports-per-supervisor# (or (.getPortsPerSupervisor ~mkClusterParam) 3)
- daemon-conf# (or (.getDaemonConf ~mkClusterParam) {})
- nimbus-daemon# (.isNimbusDaemon ~mkClusterParam)]
- (~cluster-type [cluster# :supervisors supervisors#
- :ports-per-supervisor ports-per-supervisor#
- :daemon-conf daemon-conf#
- :nimbus-daemon nimbus-daemon#]
- (let [cluster# (LocalCluster. cluster#)]
- (.run ~code cluster#)))))
-
-(defn -withLocalCluster
- ([^MkClusterParam mkClusterParam ^TestJob code]
- (with-cluster with-local-cluster mkClusterParam code))
- ([^TestJob code]
- (-withLocalCluster (MkClusterParam.) code)))
-
-(defn -getLocalCluster
- ([^Map clusterConf]
- (let [daemon-conf (get-in clusterConf ["daemon-conf"] {})
- supervisors (get-in clusterConf ["supervisors"] 2)
- ports-per-supervisor (get-in clusterConf ["ports-per-supervisor"] 3)
- inimbus (get-in clusterConf ["inimbus"] nil)
- supervisor-slot-port-min (get-in clusterConf ["supervisor-slot-port-min"] 1024)
- nimbus-daemon (get-in clusterConf ["nimbus-daemon"] false)
- local-cluster-map (mk-local-storm-cluster :supervisors supervisors
- :ports-per-supervisor ports-per-supervisor
- :daemon-conf daemon-conf
- :inimbus inimbus
- :supervisor-slot-port-min supervisor-slot-port-min
- :nimbus-daemon nimbus-daemon
- )]
- (LocalCluster. local-cluster-map))))
-
-(defn -withSimulatedTimeLocalCluster
- ([^MkClusterParam mkClusterParam ^TestJob code]
- (with-cluster with-simulated-time-local-cluster mkClusterParam code))
- ([^TestJob code]
- (-withSimulatedTimeLocalCluster (MkClusterParam.) code)))
-
-(defn -withTrackedCluster
- ([^MkClusterParam mkClusterParam ^TestJob code]
- (with-cluster with-tracked-cluster mkClusterParam code))
- ([^TestJob code]
- (-withTrackedCluster (MkClusterParam.) code)))
-
-(defn- find-tuples
- [^List fixed-tuples ^String stream]
- (let [ret (ArrayList.)]
- (doseq [fixed-tuple fixed-tuples]
- (if (= (.stream fixed-tuple) stream)
- (.add ret (.values fixed-tuple))))
- ret))
-
-(defn -readTuples
- ([^Map result ^String componentId ^String streamId]
- (let [stream-result (.get result componentId)
- ret (if stream-result
- (find-tuples stream-result streamId)
- [])]
- ret))
- ([^Map result ^String componentId]
- (-readTuples result componentId Utils/DEFAULT_STREAM_ID)))
-
-(defn -mkTrackedTopology
- [^ILocalCluster trackedCluster ^StormTopology topology]
- (-> (mk-tracked-topology (.getState trackedCluster) topology)
- (TrackedTopology.)))
-
-(defn -trackedWait
- ([^TrackedTopology trackedTopology ^Integer amt ^Integer timeout-ms]
- (tracked-wait trackedTopology amt timeout-ms))
- ([^TrackedTopology trackedTopology ^Integer amt]
- (tracked-wait trackedTopology amt))
- ([^TrackedTopology trackedTopology]
- (-trackedWait trackedTopology 1)))
-
-(defn -advanceClusterTime
- ([^ILocalCluster cluster ^Integer secs ^Integer step]
- (advance-cluster-time (.getState cluster) secs step))
- ([^ILocalCluster cluster ^Integer secs]
- (-advanceClusterTime cluster secs 1)))
-
-(defn- multiseteq
- [^Object obj1 ^Object obj2]
- (let [obj1 (clojurify-structure obj1)
- obj2 (clojurify-structure obj2)]
- (ms= obj1 obj2)))
-
-(defn -multiseteq
- [^Collection coll1 ^Collection coll2]
- (multiseteq coll1 coll2))
-
-(defn -multiseteq
- [^Map coll1 ^Map coll2]
- (multiseteq coll1 coll2))
-
-(defn -testTuple
- ([^List values]
- (-testTuple values nil))
- ([^List values ^MkTupleParam param]
- (if (nil? param)
- (test-tuple values)
- (let [stream (or (.getStream param) Utils/DEFAULT_STREAM_ID)
- component (or (.getComponent param) "component")
- fields (.getFields param)]
- (test-tuple values :stream stream :component component :fields fields)))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/thrift.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/thrift.clj b/storm-core/src/clj/backtype/storm/thrift.clj
deleted file mode 100644
index 47e233a..0000000
--- a/storm-core/src/clj/backtype/storm/thrift.clj
+++ /dev/null
@@ -1,284 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.thrift
- (:import [java.util HashMap]
- [java.io Serializable]
- [org.apache.storm.generated NodeInfo Assignment])
- (:import [org.apache.storm.generated JavaObject Grouping Nimbus StormTopology
- StormTopology$_Fields Bolt Nimbus$Client Nimbus$Iface
- ComponentCommon Grouping$_Fields SpoutSpec NullStruct StreamInfo
- GlobalStreamId ComponentObject ComponentObject$_Fields
- ShellComponent SupervisorInfo])
- (:import [org.apache.storm.utils Utils NimbusClient])
- (:import [org.apache.storm Constants])
- (:import [org.apache.storm.security.auth ReqContext])
- (:import [org.apache.storm.grouping CustomStreamGrouping])
- (:import [org.apache.storm.topology TopologyBuilder])
- (:import [org.apache.storm.clojure RichShellBolt RichShellSpout])
- (:import [org.apache.thrift.transport TTransport])
- (:use [org.apache.storm util config log zookeeper]))
-
-(defn instantiate-java-object
- [^JavaObject obj]
- (let [name (symbol (.get_full_class_name obj))
- args (map (memfn getFieldValue) (.get_args_list obj))]
- (eval `(new ~name ~@args))))
-
-(def grouping-constants
- {Grouping$_Fields/FIELDS :fields
- Grouping$_Fields/SHUFFLE :shuffle
- Grouping$_Fields/ALL :all
- Grouping$_Fields/NONE :none
- Grouping$_Fields/CUSTOM_SERIALIZED :custom-serialized
- Grouping$_Fields/CUSTOM_OBJECT :custom-object
- Grouping$_Fields/DIRECT :direct
- Grouping$_Fields/LOCAL_OR_SHUFFLE :local-or-shuffle})
-
-(defn grouping-type
- [^Grouping grouping]
- (grouping-constants (.getSetField grouping)))
-
-(defn field-grouping
- [^Grouping grouping]
- (when-not (= (grouping-type grouping) :fields)
- (throw (IllegalArgumentException. "Tried to get grouping fields from non fields grouping")))
- (.get_fields grouping))
-
-(defn global-grouping?
- [^Grouping grouping]
- (and (= :fields (grouping-type grouping))
- (empty? (field-grouping grouping))))
-
-(defn parallelism-hint
- [^ComponentCommon component-common]
- (let [phint (.get_parallelism_hint component-common)]
- (if-not (.is_set_parallelism_hint component-common) 1 phint)))
-
-(defn nimbus-client-and-conn
- ([host port]
- (nimbus-client-and-conn host port nil))
- ([host port as-user]
- (log-message "Connecting to Nimbus at " host ":" port " as user: " as-user)
- (let [conf (read-storm-config)
- nimbusClient (NimbusClient. conf host port nil as-user)
- client (.getClient nimbusClient)
- transport (.transport nimbusClient)]
- [client transport] )))
-
-(defmacro with-nimbus-connection
- [[client-sym host port] & body]
- `(let [[^Nimbus$Client ~client-sym ^TTransport conn#] (nimbus-client-and-conn ~host ~port)]
- (try
- ~@body
- (finally (.close conn#)))))
-
-(defmacro with-configured-nimbus-connection
- [client-sym & body]
- `(let [conf# (read-storm-config)
- context# (ReqContext/context)
- user# (if (.principal context#) (.getName (.principal context#)))
- nimbusClient# (NimbusClient/getConfiguredClientAs conf# user#)
- ~client-sym (.getClient nimbusClient#)
- conn# (.transport nimbusClient#)
- ]
- (try
- ~@body
- (finally (.close conn#)))))
-
-(defn direct-output-fields
- [fields]
- (StreamInfo. fields true))
-
-(defn output-fields
- [fields]
- (StreamInfo. fields false))
-
-(defn mk-output-spec
- [output-spec]
- (let [output-spec (if (map? output-spec)
- output-spec
- {Utils/DEFAULT_STREAM_ID output-spec})]
- (map-val
- (fn [out]
- (if (instance? StreamInfo out)
- out
- (StreamInfo. out false)))
- output-spec)))
-
-(defnk mk-plain-component-common
- [inputs output-spec parallelism-hint :conf nil]
- (let [ret (ComponentCommon. (HashMap. inputs) (HashMap. (mk-output-spec output-spec)))]
- (when parallelism-hint
- (.set_parallelism_hint ret parallelism-hint))
- (when conf
- (.set_json_conf ret (to-json conf)))
- ret))
-
-(defnk mk-spout-spec*
- [spout outputs :p nil :conf nil]
- (SpoutSpec. (ComponentObject/serialized_java (Utils/javaSerialize spout))
- (mk-plain-component-common {} outputs p :conf conf)))
-
-(defn mk-shuffle-grouping
- []
- (Grouping/shuffle (NullStruct.)))
-
-(defn mk-local-or-shuffle-grouping
- []
- (Grouping/local_or_shuffle (NullStruct.)))
-
-(defn mk-fields-grouping
- [fields]
- (Grouping/fields fields))
-
-(defn mk-global-grouping
- []
- (mk-fields-grouping []))
-
-(defn mk-direct-grouping
- []
- (Grouping/direct (NullStruct.)))
-
-(defn mk-all-grouping
- []
- (Grouping/all (NullStruct.)))
-
-(defn mk-none-grouping
- []
- (Grouping/none (NullStruct.)))
-
-(defn deserialized-component-object
- [^ComponentObject obj]
- (when (not= (.getSetField obj) ComponentObject$_Fields/SERIALIZED_JAVA)
- (throw (RuntimeException. "Cannot deserialize non-java-serialized object")))
- (Utils/javaDeserialize (.get_serialized_java obj) Serializable))
-
-(defn serialize-component-object
- [obj]
- (ComponentObject/serialized_java (Utils/javaSerialize obj)))
-
-(defn- mk-grouping
- [grouping-spec]
- (cond (nil? grouping-spec)
- (mk-none-grouping)
-
- (instance? Grouping grouping-spec)
- grouping-spec
-
- (instance? CustomStreamGrouping grouping-spec)
- (Grouping/custom_serialized (Utils/javaSerialize grouping-spec))
-
- (instance? JavaObject grouping-spec)
- (Grouping/custom_object grouping-spec)
-
- (sequential? grouping-spec)
- (mk-fields-grouping grouping-spec)
-
- (= grouping-spec :shuffle)
- (mk-shuffle-grouping)
-
- (= grouping-spec :local-or-shuffle)
- (mk-local-or-shuffle-grouping)
- (= grouping-spec :none)
- (mk-none-grouping)
-
- (= grouping-spec :all)
- (mk-all-grouping)
-
- (= grouping-spec :global)
- (mk-global-grouping)
-
- (= grouping-spec :direct)
- (mk-direct-grouping)
-
- true
- (throw (IllegalArgumentException.
- (str grouping-spec " is not a valid grouping")))))
-
-(defn- mk-inputs
- [inputs]
- (into {} (for [[stream-id grouping-spec] inputs]
- [(if (sequential? stream-id)
- (GlobalStreamId. (first stream-id) (second stream-id))
- (GlobalStreamId. stream-id Utils/DEFAULT_STREAM_ID))
- (mk-grouping grouping-spec)])))
-
-(defnk mk-bolt-spec*
- [inputs bolt outputs :p nil :conf nil]
- (let [common (mk-plain-component-common (mk-inputs inputs) outputs p :conf conf)]
- (Bolt. (ComponentObject/serialized_java (Utils/javaSerialize bolt))
- common)))
-
-(defnk mk-spout-spec
- [spout :parallelism-hint nil :p nil :conf nil]
- (let [parallelism-hint (if p p parallelism-hint)]
- {:obj spout :p parallelism-hint :conf conf}))
-
-(defn- shell-component-params
- [command script-or-output-spec kwargs]
- (if (string? script-or-output-spec)
- [(into-array String [command script-or-output-spec])
- (first kwargs)
- (rest kwargs)]
- [(into-array String command)
- script-or-output-spec
- kwargs]))
-
-(defnk mk-bolt-spec
- [inputs bolt :parallelism-hint nil :p nil :conf nil]
- (let [parallelism-hint (if p p parallelism-hint)]
- {:obj bolt :inputs inputs :p parallelism-hint :conf conf}))
-
-(defn mk-shell-bolt-spec
- [inputs command script-or-output-spec & kwargs]
- (let [[command output-spec kwargs]
- (shell-component-params command script-or-output-spec kwargs)]
- (apply mk-bolt-spec inputs
- (RichShellBolt. command (mk-output-spec output-spec)) kwargs)))
-
-(defn mk-shell-spout-spec
- [command script-or-output-spec & kwargs]
- (let [[command output-spec kwargs]
- (shell-component-params command script-or-output-spec kwargs)]
- (apply mk-spout-spec
- (RichShellSpout. command (mk-output-spec output-spec)) kwargs)))
-
-(defn- add-inputs
- [declarer inputs]
- (doseq [[id grouping] (mk-inputs inputs)]
- (.grouping declarer id grouping)))
-
-(defn mk-topology
- ([spout-map bolt-map]
- (let [builder (TopologyBuilder.)]
- (doseq [[name {spout :obj p :p conf :conf}] spout-map]
- (-> builder (.setSpout name spout (if-not (nil? p) (int p) p)) (.addConfigurations conf)))
- (doseq [[name {bolt :obj p :p conf :conf inputs :inputs}] bolt-map]
- (-> builder (.setBolt name bolt (if-not (nil? p) (int p) p)) (.addConfigurations conf) (add-inputs inputs)))
- (.createTopology builder)))
- ([spout-map bolt-map state-spout-map]
- (mk-topology spout-map bolt-map)))
-
-;; clojurify-structure is needed or else every element becomes the same after successive calls
-;; don't know why this happens
-(def STORM-TOPOLOGY-FIELDS
- (-> StormTopology/metaDataMap clojurify-structure keys))
-
-(def SPOUT-FIELDS
- [StormTopology$_Fields/SPOUTS
- StormTopology$_Fields/STATE_SPOUTS])
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/timer.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/timer.clj b/storm-core/src/clj/backtype/storm/timer.clj
deleted file mode 100644
index 0d8839e..0000000
--- a/storm-core/src/clj/backtype/storm/timer.clj
+++ /dev/null
@@ -1,128 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.timer
- (:import [org.apache.storm.utils Time])
- (:import [java.util PriorityQueue Comparator Random])
- (:import [java.util.concurrent Semaphore])
- (:use [org.apache.storm util log]))
-
-;; The timer defined in this file is very similar to java.util.Timer, except
-;; it integrates with Storm's time simulation capabilities. This lets us test
-;; code that does asynchronous work on the timer thread
-
-(defnk mk-timer [:kill-fn (fn [& _] ) :timer-name nil]
- (let [queue (PriorityQueue. 10 (reify Comparator
- (compare
- [this o1 o2]
- (- (first o1) (first o2)))
- (equals
- [this obj]
- true)))
- active (atom true)
- lock (Object.)
- notifier (Semaphore. 0)
- thread-name (if timer-name timer-name "timer")
- timer-thread (Thread.
- (fn []
- (while @active
- (try
- (let [[time-millis _ _ :as elem] (locking lock (.peek queue))]
- (if (and elem (>= (current-time-millis) time-millis))
- ;; It is imperative to not run the function
- ;; inside the timer lock. Otherwise, it is
- ;; possible to deadlock if the fn deals with
- ;; other locks, like the submit lock.
- (let [afn (locking lock (second (.poll queue)))]
- (afn))
- (if time-millis
- ;; If any events are scheduled, sleep until
- ;; event generation. If any recurring events
- ;; are scheduled then we will always go
- ;; through this branch, sleeping only the
- ;; exact necessary amount of time. We give
- ;; an upper bound, e.g. 1000 millis, to the
- ;; sleeping time, to limit the response time
- ;; for detecting any new event within 1 secs.
- (Time/sleep (min 1000 (- time-millis (current-time-millis))))
- ;; Otherwise poll to see if any new event
- ;; was scheduled. This is, in essence, the
- ;; response time for detecting any new event
- ;; schedulings when there are no scheduled
- ;; events.
- (Time/sleep 1000))))
- (catch Throwable t
- ;; Because the interrupted exception can be
- ;; wrapped in a RuntimeException.
- (when-not (exception-cause? InterruptedException t)
- (kill-fn t)
- (reset! active false)
- (throw t)))))
- (.release notifier)) thread-name)]
- (.setDaemon timer-thread true)
- (.setPriority timer-thread Thread/MAX_PRIORITY)
- (.start timer-thread)
- {:timer-thread timer-thread
- :queue queue
- :active active
- :lock lock
- :random (Random.)
- :cancel-notifier notifier}))
-
-(defn- check-active!
- [timer]
- (when-not @(:active timer)
- (throw (IllegalStateException. "Timer is not active"))))
-
-(defnk schedule
- [timer delay-secs afn :check-active true :jitter-ms 0]
- (when check-active (check-active! timer))
- (let [id (uuid)
- ^PriorityQueue queue (:queue timer)
- end-time-ms (+ (current-time-millis) (secs-to-millis-long delay-secs))
- end-time-ms (if (< 0 jitter-ms) (+ (.nextInt (:random timer) jitter-ms) end-time-ms) end-time-ms)]
- (locking (:lock timer)
- (.add queue [end-time-ms afn id]))))
-
-(defn schedule-recurring
- [timer delay-secs recur-secs afn]
- (schedule timer
- delay-secs
- (fn this []
- (afn)
- ; This avoids a race condition with cancel-timer.
- (schedule timer recur-secs this :check-active false))))
-
-(defn schedule-recurring-with-jitter
- [timer delay-secs recur-secs jitter-ms afn]
- (schedule timer
- delay-secs
- (fn this []
- (afn)
- ; This avoids a race condition with cancel-timer.
- (schedule timer recur-secs this :check-active false :jitter-ms jitter-ms))))
-
-(defn cancel-timer
- [timer]
- (check-active! timer)
- (locking (:lock timer)
- (reset! (:active timer) false)
- (.interrupt (:timer-thread timer)))
- (.acquire (:cancel-notifier timer)))
-
-(defn timer-waiting?
- [timer]
- (Time/isThreadWaiting (:timer-thread timer)))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/trident/testing.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/trident/testing.clj b/storm-core/src/clj/backtype/storm/trident/testing.clj
deleted file mode 100644
index aafb001..0000000
--- a/storm-core/src/clj/backtype/storm/trident/testing.clj
+++ /dev/null
@@ -1,79 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.trident.testing
- (:require [org.apache.storm.LocalDRPC :as LocalDRPC])
- (:import [org.apache.storm.trident.testing FeederBatchSpout FeederCommitterBatchSpout MemoryMapState MemoryMapState$Factory TuplifyArgs])
- (:require [org.apache.storm [LocalDRPC]])
- (:import [org.apache.storm LocalDRPC])
- (:import [org.apache.storm.tuple Fields])
- (:import [org.apache.storm.generated KillOptions])
- (:require [org.apache.storm [testing :as t]])
- (:use [org.apache.storm util])
- )
-
-(defn local-drpc []
- (LocalDRPC.))
-
-(defn exec-drpc [^LocalDRPC drpc function-name args]
- (let [res (.execute drpc function-name args)]
- (from-json res)))
-
-(defn exec-drpc-tuples [^LocalDRPC drpc function-name tuples]
- (exec-drpc drpc function-name (to-json tuples)))
-
-(defn feeder-spout [fields]
- (FeederBatchSpout. fields))
-
-(defn feeder-committer-spout [fields]
- (FeederCommitterBatchSpout. fields))
-
-(defn feed [feeder tuples]
- (.feed feeder tuples))
-
-(defn fields [& fields]
- (Fields. fields))
-
-(defn memory-map-state []
- (MemoryMapState$Factory.))
-
-(defmacro with-drpc [[drpc] & body]
- `(let [~drpc (org.apache.storm.LocalDRPC.)]
- ~@body
- (.shutdown ~drpc)
- ))
-
-(defn with-topology* [cluster storm-topo body-fn]
- (t/submit-local-topology (:nimbus cluster) "tester" {} storm-topo)
- (body-fn)
- (.killTopologyWithOpts (:nimbus cluster) "tester" (doto (KillOptions.) (.set_wait_secs 0))))
-
-(defmacro with-topology [[cluster topo storm-topo] & body]
- `(let [~storm-topo (.build ~topo)]
- (with-topology* ~cluster ~storm-topo (fn [] ~@body))))
-
-(defn bootstrap-imports []
- (import 'org.apache.storm.LocalDRPC)
- (import 'org.apache.storm.trident.TridentTopology)
- (import '[org.apache.storm.trident.operation.builtin Count Sum Equals MapGet Debug FilterNull FirstN TupleCollectionGet])
- )
-
-(defn drpc-tuples-input [topology function-name drpc outfields]
- (-> topology
- (.newDRPCStream function-name drpc)
- (.each (fields "args") (TuplifyArgs.) outfields)
- ))
-
-
[28/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ComponentType.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ComponentType.java b/storm-core/src/jvm/backtype/storm/generated/ComponentType.java
deleted file mode 100644
index 7a9fd66..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ComponentType.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum ComponentType implements org.apache.thrift.TEnum {
- BOLT(1),
- SPOUT(2);
-
- private final int value;
-
- private ComponentType(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static ComponentType findByValue(int value) {
- switch (value) {
- case 1:
- return BOLT;
- case 2:
- return SPOUT;
- default:
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/Credentials.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/Credentials.java b/storm-core/src/jvm/backtype/storm/generated/Credentials.java
deleted file mode 100644
index 231af06..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/Credentials.java
+++ /dev/null
@@ -1,458 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class Credentials implements org.apache.thrift.TBase<Credentials, Credentials._Fields>, java.io.Serializable, Cloneable, Comparable<Credentials> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Credentials");
-
- private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.MAP, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new CredentialsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new CredentialsTupleSchemeFactory());
- }
-
- private Map<String,String> creds; // 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 {
- CREDS((short)1, "creds");
-
- 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: // CREDS
- return CREDS;
- 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.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Credentials.class, metaDataMap);
- }
-
- public Credentials() {
- }
-
- public Credentials(
- Map<String,String> creds)
- {
- this();
- this.creds = creds;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public Credentials(Credentials other) {
- if (other.is_set_creds()) {
- Map<String,String> __this__creds = new HashMap<String,String>(other.creds);
- this.creds = __this__creds;
- }
- }
-
- public Credentials deepCopy() {
- return new Credentials(this);
- }
-
- @Override
- public void clear() {
- this.creds = null;
- }
-
- public int get_creds_size() {
- return (this.creds == null) ? 0 : this.creds.size();
- }
-
- public void put_to_creds(String key, String val) {
- if (this.creds == null) {
- this.creds = new HashMap<String,String>();
- }
- this.creds.put(key, val);
- }
-
- public Map<String,String> get_creds() {
- return this.creds;
- }
-
- public void set_creds(Map<String,String> creds) {
- this.creds = creds;
- }
-
- public void unset_creds() {
- this.creds = null;
- }
-
- /** Returns true if field creds is set (has been assigned a value) and false otherwise */
- public boolean is_set_creds() {
- return this.creds != null;
- }
-
- public void set_creds_isSet(boolean value) {
- if (!value) {
- this.creds = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case CREDS:
- if (value == null) {
- unset_creds();
- } else {
- set_creds((Map<String,String>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case CREDS:
- return get_creds();
-
- }
- 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 CREDS:
- return is_set_creds();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof Credentials)
- return this.equals((Credentials)that);
- return false;
- }
-
- public boolean equals(Credentials that) {
- if (that == null)
- return false;
-
- boolean this_present_creds = true && this.is_set_creds();
- boolean that_present_creds = true && that.is_set_creds();
- if (this_present_creds || that_present_creds) {
- if (!(this_present_creds && that_present_creds))
- return false;
- if (!this.creds.equals(that.creds))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_creds = true && (is_set_creds());
- list.add(present_creds);
- if (present_creds)
- list.add(creds);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(Credentials other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_creds()).compareTo(other.is_set_creds());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_creds()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creds, other.creds);
- 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("Credentials(");
- boolean first = true;
-
- sb.append("creds:");
- if (this.creds == null) {
- sb.append("null");
- } else {
- sb.append(this.creds);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_creds()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'creds' 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 CredentialsStandardSchemeFactory implements SchemeFactory {
- public CredentialsStandardScheme getScheme() {
- return new CredentialsStandardScheme();
- }
- }
-
- private static class CredentialsStandardScheme extends StandardScheme<Credentials> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, Credentials 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: // CREDS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map548 = iprot.readMapBegin();
- struct.creds = new HashMap<String,String>(2*_map548.size);
- String _key549;
- String _val550;
- for (int _i551 = 0; _i551 < _map548.size; ++_i551)
- {
- _key549 = iprot.readString();
- _val550 = iprot.readString();
- struct.creds.put(_key549, _val550);
- }
- iprot.readMapEnd();
- }
- struct.set_creds_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, Credentials struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.creds != null) {
- oprot.writeFieldBegin(CREDS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.creds.size()));
- for (Map.Entry<String, String> _iter552 : struct.creds.entrySet())
- {
- oprot.writeString(_iter552.getKey());
- oprot.writeString(_iter552.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class CredentialsTupleSchemeFactory implements SchemeFactory {
- public CredentialsTupleScheme getScheme() {
- return new CredentialsTupleScheme();
- }
- }
-
- private static class CredentialsTupleScheme extends TupleScheme<Credentials> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, Credentials struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.creds.size());
- for (Map.Entry<String, String> _iter553 : struct.creds.entrySet())
- {
- oprot.writeString(_iter553.getKey());
- oprot.writeString(_iter553.getValue());
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, Credentials struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TMap _map554 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.creds = new HashMap<String,String>(2*_map554.size);
- String _key555;
- String _val556;
- for (int _i557 = 0; _i557 < _map554.size; ++_i557)
- {
- _key555 = iprot.readString();
- _val556 = iprot.readString();
- struct.creds.put(_key555, _val556);
- }
- }
- struct.set_creds_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/DRPCExecutionException.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/DRPCExecutionException.java b/storm-core/src/jvm/backtype/storm/generated/DRPCExecutionException.java
deleted file mode 100644
index c7ba94f..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/DRPCExecutionException.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class DRPCExecutionException extends TException implements org.apache.thrift.TBase<DRPCExecutionException, DRPCExecutionException._Fields>, java.io.Serializable, Cloneable, Comparable<DRPCExecutionException> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DRPCExecutionException");
-
- 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 DRPCExecutionExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new DRPCExecutionExceptionTupleSchemeFactory());
- }
-
- 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(DRPCExecutionException.class, metaDataMap);
- }
-
- public DRPCExecutionException() {
- }
-
- public DRPCExecutionException(
- String msg)
- {
- this();
- this.msg = msg;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public DRPCExecutionException(DRPCExecutionException other) {
- if (other.is_set_msg()) {
- this.msg = other.msg;
- }
- }
-
- public DRPCExecutionException deepCopy() {
- return new DRPCExecutionException(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 DRPCExecutionException)
- return this.equals((DRPCExecutionException)that);
- return false;
- }
-
- public boolean equals(DRPCExecutionException 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(DRPCExecutionException 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("DRPCExecutionException(");
- 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 DRPCExecutionExceptionStandardSchemeFactory implements SchemeFactory {
- public DRPCExecutionExceptionStandardScheme getScheme() {
- return new DRPCExecutionExceptionStandardScheme();
- }
- }
-
- private static class DRPCExecutionExceptionStandardScheme extends StandardScheme<DRPCExecutionException> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, DRPCExecutionException 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, DRPCExecutionException 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 DRPCExecutionExceptionTupleSchemeFactory implements SchemeFactory {
- public DRPCExecutionExceptionTupleScheme getScheme() {
- return new DRPCExecutionExceptionTupleScheme();
- }
- }
-
- private static class DRPCExecutionExceptionTupleScheme extends TupleScheme<DRPCExecutionException> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, DRPCExecutionException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.msg);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, DRPCExecutionException 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/a6171bd6/storm-core/src/jvm/backtype/storm/generated/DRPCRequest.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/DRPCRequest.java b/storm-core/src/jvm/backtype/storm/generated/DRPCRequest.java
deleted file mode 100644
index 33d85c2..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/DRPCRequest.java
+++ /dev/null
@@ -1,507 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCRequest._Fields>, java.io.Serializable, Cloneable, Comparable<DRPCRequest> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DRPCRequest");
-
- private static final org.apache.thrift.protocol.TField FUNC_ARGS_FIELD_DESC = new org.apache.thrift.protocol.TField("func_args", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField REQUEST_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("request_id", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new DRPCRequestStandardSchemeFactory());
- schemes.put(TupleScheme.class, new DRPCRequestTupleSchemeFactory());
- }
-
- private String func_args; // required
- private String request_id; // 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 {
- FUNC_ARGS((short)1, "func_args"),
- REQUEST_ID((short)2, "request_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: // FUNC_ARGS
- return FUNC_ARGS;
- case 2: // REQUEST_ID
- return REQUEST_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
- 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.FUNC_ARGS, new org.apache.thrift.meta_data.FieldMetaData("func_args", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.REQUEST_ID, new org.apache.thrift.meta_data.FieldMetaData("request_id", 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(DRPCRequest.class, metaDataMap);
- }
-
- public DRPCRequest() {
- }
-
- public DRPCRequest(
- String func_args,
- String request_id)
- {
- this();
- this.func_args = func_args;
- this.request_id = request_id;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public DRPCRequest(DRPCRequest other) {
- if (other.is_set_func_args()) {
- this.func_args = other.func_args;
- }
- if (other.is_set_request_id()) {
- this.request_id = other.request_id;
- }
- }
-
- public DRPCRequest deepCopy() {
- return new DRPCRequest(this);
- }
-
- @Override
- public void clear() {
- this.func_args = null;
- this.request_id = null;
- }
-
- public String get_func_args() {
- return this.func_args;
- }
-
- public void set_func_args(String func_args) {
- this.func_args = func_args;
- }
-
- public void unset_func_args() {
- this.func_args = null;
- }
-
- /** Returns true if field func_args is set (has been assigned a value) and false otherwise */
- public boolean is_set_func_args() {
- return this.func_args != null;
- }
-
- public void set_func_args_isSet(boolean value) {
- if (!value) {
- this.func_args = null;
- }
- }
-
- public String get_request_id() {
- return this.request_id;
- }
-
- public void set_request_id(String request_id) {
- this.request_id = request_id;
- }
-
- public void unset_request_id() {
- this.request_id = null;
- }
-
- /** Returns true if field request_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_request_id() {
- return this.request_id != null;
- }
-
- public void set_request_id_isSet(boolean value) {
- if (!value) {
- this.request_id = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case FUNC_ARGS:
- if (value == null) {
- unset_func_args();
- } else {
- set_func_args((String)value);
- }
- break;
-
- case REQUEST_ID:
- if (value == null) {
- unset_request_id();
- } else {
- set_request_id((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case FUNC_ARGS:
- return get_func_args();
-
- case REQUEST_ID:
- return get_request_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 FUNC_ARGS:
- return is_set_func_args();
- case REQUEST_ID:
- return is_set_request_id();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof DRPCRequest)
- return this.equals((DRPCRequest)that);
- return false;
- }
-
- public boolean equals(DRPCRequest that) {
- if (that == null)
- return false;
-
- boolean this_present_func_args = true && this.is_set_func_args();
- boolean that_present_func_args = true && that.is_set_func_args();
- if (this_present_func_args || that_present_func_args) {
- if (!(this_present_func_args && that_present_func_args))
- return false;
- if (!this.func_args.equals(that.func_args))
- return false;
- }
-
- boolean this_present_request_id = true && this.is_set_request_id();
- boolean that_present_request_id = true && that.is_set_request_id();
- if (this_present_request_id || that_present_request_id) {
- if (!(this_present_request_id && that_present_request_id))
- return false;
- if (!this.request_id.equals(that.request_id))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_func_args = true && (is_set_func_args());
- list.add(present_func_args);
- if (present_func_args)
- list.add(func_args);
-
- boolean present_request_id = true && (is_set_request_id());
- list.add(present_request_id);
- if (present_request_id)
- list.add(request_id);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(DRPCRequest other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_func_args()).compareTo(other.is_set_func_args());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_func_args()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.func_args, other.func_args);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_request_id()).compareTo(other.is_set_request_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_request_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request_id, other.request_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("DRPCRequest(");
- boolean first = true;
-
- sb.append("func_args:");
- if (this.func_args == null) {
- sb.append("null");
- } else {
- sb.append(this.func_args);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("request_id:");
- if (this.request_id == null) {
- sb.append("null");
- } else {
- sb.append(this.request_id);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_func_args()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'func_args' is unset! Struct:" + toString());
- }
-
- if (!is_set_request_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'request_id' 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 DRPCRequestStandardSchemeFactory implements SchemeFactory {
- public DRPCRequestStandardScheme getScheme() {
- return new DRPCRequestStandardScheme();
- }
- }
-
- private static class DRPCRequestStandardScheme extends StandardScheme<DRPCRequest> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, DRPCRequest 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: // FUNC_ARGS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.func_args = iprot.readString();
- struct.set_func_args_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // REQUEST_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.request_id = iprot.readString();
- struct.set_request_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, DRPCRequest struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.func_args != null) {
- oprot.writeFieldBegin(FUNC_ARGS_FIELD_DESC);
- oprot.writeString(struct.func_args);
- oprot.writeFieldEnd();
- }
- if (struct.request_id != null) {
- oprot.writeFieldBegin(REQUEST_ID_FIELD_DESC);
- oprot.writeString(struct.request_id);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class DRPCRequestTupleSchemeFactory implements SchemeFactory {
- public DRPCRequestTupleScheme getScheme() {
- return new DRPCRequestTupleScheme();
- }
- }
-
- private static class DRPCRequestTupleScheme extends TupleScheme<DRPCRequest> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, DRPCRequest struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.func_args);
- oprot.writeString(struct.request_id);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, DRPCRequest struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.func_args = iprot.readString();
- struct.set_func_args_isSet(true);
- struct.request_id = iprot.readString();
- struct.set_request_id_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/DebugOptions.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/DebugOptions.java b/storm-core/src/jvm/backtype/storm/generated/DebugOptions.java
deleted file mode 100644
index 1ceb853..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/DebugOptions.java
+++ /dev/null
@@ -1,506 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, DebugOptions._Fields>, java.io.Serializable, Cloneable, Comparable<DebugOptions> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DebugOptions");
-
- private static final org.apache.thrift.protocol.TField ENABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("enable", org.apache.thrift.protocol.TType.BOOL, (short)1);
- private static final org.apache.thrift.protocol.TField SAMPLINGPCT_FIELD_DESC = new org.apache.thrift.protocol.TField("samplingpct", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new DebugOptionsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new DebugOptionsTupleSchemeFactory());
- }
-
- private boolean enable; // optional
- private double samplingpct; // 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 {
- ENABLE((short)1, "enable"),
- SAMPLINGPCT((short)2, "samplingpct");
-
- 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: // ENABLE
- return ENABLE;
- case 2: // SAMPLINGPCT
- return SAMPLINGPCT;
- 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 __ENABLE_ISSET_ID = 0;
- private static final int __SAMPLINGPCT_ISSET_ID = 1;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.ENABLE,_Fields.SAMPLINGPCT};
- 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.ENABLE, new org.apache.thrift.meta_data.FieldMetaData("enable", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
- tmpMap.put(_Fields.SAMPLINGPCT, new org.apache.thrift.meta_data.FieldMetaData("samplingpct", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DebugOptions.class, metaDataMap);
- }
-
- public DebugOptions() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public DebugOptions(DebugOptions other) {
- __isset_bitfield = other.__isset_bitfield;
- this.enable = other.enable;
- this.samplingpct = other.samplingpct;
- }
-
- public DebugOptions deepCopy() {
- return new DebugOptions(this);
- }
-
- @Override
- public void clear() {
- set_enable_isSet(false);
- this.enable = false;
- set_samplingpct_isSet(false);
- this.samplingpct = 0.0;
- }
-
- public boolean is_enable() {
- return this.enable;
- }
-
- public void set_enable(boolean enable) {
- this.enable = enable;
- set_enable_isSet(true);
- }
-
- public void unset_enable() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ENABLE_ISSET_ID);
- }
-
- /** Returns true if field enable is set (has been assigned a value) and false otherwise */
- public boolean is_set_enable() {
- return EncodingUtils.testBit(__isset_bitfield, __ENABLE_ISSET_ID);
- }
-
- public void set_enable_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ENABLE_ISSET_ID, value);
- }
-
- public double get_samplingpct() {
- return this.samplingpct;
- }
-
- public void set_samplingpct(double samplingpct) {
- this.samplingpct = samplingpct;
- set_samplingpct_isSet(true);
- }
-
- public void unset_samplingpct() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SAMPLINGPCT_ISSET_ID);
- }
-
- /** Returns true if field samplingpct is set (has been assigned a value) and false otherwise */
- public boolean is_set_samplingpct() {
- return EncodingUtils.testBit(__isset_bitfield, __SAMPLINGPCT_ISSET_ID);
- }
-
- public void set_samplingpct_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SAMPLINGPCT_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ENABLE:
- if (value == null) {
- unset_enable();
- } else {
- set_enable((Boolean)value);
- }
- break;
-
- case SAMPLINGPCT:
- if (value == null) {
- unset_samplingpct();
- } else {
- set_samplingpct((Double)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ENABLE:
- return is_enable();
-
- case SAMPLINGPCT:
- return get_samplingpct();
-
- }
- 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 ENABLE:
- return is_set_enable();
- case SAMPLINGPCT:
- return is_set_samplingpct();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof DebugOptions)
- return this.equals((DebugOptions)that);
- return false;
- }
-
- public boolean equals(DebugOptions that) {
- if (that == null)
- return false;
-
- boolean this_present_enable = true && this.is_set_enable();
- boolean that_present_enable = true && that.is_set_enable();
- if (this_present_enable || that_present_enable) {
- if (!(this_present_enable && that_present_enable))
- return false;
- if (this.enable != that.enable)
- return false;
- }
-
- boolean this_present_samplingpct = true && this.is_set_samplingpct();
- boolean that_present_samplingpct = true && that.is_set_samplingpct();
- if (this_present_samplingpct || that_present_samplingpct) {
- if (!(this_present_samplingpct && that_present_samplingpct))
- return false;
- if (this.samplingpct != that.samplingpct)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_enable = true && (is_set_enable());
- list.add(present_enable);
- if (present_enable)
- list.add(enable);
-
- boolean present_samplingpct = true && (is_set_samplingpct());
- list.add(present_samplingpct);
- if (present_samplingpct)
- list.add(samplingpct);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(DebugOptions other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_enable()).compareTo(other.is_set_enable());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_enable()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.enable, other.enable);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_samplingpct()).compareTo(other.is_set_samplingpct());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_samplingpct()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.samplingpct, other.samplingpct);
- 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("DebugOptions(");
- boolean first = true;
-
- if (is_set_enable()) {
- sb.append("enable:");
- sb.append(this.enable);
- first = false;
- }
- if (is_set_samplingpct()) {
- if (!first) sb.append(", ");
- sb.append("samplingpct:");
- sb.append(this.samplingpct);
- 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 DebugOptionsStandardSchemeFactory implements SchemeFactory {
- public DebugOptionsStandardScheme getScheme() {
- return new DebugOptionsStandardScheme();
- }
- }
-
- private static class DebugOptionsStandardScheme extends StandardScheme<DebugOptions> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, DebugOptions 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: // ENABLE
- if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
- struct.enable = iprot.readBool();
- struct.set_enable_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // SAMPLINGPCT
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.samplingpct = iprot.readDouble();
- struct.set_samplingpct_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, DebugOptions struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.is_set_enable()) {
- oprot.writeFieldBegin(ENABLE_FIELD_DESC);
- oprot.writeBool(struct.enable);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_samplingpct()) {
- oprot.writeFieldBegin(SAMPLINGPCT_FIELD_DESC);
- oprot.writeDouble(struct.samplingpct);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class DebugOptionsTupleSchemeFactory implements SchemeFactory {
- public DebugOptionsTupleScheme getScheme() {
- return new DebugOptionsTupleScheme();
- }
- }
-
- private static class DebugOptionsTupleScheme extends TupleScheme<DebugOptions> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, DebugOptions struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_enable()) {
- optionals.set(0);
- }
- if (struct.is_set_samplingpct()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.is_set_enable()) {
- oprot.writeBool(struct.enable);
- }
- if (struct.is_set_samplingpct()) {
- oprot.writeDouble(struct.samplingpct);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, DebugOptions struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.enable = iprot.readBool();
- struct.set_enable_isSet(true);
- }
- if (incoming.get(1)) {
- struct.samplingpct = iprot.readDouble();
- struct.set_samplingpct_isSet(true);
- }
- }
- }
-
-}
-
[19/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LSTopoHistory.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/LSTopoHistory.java b/storm-core/src/jvm/backtype/storm/generated/LSTopoHistory.java
deleted file mode 100644
index 792c185..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/LSTopoHistory.java
+++ /dev/null
@@ -1,805 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class LSTopoHistory implements org.apache.thrift.TBase<LSTopoHistory, LSTopoHistory._Fields>, java.io.Serializable, Cloneable, Comparable<LSTopoHistory> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LSTopoHistory");
-
- private static final org.apache.thrift.protocol.TField TOPOLOGY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_id", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField TIME_STAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("time_stamp", org.apache.thrift.protocol.TType.I64, (short)2);
- private static final org.apache.thrift.protocol.TField USERS_FIELD_DESC = new org.apache.thrift.protocol.TField("users", org.apache.thrift.protocol.TType.LIST, (short)3);
- private static final org.apache.thrift.protocol.TField GROUPS_FIELD_DESC = new org.apache.thrift.protocol.TField("groups", org.apache.thrift.protocol.TType.LIST, (short)4);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new LSTopoHistoryStandardSchemeFactory());
- schemes.put(TupleScheme.class, new LSTopoHistoryTupleSchemeFactory());
- }
-
- private String topology_id; // required
- private long time_stamp; // required
- private List<String> users; // required
- private List<String> groups; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- TOPOLOGY_ID((short)1, "topology_id"),
- TIME_STAMP((short)2, "time_stamp"),
- USERS((short)3, "users"),
- GROUPS((short)4, "groups");
-
- private static final Map<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: // TOPOLOGY_ID
- return TOPOLOGY_ID;
- case 2: // TIME_STAMP
- return TIME_STAMP;
- case 3: // USERS
- return USERS;
- case 4: // GROUPS
- return GROUPS;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an 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 __TIME_STAMP_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
- 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.TOPOLOGY_ID, new org.apache.thrift.meta_data.FieldMetaData("topology_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.TIME_STAMP, new org.apache.thrift.meta_data.FieldMetaData("time_stamp", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.USERS, new org.apache.thrift.meta_data.FieldMetaData("users", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- tmpMap.put(_Fields.GROUPS, new org.apache.thrift.meta_data.FieldMetaData("groups", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LSTopoHistory.class, metaDataMap);
- }
-
- public LSTopoHistory() {
- }
-
- public LSTopoHistory(
- String topology_id,
- long time_stamp,
- List<String> users,
- List<String> groups)
- {
- this();
- this.topology_id = topology_id;
- this.time_stamp = time_stamp;
- set_time_stamp_isSet(true);
- this.users = users;
- this.groups = groups;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public LSTopoHistory(LSTopoHistory other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_topology_id()) {
- this.topology_id = other.topology_id;
- }
- this.time_stamp = other.time_stamp;
- if (other.is_set_users()) {
- List<String> __this__users = new ArrayList<String>(other.users);
- this.users = __this__users;
- }
- if (other.is_set_groups()) {
- List<String> __this__groups = new ArrayList<String>(other.groups);
- this.groups = __this__groups;
- }
- }
-
- public LSTopoHistory deepCopy() {
- return new LSTopoHistory(this);
- }
-
- @Override
- public void clear() {
- this.topology_id = null;
- set_time_stamp_isSet(false);
- this.time_stamp = 0;
- this.users = null;
- this.groups = null;
- }
-
- public String get_topology_id() {
- return this.topology_id;
- }
-
- public void set_topology_id(String topology_id) {
- this.topology_id = topology_id;
- }
-
- public void unset_topology_id() {
- this.topology_id = null;
- }
-
- /** Returns true if field topology_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_topology_id() {
- return this.topology_id != null;
- }
-
- public void set_topology_id_isSet(boolean value) {
- if (!value) {
- this.topology_id = null;
- }
- }
-
- public long get_time_stamp() {
- return this.time_stamp;
- }
-
- public void set_time_stamp(long time_stamp) {
- this.time_stamp = time_stamp;
- set_time_stamp_isSet(true);
- }
-
- public void unset_time_stamp() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIME_STAMP_ISSET_ID);
- }
-
- /** Returns true if field time_stamp is set (has been assigned a value) and false otherwise */
- public boolean is_set_time_stamp() {
- return EncodingUtils.testBit(__isset_bitfield, __TIME_STAMP_ISSET_ID);
- }
-
- public void set_time_stamp_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIME_STAMP_ISSET_ID, value);
- }
-
- public int get_users_size() {
- return (this.users == null) ? 0 : this.users.size();
- }
-
- public java.util.Iterator<String> get_users_iterator() {
- return (this.users == null) ? null : this.users.iterator();
- }
-
- public void add_to_users(String elem) {
- if (this.users == null) {
- this.users = new ArrayList<String>();
- }
- this.users.add(elem);
- }
-
- public List<String> get_users() {
- return this.users;
- }
-
- public void set_users(List<String> users) {
- this.users = users;
- }
-
- public void unset_users() {
- this.users = null;
- }
-
- /** Returns true if field users is set (has been assigned a value) and false otherwise */
- public boolean is_set_users() {
- return this.users != null;
- }
-
- public void set_users_isSet(boolean value) {
- if (!value) {
- this.users = null;
- }
- }
-
- public int get_groups_size() {
- return (this.groups == null) ? 0 : this.groups.size();
- }
-
- public java.util.Iterator<String> get_groups_iterator() {
- return (this.groups == null) ? null : this.groups.iterator();
- }
-
- public void add_to_groups(String elem) {
- if (this.groups == null) {
- this.groups = new ArrayList<String>();
- }
- this.groups.add(elem);
- }
-
- public List<String> get_groups() {
- return this.groups;
- }
-
- public void set_groups(List<String> groups) {
- this.groups = groups;
- }
-
- public void unset_groups() {
- this.groups = null;
- }
-
- /** Returns true if field groups is set (has been assigned a value) and false otherwise */
- public boolean is_set_groups() {
- return this.groups != null;
- }
-
- public void set_groups_isSet(boolean value) {
- if (!value) {
- this.groups = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TOPOLOGY_ID:
- if (value == null) {
- unset_topology_id();
- } else {
- set_topology_id((String)value);
- }
- break;
-
- case TIME_STAMP:
- if (value == null) {
- unset_time_stamp();
- } else {
- set_time_stamp((Long)value);
- }
- break;
-
- case USERS:
- if (value == null) {
- unset_users();
- } else {
- set_users((List<String>)value);
- }
- break;
-
- case GROUPS:
- if (value == null) {
- unset_groups();
- } else {
- set_groups((List<String>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TOPOLOGY_ID:
- return get_topology_id();
-
- case TIME_STAMP:
- return get_time_stamp();
-
- case USERS:
- return get_users();
-
- case GROUPS:
- return get_groups();
-
- }
- 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 TOPOLOGY_ID:
- return is_set_topology_id();
- case TIME_STAMP:
- return is_set_time_stamp();
- case USERS:
- return is_set_users();
- case GROUPS:
- return is_set_groups();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof LSTopoHistory)
- return this.equals((LSTopoHistory)that);
- return false;
- }
-
- public boolean equals(LSTopoHistory that) {
- if (that == null)
- return false;
-
- boolean this_present_topology_id = true && this.is_set_topology_id();
- boolean that_present_topology_id = true && that.is_set_topology_id();
- if (this_present_topology_id || that_present_topology_id) {
- if (!(this_present_topology_id && that_present_topology_id))
- return false;
- if (!this.topology_id.equals(that.topology_id))
- return false;
- }
-
- boolean this_present_time_stamp = true;
- boolean that_present_time_stamp = true;
- if (this_present_time_stamp || that_present_time_stamp) {
- if (!(this_present_time_stamp && that_present_time_stamp))
- return false;
- if (this.time_stamp != that.time_stamp)
- return false;
- }
-
- boolean this_present_users = true && this.is_set_users();
- boolean that_present_users = true && that.is_set_users();
- if (this_present_users || that_present_users) {
- if (!(this_present_users && that_present_users))
- return false;
- if (!this.users.equals(that.users))
- return false;
- }
-
- boolean this_present_groups = true && this.is_set_groups();
- boolean that_present_groups = true && that.is_set_groups();
- if (this_present_groups || that_present_groups) {
- if (!(this_present_groups && that_present_groups))
- return false;
- if (!this.groups.equals(that.groups))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_topology_id = true && (is_set_topology_id());
- list.add(present_topology_id);
- if (present_topology_id)
- list.add(topology_id);
-
- boolean present_time_stamp = true;
- list.add(present_time_stamp);
- if (present_time_stamp)
- list.add(time_stamp);
-
- boolean present_users = true && (is_set_users());
- list.add(present_users);
- if (present_users)
- list.add(users);
-
- boolean present_groups = true && (is_set_groups());
- list.add(present_groups);
- if (present_groups)
- list.add(groups);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(LSTopoHistory other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_topology_id()).compareTo(other.is_set_topology_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topology_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology_id, other.topology_id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_time_stamp()).compareTo(other.is_set_time_stamp());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_time_stamp()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.time_stamp, other.time_stamp);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_users()).compareTo(other.is_set_users());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_users()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.users, other.users);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_groups()).compareTo(other.is_set_groups());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_groups()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groups, other.groups);
- 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("LSTopoHistory(");
- boolean first = true;
-
- sb.append("topology_id:");
- if (this.topology_id == null) {
- sb.append("null");
- } else {
- sb.append(this.topology_id);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("time_stamp:");
- sb.append(this.time_stamp);
- first = false;
- if (!first) sb.append(", ");
- sb.append("users:");
- if (this.users == null) {
- sb.append("null");
- } else {
- sb.append(this.users);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("groups:");
- if (this.groups == null) {
- sb.append("null");
- } else {
- sb.append(this.groups);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_topology_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'topology_id' is unset! Struct:" + toString());
- }
-
- if (!is_set_time_stamp()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'time_stamp' is unset! Struct:" + toString());
- }
-
- if (!is_set_users()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'users' is unset! Struct:" + toString());
- }
-
- if (!is_set_groups()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'groups' 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 LSTopoHistoryStandardSchemeFactory implements SchemeFactory {
- public LSTopoHistoryStandardScheme getScheme() {
- return new LSTopoHistoryStandardScheme();
- }
- }
-
- private static class LSTopoHistoryStandardScheme extends StandardScheme<LSTopoHistory> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, LSTopoHistory 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: // TOPOLOGY_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.topology_id = iprot.readString();
- struct.set_topology_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // TIME_STAMP
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.time_stamp = iprot.readI64();
- struct.set_time_stamp_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // USERS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list750 = iprot.readListBegin();
- struct.users = new ArrayList<String>(_list750.size);
- String _elem751;
- for (int _i752 = 0; _i752 < _list750.size; ++_i752)
- {
- _elem751 = iprot.readString();
- struct.users.add(_elem751);
- }
- iprot.readListEnd();
- }
- struct.set_users_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // GROUPS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list753 = iprot.readListBegin();
- struct.groups = new ArrayList<String>(_list753.size);
- String _elem754;
- for (int _i755 = 0; _i755 < _list753.size; ++_i755)
- {
- _elem754 = iprot.readString();
- struct.groups.add(_elem754);
- }
- iprot.readListEnd();
- }
- struct.set_groups_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, LSTopoHistory struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.topology_id != null) {
- oprot.writeFieldBegin(TOPOLOGY_ID_FIELD_DESC);
- oprot.writeString(struct.topology_id);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(TIME_STAMP_FIELD_DESC);
- oprot.writeI64(struct.time_stamp);
- oprot.writeFieldEnd();
- if (struct.users != null) {
- oprot.writeFieldBegin(USERS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.users.size()));
- for (String _iter756 : struct.users)
- {
- oprot.writeString(_iter756);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.groups != null) {
- oprot.writeFieldBegin(GROUPS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.groups.size()));
- for (String _iter757 : struct.groups)
- {
- oprot.writeString(_iter757);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class LSTopoHistoryTupleSchemeFactory implements SchemeFactory {
- public LSTopoHistoryTupleScheme getScheme() {
- return new LSTopoHistoryTupleScheme();
- }
- }
-
- private static class LSTopoHistoryTupleScheme extends TupleScheme<LSTopoHistory> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, LSTopoHistory struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.topology_id);
- oprot.writeI64(struct.time_stamp);
- {
- oprot.writeI32(struct.users.size());
- for (String _iter758 : struct.users)
- {
- oprot.writeString(_iter758);
- }
- }
- {
- oprot.writeI32(struct.groups.size());
- for (String _iter759 : struct.groups)
- {
- oprot.writeString(_iter759);
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, LSTopoHistory struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.topology_id = iprot.readString();
- struct.set_topology_id_isSet(true);
- struct.time_stamp = iprot.readI64();
- struct.set_time_stamp_isSet(true);
- {
- org.apache.thrift.protocol.TList _list760 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.users = new ArrayList<String>(_list760.size);
- String _elem761;
- for (int _i762 = 0; _i762 < _list760.size; ++_i762)
- {
- _elem761 = iprot.readString();
- struct.users.add(_elem761);
- }
- }
- struct.set_users_isSet(true);
- {
- org.apache.thrift.protocol.TList _list763 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.groups = new ArrayList<String>(_list763.size);
- String _elem764;
- for (int _i765 = 0; _i765 < _list763.size; ++_i765)
- {
- _elem764 = iprot.readString();
- struct.groups.add(_elem764);
- }
- }
- struct.set_groups_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LSTopoHistoryList.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/LSTopoHistoryList.java b/storm-core/src/jvm/backtype/storm/generated/LSTopoHistoryList.java
deleted file mode 100644
index 4b9b150..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/LSTopoHistoryList.java
+++ /dev/null
@@ -1,460 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class LSTopoHistoryList implements org.apache.thrift.TBase<LSTopoHistoryList, LSTopoHistoryList._Fields>, java.io.Serializable, Cloneable, Comparable<LSTopoHistoryList> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LSTopoHistoryList");
-
- private static final org.apache.thrift.protocol.TField TOPO_HISTORY_FIELD_DESC = new org.apache.thrift.protocol.TField("topo_history", org.apache.thrift.protocol.TType.LIST, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new LSTopoHistoryListStandardSchemeFactory());
- schemes.put(TupleScheme.class, new LSTopoHistoryListTupleSchemeFactory());
- }
-
- private List<LSTopoHistory> topo_history; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- TOPO_HISTORY((short)1, "topo_history");
-
- 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: // TOPO_HISTORY
- return TOPO_HISTORY;
- 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.TOPO_HISTORY, new org.apache.thrift.meta_data.FieldMetaData("topo_history", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LSTopoHistory.class))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LSTopoHistoryList.class, metaDataMap);
- }
-
- public LSTopoHistoryList() {
- }
-
- public LSTopoHistoryList(
- List<LSTopoHistory> topo_history)
- {
- this();
- this.topo_history = topo_history;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public LSTopoHistoryList(LSTopoHistoryList other) {
- if (other.is_set_topo_history()) {
- List<LSTopoHistory> __this__topo_history = new ArrayList<LSTopoHistory>(other.topo_history.size());
- for (LSTopoHistory other_element : other.topo_history) {
- __this__topo_history.add(new LSTopoHistory(other_element));
- }
- this.topo_history = __this__topo_history;
- }
- }
-
- public LSTopoHistoryList deepCopy() {
- return new LSTopoHistoryList(this);
- }
-
- @Override
- public void clear() {
- this.topo_history = null;
- }
-
- public int get_topo_history_size() {
- return (this.topo_history == null) ? 0 : this.topo_history.size();
- }
-
- public java.util.Iterator<LSTopoHistory> get_topo_history_iterator() {
- return (this.topo_history == null) ? null : this.topo_history.iterator();
- }
-
- public void add_to_topo_history(LSTopoHistory elem) {
- if (this.topo_history == null) {
- this.topo_history = new ArrayList<LSTopoHistory>();
- }
- this.topo_history.add(elem);
- }
-
- public List<LSTopoHistory> get_topo_history() {
- return this.topo_history;
- }
-
- public void set_topo_history(List<LSTopoHistory> topo_history) {
- this.topo_history = topo_history;
- }
-
- public void unset_topo_history() {
- this.topo_history = null;
- }
-
- /** Returns true if field topo_history is set (has been assigned a value) and false otherwise */
- public boolean is_set_topo_history() {
- return this.topo_history != null;
- }
-
- public void set_topo_history_isSet(boolean value) {
- if (!value) {
- this.topo_history = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TOPO_HISTORY:
- if (value == null) {
- unset_topo_history();
- } else {
- set_topo_history((List<LSTopoHistory>)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TOPO_HISTORY:
- return get_topo_history();
-
- }
- 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 TOPO_HISTORY:
- return is_set_topo_history();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof LSTopoHistoryList)
- return this.equals((LSTopoHistoryList)that);
- return false;
- }
-
- public boolean equals(LSTopoHistoryList that) {
- if (that == null)
- return false;
-
- boolean this_present_topo_history = true && this.is_set_topo_history();
- boolean that_present_topo_history = true && that.is_set_topo_history();
- if (this_present_topo_history || that_present_topo_history) {
- if (!(this_present_topo_history && that_present_topo_history))
- return false;
- if (!this.topo_history.equals(that.topo_history))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_topo_history = true && (is_set_topo_history());
- list.add(present_topo_history);
- if (present_topo_history)
- list.add(topo_history);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(LSTopoHistoryList other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_topo_history()).compareTo(other.is_set_topo_history());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topo_history()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topo_history, other.topo_history);
- 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("LSTopoHistoryList(");
- boolean first = true;
-
- sb.append("topo_history:");
- if (this.topo_history == null) {
- sb.append("null");
- } else {
- sb.append(this.topo_history);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_topo_history()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'topo_history' 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 LSTopoHistoryListStandardSchemeFactory implements SchemeFactory {
- public LSTopoHistoryListStandardScheme getScheme() {
- return new LSTopoHistoryListStandardScheme();
- }
- }
-
- private static class LSTopoHistoryListStandardScheme extends StandardScheme<LSTopoHistoryList> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, LSTopoHistoryList 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: // TOPO_HISTORY
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list766 = iprot.readListBegin();
- struct.topo_history = new ArrayList<LSTopoHistory>(_list766.size);
- LSTopoHistory _elem767;
- for (int _i768 = 0; _i768 < _list766.size; ++_i768)
- {
- _elem767 = new LSTopoHistory();
- _elem767.read(iprot);
- struct.topo_history.add(_elem767);
- }
- iprot.readListEnd();
- }
- struct.set_topo_history_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, LSTopoHistoryList struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.topo_history != null) {
- oprot.writeFieldBegin(TOPO_HISTORY_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.topo_history.size()));
- for (LSTopoHistory _iter769 : struct.topo_history)
- {
- _iter769.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class LSTopoHistoryListTupleSchemeFactory implements SchemeFactory {
- public LSTopoHistoryListTupleScheme getScheme() {
- return new LSTopoHistoryListTupleScheme();
- }
- }
-
- private static class LSTopoHistoryListTupleScheme extends TupleScheme<LSTopoHistoryList> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, LSTopoHistoryList struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.topo_history.size());
- for (LSTopoHistory _iter770 : struct.topo_history)
- {
- _iter770.write(oprot);
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, LSTopoHistoryList struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TList _list771 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.topo_history = new ArrayList<LSTopoHistory>(_list771.size);
- LSTopoHistory _elem772;
- for (int _i773 = 0; _i773 < _list771.size; ++_i773)
- {
- _elem772 = new LSTopoHistory();
- _elem772.read(iprot);
- struct.topo_history.add(_elem772);
- }
- }
- struct.set_topo_history_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/LSWorkerHeartbeat.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/LSWorkerHeartbeat.java b/storm-core/src/jvm/backtype/storm/generated/LSWorkerHeartbeat.java
deleted file mode 100644
index 1c42bde..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/LSWorkerHeartbeat.java
+++ /dev/null
@@ -1,755 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class LSWorkerHeartbeat implements org.apache.thrift.TBase<LSWorkerHeartbeat, LSWorkerHeartbeat._Fields>, java.io.Serializable, Cloneable, Comparable<LSWorkerHeartbeat> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LSWorkerHeartbeat");
-
- private static final org.apache.thrift.protocol.TField TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("time_secs", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField TOPOLOGY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("topology_id", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("executors", org.apache.thrift.protocol.TType.LIST, (short)3);
- private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)4);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new LSWorkerHeartbeatStandardSchemeFactory());
- schemes.put(TupleScheme.class, new LSWorkerHeartbeatTupleSchemeFactory());
- }
-
- private int time_secs; // required
- private String topology_id; // required
- private List<ExecutorInfo> executors; // required
- private int port; // 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 {
- TIME_SECS((short)1, "time_secs"),
- TOPOLOGY_ID((short)2, "topology_id"),
- EXECUTORS((short)3, "executors"),
- PORT((short)4, "port");
-
- 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: // TIME_SECS
- return TIME_SECS;
- case 2: // TOPOLOGY_ID
- return TOPOLOGY_ID;
- case 3: // EXECUTORS
- return EXECUTORS;
- case 4: // PORT
- return PORT;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _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 __TIME_SECS_ISSET_ID = 0;
- private static final int __PORT_ISSET_ID = 1;
- private byte __isset_bitfield = 0;
- 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.TIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("time_secs", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.TOPOLOGY_ID, new org.apache.thrift.meta_data.FieldMetaData("topology_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.EXECUTORS, new org.apache.thrift.meta_data.FieldMetaData("executors", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ExecutorInfo.class))));
- tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", 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(LSWorkerHeartbeat.class, metaDataMap);
- }
-
- public LSWorkerHeartbeat() {
- }
-
- public LSWorkerHeartbeat(
- int time_secs,
- String topology_id,
- List<ExecutorInfo> executors,
- int port)
- {
- this();
- this.time_secs = time_secs;
- set_time_secs_isSet(true);
- this.topology_id = topology_id;
- this.executors = executors;
- this.port = port;
- set_port_isSet(true);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public LSWorkerHeartbeat(LSWorkerHeartbeat other) {
- __isset_bitfield = other.__isset_bitfield;
- this.time_secs = other.time_secs;
- if (other.is_set_topology_id()) {
- this.topology_id = other.topology_id;
- }
- if (other.is_set_executors()) {
- List<ExecutorInfo> __this__executors = new ArrayList<ExecutorInfo>(other.executors.size());
- for (ExecutorInfo other_element : other.executors) {
- __this__executors.add(new ExecutorInfo(other_element));
- }
- this.executors = __this__executors;
- }
- this.port = other.port;
- }
-
- public LSWorkerHeartbeat deepCopy() {
- return new LSWorkerHeartbeat(this);
- }
-
- @Override
- public void clear() {
- set_time_secs_isSet(false);
- this.time_secs = 0;
- this.topology_id = null;
- this.executors = null;
- set_port_isSet(false);
- this.port = 0;
- }
-
- public int get_time_secs() {
- return this.time_secs;
- }
-
- public void set_time_secs(int time_secs) {
- this.time_secs = time_secs;
- set_time_secs_isSet(true);
- }
-
- public void unset_time_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field time_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_time_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __TIME_SECS_ISSET_ID);
- }
-
- public void set_time_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIME_SECS_ISSET_ID, value);
- }
-
- public String get_topology_id() {
- return this.topology_id;
- }
-
- public void set_topology_id(String topology_id) {
- this.topology_id = topology_id;
- }
-
- public void unset_topology_id() {
- this.topology_id = null;
- }
-
- /** Returns true if field topology_id is set (has been assigned a value) and false otherwise */
- public boolean is_set_topology_id() {
- return this.topology_id != null;
- }
-
- public void set_topology_id_isSet(boolean value) {
- if (!value) {
- this.topology_id = null;
- }
- }
-
- public int get_executors_size() {
- return (this.executors == null) ? 0 : this.executors.size();
- }
-
- public java.util.Iterator<ExecutorInfo> get_executors_iterator() {
- return (this.executors == null) ? null : this.executors.iterator();
- }
-
- public void add_to_executors(ExecutorInfo elem) {
- if (this.executors == null) {
- this.executors = new ArrayList<ExecutorInfo>();
- }
- this.executors.add(elem);
- }
-
- public List<ExecutorInfo> get_executors() {
- return this.executors;
- }
-
- public void set_executors(List<ExecutorInfo> executors) {
- this.executors = executors;
- }
-
- public void unset_executors() {
- this.executors = null;
- }
-
- /** Returns true if field executors is set (has been assigned a value) and false otherwise */
- public boolean is_set_executors() {
- return this.executors != null;
- }
-
- public void set_executors_isSet(boolean value) {
- if (!value) {
- this.executors = null;
- }
- }
-
- public int get_port() {
- return this.port;
- }
-
- public void set_port(int port) {
- this.port = port;
- set_port_isSet(true);
- }
-
- public void unset_port() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID);
- }
-
- /** Returns true if field port is set (has been assigned a value) and false otherwise */
- public boolean is_set_port() {
- return EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID);
- }
-
- public void set_port_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TIME_SECS:
- if (value == null) {
- unset_time_secs();
- } else {
- set_time_secs((Integer)value);
- }
- break;
-
- case TOPOLOGY_ID:
- if (value == null) {
- unset_topology_id();
- } else {
- set_topology_id((String)value);
- }
- break;
-
- case EXECUTORS:
- if (value == null) {
- unset_executors();
- } else {
- set_executors((List<ExecutorInfo>)value);
- }
- break;
-
- case PORT:
- if (value == null) {
- unset_port();
- } else {
- set_port((Integer)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TIME_SECS:
- return get_time_secs();
-
- case TOPOLOGY_ID:
- return get_topology_id();
-
- case EXECUTORS:
- return get_executors();
-
- case PORT:
- return get_port();
-
- }
- 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 TIME_SECS:
- return is_set_time_secs();
- case TOPOLOGY_ID:
- return is_set_topology_id();
- case EXECUTORS:
- return is_set_executors();
- case PORT:
- return is_set_port();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof LSWorkerHeartbeat)
- return this.equals((LSWorkerHeartbeat)that);
- return false;
- }
-
- public boolean equals(LSWorkerHeartbeat that) {
- if (that == null)
- return false;
-
- boolean this_present_time_secs = true;
- boolean that_present_time_secs = true;
- if (this_present_time_secs || that_present_time_secs) {
- if (!(this_present_time_secs && that_present_time_secs))
- return false;
- if (this.time_secs != that.time_secs)
- return false;
- }
-
- boolean this_present_topology_id = true && this.is_set_topology_id();
- boolean that_present_topology_id = true && that.is_set_topology_id();
- if (this_present_topology_id || that_present_topology_id) {
- if (!(this_present_topology_id && that_present_topology_id))
- return false;
- if (!this.topology_id.equals(that.topology_id))
- return false;
- }
-
- boolean this_present_executors = true && this.is_set_executors();
- boolean that_present_executors = true && that.is_set_executors();
- if (this_present_executors || that_present_executors) {
- if (!(this_present_executors && that_present_executors))
- return false;
- if (!this.executors.equals(that.executors))
- return false;
- }
-
- boolean this_present_port = true;
- boolean that_present_port = true;
- if (this_present_port || that_present_port) {
- if (!(this_present_port && that_present_port))
- return false;
- if (this.port != that.port)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_time_secs = true;
- list.add(present_time_secs);
- if (present_time_secs)
- list.add(time_secs);
-
- boolean present_topology_id = true && (is_set_topology_id());
- list.add(present_topology_id);
- if (present_topology_id)
- list.add(topology_id);
-
- boolean present_executors = true && (is_set_executors());
- list.add(present_executors);
- if (present_executors)
- list.add(executors);
-
- boolean present_port = true;
- list.add(present_port);
- if (present_port)
- list.add(port);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(LSWorkerHeartbeat other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_time_secs()).compareTo(other.is_set_time_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_time_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.time_secs, other.time_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_topology_id()).compareTo(other.is_set_topology_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_topology_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology_id, other.topology_id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_executors()).compareTo(other.is_set_executors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_executors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executors, other.executors);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_port()).compareTo(other.is_set_port());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_port()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port);
- 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("LSWorkerHeartbeat(");
- boolean first = true;
-
- sb.append("time_secs:");
- sb.append(this.time_secs);
- first = false;
- if (!first) sb.append(", ");
- sb.append("topology_id:");
- if (this.topology_id == null) {
- sb.append("null");
- } else {
- sb.append(this.topology_id);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("executors:");
- if (this.executors == null) {
- sb.append("null");
- } else {
- sb.append(this.executors);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("port:");
- sb.append(this.port);
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_time_secs()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'time_secs' is unset! Struct:" + toString());
- }
-
- if (!is_set_topology_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'topology_id' is unset! Struct:" + toString());
- }
-
- if (!is_set_executors()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'executors' is unset! Struct:" + toString());
- }
-
- if (!is_set_port()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'port' 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 LSWorkerHeartbeatStandardSchemeFactory implements SchemeFactory {
- public LSWorkerHeartbeatStandardScheme getScheme() {
- return new LSWorkerHeartbeatStandardScheme();
- }
- }
-
- private static class LSWorkerHeartbeatStandardScheme extends StandardScheme<LSWorkerHeartbeat> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, LSWorkerHeartbeat 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: // TIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.time_secs = iprot.readI32();
- struct.set_time_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // TOPOLOGY_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.topology_id = iprot.readString();
- struct.set_topology_id_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // EXECUTORS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list742 = iprot.readListBegin();
- struct.executors = new ArrayList<ExecutorInfo>(_list742.size);
- ExecutorInfo _elem743;
- for (int _i744 = 0; _i744 < _list742.size; ++_i744)
- {
- _elem743 = new ExecutorInfo();
- _elem743.read(iprot);
- struct.executors.add(_elem743);
- }
- iprot.readListEnd();
- }
- struct.set_executors_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // PORT
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.port = iprot.readI32();
- struct.set_port_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, LSWorkerHeartbeat struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldBegin(TIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.time_secs);
- oprot.writeFieldEnd();
- if (struct.topology_id != null) {
- oprot.writeFieldBegin(TOPOLOGY_ID_FIELD_DESC);
- oprot.writeString(struct.topology_id);
- oprot.writeFieldEnd();
- }
- if (struct.executors != null) {
- oprot.writeFieldBegin(EXECUTORS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.executors.size()));
- for (ExecutorInfo _iter745 : struct.executors)
- {
- _iter745.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(PORT_FIELD_DESC);
- oprot.writeI32(struct.port);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class LSWorkerHeartbeatTupleSchemeFactory implements SchemeFactory {
- public LSWorkerHeartbeatTupleScheme getScheme() {
- return new LSWorkerHeartbeatTupleScheme();
- }
- }
-
- private static class LSWorkerHeartbeatTupleScheme extends TupleScheme<LSWorkerHeartbeat> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, LSWorkerHeartbeat struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeI32(struct.time_secs);
- oprot.writeString(struct.topology_id);
- {
- oprot.writeI32(struct.executors.size());
- for (ExecutorInfo _iter746 : struct.executors)
- {
- _iter746.write(oprot);
- }
- }
- oprot.writeI32(struct.port);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, LSWorkerHeartbeat struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.time_secs = iprot.readI32();
- struct.set_time_secs_isSet(true);
- struct.topology_id = iprot.readString();
- struct.set_topology_id_isSet(true);
- {
- org.apache.thrift.protocol.TList _list747 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.executors = new ArrayList<ExecutorInfo>(_list747.size);
- ExecutorInfo _elem748;
- for (int _i749 = 0; _i749 < _list747.size; ++_i749)
- {
- _elem748 = new ExecutorInfo();
- _elem748.read(iprot);
- struct.executors.add(_elem748);
- }
- }
- struct.set_executors_isSet(true);
- struct.port = iprot.readI32();
- struct.set_port_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ListBlobsResult.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ListBlobsResult.java b/storm-core/src/jvm/backtype/storm/generated/ListBlobsResult.java
deleted file mode 100644
index 87337e1..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ListBlobsResult.java
+++ /dev/null
@@ -1,556 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ListBlobsResult implements org.apache.thrift.TBase<ListBlobsResult, ListBlobsResult._Fields>, java.io.Serializable, Cloneable, Comparable<ListBlobsResult> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ListBlobsResult");
-
- private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)1);
- private static final org.apache.thrift.protocol.TField SESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("session", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ListBlobsResultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ListBlobsResultTupleSchemeFactory());
- }
-
- private List<String> keys; // required
- private String session; // 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 {
- KEYS((short)1, "keys"),
- SESSION((short)2, "session");
-
- 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: // KEYS
- return KEYS;
- case 2: // SESSION
- return SESSION;
- 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.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- tmpMap.put(_Fields.SESSION, new org.apache.thrift.meta_data.FieldMetaData("session", 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(ListBlobsResult.class, metaDataMap);
- }
-
- public ListBlobsResult() {
- }
-
- public ListBlobsResult(
- List<String> keys,
- String session)
- {
- this();
- this.keys = keys;
- this.session = session;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ListBlobsResult(ListBlobsResult other) {
- if (other.is_set_keys()) {
- List<String> __this__keys = new ArrayList<String>(other.keys);
- this.keys = __this__keys;
- }
- if (other.is_set_session()) {
- this.session = other.session;
- }
- }
-
- public ListBlobsResult deepCopy() {
- return new ListBlobsResult(this);
- }
-
- @Override
- public void clear() {
- this.keys = null;
- this.session = null;
- }
-
- public int get_keys_size() {
- return (this.keys == null) ? 0 : this.keys.size();
- }
-
- public java.util.Iterator<String> get_keys_iterator() {
- return (this.keys == null) ? null : this.keys.iterator();
- }
-
- public void add_to_keys(String elem) {
- if (this.keys == null) {
- this.keys = new ArrayList<String>();
- }
- this.keys.add(elem);
- }
-
- public List<String> get_keys() {
- return this.keys;
- }
-
- public void set_keys(List<String> keys) {
- this.keys = keys;
- }
-
- public void unset_keys() {
- this.keys = null;
- }
-
- /** Returns true if field keys is set (has been assigned a value) and false otherwise */
- public boolean is_set_keys() {
- return this.keys != null;
- }
-
- public void set_keys_isSet(boolean value) {
- if (!value) {
- this.keys = null;
- }
- }
-
- public String get_session() {
- return this.session;
- }
-
- public void set_session(String session) {
- this.session = session;
- }
-
- public void unset_session() {
- this.session = null;
- }
-
- /** Returns true if field session is set (has been assigned a value) and false otherwise */
- public boolean is_set_session() {
- return this.session != null;
- }
-
- public void set_session_isSet(boolean value) {
- if (!value) {
- this.session = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case KEYS:
- if (value == null) {
- unset_keys();
- } else {
- set_keys((List<String>)value);
- }
- break;
-
- case SESSION:
- if (value == null) {
- unset_session();
- } else {
- set_session((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case KEYS:
- return get_keys();
-
- case SESSION:
- return get_session();
-
- }
- 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 KEYS:
- return is_set_keys();
- case SESSION:
- return is_set_session();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ListBlobsResult)
- return this.equals((ListBlobsResult)that);
- return false;
- }
-
- public boolean equals(ListBlobsResult that) {
- if (that == null)
- return false;
-
- boolean this_present_keys = true && this.is_set_keys();
- boolean that_present_keys = true && that.is_set_keys();
- if (this_present_keys || that_present_keys) {
- if (!(this_present_keys && that_present_keys))
- return false;
- if (!this.keys.equals(that.keys))
- return false;
- }
-
- boolean this_present_session = true && this.is_set_session();
- boolean that_present_session = true && that.is_set_session();
- if (this_present_session || that_present_session) {
- if (!(this_present_session && that_present_session))
- return false;
- if (!this.session.equals(that.session))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_keys = true && (is_set_keys());
- list.add(present_keys);
- if (present_keys)
- list.add(keys);
-
- boolean present_session = true && (is_set_session());
- list.add(present_session);
- if (present_session)
- list.add(session);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ListBlobsResult other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_keys()).compareTo(other.is_set_keys());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_keys()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_session()).compareTo(other.is_set_session());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_session()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.session, other.session);
- 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("ListBlobsResult(");
- boolean first = true;
-
- sb.append("keys:");
- if (this.keys == null) {
- sb.append("null");
- } else {
- sb.append(this.keys);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("session:");
- if (this.session == null) {
- sb.append("null");
- } else {
- sb.append(this.session);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_keys()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys' is unset! Struct:" + toString());
- }
-
- if (!is_set_session()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'session' 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 ListBlobsResultStandardSchemeFactory implements SchemeFactory {
- public ListBlobsResultStandardScheme getScheme() {
- return new ListBlobsResultStandardScheme();
- }
- }
-
- private static class ListBlobsResultStandardScheme extends StandardScheme<ListBlobsResult> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ListBlobsResult 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: // KEYS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list566 = iprot.readListBegin();
- struct.keys = new ArrayList<String>(_list566.size);
- String _elem567;
- for (int _i568 = 0; _i568 < _list566.size; ++_i568)
- {
- _elem567 = iprot.readString();
- struct.keys.add(_elem567);
- }
- iprot.readListEnd();
- }
- struct.set_keys_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // SESSION
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.session = iprot.readString();
- struct.set_session_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, ListBlobsResult struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.keys != null) {
- oprot.writeFieldBegin(KEYS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size()));
- for (String _iter569 : struct.keys)
- {
- oprot.writeString(_iter569);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.session != null) {
- oprot.writeFieldBegin(SESSION_FIELD_DESC);
- oprot.writeString(struct.session);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ListBlobsResultTupleSchemeFactory implements SchemeFactory {
- public ListBlobsResultTupleScheme getScheme() {
- return new ListBlobsResultTupleScheme();
- }
- }
-
- private static class ListBlobsResultTupleScheme extends TupleScheme<ListBlobsResult> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ListBlobsResult struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- {
- oprot.writeI32(struct.keys.size());
- for (String _iter570 : struct.keys)
- {
- oprot.writeString(_iter570);
- }
- }
- oprot.writeString(struct.session);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ListBlobsResult struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- {
- org.apache.thrift.protocol.TList _list571 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.keys = new ArrayList<String>(_list571.size);
- String _elem572;
- for (int _i573 = 0; _i573 < _list571.size; ++_i573)
- {
- _elem572 = iprot.readString();
- struct.keys.add(_elem572);
- }
- }
- struct.set_keys_isSet(true);
- struct.session = iprot.readString();
- struct.set_session_isSet(true);
- }
- }
-
-}
-
[48/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/executor.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/executor.clj b/storm-core/src/clj/backtype/storm/daemon/executor.clj
deleted file mode 100644
index 2436048..0000000
--- a/storm-core/src/clj/backtype/storm/daemon/executor.clj
+++ /dev/null
@@ -1,864 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.daemon.executor
- (:use [org.apache.storm.daemon common])
- (:import [org.apache.storm.generated Grouping]
- [java.io Serializable])
- (:use [org.apache.storm util config log timer stats])
- (:import [java.util List Random HashMap ArrayList LinkedList Map])
- (:import [org.apache.storm ICredentialsListener])
- (:import [org.apache.storm.hooks ITaskHook])
- (:import [org.apache.storm.tuple AddressedTuple Tuple Fields TupleImpl MessageId])
- (:import [org.apache.storm.spout ISpoutWaitStrategy ISpout SpoutOutputCollector ISpoutOutputCollector])
- (:import [org.apache.storm.hooks.info SpoutAckInfo SpoutFailInfo
- EmitInfo BoltFailInfo BoltAckInfo BoltExecuteInfo])
- (:import [org.apache.storm.grouping CustomStreamGrouping])
- (:import [org.apache.storm.task WorkerTopologyContext IBolt OutputCollector IOutputCollector])
- (:import [org.apache.storm.generated GlobalStreamId])
- (:import [org.apache.storm.utils Utils TupleUtils MutableObject RotatingMap RotatingMap$ExpiredCallback MutableLong Time DisruptorQueue WorkerBackpressureThread])
- (:import [com.lmax.disruptor InsufficientCapacityException])
- (:import [org.apache.storm.serialization KryoTupleSerializer])
- (:import [org.apache.storm.daemon Shutdownable])
- (:import [org.apache.storm.metric.api IMetric IMetricsConsumer$TaskInfo IMetricsConsumer$DataPoint StateMetric])
- (:import [org.apache.storm Config Constants])
- (:import [org.apache.storm.cluster ClusterStateContext DaemonType])
- (:import [org.apache.storm.grouping LoadAwareCustomStreamGrouping LoadAwareShuffleGrouping LoadMapping ShuffleGrouping])
- (:import [java.util.concurrent ConcurrentLinkedQueue])
- (:require [org.apache.storm [thrift :as thrift]
- [cluster :as cluster] [disruptor :as disruptor] [stats :as stats]])
- (:require [org.apache.storm.daemon [task :as task]])
- (:require [org.apache.storm.daemon.builtin-metrics :as builtin-metrics])
- (:require [clojure.set :as set]))
-
-(defn- mk-fields-grouper
- [^Fields out-fields ^Fields group-fields ^List target-tasks]
- (let [num-tasks (count target-tasks)
- task-getter (fn [i] (.get target-tasks i))]
- (fn [task-id ^List values load]
- (-> (.select out-fields group-fields values)
- (TupleUtils/listHashCode)
- (mod num-tasks)
- task-getter))))
-
-(defn- mk-custom-grouper
- [^CustomStreamGrouping grouping ^WorkerTopologyContext context ^String component-id ^String stream-id target-tasks]
- (.prepare grouping context (GlobalStreamId. component-id stream-id) target-tasks)
- (if (instance? LoadAwareCustomStreamGrouping grouping)
- (fn [task-id ^List values load]
- (.chooseTasks ^LoadAwareCustomStreamGrouping grouping task-id values load))
- (fn [task-id ^List values load]
- (.chooseTasks grouping task-id values))))
-
-(defn mk-shuffle-grouper
- [^List target-tasks topo-conf ^WorkerTopologyContext context ^String component-id ^String stream-id]
- (if (.get topo-conf TOPOLOGY-DISABLE-LOADAWARE-MESSAGING)
- (mk-custom-grouper (ShuffleGrouping.) context component-id stream-id target-tasks)
- (mk-custom-grouper (LoadAwareShuffleGrouping.) context component-id stream-id target-tasks)))
-
-(defn- mk-grouper
- "Returns a function that returns a vector of which task indices to send tuple to, or just a single task index."
- [^WorkerTopologyContext context component-id stream-id ^Fields out-fields thrift-grouping ^List target-tasks topo-conf]
- (let [num-tasks (count target-tasks)
- random (Random.)
- target-tasks (vec (sort target-tasks))]
- (condp = (thrift/grouping-type thrift-grouping)
- :fields
- (if (thrift/global-grouping? thrift-grouping)
- (fn [task-id tuple load]
- ;; It's possible for target to have multiple tasks if it reads multiple sources
- (first target-tasks))
- (let [group-fields (Fields. (thrift/field-grouping thrift-grouping))]
- (mk-fields-grouper out-fields group-fields target-tasks)
- ))
- :all
- (fn [task-id tuple load] target-tasks)
- :shuffle
- (mk-shuffle-grouper target-tasks topo-conf context component-id stream-id)
- :local-or-shuffle
- (let [same-tasks (set/intersection
- (set target-tasks)
- (set (.getThisWorkerTasks context)))]
- (if-not (empty? same-tasks)
- (mk-shuffle-grouper (vec same-tasks) topo-conf context component-id stream-id)
- (mk-shuffle-grouper target-tasks topo-conf context component-id stream-id)))
- :none
- (fn [task-id tuple load]
- (let [i (mod (.nextInt random) num-tasks)]
- (get target-tasks i)
- ))
- :custom-object
- (let [grouping (thrift/instantiate-java-object (.get_custom_object thrift-grouping))]
- (mk-custom-grouper grouping context component-id stream-id target-tasks))
- :custom-serialized
- (let [grouping (Utils/javaDeserialize (.get_custom_serialized thrift-grouping) Serializable)]
- (mk-custom-grouper grouping context component-id stream-id target-tasks))
- :direct
- :direct
- )))
-
-(defn- outbound-groupings
- [^WorkerTopologyContext worker-context this-component-id stream-id out-fields component->grouping topo-conf]
- (->> component->grouping
- (filter-key #(-> worker-context
- (.getComponentTasks %)
- count
- pos?))
- (map (fn [[component tgrouping]]
- [component
- (mk-grouper worker-context
- this-component-id
- stream-id
- out-fields
- tgrouping
- (.getComponentTasks worker-context component)
- topo-conf)]))
- (into {})
- (HashMap.)))
-
-(defn outbound-components
- "Returns map of stream id to component id to grouper"
- [^WorkerTopologyContext worker-context component-id topo-conf]
- (->> (.getTargets worker-context component-id)
- clojurify-structure
- (map (fn [[stream-id component->grouping]]
- [stream-id
- (outbound-groupings
- worker-context
- component-id
- stream-id
- (.getComponentOutputFields worker-context component-id stream-id)
- component->grouping
- topo-conf)]))
- (into {})
- (HashMap.)))
-
-(defn executor-type [^WorkerTopologyContext context component-id]
- (let [topology (.getRawTopology context)
- spouts (.get_spouts topology)
- bolts (.get_bolts topology)]
- (cond (contains? spouts component-id) :spout
- (contains? bolts component-id) :bolt
- :else (throw-runtime "Could not find " component-id " in topology " topology))))
-
-(defn executor-selector [executor-data & _] (:type executor-data))
-
-(defmulti mk-threads executor-selector)
-(defmulti mk-executor-stats executor-selector)
-(defmulti close-component executor-selector)
-
-(defn- normalized-component-conf [storm-conf general-context component-id]
- (let [to-remove (disj (set ALL-CONFIGS)
- TOPOLOGY-DEBUG
- TOPOLOGY-MAX-SPOUT-PENDING
- TOPOLOGY-MAX-TASK-PARALLELISM
- TOPOLOGY-TRANSACTIONAL-ID
- TOPOLOGY-TICK-TUPLE-FREQ-SECS
- TOPOLOGY-SLEEP-SPOUT-WAIT-STRATEGY-TIME-MS
- TOPOLOGY-SPOUT-WAIT-STRATEGY
- TOPOLOGY-BOLTS-WINDOW-LENGTH-COUNT
- TOPOLOGY-BOLTS-WINDOW-LENGTH-DURATION-MS
- TOPOLOGY-BOLTS-SLIDING-INTERVAL-COUNT
- TOPOLOGY-BOLTS-SLIDING-INTERVAL-DURATION-MS
- TOPOLOGY-BOLTS-TUPLE-TIMESTAMP-FIELD-NAME
- TOPOLOGY-BOLTS-LATE-TUPLE-STREAM
- TOPOLOGY-BOLTS-TUPLE-TIMESTAMP-MAX-LAG-MS
- TOPOLOGY-BOLTS-MESSAGE-ID-FIELD-NAME
- TOPOLOGY-STATE-PROVIDER
- TOPOLOGY-STATE-PROVIDER-CONFIG
- )
- spec-conf (-> general-context
- (.getComponentCommon component-id)
- .get_json_conf
- from-json)]
- (merge storm-conf (apply dissoc spec-conf to-remove))
- ))
-
-(defprotocol RunningExecutor
- (render-stats [this])
- (get-executor-id [this])
- (credentials-changed [this creds])
- (get-backpressure-flag [this]))
-
-(defn throttled-report-error-fn [executor]
- (let [storm-conf (:storm-conf executor)
- error-interval-secs (storm-conf TOPOLOGY-ERROR-THROTTLE-INTERVAL-SECS)
- max-per-interval (storm-conf TOPOLOGY-MAX-ERROR-REPORT-PER-INTERVAL)
- interval-start-time (atom (current-time-secs))
- interval-errors (atom 0)
- ]
- (fn [error]
- (log-error error)
- (when (> (time-delta @interval-start-time)
- error-interval-secs)
- (reset! interval-errors 0)
- (reset! interval-start-time (current-time-secs)))
- (swap! interval-errors inc)
-
- (when (<= @interval-errors max-per-interval)
- (cluster/report-error (:storm-cluster-state executor) (:storm-id executor) (:component-id executor)
- (hostname storm-conf)
- (.getThisWorkerPort (:worker-context executor)) error)
- ))))
-
-;; in its own function so that it can be mocked out by tracked topologies
-(defn mk-executor-transfer-fn [batch-transfer->worker storm-conf]
- (let [debug? (= true (storm-conf TOPOLOGY-DEBUG))]
- (fn this
- [task tuple]
- (let [val (AddressedTuple. task tuple)]
- (when debug? (log-message "TRANSFERING tuple " val))
- (disruptor/publish batch-transfer->worker val)))))
-
-(defn mk-executor-data [worker executor-id]
- (let [worker-context (worker-context worker)
- task-ids (executor-id->tasks executor-id)
- component-id (.getComponentId worker-context (first task-ids))
- storm-conf (normalized-component-conf (:storm-conf worker) worker-context component-id)
- executor-type (executor-type worker-context component-id)
- batch-transfer->worker (disruptor/disruptor-queue
- (str "executor" executor-id "-send-queue")
- (storm-conf TOPOLOGY-EXECUTOR-SEND-BUFFER-SIZE)
- (storm-conf TOPOLOGY-DISRUPTOR-WAIT-TIMEOUT-MILLIS)
- :producer-type :single-threaded
- :batch-size (storm-conf TOPOLOGY-DISRUPTOR-BATCH-SIZE)
- :batch-timeout (storm-conf TOPOLOGY-DISRUPTOR-BATCH-TIMEOUT-MILLIS))
- ]
- (recursive-map
- :worker worker
- :worker-context worker-context
- :executor-id executor-id
- :task-ids task-ids
- :component-id component-id
- :open-or-prepare-was-called? (atom false)
- :storm-conf storm-conf
- :receive-queue ((:executor-receive-queue-map worker) executor-id)
- :storm-id (:storm-id worker)
- :conf (:conf worker)
- :shared-executor-data (HashMap.)
- :storm-active-atom (:storm-active-atom worker)
- :storm-component->debug-atom (:storm-component->debug-atom worker)
- :batch-transfer-queue batch-transfer->worker
- :transfer-fn (mk-executor-transfer-fn batch-transfer->worker storm-conf)
- :suicide-fn (:suicide-fn worker)
- :storm-cluster-state (cluster/mk-storm-cluster-state (:cluster-state worker)
- :acls (Utils/getWorkerACL storm-conf)
- :context (ClusterStateContext. DaemonType/WORKER))
- :type executor-type
- ;; TODO: should refactor this to be part of the executor specific map (spout or bolt with :common field)
- :stats (mk-executor-stats <> (sampling-rate storm-conf))
- :interval->task->metric-registry (HashMap.)
- :task->component (:task->component worker)
- :stream->component->grouper (outbound-components worker-context component-id storm-conf)
- :report-error (throttled-report-error-fn <>)
- :report-error-and-die (fn [error]
- (try
- ((:report-error <>) error)
- (catch Exception e
- (log-message "Error while reporting error to cluster, proceeding with shutdown")))
- (if (or
- (exception-cause? InterruptedException error)
- (exception-cause? java.io.InterruptedIOException error))
- (log-message "Got interrupted excpetion shutting thread down...")
- ((:suicide-fn <>))))
- :sampler (mk-stats-sampler storm-conf)
- :spout-throttling-metrics (if (= executor-type :spout)
- (builtin-metrics/make-spout-throttling-data)
- nil)
- ;; TODO: add in the executor-specific stuff in a :specific... or make a spout-data, bolt-data function?
- )))
-
-(defn- mk-disruptor-backpressure-handler [executor-data]
- "make a handler for the executor's receive disruptor queue to
- check highWaterMark and lowWaterMark for backpressure"
- (disruptor/disruptor-backpressure-handler
- (fn []
- "When receive queue is above highWaterMark"
- (do (log-debug "executor " (:executor-id executor-data) " is congested, set backpressure flag true")
- (WorkerBackpressureThread/notifyBackpressureChecker (:backpressure-trigger (:worker executor-data)))))
- (fn []
- "When receive queue is below lowWaterMark"
- (do (log-debug "executor " (:executor-id executor-data) " is not-congested, set backpressure flag false")
- (WorkerBackpressureThread/notifyBackpressureChecker (:backpressure-trigger (:worker executor-data)))))))
-
-(defn start-batch-transfer->worker-handler! [worker executor-data]
- (let [worker-transfer-fn (:transfer-fn worker)
- cached-emit (MutableObject. (ArrayList.))
- storm-conf (:storm-conf executor-data)
- serializer (KryoTupleSerializer. storm-conf (:worker-context executor-data))
- ]
- (disruptor/consume-loop*
- (:batch-transfer-queue executor-data)
- (disruptor/handler [o seq-id batch-end?]
- (let [^ArrayList alist (.getObject cached-emit)]
- (.add alist o)
- (when batch-end?
- (worker-transfer-fn serializer alist)
- (.setObject cached-emit (ArrayList.)))))
- :kill-fn (:report-error-and-die executor-data))))
-
-(defn setup-metrics! [executor-data]
- (let [{:keys [storm-conf receive-queue worker-context interval->task->metric-registry]} executor-data
- distinct-time-bucket-intervals (keys interval->task->metric-registry)]
- (doseq [interval distinct-time-bucket-intervals]
- (schedule-recurring
- (:user-timer (:worker executor-data))
- interval
- interval
- (fn []
- (let [val [(AddressedTuple. AddressedTuple/BROADCAST_DEST (TupleImpl. worker-context [interval] Constants/SYSTEM_TASK_ID Constants/METRICS_TICK_STREAM_ID))]]
- (disruptor/publish receive-queue val)))))))
-
-(defn metrics-tick
- [executor-data task-data ^TupleImpl tuple]
- (let [{:keys [interval->task->metric-registry ^WorkerTopologyContext worker-context]} executor-data
- interval (.getInteger tuple 0)
- task-id (:task-id task-data)
- name->imetric (-> interval->task->metric-registry (get interval) (get task-id))
- task-info (IMetricsConsumer$TaskInfo.
- (hostname (:storm-conf executor-data))
- (.getThisWorkerPort worker-context)
- (:component-id executor-data)
- task-id
- (long (Time/currentTimeSecs))
- interval)
- data-points (->> name->imetric
- (map (fn [[name imetric]]
- (let [value (.getValueAndReset ^IMetric imetric)]
- (if value
- (IMetricsConsumer$DataPoint. name value)))))
- (filter identity)
- (into []))]
- (when (seq data-points)
- (task/send-unanchored task-data Constants/METRICS_STREAM_ID [task-info data-points]))))
-
-(defn setup-ticks! [worker executor-data]
- (let [storm-conf (:storm-conf executor-data)
- tick-time-secs (storm-conf TOPOLOGY-TICK-TUPLE-FREQ-SECS)
- receive-queue (:receive-queue executor-data)
- context (:worker-context executor-data)]
- (when tick-time-secs
- (if (or (Utils/isSystemId (:component-id executor-data))
- (and (= false (storm-conf TOPOLOGY-ENABLE-MESSAGE-TIMEOUTS))
- (= :spout (:type executor-data))))
- (log-message "Timeouts disabled for executor " (:component-id executor-data) ":" (:executor-id executor-data))
- (schedule-recurring
- (:user-timer worker)
- tick-time-secs
- tick-time-secs
- (fn []
- (let [val [(AddressedTuple. AddressedTuple/BROADCAST_DEST (TupleImpl. context [tick-time-secs] Constants/SYSTEM_TASK_ID Constants/SYSTEM_TICK_STREAM_ID))]]
- (disruptor/publish receive-queue val))))))))
-
-(defn mk-executor [worker executor-id initial-credentials]
- (let [executor-data (mk-executor-data worker executor-id)
- _ (log-message "Loading executor " (:component-id executor-data) ":" (pr-str executor-id))
- task-datas (->> executor-data
- :task-ids
- (map (fn [t] [t (task/mk-task executor-data t)]))
- (into {})
- (HashMap.))
- _ (log-message "Loaded executor tasks " (:component-id executor-data) ":" (pr-str executor-id))
- report-error-and-die (:report-error-and-die executor-data)
- component-id (:component-id executor-data)
-
-
- disruptor-handler (mk-disruptor-backpressure-handler executor-data)
- _ (.registerBackpressureCallback (:receive-queue executor-data) disruptor-handler)
- _ (-> (.setHighWaterMark (:receive-queue executor-data) ((:storm-conf executor-data) BACKPRESSURE-DISRUPTOR-HIGH-WATERMARK))
- (.setLowWaterMark ((:storm-conf executor-data) BACKPRESSURE-DISRUPTOR-LOW-WATERMARK))
- (.setEnableBackpressure ((:storm-conf executor-data) TOPOLOGY-BACKPRESSURE-ENABLE)))
-
- ;; starting the batch-transfer->worker ensures that anything publishing to that queue
- ;; doesn't block (because it's a single threaded queue and the caching/consumer started
- ;; trick isn't thread-safe)
- system-threads [(start-batch-transfer->worker-handler! worker executor-data)]
- handlers (with-error-reaction report-error-and-die
- (mk-threads executor-data task-datas initial-credentials))
- threads (concat handlers system-threads)]
- (setup-ticks! worker executor-data)
-
- (log-message "Finished loading executor " component-id ":" (pr-str executor-id))
- ;; TODO: add method here to get rendered stats... have worker call that when heartbeating
- (reify
- RunningExecutor
- (render-stats [this]
- (stats/render-stats! (:stats executor-data)))
- (get-executor-id [this]
- executor-id)
- (credentials-changed [this creds]
- (let [receive-queue (:receive-queue executor-data)
- context (:worker-context executor-data)
- val [(AddressedTuple. AddressedTuple/BROADCAST_DEST (TupleImpl. context [creds] Constants/SYSTEM_TASK_ID Constants/CREDENTIALS_CHANGED_STREAM_ID))]]
- (disruptor/publish receive-queue val)))
- (get-backpressure-flag [this]
- (.getThrottleOn (:receive-queue executor-data)))
- Shutdownable
- (shutdown
- [this]
- (log-message "Shutting down executor " component-id ":" (pr-str executor-id))
- (disruptor/halt-with-interrupt! (:receive-queue executor-data))
- (disruptor/halt-with-interrupt! (:batch-transfer-queue executor-data))
- (doseq [t threads]
- (.interrupt t)
- (.join t))
- (stats/cleanup-stats! (:stats executor-data))
- (doseq [user-context (map :user-context (vals task-datas))]
- (doseq [hook (.getHooks user-context)]
- (.cleanup hook)))
- (.disconnect (:storm-cluster-state executor-data))
- (when @(:open-or-prepare-was-called? executor-data)
- (doseq [obj (map :object (vals task-datas))]
- (close-component executor-data obj)))
- (log-message "Shut down executor " component-id ":" (pr-str executor-id)))
- )))
-
-(defn- fail-spout-msg [executor-data task-data msg-id tuple-info time-delta reason id debug?]
- (let [^ISpout spout (:object task-data)
- storm-conf (:storm-conf executor-data)
- task-id (:task-id task-data)]
- ;;TODO: need to throttle these when there's lots of failures
- (when debug?
- (log-message "SPOUT Failing " id ": " tuple-info " REASON: " reason " MSG-ID: " msg-id))
- (.fail spout msg-id)
- (task/apply-hooks (:user-context task-data) .spoutFail (SpoutFailInfo. msg-id task-id time-delta))
- (when time-delta
- (stats/spout-failed-tuple! (:stats executor-data) (:stream tuple-info) time-delta))))
-
-(defn- ack-spout-msg [executor-data task-data msg-id tuple-info time-delta id debug?]
- (let [^ISpout spout (:object task-data)
- task-id (:task-id task-data)]
- (when debug? (log-message "SPOUT Acking message " id " " msg-id))
- (.ack spout msg-id)
- (task/apply-hooks (:user-context task-data) .spoutAck (SpoutAckInfo. msg-id task-id time-delta))
- (when time-delta
- (stats/spout-acked-tuple! (:stats executor-data) (:stream tuple-info) time-delta))))
-
-(defn mk-task-receiver [executor-data tuple-action-fn]
- (let [task-ids (:task-ids executor-data)
- debug? (= true (-> executor-data :storm-conf (get TOPOLOGY-DEBUG)))
- ]
- (disruptor/clojure-handler
- (fn [tuple-batch sequence-id end-of-batch?]
- (fast-list-iter [^AddressedTuple addressed-tuple tuple-batch]
- (let [^TupleImpl tuple (.getTuple addressed-tuple)
- task-id (.getDest addressed-tuple)]
- (when debug? (log-message "Processing received message FOR " task-id " TUPLE: " tuple))
- (if (not= task-id AddressedTuple/BROADCAST_DEST)
- (tuple-action-fn task-id tuple)
- ;; null task ids are broadcast tuples
- (fast-list-iter [task-id task-ids]
- (tuple-action-fn task-id tuple)
- ))
- ))))))
-
-(defn executor-max-spout-pending [storm-conf num-tasks]
- (let [p (storm-conf TOPOLOGY-MAX-SPOUT-PENDING)]
- (if p (* p num-tasks))))
-
-(defn init-spout-wait-strategy [storm-conf]
- (let [ret (-> storm-conf (get TOPOLOGY-SPOUT-WAIT-STRATEGY) new-instance)]
- (.prepare ret storm-conf)
- ret
- ))
-
-;; Send sampled data to the eventlogger if the global or component level
-;; debug flag is set (via nimbus api).
-(defn send-to-eventlogger [executor-data task-data values component-id message-id random]
- (let [c->d @(:storm-component->debug-atom executor-data)
- options (get c->d component-id (get c->d (:storm-id executor-data)))
- spct (if (and (not-nil? options) (:enable options)) (:samplingpct options) 0)]
- ;; the thread's initialized random number generator is used to generate
- ;; uniformily distributed random numbers.
- (when (and (> spct 0) (< (* 100 (.nextDouble random)) spct))
- (task/send-unanchored
- task-data
- EVENTLOGGER-STREAM-ID
- [component-id message-id (System/currentTimeMillis) values]))))
-
-(defmethod mk-threads :spout [executor-data task-datas initial-credentials]
- (let [{:keys [storm-conf component-id worker-context transfer-fn report-error sampler open-or-prepare-was-called?]} executor-data
- ^ISpoutWaitStrategy spout-wait-strategy (init-spout-wait-strategy storm-conf)
- max-spout-pending (executor-max-spout-pending storm-conf (count task-datas))
- ^Integer max-spout-pending (if max-spout-pending (int max-spout-pending))
- last-active (atom false)
- spouts (ArrayList. (map :object (vals task-datas)))
- rand (Random. (Utils/secureRandomLong))
- ^DisruptorQueue transfer-queue (executor-data :batch-transfer-queue)
- debug? (= true (storm-conf TOPOLOGY-DEBUG))
- backpressure-enabled? (= true (storm-conf TOPOLOGY-BACKPRESSURE-ENABLE))
-
- pending (RotatingMap.
- 2 ;; microoptimize for performance of .size method
- (reify RotatingMap$ExpiredCallback
- (expire [this id [task-id spout-id tuple-info start-time-ms]]
- (let [time-delta (if start-time-ms (time-delta-ms start-time-ms))]
- (fail-spout-msg executor-data (get task-datas task-id) spout-id tuple-info time-delta "TIMEOUT" id debug?)
- ))))
- tuple-action-fn (fn [task-id ^TupleImpl tuple]
- (let [stream-id (.getSourceStreamId tuple)]
- (condp = stream-id
- Constants/SYSTEM_TICK_STREAM_ID (.rotate pending)
- Constants/METRICS_TICK_STREAM_ID (metrics-tick executor-data (get task-datas task-id) tuple)
- Constants/CREDENTIALS_CHANGED_STREAM_ID
- (let [task-data (get task-datas task-id)
- spout-obj (:object task-data)]
- (when (instance? ICredentialsListener spout-obj)
- (.setCredentials spout-obj (.getValue tuple 0))))
- ACKER-RESET-TIMEOUT-STREAM-ID
- (let [id (.getValue tuple 0)
- pending-for-id (.get pending id)]
- (when pending-for-id
- (.put pending id pending-for-id)))
- (let [id (.getValue tuple 0)
- time-delta-ms (.getValue tuple 1)
- [stored-task-id spout-id tuple-finished-info start-time-ms] (.remove pending id)]
- (when spout-id
- (when-not (= stored-task-id task-id)
- (throw-runtime "Fatal error, mismatched task ids: " task-id " " stored-task-id))
- (let [time-delta (if start-time-ms time-delta-ms)]
- (condp = stream-id
- ACKER-ACK-STREAM-ID (ack-spout-msg executor-data (get task-datas task-id)
- spout-id tuple-finished-info time-delta id debug?)
- ACKER-FAIL-STREAM-ID (fail-spout-msg executor-data (get task-datas task-id)
- spout-id tuple-finished-info time-delta "FAIL-STREAM" id debug?)
- )))
- ;; TODO: on failure, emit tuple to failure stream
- ))))
- receive-queue (:receive-queue executor-data)
- event-handler (mk-task-receiver executor-data tuple-action-fn)
- has-ackers? (has-ackers? storm-conf)
- has-eventloggers? (has-eventloggers? storm-conf)
- emitted-count (MutableLong. 0)
- empty-emit-streak (MutableLong. 0)]
-
- [(async-loop
- (fn []
- ;; If topology was started in inactive state, don't call (.open spout) until it's activated first.
- (while (not @(:storm-active-atom executor-data))
- (Thread/sleep 100))
-
- (log-message "Opening spout " component-id ":" (keys task-datas))
- (builtin-metrics/register-spout-throttling-metrics (:spout-throttling-metrics executor-data) storm-conf (:user-context (first (vals task-datas))))
- (doseq [[task-id task-data] task-datas
- :let [^ISpout spout-obj (:object task-data)
- tasks-fn (:tasks-fn task-data)
- send-spout-msg (fn [out-stream-id values message-id out-task-id]
- (.increment emitted-count)
- (let [out-tasks (if out-task-id
- (tasks-fn out-task-id out-stream-id values)
- (tasks-fn out-stream-id values))
- rooted? (and message-id has-ackers?)
- root-id (if rooted? (MessageId/generateId rand))
- ^List out-ids (fast-list-for [t out-tasks] (if rooted? (MessageId/generateId rand)))]
- (fast-list-iter [out-task out-tasks id out-ids]
- (let [tuple-id (if rooted?
- (MessageId/makeRootId root-id id)
- (MessageId/makeUnanchored))
- out-tuple (TupleImpl. worker-context
- values
- task-id
- out-stream-id
- tuple-id)]
- (transfer-fn out-task out-tuple)))
- (if has-eventloggers?
- (send-to-eventlogger executor-data task-data values component-id message-id rand))
- (if (and rooted?
- (not (.isEmpty out-ids)))
- (do
- (.put pending root-id [task-id
- message-id
- {:stream out-stream-id
- :values (if debug? values nil)}
- (if (sampler) (System/currentTimeMillis))])
- (task/send-unanchored task-data
- ACKER-INIT-STREAM-ID
- [root-id (Utils/bitXorVals out-ids) task-id]))
- (when message-id
- (ack-spout-msg executor-data task-data message-id
- {:stream out-stream-id :values values}
- (if (sampler) 0) "0:" debug?)))
- (or out-tasks [])
- ))]]
- (builtin-metrics/register-all (:builtin-metrics task-data) storm-conf (:user-context task-data))
- (builtin-metrics/register-queue-metrics {:sendqueue (:batch-transfer-queue executor-data)
- :receive receive-queue}
- storm-conf (:user-context task-data))
- (when (instance? ICredentialsListener spout-obj) (.setCredentials spout-obj initial-credentials))
-
- (.open spout-obj
- storm-conf
- (:user-context task-data)
- (SpoutOutputCollector.
- (reify ISpoutOutputCollector
- (^long getPendingCount[this]
- (.size pending)
- )
- (^List emit [this ^String stream-id ^List tuple ^Object message-id]
- (send-spout-msg stream-id tuple message-id nil)
- )
- (^void emitDirect [this ^int out-task-id ^String stream-id
- ^List tuple ^Object message-id]
- (send-spout-msg stream-id tuple message-id out-task-id)
- )
- (reportError [this error]
- (report-error error)
- )))))
- (reset! open-or-prepare-was-called? true)
- (log-message "Opened spout " component-id ":" (keys task-datas))
- (setup-metrics! executor-data)
-
- (fn []
- ;; This design requires that spouts be non-blocking
- (disruptor/consume-batch receive-queue event-handler)
-
- (let [active? @(:storm-active-atom executor-data)
- curr-count (.get emitted-count)
- throttle-on (and backpressure-enabled?
- @(:throttle-on (:worker executor-data)))
- reached-max-spout-pending (and max-spout-pending
- (>= (.size pending) max-spout-pending))
- ]
- (if active?
- ; activated
- (do
- (when-not @last-active
- (reset! last-active true)
- (log-message "Activating spout " component-id ":" (keys task-datas))
- (fast-list-iter [^ISpout spout spouts] (.activate spout)))
-
- (if (and (not (.isFull transfer-queue))
- (not throttle-on)
- (not reached-max-spout-pending))
- (fast-list-iter [^ISpout spout spouts] (.nextTuple spout))))
- ; deactivated
- (do
- (when @last-active
- (reset! last-active false)
- (log-message "Deactivating spout " component-id ":" (keys task-datas))
- (fast-list-iter [^ISpout spout spouts] (.deactivate spout)))
- ;; TODO: log that it's getting throttled
- (Time/sleep 100)
- (builtin-metrics/skipped-inactive! (:spout-throttling-metrics executor-data) (:stats executor-data))))
-
- (if (and (= curr-count (.get emitted-count)) active?)
- (do (.increment empty-emit-streak)
- (.emptyEmit spout-wait-strategy (.get empty-emit-streak))
- ;; update the spout throttling metrics
- (if throttle-on
- (builtin-metrics/skipped-throttle! (:spout-throttling-metrics executor-data) (:stats executor-data))
- (if reached-max-spout-pending
- (builtin-metrics/skipped-max-spout! (:spout-throttling-metrics executor-data) (:stats executor-data)))))
- (.set empty-emit-streak 0)
- ))
- 0))
- :kill-fn (:report-error-and-die executor-data)
- :factory? true
- :thread-name (str component-id "-executor" (:executor-id executor-data)))]))
-
-(defn- tuple-time-delta! [^TupleImpl tuple]
- (let [ms (.getProcessSampleStartTime tuple)]
- (if ms
- (time-delta-ms ms))))
-
-(defn- tuple-execute-time-delta! [^TupleImpl tuple]
- (let [ms (.getExecuteSampleStartTime tuple)]
- (if ms
- (time-delta-ms ms))))
-
-(defn put-xor! [^Map pending key id]
- (let [curr (or (.get pending key) (long 0))]
- (.put pending key (bit-xor curr id))))
-
-(defmethod mk-threads :bolt [executor-data task-datas initial-credentials]
- (let [{:keys [storm-conf component-id worker-context transfer-fn report-error sampler
- open-or-prepare-was-called?]} executor-data
- execute-sampler (mk-stats-sampler storm-conf)
- executor-stats (:stats executor-data)
- rand (Random. (Utils/secureRandomLong))
- debug? (= true (storm-conf TOPOLOGY-DEBUG))
-
- tuple-action-fn (fn [task-id ^TupleImpl tuple]
- ;; synchronization needs to be done with a key provided by this bolt, otherwise:
- ;; spout 1 sends synchronization (s1), dies, same spout restarts somewhere else, sends synchronization (s2) and incremental update. s2 and update finish before s1 -> lose the incremental update
- ;; TODO: for state sync, need to first send sync messages in a loop and receive tuples until synchronization
- ;; buffer other tuples until fully synchronized, then process all of those tuples
- ;; then go into normal loop
- ;; spill to disk?
- ;; could be receiving incremental updates while waiting for sync or even a partial sync because of another failed task
- ;; should remember sync requests and include a random sync id in the request. drop anything not related to active sync requests
- ;; or just timeout the sync messages that are coming in until full sync is hit from that task
- ;; need to drop incremental updates from tasks where waiting for sync. otherwise, buffer the incremental updates
- ;; TODO: for state sync, need to check if tuple comes from state spout. if so, update state
- ;; TODO: how to handle incremental updates as well as synchronizations at same time
- ;; TODO: need to version tuples somehow
-
- ;;(log-debug "Received tuple " tuple " at task " task-id)
- ;; need to do it this way to avoid reflection
- (let [stream-id (.getSourceStreamId tuple)]
- (condp = stream-id
- Constants/CREDENTIALS_CHANGED_STREAM_ID
- (let [task-data (get task-datas task-id)
- bolt-obj (:object task-data)]
- (when (instance? ICredentialsListener bolt-obj)
- (.setCredentials bolt-obj (.getValue tuple 0))))
- Constants/METRICS_TICK_STREAM_ID (metrics-tick executor-data (get task-datas task-id) tuple)
- (let [task-data (get task-datas task-id)
- ^IBolt bolt-obj (:object task-data)
- user-context (:user-context task-data)
- sampler? (sampler)
- execute-sampler? (execute-sampler)
- now (if (or sampler? execute-sampler?) (System/currentTimeMillis))]
- (when sampler?
- (.setProcessSampleStartTime tuple now))
- (when execute-sampler?
- (.setExecuteSampleStartTime tuple now))
- (.execute bolt-obj tuple)
- (let [delta (tuple-execute-time-delta! tuple)]
- (when debug?
- (log-message "Execute done TUPLE " tuple " TASK: " task-id " DELTA: " delta))
-
- (task/apply-hooks user-context .boltExecute (BoltExecuteInfo. tuple task-id delta))
- (when delta
- (stats/bolt-execute-tuple! executor-stats
- (.getSourceComponent tuple)
- (.getSourceStreamId tuple)
- delta)))))))
- has-eventloggers? (has-eventloggers? storm-conf)]
-
- ;; TODO: can get any SubscribedState objects out of the context now
-
- [(async-loop
- (fn []
- ;; If topology was started in inactive state, don't call prepare bolt until it's activated first.
- (while (not @(:storm-active-atom executor-data))
- (Thread/sleep 100))
-
- (log-message "Preparing bolt " component-id ":" (keys task-datas))
- (doseq [[task-id task-data] task-datas
- :let [^IBolt bolt-obj (:object task-data)
- tasks-fn (:tasks-fn task-data)
- user-context (:user-context task-data)
- bolt-emit (fn [stream anchors values task]
- (let [out-tasks (if task
- (tasks-fn task stream values)
- (tasks-fn stream values))]
- (fast-list-iter [t out-tasks]
- (let [anchors-to-ids (HashMap.)]
- (fast-list-iter [^TupleImpl a anchors]
- (let [root-ids (-> a .getMessageId .getAnchorsToIds .keySet)]
- (when (pos? (count root-ids))
- (let [edge-id (MessageId/generateId rand)]
- (.updateAckVal a edge-id)
- (fast-list-iter [root-id root-ids]
- (put-xor! anchors-to-ids root-id edge-id))
- ))))
- (let [tuple (TupleImpl. worker-context
- values
- task-id
- stream
- (MessageId/makeId anchors-to-ids))]
- (transfer-fn t tuple))))
- (if has-eventloggers?
- (send-to-eventlogger executor-data task-data values component-id nil rand))
- (or out-tasks [])))]]
- (builtin-metrics/register-all (:builtin-metrics task-data) storm-conf user-context)
- (when (instance? ICredentialsListener bolt-obj) (.setCredentials bolt-obj initial-credentials))
- (if (= component-id Constants/SYSTEM_COMPONENT_ID)
- (do
- (builtin-metrics/register-queue-metrics {:sendqueue (:batch-transfer-queue executor-data)
- :receive (:receive-queue executor-data)
- :transfer (:transfer-queue (:worker executor-data))}
- storm-conf user-context)
- (builtin-metrics/register-iconnection-client-metrics (:cached-node+port->socket (:worker executor-data)) storm-conf user-context)
- (builtin-metrics/register-iconnection-server-metric (:receiver (:worker executor-data)) storm-conf user-context))
- (builtin-metrics/register-queue-metrics {:sendqueue (:batch-transfer-queue executor-data)
- :receive (:receive-queue executor-data)}
- storm-conf user-context)
- )
-
- (.prepare bolt-obj
- storm-conf
- user-context
- (OutputCollector.
- (reify IOutputCollector
- (emit [this stream anchors values]
- (bolt-emit stream anchors values nil))
- (emitDirect [this task stream anchors values]
- (bolt-emit stream anchors values task))
- (^void ack [this ^Tuple tuple]
- (let [^TupleImpl tuple tuple
- ack-val (.getAckVal tuple)]
- (fast-map-iter [[root id] (.. tuple getMessageId getAnchorsToIds)]
- (task/send-unanchored task-data
- ACKER-ACK-STREAM-ID
- [root (bit-xor id ack-val)])))
- (let [delta (tuple-time-delta! tuple)]
- (when debug?
- (log-message "BOLT ack TASK: " task-id " TIME: " delta " TUPLE: " tuple))
- (task/apply-hooks user-context .boltAck (BoltAckInfo. tuple task-id delta))
- (when delta
- (stats/bolt-acked-tuple! executor-stats
- (.getSourceComponent tuple)
- (.getSourceStreamId tuple)
- delta))))
- (^void fail [this ^Tuple tuple]
- (fast-list-iter [root (.. tuple getMessageId getAnchors)]
- (task/send-unanchored task-data
- ACKER-FAIL-STREAM-ID
- [root]))
- (let [delta (tuple-time-delta! tuple)
- debug? (= true (storm-conf TOPOLOGY-DEBUG))]
- (when debug?
- (log-message "BOLT fail TASK: " task-id " TIME: " delta " TUPLE: " tuple))
- (task/apply-hooks user-context .boltFail (BoltFailInfo. tuple task-id delta))
- (when delta
- (stats/bolt-failed-tuple! executor-stats
- (.getSourceComponent tuple)
- (.getSourceStreamId tuple)
- delta))))
- (^void resetTimeout [this ^Tuple tuple]
- (fast-list-iter [root (.. tuple getMessageId getAnchors)]
- (task/send-unanchored task-data
- ACKER-RESET-TIMEOUT-STREAM-ID
- [root])))
- (reportError [this error]
- (report-error error)
- )))))
- (reset! open-or-prepare-was-called? true)
- (log-message "Prepared bolt " component-id ":" (keys task-datas))
- (setup-metrics! executor-data)
-
- (let [receive-queue (:receive-queue executor-data)
- event-handler (mk-task-receiver executor-data tuple-action-fn)]
- (fn []
- (disruptor/consume-batch-when-available receive-queue event-handler)
- 0)))
- :kill-fn (:report-error-and-die executor-data)
- :factory? true
- :thread-name (str component-id "-executor" (:executor-id executor-data)))]))
-
-(defmethod close-component :spout [executor-data spout]
- (.close spout))
-
-(defmethod close-component :bolt [executor-data bolt]
- (.cleanup bolt))
-
-;; TODO: refactor this to be part of an executor-specific map
-(defmethod mk-executor-stats :spout [_ rate]
- (stats/mk-spout-stats rate))
-
-(defmethod mk-executor-stats :bolt [_ rate]
- (stats/mk-bolt-stats rate))
[23/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/GlobalStreamId.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/GlobalStreamId.java b/storm-core/src/jvm/backtype/storm/generated/GlobalStreamId.java
deleted file mode 100644
index 677dfd8..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/GlobalStreamId.java
+++ /dev/null
@@ -1,507 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class GlobalStreamId implements org.apache.thrift.TBase<GlobalStreamId, GlobalStreamId._Fields>, java.io.Serializable, Cloneable, Comparable<GlobalStreamId> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GlobalStreamId");
-
- private static final org.apache.thrift.protocol.TField COMPONENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("componentId", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField STREAM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("streamId", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new GlobalStreamIdStandardSchemeFactory());
- schemes.put(TupleScheme.class, new GlobalStreamIdTupleSchemeFactory());
- }
-
- private String componentId; // required
- private String streamId; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- COMPONENT_ID((short)1, "componentId"),
- STREAM_ID((short)2, "streamId");
-
- private static final Map<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: // COMPONENT_ID
- return COMPONENT_ID;
- case 2: // STREAM_ID
- return STREAM_ID;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, 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.COMPONENT_ID, new org.apache.thrift.meta_data.FieldMetaData("componentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.STREAM_ID, new org.apache.thrift.meta_data.FieldMetaData("streamId", 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(GlobalStreamId.class, metaDataMap);
- }
-
- public GlobalStreamId() {
- }
-
- public GlobalStreamId(
- String componentId,
- String streamId)
- {
- this();
- this.componentId = componentId;
- this.streamId = streamId;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public GlobalStreamId(GlobalStreamId other) {
- if (other.is_set_componentId()) {
- this.componentId = other.componentId;
- }
- if (other.is_set_streamId()) {
- this.streamId = other.streamId;
- }
- }
-
- public GlobalStreamId deepCopy() {
- return new GlobalStreamId(this);
- }
-
- @Override
- public void clear() {
- this.componentId = null;
- this.streamId = null;
- }
-
- public String get_componentId() {
- return this.componentId;
- }
-
- public void set_componentId(String componentId) {
- this.componentId = componentId;
- }
-
- public void unset_componentId() {
- this.componentId = null;
- }
-
- /** Returns true if field componentId is set (has been assigned a value) and false otherwise */
- public boolean is_set_componentId() {
- return this.componentId != null;
- }
-
- public void set_componentId_isSet(boolean value) {
- if (!value) {
- this.componentId = null;
- }
- }
-
- public String get_streamId() {
- return this.streamId;
- }
-
- public void set_streamId(String streamId) {
- this.streamId = streamId;
- }
-
- public void unset_streamId() {
- this.streamId = null;
- }
-
- /** Returns true if field streamId is set (has been assigned a value) and false otherwise */
- public boolean is_set_streamId() {
- return this.streamId != null;
- }
-
- public void set_streamId_isSet(boolean value) {
- if (!value) {
- this.streamId = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case COMPONENT_ID:
- if (value == null) {
- unset_componentId();
- } else {
- set_componentId((String)value);
- }
- break;
-
- case STREAM_ID:
- if (value == null) {
- unset_streamId();
- } else {
- set_streamId((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case COMPONENT_ID:
- return get_componentId();
-
- case STREAM_ID:
- return get_streamId();
-
- }
- 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 COMPONENT_ID:
- return is_set_componentId();
- case STREAM_ID:
- return is_set_streamId();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof GlobalStreamId)
- return this.equals((GlobalStreamId)that);
- return false;
- }
-
- public boolean equals(GlobalStreamId that) {
- if (that == null)
- return false;
-
- boolean this_present_componentId = true && this.is_set_componentId();
- boolean that_present_componentId = true && that.is_set_componentId();
- if (this_present_componentId || that_present_componentId) {
- if (!(this_present_componentId && that_present_componentId))
- return false;
- if (!this.componentId.equals(that.componentId))
- return false;
- }
-
- boolean this_present_streamId = true && this.is_set_streamId();
- boolean that_present_streamId = true && that.is_set_streamId();
- if (this_present_streamId || that_present_streamId) {
- if (!(this_present_streamId && that_present_streamId))
- return false;
- if (!this.streamId.equals(that.streamId))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_componentId = true && (is_set_componentId());
- list.add(present_componentId);
- if (present_componentId)
- list.add(componentId);
-
- boolean present_streamId = true && (is_set_streamId());
- list.add(present_streamId);
- if (present_streamId)
- list.add(streamId);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(GlobalStreamId other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_componentId()).compareTo(other.is_set_componentId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_componentId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.componentId, other.componentId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_streamId()).compareTo(other.is_set_streamId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_streamId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamId, other.streamId);
- 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("GlobalStreamId(");
- boolean first = true;
-
- sb.append("componentId:");
- if (this.componentId == null) {
- sb.append("null");
- } else {
- sb.append(this.componentId);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("streamId:");
- if (this.streamId == null) {
- sb.append("null");
- } else {
- sb.append(this.streamId);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_componentId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'componentId' is unset! Struct:" + toString());
- }
-
- if (!is_set_streamId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'streamId' 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 GlobalStreamIdStandardSchemeFactory implements SchemeFactory {
- public GlobalStreamIdStandardScheme getScheme() {
- return new GlobalStreamIdStandardScheme();
- }
- }
-
- private static class GlobalStreamIdStandardScheme extends StandardScheme<GlobalStreamId> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, GlobalStreamId 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: // COMPONENT_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.componentId = iprot.readString();
- struct.set_componentId_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // STREAM_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.streamId = iprot.readString();
- struct.set_streamId_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, GlobalStreamId struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.componentId != null) {
- oprot.writeFieldBegin(COMPONENT_ID_FIELD_DESC);
- oprot.writeString(struct.componentId);
- oprot.writeFieldEnd();
- }
- if (struct.streamId != null) {
- oprot.writeFieldBegin(STREAM_ID_FIELD_DESC);
- oprot.writeString(struct.streamId);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class GlobalStreamIdTupleSchemeFactory implements SchemeFactory {
- public GlobalStreamIdTupleScheme getScheme() {
- return new GlobalStreamIdTupleScheme();
- }
- }
-
- private static class GlobalStreamIdTupleScheme extends TupleScheme<GlobalStreamId> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, GlobalStreamId struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.componentId);
- oprot.writeString(struct.streamId);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, GlobalStreamId struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.componentId = iprot.readString();
- struct.set_componentId_isSet(true);
- struct.streamId = iprot.readString();
- struct.set_streamId_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/Grouping.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/Grouping.java b/storm-core/src/jvm/backtype/storm/generated/Grouping.java
deleted file mode 100644
index ccb19bc..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/Grouping.java
+++ /dev/null
@@ -1,800 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Fields> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Grouping");
- private static final org.apache.thrift.protocol.TField FIELDS_FIELD_DESC = new org.apache.thrift.protocol.TField("fields", org.apache.thrift.protocol.TType.LIST, (short)1);
- private static final org.apache.thrift.protocol.TField SHUFFLE_FIELD_DESC = new org.apache.thrift.protocol.TField("shuffle", org.apache.thrift.protocol.TType.STRUCT, (short)2);
- private static final org.apache.thrift.protocol.TField ALL_FIELD_DESC = new org.apache.thrift.protocol.TField("all", org.apache.thrift.protocol.TType.STRUCT, (short)3);
- private static final org.apache.thrift.protocol.TField NONE_FIELD_DESC = new org.apache.thrift.protocol.TField("none", org.apache.thrift.protocol.TType.STRUCT, (short)4);
- private static final org.apache.thrift.protocol.TField DIRECT_FIELD_DESC = new org.apache.thrift.protocol.TField("direct", org.apache.thrift.protocol.TType.STRUCT, (short)5);
- private static final org.apache.thrift.protocol.TField CUSTOM_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("custom_object", org.apache.thrift.protocol.TType.STRUCT, (short)6);
- private static final org.apache.thrift.protocol.TField CUSTOM_SERIALIZED_FIELD_DESC = new org.apache.thrift.protocol.TField("custom_serialized", org.apache.thrift.protocol.TType.STRING, (short)7);
- private static final org.apache.thrift.protocol.TField LOCAL_OR_SHUFFLE_FIELD_DESC = new org.apache.thrift.protocol.TField("local_or_shuffle", org.apache.thrift.protocol.TType.STRUCT, (short)8);
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- FIELDS((short)1, "fields"),
- SHUFFLE((short)2, "shuffle"),
- ALL((short)3, "all"),
- NONE((short)4, "none"),
- DIRECT((short)5, "direct"),
- CUSTOM_OBJECT((short)6, "custom_object"),
- CUSTOM_SERIALIZED((short)7, "custom_serialized"),
- LOCAL_OR_SHUFFLE((short)8, "local_or_shuffle");
-
- 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: // FIELDS
- return FIELDS;
- case 2: // SHUFFLE
- return SHUFFLE;
- case 3: // ALL
- return ALL;
- case 4: // NONE
- return NONE;
- case 5: // DIRECT
- return DIRECT;
- case 6: // CUSTOM_OBJECT
- return CUSTOM_OBJECT;
- case 7: // CUSTOM_SERIALIZED
- return CUSTOM_SERIALIZED;
- case 8: // LOCAL_OR_SHUFFLE
- return LOCAL_OR_SHUFFLE;
- 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;
- }
- }
-
- 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.FIELDS, new org.apache.thrift.meta_data.FieldMetaData("fields", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- tmpMap.put(_Fields.SHUFFLE, new org.apache.thrift.meta_data.FieldMetaData("shuffle", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NullStruct.class)));
- tmpMap.put(_Fields.ALL, new org.apache.thrift.meta_data.FieldMetaData("all", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NullStruct.class)));
- tmpMap.put(_Fields.NONE, new org.apache.thrift.meta_data.FieldMetaData("none", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NullStruct.class)));
- tmpMap.put(_Fields.DIRECT, new org.apache.thrift.meta_data.FieldMetaData("direct", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NullStruct.class)));
- tmpMap.put(_Fields.CUSTOM_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("custom_object", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JavaObject.class)));
- tmpMap.put(_Fields.CUSTOM_SERIALIZED, new org.apache.thrift.meta_data.FieldMetaData("custom_serialized", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
- tmpMap.put(_Fields.LOCAL_OR_SHUFFLE, new org.apache.thrift.meta_data.FieldMetaData("local_or_shuffle", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NullStruct.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Grouping.class, metaDataMap);
- }
-
- public Grouping() {
- super();
- }
-
- public Grouping(_Fields setField, Object value) {
- super(setField, value);
- }
-
- public Grouping(Grouping other) {
- super(other);
- }
- public Grouping deepCopy() {
- return new Grouping(this);
- }
-
- public static Grouping fields(List<String> value) {
- Grouping x = new Grouping();
- x.set_fields(value);
- return x;
- }
-
- public static Grouping shuffle(NullStruct value) {
- Grouping x = new Grouping();
- x.set_shuffle(value);
- return x;
- }
-
- public static Grouping all(NullStruct value) {
- Grouping x = new Grouping();
- x.set_all(value);
- return x;
- }
-
- public static Grouping none(NullStruct value) {
- Grouping x = new Grouping();
- x.set_none(value);
- return x;
- }
-
- public static Grouping direct(NullStruct value) {
- Grouping x = new Grouping();
- x.set_direct(value);
- return x;
- }
-
- public static Grouping custom_object(JavaObject value) {
- Grouping x = new Grouping();
- x.set_custom_object(value);
- return x;
- }
-
- public static Grouping custom_serialized(ByteBuffer value) {
- Grouping x = new Grouping();
- x.set_custom_serialized(value);
- return x;
- }
-
- public static Grouping custom_serialized(byte[] value) {
- Grouping x = new Grouping();
- x.set_custom_serialized(ByteBuffer.wrap(Arrays.copyOf(value, value.length)));
- return x;
- }
-
- public static Grouping local_or_shuffle(NullStruct value) {
- Grouping x = new Grouping();
- x.set_local_or_shuffle(value);
- return x;
- }
-
-
- @Override
- protected void checkType(_Fields setField, Object value) throws ClassCastException {
- switch (setField) {
- case FIELDS:
- if (value instanceof List) {
- break;
- }
- throw new ClassCastException("Was expecting value of type List<String> for field 'fields', but got " + value.getClass().getSimpleName());
- case SHUFFLE:
- if (value instanceof NullStruct) {
- break;
- }
- throw new ClassCastException("Was expecting value of type NullStruct for field 'shuffle', but got " + value.getClass().getSimpleName());
- case ALL:
- if (value instanceof NullStruct) {
- break;
- }
- throw new ClassCastException("Was expecting value of type NullStruct for field 'all', but got " + value.getClass().getSimpleName());
- case NONE:
- if (value instanceof NullStruct) {
- break;
- }
- throw new ClassCastException("Was expecting value of type NullStruct for field 'none', but got " + value.getClass().getSimpleName());
- case DIRECT:
- if (value instanceof NullStruct) {
- break;
- }
- throw new ClassCastException("Was expecting value of type NullStruct for field 'direct', but got " + value.getClass().getSimpleName());
- case CUSTOM_OBJECT:
- if (value instanceof JavaObject) {
- break;
- }
- throw new ClassCastException("Was expecting value of type JavaObject for field 'custom_object', but got " + value.getClass().getSimpleName());
- case CUSTOM_SERIALIZED:
- if (value instanceof ByteBuffer) {
- break;
- }
- throw new ClassCastException("Was expecting value of type ByteBuffer for field 'custom_serialized', but got " + value.getClass().getSimpleName());
- case LOCAL_OR_SHUFFLE:
- if (value instanceof NullStruct) {
- break;
- }
- throw new ClassCastException("Was expecting value of type NullStruct for field 'local_or_shuffle', but got " + value.getClass().getSimpleName());
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(field.id);
- if (setField != null) {
- switch (setField) {
- case FIELDS:
- if (field.type == FIELDS_FIELD_DESC.type) {
- List<String> fields;
- {
- org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
- fields = new ArrayList<String>(_list8.size);
- String _elem9;
- for (int _i10 = 0; _i10 < _list8.size; ++_i10)
- {
- _elem9 = iprot.readString();
- fields.add(_elem9);
- }
- iprot.readListEnd();
- }
- return fields;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case SHUFFLE:
- if (field.type == SHUFFLE_FIELD_DESC.type) {
- NullStruct shuffle;
- shuffle = new NullStruct();
- shuffle.read(iprot);
- return shuffle;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case ALL:
- if (field.type == ALL_FIELD_DESC.type) {
- NullStruct all;
- all = new NullStruct();
- all.read(iprot);
- return all;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case NONE:
- if (field.type == NONE_FIELD_DESC.type) {
- NullStruct none;
- none = new NullStruct();
- none.read(iprot);
- return none;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case DIRECT:
- if (field.type == DIRECT_FIELD_DESC.type) {
- NullStruct direct;
- direct = new NullStruct();
- direct.read(iprot);
- return direct;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case CUSTOM_OBJECT:
- if (field.type == CUSTOM_OBJECT_FIELD_DESC.type) {
- JavaObject custom_object;
- custom_object = new JavaObject();
- custom_object.read(iprot);
- return custom_object;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case CUSTOM_SERIALIZED:
- if (field.type == CUSTOM_SERIALIZED_FIELD_DESC.type) {
- ByteBuffer custom_serialized;
- custom_serialized = iprot.readBinary();
- return custom_serialized;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case LOCAL_OR_SHUFFLE:
- if (field.type == LOCAL_OR_SHUFFLE_FIELD_DESC.type) {
- NullStruct local_or_shuffle;
- local_or_shuffle = new NullStruct();
- local_or_shuffle.read(iprot);
- return local_or_shuffle;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- }
-
- @Override
- protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case FIELDS:
- List<String> fields = (List<String>)value_;
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, fields.size()));
- for (String _iter11 : fields)
- {
- oprot.writeString(_iter11);
- }
- oprot.writeListEnd();
- }
- return;
- case SHUFFLE:
- NullStruct shuffle = (NullStruct)value_;
- shuffle.write(oprot);
- return;
- case ALL:
- NullStruct all = (NullStruct)value_;
- all.write(oprot);
- return;
- case NONE:
- NullStruct none = (NullStruct)value_;
- none.write(oprot);
- return;
- case DIRECT:
- NullStruct direct = (NullStruct)value_;
- direct.write(oprot);
- return;
- case CUSTOM_OBJECT:
- JavaObject custom_object = (JavaObject)value_;
- custom_object.write(oprot);
- return;
- case CUSTOM_SERIALIZED:
- ByteBuffer custom_serialized = (ByteBuffer)value_;
- oprot.writeBinary(custom_serialized);
- return;
- case LOCAL_OR_SHUFFLE:
- NullStruct local_or_shuffle = (NullStruct)value_;
- local_or_shuffle.write(oprot);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(fieldID);
- if (setField != null) {
- switch (setField) {
- case FIELDS:
- List<String> fields;
- {
- org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
- fields = new ArrayList<String>(_list12.size);
- String _elem13;
- for (int _i14 = 0; _i14 < _list12.size; ++_i14)
- {
- _elem13 = iprot.readString();
- fields.add(_elem13);
- }
- iprot.readListEnd();
- }
- return fields;
- case SHUFFLE:
- NullStruct shuffle;
- shuffle = new NullStruct();
- shuffle.read(iprot);
- return shuffle;
- case ALL:
- NullStruct all;
- all = new NullStruct();
- all.read(iprot);
- return all;
- case NONE:
- NullStruct none;
- none = new NullStruct();
- none.read(iprot);
- return none;
- case DIRECT:
- NullStruct direct;
- direct = new NullStruct();
- direct.read(iprot);
- return direct;
- case CUSTOM_OBJECT:
- JavaObject custom_object;
- custom_object = new JavaObject();
- custom_object.read(iprot);
- return custom_object;
- case CUSTOM_SERIALIZED:
- ByteBuffer custom_serialized;
- custom_serialized = iprot.readBinary();
- return custom_serialized;
- case LOCAL_OR_SHUFFLE:
- NullStruct local_or_shuffle;
- local_or_shuffle = new NullStruct();
- local_or_shuffle.read(iprot);
- return local_or_shuffle;
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- throw new TProtocolException("Couldn't find a field with field id " + fieldID);
- }
- }
-
- @Override
- protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case FIELDS:
- List<String> fields = (List<String>)value_;
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, fields.size()));
- for (String _iter15 : fields)
- {
- oprot.writeString(_iter15);
- }
- oprot.writeListEnd();
- }
- return;
- case SHUFFLE:
- NullStruct shuffle = (NullStruct)value_;
- shuffle.write(oprot);
- return;
- case ALL:
- NullStruct all = (NullStruct)value_;
- all.write(oprot);
- return;
- case NONE:
- NullStruct none = (NullStruct)value_;
- none.write(oprot);
- return;
- case DIRECT:
- NullStruct direct = (NullStruct)value_;
- direct.write(oprot);
- return;
- case CUSTOM_OBJECT:
- JavaObject custom_object = (JavaObject)value_;
- custom_object.write(oprot);
- return;
- case CUSTOM_SERIALIZED:
- ByteBuffer custom_serialized = (ByteBuffer)value_;
- oprot.writeBinary(custom_serialized);
- return;
- case LOCAL_OR_SHUFFLE:
- NullStruct local_or_shuffle = (NullStruct)value_;
- local_or_shuffle.write(oprot);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) {
- switch (setField) {
- case FIELDS:
- return FIELDS_FIELD_DESC;
- case SHUFFLE:
- return SHUFFLE_FIELD_DESC;
- case ALL:
- return ALL_FIELD_DESC;
- case NONE:
- return NONE_FIELD_DESC;
- case DIRECT:
- return DIRECT_FIELD_DESC;
- case CUSTOM_OBJECT:
- return CUSTOM_OBJECT_FIELD_DESC;
- case CUSTOM_SERIALIZED:
- return CUSTOM_SERIALIZED_FIELD_DESC;
- case LOCAL_OR_SHUFFLE:
- return LOCAL_OR_SHUFFLE_FIELD_DESC;
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TStruct getStructDesc() {
- return STRUCT_DESC;
- }
-
- @Override
- protected _Fields enumForId(short id) {
- return _Fields.findByThriftIdOrThrow(id);
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
-
- public List<String> get_fields() {
- if (getSetField() == _Fields.FIELDS) {
- return (List<String>)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'fields' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_fields(List<String> value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.FIELDS;
- value_ = value;
- }
-
- public NullStruct get_shuffle() {
- if (getSetField() == _Fields.SHUFFLE) {
- return (NullStruct)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'shuffle' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_shuffle(NullStruct value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.SHUFFLE;
- value_ = value;
- }
-
- public NullStruct get_all() {
- if (getSetField() == _Fields.ALL) {
- return (NullStruct)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'all' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_all(NullStruct value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.ALL;
- value_ = value;
- }
-
- public NullStruct get_none() {
- if (getSetField() == _Fields.NONE) {
- return (NullStruct)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'none' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_none(NullStruct value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.NONE;
- value_ = value;
- }
-
- public NullStruct get_direct() {
- if (getSetField() == _Fields.DIRECT) {
- return (NullStruct)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'direct' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_direct(NullStruct value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.DIRECT;
- value_ = value;
- }
-
- public JavaObject get_custom_object() {
- if (getSetField() == _Fields.CUSTOM_OBJECT) {
- return (JavaObject)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'custom_object' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_custom_object(JavaObject value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.CUSTOM_OBJECT;
- value_ = value;
- }
-
- public byte[] get_custom_serialized() {
- set_custom_serialized(org.apache.thrift.TBaseHelper.rightSize(buffer_for_custom_serialized()));
- ByteBuffer b = buffer_for_custom_serialized();
- return b == null ? null : b.array();
- }
-
- public ByteBuffer buffer_for_custom_serialized() {
- if (getSetField() == _Fields.CUSTOM_SERIALIZED) {
- return org.apache.thrift.TBaseHelper.copyBinary((ByteBuffer)getFieldValue());
- } else {
- throw new RuntimeException("Cannot get field 'custom_serialized' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_custom_serialized(byte[] value) {
- set_custom_serialized(ByteBuffer.wrap(Arrays.copyOf(value, value.length)));
- }
-
- public void set_custom_serialized(ByteBuffer value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.CUSTOM_SERIALIZED;
- value_ = value;
- }
-
- public NullStruct get_local_or_shuffle() {
- if (getSetField() == _Fields.LOCAL_OR_SHUFFLE) {
- return (NullStruct)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'local_or_shuffle' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_local_or_shuffle(NullStruct value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.LOCAL_OR_SHUFFLE;
- value_ = value;
- }
-
- public boolean is_set_fields() {
- return setField_ == _Fields.FIELDS;
- }
-
-
- public boolean is_set_shuffle() {
- return setField_ == _Fields.SHUFFLE;
- }
-
-
- public boolean is_set_all() {
- return setField_ == _Fields.ALL;
- }
-
-
- public boolean is_set_none() {
- return setField_ == _Fields.NONE;
- }
-
-
- public boolean is_set_direct() {
- return setField_ == _Fields.DIRECT;
- }
-
-
- public boolean is_set_custom_object() {
- return setField_ == _Fields.CUSTOM_OBJECT;
- }
-
-
- public boolean is_set_custom_serialized() {
- return setField_ == _Fields.CUSTOM_SERIALIZED;
- }
-
-
- public boolean is_set_local_or_shuffle() {
- return setField_ == _Fields.LOCAL_OR_SHUFFLE;
- }
-
-
- public boolean equals(Object other) {
- if (other instanceof Grouping) {
- return equals((Grouping)other);
- } else {
- return false;
- }
- }
-
- public boolean equals(Grouping other) {
- return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue());
- }
-
- @Override
- public int compareTo(Grouping other) {
- int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField());
- if (lastComparison == 0) {
- return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue());
- }
- return lastComparison;
- }
-
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
- list.add(this.getClass().getName());
- org.apache.thrift.TFieldIdEnum setField = getSetField();
- if (setField != null) {
- list.add(setField.getThriftFieldId());
- Object value = getFieldValue();
- if (value instanceof org.apache.thrift.TEnum) {
- list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
- } else {
- list.add(value);
- }
- }
- return list.hashCode();
- }
- 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);
- }
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/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 cb31213..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.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class 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/a6171bd6/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 697dd06..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.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class 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);
- }
- }
-
-}
-
[06/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java b/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java
deleted file mode 100644
index fa95be7..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/TopologyInfo.java
+++ /dev/null
@@ -1,2144 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class TopologyInfo implements org.apache.thrift.TBase<TopologyInfo, TopologyInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TopologyInfo> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyInfo");
-
- private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)3);
- private static final org.apache.thrift.protocol.TField EXECUTORS_FIELD_DESC = new org.apache.thrift.protocol.TField("executors", org.apache.thrift.protocol.TType.LIST, (short)4);
- private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)5);
- private static final org.apache.thrift.protocol.TField ERRORS_FIELD_DESC = new org.apache.thrift.protocol.TField("errors", org.apache.thrift.protocol.TType.MAP, (short)6);
- private static final org.apache.thrift.protocol.TField COMPONENT_DEBUG_FIELD_DESC = new org.apache.thrift.protocol.TField("component_debug", org.apache.thrift.protocol.TType.MAP, (short)7);
- private static final org.apache.thrift.protocol.TField SCHED_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("sched_status", org.apache.thrift.protocol.TType.STRING, (short)513);
- private static final org.apache.thrift.protocol.TField OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)514);
- private static final org.apache.thrift.protocol.TField REPLICATION_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("replication_count", org.apache.thrift.protocol.TType.I32, (short)515);
- private static final org.apache.thrift.protocol.TField REQUESTED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)521);
- private static final org.apache.thrift.protocol.TField REQUESTED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_memoffheap", org.apache.thrift.protocol.TType.DOUBLE, (short)522);
- private static final org.apache.thrift.protocol.TField REQUESTED_CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("requested_cpu", org.apache.thrift.protocol.TType.DOUBLE, (short)523);
- private static final org.apache.thrift.protocol.TField ASSIGNED_MEMONHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("assigned_memonheap", org.apache.thrift.protocol.TType.DOUBLE, (short)524);
- private static final org.apache.thrift.protocol.TField ASSIGNED_MEMOFFHEAP_FIELD_DESC = new org.apache.thrift.protocol.TField("assigned_memoffheap", org.apache.thrift.protocol.TType.DOUBLE, (short)525);
- private static final org.apache.thrift.protocol.TField ASSIGNED_CPU_FIELD_DESC = new org.apache.thrift.protocol.TField("assigned_cpu", org.apache.thrift.protocol.TType.DOUBLE, (short)526);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new TopologyInfoStandardSchemeFactory());
- schemes.put(TupleScheme.class, new TopologyInfoTupleSchemeFactory());
- }
-
- private String id; // required
- private String name; // required
- private int uptime_secs; // required
- private List<ExecutorSummary> executors; // required
- private String status; // required
- private Map<String,List<ErrorInfo>> errors; // required
- private Map<String,DebugOptions> component_debug; // optional
- private String sched_status; // optional
- private String owner; // optional
- private int replication_count; // optional
- private double requested_memonheap; // optional
- private double requested_memoffheap; // optional
- private double requested_cpu; // optional
- private double assigned_memonheap; // optional
- private double assigned_memoffheap; // optional
- private double assigned_cpu; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- ID((short)1, "id"),
- NAME((short)2, "name"),
- UPTIME_SECS((short)3, "uptime_secs"),
- EXECUTORS((short)4, "executors"),
- STATUS((short)5, "status"),
- ERRORS((short)6, "errors"),
- COMPONENT_DEBUG((short)7, "component_debug"),
- SCHED_STATUS((short)513, "sched_status"),
- OWNER((short)514, "owner"),
- REPLICATION_COUNT((short)515, "replication_count"),
- REQUESTED_MEMONHEAP((short)521, "requested_memonheap"),
- REQUESTED_MEMOFFHEAP((short)522, "requested_memoffheap"),
- REQUESTED_CPU((short)523, "requested_cpu"),
- ASSIGNED_MEMONHEAP((short)524, "assigned_memonheap"),
- ASSIGNED_MEMOFFHEAP((short)525, "assigned_memoffheap"),
- ASSIGNED_CPU((short)526, "assigned_cpu");
-
- 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: // ID
- return ID;
- case 2: // NAME
- return NAME;
- case 3: // UPTIME_SECS
- return UPTIME_SECS;
- case 4: // EXECUTORS
- return EXECUTORS;
- case 5: // STATUS
- return STATUS;
- case 6: // ERRORS
- return ERRORS;
- case 7: // COMPONENT_DEBUG
- return COMPONENT_DEBUG;
- case 513: // SCHED_STATUS
- return SCHED_STATUS;
- case 514: // OWNER
- return OWNER;
- case 515: // REPLICATION_COUNT
- return REPLICATION_COUNT;
- case 521: // REQUESTED_MEMONHEAP
- return REQUESTED_MEMONHEAP;
- case 522: // REQUESTED_MEMOFFHEAP
- return REQUESTED_MEMOFFHEAP;
- case 523: // REQUESTED_CPU
- return REQUESTED_CPU;
- case 524: // ASSIGNED_MEMONHEAP
- return ASSIGNED_MEMONHEAP;
- case 525: // ASSIGNED_MEMOFFHEAP
- return ASSIGNED_MEMOFFHEAP;
- case 526: // ASSIGNED_CPU
- return ASSIGNED_CPU;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return 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 __UPTIME_SECS_ISSET_ID = 0;
- private static final int __REPLICATION_COUNT_ISSET_ID = 1;
- private static final int __REQUESTED_MEMONHEAP_ISSET_ID = 2;
- private static final int __REQUESTED_MEMOFFHEAP_ISSET_ID = 3;
- private static final int __REQUESTED_CPU_ISSET_ID = 4;
- private static final int __ASSIGNED_MEMONHEAP_ISSET_ID = 5;
- private static final int __ASSIGNED_MEMOFFHEAP_ISSET_ID = 6;
- private static final int __ASSIGNED_CPU_ISSET_ID = 7;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.COMPONENT_DEBUG,_Fields.SCHED_STATUS,_Fields.OWNER,_Fields.REPLICATION_COUNT,_Fields.REQUESTED_MEMONHEAP,_Fields.REQUESTED_MEMOFFHEAP,_Fields.REQUESTED_CPU,_Fields.ASSIGNED_MEMONHEAP,_Fields.ASSIGNED_MEMOFFHEAP,_Fields.ASSIGNED_CPU};
- 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.EXECUTORS, new org.apache.thrift.meta_data.FieldMetaData("executors", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ExecutorSummary.class))));
- tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.ERRORS, new org.apache.thrift.meta_data.FieldMetaData("errors", org.apache.thrift.TFieldRequirementType.REQUIRED,
- 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.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ErrorInfo.class)))));
- tmpMap.put(_Fields.COMPONENT_DEBUG, new org.apache.thrift.meta_data.FieldMetaData("component_debug", 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, DebugOptions.class))));
- tmpMap.put(_Fields.SCHED_STATUS, new org.apache.thrift.meta_data.FieldMetaData("sched_status", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- 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)));
- tmpMap.put(_Fields.REQUESTED_MEMONHEAP, new org.apache.thrift.meta_data.FieldMetaData("requested_memonheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.REQUESTED_MEMOFFHEAP, new org.apache.thrift.meta_data.FieldMetaData("requested_memoffheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.REQUESTED_CPU, new org.apache.thrift.meta_data.FieldMetaData("requested_cpu", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.ASSIGNED_MEMONHEAP, new org.apache.thrift.meta_data.FieldMetaData("assigned_memonheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.ASSIGNED_MEMOFFHEAP, new org.apache.thrift.meta_data.FieldMetaData("assigned_memoffheap", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- tmpMap.put(_Fields.ASSIGNED_CPU, new org.apache.thrift.meta_data.FieldMetaData("assigned_cpu", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologyInfo.class, metaDataMap);
- }
-
- public TopologyInfo() {
- }
-
- public TopologyInfo(
- String id,
- String name,
- int uptime_secs,
- List<ExecutorSummary> executors,
- String status,
- Map<String,List<ErrorInfo>> errors)
- {
- this();
- this.id = id;
- this.name = name;
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- this.executors = executors;
- this.status = status;
- this.errors = errors;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public TopologyInfo(TopologyInfo other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_id()) {
- this.id = other.id;
- }
- if (other.is_set_name()) {
- this.name = other.name;
- }
- this.uptime_secs = other.uptime_secs;
- if (other.is_set_executors()) {
- List<ExecutorSummary> __this__executors = new ArrayList<ExecutorSummary>(other.executors.size());
- for (ExecutorSummary other_element : other.executors) {
- __this__executors.add(new ExecutorSummary(other_element));
- }
- this.executors = __this__executors;
- }
- if (other.is_set_status()) {
- this.status = other.status;
- }
- if (other.is_set_errors()) {
- Map<String,List<ErrorInfo>> __this__errors = new HashMap<String,List<ErrorInfo>>(other.errors.size());
- for (Map.Entry<String, List<ErrorInfo>> other_element : other.errors.entrySet()) {
-
- String other_element_key = other_element.getKey();
- List<ErrorInfo> other_element_value = other_element.getValue();
-
- String __this__errors_copy_key = other_element_key;
-
- List<ErrorInfo> __this__errors_copy_value = new ArrayList<ErrorInfo>(other_element_value.size());
- for (ErrorInfo other_element_value_element : other_element_value) {
- __this__errors_copy_value.add(new ErrorInfo(other_element_value_element));
- }
-
- __this__errors.put(__this__errors_copy_key, __this__errors_copy_value);
- }
- this.errors = __this__errors;
- }
- if (other.is_set_component_debug()) {
- Map<String,DebugOptions> __this__component_debug = new HashMap<String,DebugOptions>(other.component_debug.size());
- for (Map.Entry<String, DebugOptions> other_element : other.component_debug.entrySet()) {
-
- String other_element_key = other_element.getKey();
- DebugOptions other_element_value = other_element.getValue();
-
- String __this__component_debug_copy_key = other_element_key;
-
- DebugOptions __this__component_debug_copy_value = new DebugOptions(other_element_value);
-
- __this__component_debug.put(__this__component_debug_copy_key, __this__component_debug_copy_value);
- }
- this.component_debug = __this__component_debug;
- }
- if (other.is_set_sched_status()) {
- this.sched_status = other.sched_status;
- }
- if (other.is_set_owner()) {
- this.owner = other.owner;
- }
- this.replication_count = other.replication_count;
- this.requested_memonheap = other.requested_memonheap;
- this.requested_memoffheap = other.requested_memoffheap;
- this.requested_cpu = other.requested_cpu;
- this.assigned_memonheap = other.assigned_memonheap;
- this.assigned_memoffheap = other.assigned_memoffheap;
- this.assigned_cpu = other.assigned_cpu;
- }
-
- public TopologyInfo deepCopy() {
- return new TopologyInfo(this);
- }
-
- @Override
- public void clear() {
- this.id = null;
- this.name = null;
- set_uptime_secs_isSet(false);
- this.uptime_secs = 0;
- this.executors = null;
- this.status = null;
- this.errors = null;
- this.component_debug = null;
- this.sched_status = null;
- this.owner = null;
- set_replication_count_isSet(false);
- this.replication_count = 0;
- set_requested_memonheap_isSet(false);
- this.requested_memonheap = 0.0;
- set_requested_memoffheap_isSet(false);
- this.requested_memoffheap = 0.0;
- set_requested_cpu_isSet(false);
- this.requested_cpu = 0.0;
- set_assigned_memonheap_isSet(false);
- this.assigned_memonheap = 0.0;
- set_assigned_memoffheap_isSet(false);
- this.assigned_memoffheap = 0.0;
- set_assigned_cpu_isSet(false);
- this.assigned_cpu = 0.0;
- }
-
- public String get_id() {
- return this.id;
- }
-
- public void set_id(String id) {
- this.id = id;
- }
-
- public void unset_id() {
- this.id = null;
- }
-
- /** Returns true if field id is set (has been assigned a value) and false otherwise */
- public boolean is_set_id() {
- return this.id != null;
- }
-
- public void set_id_isSet(boolean value) {
- if (!value) {
- this.id = 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_uptime_secs() {
- return this.uptime_secs;
- }
-
- public void set_uptime_secs(int uptime_secs) {
- this.uptime_secs = uptime_secs;
- set_uptime_secs_isSet(true);
- }
-
- public void unset_uptime_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_uptime_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID);
- }
-
- public void set_uptime_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID, value);
- }
-
- public int get_executors_size() {
- return (this.executors == null) ? 0 : this.executors.size();
- }
-
- public java.util.Iterator<ExecutorSummary> get_executors_iterator() {
- return (this.executors == null) ? null : this.executors.iterator();
- }
-
- public void add_to_executors(ExecutorSummary elem) {
- if (this.executors == null) {
- this.executors = new ArrayList<ExecutorSummary>();
- }
- this.executors.add(elem);
- }
-
- public List<ExecutorSummary> get_executors() {
- return this.executors;
- }
-
- public void set_executors(List<ExecutorSummary> executors) {
- this.executors = executors;
- }
-
- public void unset_executors() {
- this.executors = null;
- }
-
- /** Returns true if field executors is set (has been assigned a value) and false otherwise */
- public boolean is_set_executors() {
- return this.executors != null;
- }
-
- public void set_executors_isSet(boolean value) {
- if (!value) {
- this.executors = null;
- }
- }
-
- public String get_status() {
- return this.status;
- }
-
- public void set_status(String status) {
- this.status = status;
- }
-
- public void unset_status() {
- this.status = null;
- }
-
- /** Returns true if field status is set (has been assigned a value) and false otherwise */
- public boolean is_set_status() {
- return this.status != null;
- }
-
- public void set_status_isSet(boolean value) {
- if (!value) {
- this.status = null;
- }
- }
-
- public int get_errors_size() {
- return (this.errors == null) ? 0 : this.errors.size();
- }
-
- public void put_to_errors(String key, List<ErrorInfo> val) {
- if (this.errors == null) {
- this.errors = new HashMap<String,List<ErrorInfo>>();
- }
- this.errors.put(key, val);
- }
-
- public Map<String,List<ErrorInfo>> get_errors() {
- return this.errors;
- }
-
- public void set_errors(Map<String,List<ErrorInfo>> errors) {
- this.errors = errors;
- }
-
- public void unset_errors() {
- this.errors = null;
- }
-
- /** Returns true if field errors is set (has been assigned a value) and false otherwise */
- public boolean is_set_errors() {
- return this.errors != null;
- }
-
- public void set_errors_isSet(boolean value) {
- if (!value) {
- this.errors = null;
- }
- }
-
- public int get_component_debug_size() {
- return (this.component_debug == null) ? 0 : this.component_debug.size();
- }
-
- public void put_to_component_debug(String key, DebugOptions val) {
- if (this.component_debug == null) {
- this.component_debug = new HashMap<String,DebugOptions>();
- }
- this.component_debug.put(key, val);
- }
-
- public Map<String,DebugOptions> get_component_debug() {
- return this.component_debug;
- }
-
- public void set_component_debug(Map<String,DebugOptions> component_debug) {
- this.component_debug = component_debug;
- }
-
- public void unset_component_debug() {
- this.component_debug = null;
- }
-
- /** Returns true if field component_debug is set (has been assigned a value) and false otherwise */
- public boolean is_set_component_debug() {
- return this.component_debug != null;
- }
-
- public void set_component_debug_isSet(boolean value) {
- if (!value) {
- this.component_debug = null;
- }
- }
-
- public String get_sched_status() {
- return this.sched_status;
- }
-
- public void set_sched_status(String sched_status) {
- this.sched_status = sched_status;
- }
-
- public void unset_sched_status() {
- this.sched_status = null;
- }
-
- /** Returns true if field sched_status is set (has been assigned a value) and false otherwise */
- public boolean is_set_sched_status() {
- return this.sched_status != null;
- }
-
- public void set_sched_status_isSet(boolean value) {
- if (!value) {
- this.sched_status = null;
- }
- }
-
- public String get_owner() {
- return this.owner;
- }
-
- public void set_owner(String owner) {
- this.owner = owner;
- }
-
- public void unset_owner() {
- this.owner = null;
- }
-
- /** Returns true if field owner is set (has been assigned a value) and false otherwise */
- public boolean is_set_owner() {
- return this.owner != null;
- }
-
- public void set_owner_isSet(boolean value) {
- if (!value) {
- this.owner = null;
- }
- }
-
- 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_bitfield = EncodingUtils.clearBit(__isset_bitfield, __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 EncodingUtils.testBit(__isset_bitfield, __REPLICATION_COUNT_ISSET_ID);
- }
-
- public void set_replication_count_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REPLICATION_COUNT_ISSET_ID, value);
- }
-
- public double get_requested_memonheap() {
- return this.requested_memonheap;
- }
-
- public void set_requested_memonheap(double requested_memonheap) {
- this.requested_memonheap = requested_memonheap;
- set_requested_memonheap_isSet(true);
- }
-
- public void unset_requested_memonheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTED_MEMONHEAP_ISSET_ID);
- }
-
- /** Returns true if field requested_memonheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_requested_memonheap() {
- return EncodingUtils.testBit(__isset_bitfield, __REQUESTED_MEMONHEAP_ISSET_ID);
- }
-
- public void set_requested_memonheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTED_MEMONHEAP_ISSET_ID, value);
- }
-
- public double get_requested_memoffheap() {
- return this.requested_memoffheap;
- }
-
- public void set_requested_memoffheap(double requested_memoffheap) {
- this.requested_memoffheap = requested_memoffheap;
- set_requested_memoffheap_isSet(true);
- }
-
- public void unset_requested_memoffheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTED_MEMOFFHEAP_ISSET_ID);
- }
-
- /** Returns true if field requested_memoffheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_requested_memoffheap() {
- return EncodingUtils.testBit(__isset_bitfield, __REQUESTED_MEMOFFHEAP_ISSET_ID);
- }
-
- public void set_requested_memoffheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTED_MEMOFFHEAP_ISSET_ID, value);
- }
-
- public double get_requested_cpu() {
- return this.requested_cpu;
- }
-
- public void set_requested_cpu(double requested_cpu) {
- this.requested_cpu = requested_cpu;
- set_requested_cpu_isSet(true);
- }
-
- public void unset_requested_cpu() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTED_CPU_ISSET_ID);
- }
-
- /** Returns true if field requested_cpu is set (has been assigned a value) and false otherwise */
- public boolean is_set_requested_cpu() {
- return EncodingUtils.testBit(__isset_bitfield, __REQUESTED_CPU_ISSET_ID);
- }
-
- public void set_requested_cpu_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTED_CPU_ISSET_ID, value);
- }
-
- public double get_assigned_memonheap() {
- return this.assigned_memonheap;
- }
-
- public void set_assigned_memonheap(double assigned_memonheap) {
- this.assigned_memonheap = assigned_memonheap;
- set_assigned_memonheap_isSet(true);
- }
-
- public void unset_assigned_memonheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ASSIGNED_MEMONHEAP_ISSET_ID);
- }
-
- /** Returns true if field assigned_memonheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_assigned_memonheap() {
- return EncodingUtils.testBit(__isset_bitfield, __ASSIGNED_MEMONHEAP_ISSET_ID);
- }
-
- public void set_assigned_memonheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ASSIGNED_MEMONHEAP_ISSET_ID, value);
- }
-
- public double get_assigned_memoffheap() {
- return this.assigned_memoffheap;
- }
-
- public void set_assigned_memoffheap(double assigned_memoffheap) {
- this.assigned_memoffheap = assigned_memoffheap;
- set_assigned_memoffheap_isSet(true);
- }
-
- public void unset_assigned_memoffheap() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ASSIGNED_MEMOFFHEAP_ISSET_ID);
- }
-
- /** Returns true if field assigned_memoffheap is set (has been assigned a value) and false otherwise */
- public boolean is_set_assigned_memoffheap() {
- return EncodingUtils.testBit(__isset_bitfield, __ASSIGNED_MEMOFFHEAP_ISSET_ID);
- }
-
- public void set_assigned_memoffheap_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ASSIGNED_MEMOFFHEAP_ISSET_ID, value);
- }
-
- public double get_assigned_cpu() {
- return this.assigned_cpu;
- }
-
- public void set_assigned_cpu(double assigned_cpu) {
- this.assigned_cpu = assigned_cpu;
- set_assigned_cpu_isSet(true);
- }
-
- public void unset_assigned_cpu() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ASSIGNED_CPU_ISSET_ID);
- }
-
- /** Returns true if field assigned_cpu is set (has been assigned a value) and false otherwise */
- public boolean is_set_assigned_cpu() {
- return EncodingUtils.testBit(__isset_bitfield, __ASSIGNED_CPU_ISSET_ID);
- }
-
- public void set_assigned_cpu_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ASSIGNED_CPU_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ID:
- if (value == null) {
- unset_id();
- } else {
- set_id((String)value);
- }
- break;
-
- case NAME:
- if (value == null) {
- unset_name();
- } else {
- set_name((String)value);
- }
- break;
-
- case UPTIME_SECS:
- if (value == null) {
- unset_uptime_secs();
- } else {
- set_uptime_secs((Integer)value);
- }
- break;
-
- case EXECUTORS:
- if (value == null) {
- unset_executors();
- } else {
- set_executors((List<ExecutorSummary>)value);
- }
- break;
-
- case STATUS:
- if (value == null) {
- unset_status();
- } else {
- set_status((String)value);
- }
- break;
-
- case ERRORS:
- if (value == null) {
- unset_errors();
- } else {
- set_errors((Map<String,List<ErrorInfo>>)value);
- }
- break;
-
- case COMPONENT_DEBUG:
- if (value == null) {
- unset_component_debug();
- } else {
- set_component_debug((Map<String,DebugOptions>)value);
- }
- break;
-
- case SCHED_STATUS:
- if (value == null) {
- unset_sched_status();
- } else {
- set_sched_status((String)value);
- }
- break;
-
- case OWNER:
- if (value == null) {
- unset_owner();
- } else {
- set_owner((String)value);
- }
- break;
-
- case REPLICATION_COUNT:
- if (value == null) {
- unset_replication_count();
- } else {
- set_replication_count((Integer)value);
- }
- break;
-
- case REQUESTED_MEMONHEAP:
- if (value == null) {
- unset_requested_memonheap();
- } else {
- set_requested_memonheap((Double)value);
- }
- break;
-
- case REQUESTED_MEMOFFHEAP:
- if (value == null) {
- unset_requested_memoffheap();
- } else {
- set_requested_memoffheap((Double)value);
- }
- break;
-
- case REQUESTED_CPU:
- if (value == null) {
- unset_requested_cpu();
- } else {
- set_requested_cpu((Double)value);
- }
- break;
-
- case ASSIGNED_MEMONHEAP:
- if (value == null) {
- unset_assigned_memonheap();
- } else {
- set_assigned_memonheap((Double)value);
- }
- break;
-
- case ASSIGNED_MEMOFFHEAP:
- if (value == null) {
- unset_assigned_memoffheap();
- } else {
- set_assigned_memoffheap((Double)value);
- }
- break;
-
- case ASSIGNED_CPU:
- if (value == null) {
- unset_assigned_cpu();
- } else {
- set_assigned_cpu((Double)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ID:
- return get_id();
-
- case NAME:
- return get_name();
-
- case UPTIME_SECS:
- return get_uptime_secs();
-
- case EXECUTORS:
- return get_executors();
-
- case STATUS:
- return get_status();
-
- case ERRORS:
- return get_errors();
-
- case COMPONENT_DEBUG:
- return get_component_debug();
-
- case SCHED_STATUS:
- return get_sched_status();
-
- case OWNER:
- return get_owner();
-
- case REPLICATION_COUNT:
- return get_replication_count();
-
- case REQUESTED_MEMONHEAP:
- return get_requested_memonheap();
-
- case REQUESTED_MEMOFFHEAP:
- return get_requested_memoffheap();
-
- case REQUESTED_CPU:
- return get_requested_cpu();
-
- case ASSIGNED_MEMONHEAP:
- return get_assigned_memonheap();
-
- case ASSIGNED_MEMOFFHEAP:
- return get_assigned_memoffheap();
-
- case ASSIGNED_CPU:
- return get_assigned_cpu();
-
- }
- 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 ID:
- return is_set_id();
- case NAME:
- return is_set_name();
- case UPTIME_SECS:
- return is_set_uptime_secs();
- case EXECUTORS:
- return is_set_executors();
- case STATUS:
- return is_set_status();
- case ERRORS:
- return is_set_errors();
- case COMPONENT_DEBUG:
- return is_set_component_debug();
- case SCHED_STATUS:
- return is_set_sched_status();
- case OWNER:
- return is_set_owner();
- case REPLICATION_COUNT:
- return is_set_replication_count();
- case REQUESTED_MEMONHEAP:
- return is_set_requested_memonheap();
- case REQUESTED_MEMOFFHEAP:
- return is_set_requested_memoffheap();
- case REQUESTED_CPU:
- return is_set_requested_cpu();
- case ASSIGNED_MEMONHEAP:
- return is_set_assigned_memonheap();
- case ASSIGNED_MEMOFFHEAP:
- return is_set_assigned_memoffheap();
- case ASSIGNED_CPU:
- return is_set_assigned_cpu();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof TopologyInfo)
- return this.equals((TopologyInfo)that);
- return false;
- }
-
- public boolean equals(TopologyInfo that) {
- if (that == null)
- return false;
-
- boolean this_present_id = true && this.is_set_id();
- boolean that_present_id = true && that.is_set_id();
- if (this_present_id || that_present_id) {
- if (!(this_present_id && that_present_id))
- return false;
- if (!this.id.equals(that.id))
- 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_uptime_secs = true;
- boolean that_present_uptime_secs = true;
- if (this_present_uptime_secs || that_present_uptime_secs) {
- if (!(this_present_uptime_secs && that_present_uptime_secs))
- return false;
- if (this.uptime_secs != that.uptime_secs)
- return false;
- }
-
- boolean this_present_executors = true && this.is_set_executors();
- boolean that_present_executors = true && that.is_set_executors();
- if (this_present_executors || that_present_executors) {
- if (!(this_present_executors && that_present_executors))
- return false;
- if (!this.executors.equals(that.executors))
- return false;
- }
-
- boolean this_present_status = true && this.is_set_status();
- boolean that_present_status = true && that.is_set_status();
- if (this_present_status || that_present_status) {
- if (!(this_present_status && that_present_status))
- return false;
- if (!this.status.equals(that.status))
- return false;
- }
-
- boolean this_present_errors = true && this.is_set_errors();
- boolean that_present_errors = true && that.is_set_errors();
- if (this_present_errors || that_present_errors) {
- if (!(this_present_errors && that_present_errors))
- return false;
- if (!this.errors.equals(that.errors))
- return false;
- }
-
- boolean this_present_component_debug = true && this.is_set_component_debug();
- boolean that_present_component_debug = true && that.is_set_component_debug();
- if (this_present_component_debug || that_present_component_debug) {
- if (!(this_present_component_debug && that_present_component_debug))
- return false;
- if (!this.component_debug.equals(that.component_debug))
- return false;
- }
-
- boolean this_present_sched_status = true && this.is_set_sched_status();
- boolean that_present_sched_status = true && that.is_set_sched_status();
- if (this_present_sched_status || that_present_sched_status) {
- if (!(this_present_sched_status && that_present_sched_status))
- return false;
- if (!this.sched_status.equals(that.sched_status))
- return false;
- }
-
- boolean this_present_owner = true && this.is_set_owner();
- boolean that_present_owner = true && that.is_set_owner();
- if (this_present_owner || that_present_owner) {
- if (!(this_present_owner && that_present_owner))
- return false;
- if (!this.owner.equals(that.owner))
- 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;
- }
-
- boolean this_present_requested_memonheap = true && this.is_set_requested_memonheap();
- boolean that_present_requested_memonheap = true && that.is_set_requested_memonheap();
- if (this_present_requested_memonheap || that_present_requested_memonheap) {
- if (!(this_present_requested_memonheap && that_present_requested_memonheap))
- return false;
- if (this.requested_memonheap != that.requested_memonheap)
- return false;
- }
-
- boolean this_present_requested_memoffheap = true && this.is_set_requested_memoffheap();
- boolean that_present_requested_memoffheap = true && that.is_set_requested_memoffheap();
- if (this_present_requested_memoffheap || that_present_requested_memoffheap) {
- if (!(this_present_requested_memoffheap && that_present_requested_memoffheap))
- return false;
- if (this.requested_memoffheap != that.requested_memoffheap)
- return false;
- }
-
- boolean this_present_requested_cpu = true && this.is_set_requested_cpu();
- boolean that_present_requested_cpu = true && that.is_set_requested_cpu();
- if (this_present_requested_cpu || that_present_requested_cpu) {
- if (!(this_present_requested_cpu && that_present_requested_cpu))
- return false;
- if (this.requested_cpu != that.requested_cpu)
- return false;
- }
-
- boolean this_present_assigned_memonheap = true && this.is_set_assigned_memonheap();
- boolean that_present_assigned_memonheap = true && that.is_set_assigned_memonheap();
- if (this_present_assigned_memonheap || that_present_assigned_memonheap) {
- if (!(this_present_assigned_memonheap && that_present_assigned_memonheap))
- return false;
- if (this.assigned_memonheap != that.assigned_memonheap)
- return false;
- }
-
- boolean this_present_assigned_memoffheap = true && this.is_set_assigned_memoffheap();
- boolean that_present_assigned_memoffheap = true && that.is_set_assigned_memoffheap();
- if (this_present_assigned_memoffheap || that_present_assigned_memoffheap) {
- if (!(this_present_assigned_memoffheap && that_present_assigned_memoffheap))
- return false;
- if (this.assigned_memoffheap != that.assigned_memoffheap)
- return false;
- }
-
- boolean this_present_assigned_cpu = true && this.is_set_assigned_cpu();
- boolean that_present_assigned_cpu = true && that.is_set_assigned_cpu();
- if (this_present_assigned_cpu || that_present_assigned_cpu) {
- if (!(this_present_assigned_cpu && that_present_assigned_cpu))
- return false;
- if (this.assigned_cpu != that.assigned_cpu)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_id = true && (is_set_id());
- list.add(present_id);
- if (present_id)
- list.add(id);
-
- boolean present_name = true && (is_set_name());
- list.add(present_name);
- if (present_name)
- list.add(name);
-
- boolean present_uptime_secs = true;
- list.add(present_uptime_secs);
- if (present_uptime_secs)
- list.add(uptime_secs);
-
- boolean present_executors = true && (is_set_executors());
- list.add(present_executors);
- if (present_executors)
- list.add(executors);
-
- boolean present_status = true && (is_set_status());
- list.add(present_status);
- if (present_status)
- list.add(status);
-
- boolean present_errors = true && (is_set_errors());
- list.add(present_errors);
- if (present_errors)
- list.add(errors);
-
- boolean present_component_debug = true && (is_set_component_debug());
- list.add(present_component_debug);
- if (present_component_debug)
- list.add(component_debug);
-
- boolean present_sched_status = true && (is_set_sched_status());
- list.add(present_sched_status);
- if (present_sched_status)
- list.add(sched_status);
-
- boolean present_owner = true && (is_set_owner());
- list.add(present_owner);
- if (present_owner)
- list.add(owner);
-
- boolean present_replication_count = true && (is_set_replication_count());
- list.add(present_replication_count);
- if (present_replication_count)
- list.add(replication_count);
-
- boolean present_requested_memonheap = true && (is_set_requested_memonheap());
- list.add(present_requested_memonheap);
- if (present_requested_memonheap)
- list.add(requested_memonheap);
-
- boolean present_requested_memoffheap = true && (is_set_requested_memoffheap());
- list.add(present_requested_memoffheap);
- if (present_requested_memoffheap)
- list.add(requested_memoffheap);
-
- boolean present_requested_cpu = true && (is_set_requested_cpu());
- list.add(present_requested_cpu);
- if (present_requested_cpu)
- list.add(requested_cpu);
-
- boolean present_assigned_memonheap = true && (is_set_assigned_memonheap());
- list.add(present_assigned_memonheap);
- if (present_assigned_memonheap)
- list.add(assigned_memonheap);
-
- boolean present_assigned_memoffheap = true && (is_set_assigned_memoffheap());
- list.add(present_assigned_memoffheap);
- if (present_assigned_memoffheap)
- list.add(assigned_memoffheap);
-
- boolean present_assigned_cpu = true && (is_set_assigned_cpu());
- list.add(present_assigned_cpu);
- if (present_assigned_cpu)
- list.add(assigned_cpu);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(TopologyInfo other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_id()).compareTo(other.is_set_id());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_id()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
- 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_uptime_secs()).compareTo(other.is_set_uptime_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_uptime_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, other.uptime_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_executors()).compareTo(other.is_set_executors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_executors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executors, other.executors);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_status()).compareTo(other.is_set_status());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_status()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_errors()).compareTo(other.is_set_errors());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_errors()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errors, other.errors);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_component_debug()).compareTo(other.is_set_component_debug());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_component_debug()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.component_debug, other.component_debug);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_sched_status()).compareTo(other.is_set_sched_status());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_sched_status()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sched_status, other.sched_status);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_owner()).compareTo(other.is_set_owner());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_owner()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, other.owner);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_replication_count()).compareTo(other.is_set_replication_count());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_replication_count()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.replication_count, other.replication_count);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_requested_memonheap()).compareTo(other.is_set_requested_memonheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_requested_memonheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requested_memonheap, other.requested_memonheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_requested_memoffheap()).compareTo(other.is_set_requested_memoffheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_requested_memoffheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requested_memoffheap, other.requested_memoffheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_requested_cpu()).compareTo(other.is_set_requested_cpu());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_requested_cpu()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requested_cpu, other.requested_cpu);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assigned_memonheap()).compareTo(other.is_set_assigned_memonheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assigned_memonheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assigned_memonheap, other.assigned_memonheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assigned_memoffheap()).compareTo(other.is_set_assigned_memoffheap());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assigned_memoffheap()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assigned_memoffheap, other.assigned_memoffheap);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_assigned_cpu()).compareTo(other.is_set_assigned_cpu());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_assigned_cpu()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assigned_cpu, other.assigned_cpu);
- 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("TopologyInfo(");
- boolean first = true;
-
- sb.append("id:");
- if (this.id == null) {
- sb.append("null");
- } else {
- sb.append(this.id);
- }
- first = false;
- 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("uptime_secs:");
- sb.append(this.uptime_secs);
- first = false;
- if (!first) sb.append(", ");
- sb.append("executors:");
- if (this.executors == null) {
- sb.append("null");
- } else {
- sb.append(this.executors);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("status:");
- if (this.status == null) {
- sb.append("null");
- } else {
- sb.append(this.status);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("errors:");
- if (this.errors == null) {
- sb.append("null");
- } else {
- sb.append(this.errors);
- }
- first = false;
- if (is_set_component_debug()) {
- if (!first) sb.append(", ");
- sb.append("component_debug:");
- if (this.component_debug == null) {
- sb.append("null");
- } else {
- sb.append(this.component_debug);
- }
- first = false;
- }
- if (is_set_sched_status()) {
- if (!first) sb.append(", ");
- sb.append("sched_status:");
- if (this.sched_status == null) {
- sb.append("null");
- } else {
- sb.append(this.sched_status);
- }
- first = false;
- }
- if (is_set_owner()) {
- if (!first) sb.append(", ");
- sb.append("owner:");
- if (this.owner == null) {
- sb.append("null");
- } else {
- sb.append(this.owner);
- }
- first = false;
- }
- if (is_set_replication_count()) {
- if (!first) sb.append(", ");
- sb.append("replication_count:");
- sb.append(this.replication_count);
- first = false;
- }
- if (is_set_requested_memonheap()) {
- if (!first) sb.append(", ");
- sb.append("requested_memonheap:");
- sb.append(this.requested_memonheap);
- first = false;
- }
- if (is_set_requested_memoffheap()) {
- if (!first) sb.append(", ");
- sb.append("requested_memoffheap:");
- sb.append(this.requested_memoffheap);
- first = false;
- }
- if (is_set_requested_cpu()) {
- if (!first) sb.append(", ");
- sb.append("requested_cpu:");
- sb.append(this.requested_cpu);
- first = false;
- }
- if (is_set_assigned_memonheap()) {
- if (!first) sb.append(", ");
- sb.append("assigned_memonheap:");
- sb.append(this.assigned_memonheap);
- first = false;
- }
- if (is_set_assigned_memoffheap()) {
- if (!first) sb.append(", ");
- sb.append("assigned_memoffheap:");
- sb.append(this.assigned_memoffheap);
- first = false;
- }
- if (is_set_assigned_cpu()) {
- if (!first) sb.append(", ");
- sb.append("assigned_cpu:");
- sb.append(this.assigned_cpu);
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_id()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' is unset! Struct:" + toString());
- }
-
- if (!is_set_name()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' is unset! Struct:" + toString());
- }
-
- if (!is_set_uptime_secs()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString());
- }
-
- if (!is_set_executors()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'executors' is unset! Struct:" + toString());
- }
-
- if (!is_set_status()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString());
- }
-
- if (!is_set_errors()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'errors' 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 TopologyInfoStandardSchemeFactory implements SchemeFactory {
- public TopologyInfoStandardScheme getScheme() {
- return new TopologyInfoStandardScheme();
- }
- }
-
- private static class TopologyInfoStandardScheme extends StandardScheme<TopologyInfo> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, TopologyInfo 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: // ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.id = iprot.readString();
- struct.set_id_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: // UPTIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // EXECUTORS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list332 = iprot.readListBegin();
- struct.executors = new ArrayList<ExecutorSummary>(_list332.size);
- ExecutorSummary _elem333;
- for (int _i334 = 0; _i334 < _list332.size; ++_i334)
- {
- _elem333 = new ExecutorSummary();
- _elem333.read(iprot);
- struct.executors.add(_elem333);
- }
- iprot.readListEnd();
- }
- struct.set_executors_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // STATUS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.status = iprot.readString();
- struct.set_status_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // ERRORS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map335 = iprot.readMapBegin();
- struct.errors = new HashMap<String,List<ErrorInfo>>(2*_map335.size);
- String _key336;
- List<ErrorInfo> _val337;
- for (int _i338 = 0; _i338 < _map335.size; ++_i338)
- {
- _key336 = iprot.readString();
- {
- org.apache.thrift.protocol.TList _list339 = iprot.readListBegin();
- _val337 = new ArrayList<ErrorInfo>(_list339.size);
- ErrorInfo _elem340;
- for (int _i341 = 0; _i341 < _list339.size; ++_i341)
- {
- _elem340 = new ErrorInfo();
- _elem340.read(iprot);
- _val337.add(_elem340);
- }
- iprot.readListEnd();
- }
- struct.errors.put(_key336, _val337);
- }
- iprot.readMapEnd();
- }
- struct.set_errors_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // COMPONENT_DEBUG
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map342 = iprot.readMapBegin();
- struct.component_debug = new HashMap<String,DebugOptions>(2*_map342.size);
- String _key343;
- DebugOptions _val344;
- for (int _i345 = 0; _i345 < _map342.size; ++_i345)
- {
- _key343 = iprot.readString();
- _val344 = new DebugOptions();
- _val344.read(iprot);
- struct.component_debug.put(_key343, _val344);
- }
- iprot.readMapEnd();
- }
- struct.set_component_debug_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 513: // SCHED_STATUS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.sched_status = iprot.readString();
- struct.set_sched_status_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 514: // OWNER
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.owner = iprot.readString();
- struct.set_owner_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 515: // REPLICATION_COUNT
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.replication_count = iprot.readI32();
- struct.set_replication_count_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 521: // REQUESTED_MEMONHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.requested_memonheap = iprot.readDouble();
- struct.set_requested_memonheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 522: // REQUESTED_MEMOFFHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.requested_memoffheap = iprot.readDouble();
- struct.set_requested_memoffheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 523: // REQUESTED_CPU
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.requested_cpu = iprot.readDouble();
- struct.set_requested_cpu_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 524: // ASSIGNED_MEMONHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.assigned_memonheap = iprot.readDouble();
- struct.set_assigned_memonheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 525: // ASSIGNED_MEMOFFHEAP
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.assigned_memoffheap = iprot.readDouble();
- struct.set_assigned_memoffheap_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 526: // ASSIGNED_CPU
- if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
- struct.assigned_cpu = iprot.readDouble();
- struct.set_assigned_cpu_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, TopologyInfo struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.id != null) {
- oprot.writeFieldBegin(ID_FIELD_DESC);
- oprot.writeString(struct.id);
- oprot.writeFieldEnd();
- }
- if (struct.name != null) {
- oprot.writeFieldBegin(NAME_FIELD_DESC);
- oprot.writeString(struct.name);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.uptime_secs);
- oprot.writeFieldEnd();
- if (struct.executors != null) {
- oprot.writeFieldBegin(EXECUTORS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.executors.size()));
- for (ExecutorSummary _iter346 : struct.executors)
- {
- _iter346.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.status != null) {
- oprot.writeFieldBegin(STATUS_FIELD_DESC);
- oprot.writeString(struct.status);
- oprot.writeFieldEnd();
- }
- if (struct.errors != null) {
- oprot.writeFieldBegin(ERRORS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, struct.errors.size()));
- for (Map.Entry<String, List<ErrorInfo>> _iter347 : struct.errors.entrySet())
- {
- oprot.writeString(_iter347.getKey());
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter347.getValue().size()));
- for (ErrorInfo _iter348 : _iter347.getValue())
- {
- _iter348.write(oprot);
- }
- oprot.writeListEnd();
- }
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.component_debug != null) {
- if (struct.is_set_component_debug()) {
- oprot.writeFieldBegin(COMPONENT_DEBUG_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.component_debug.size()));
- for (Map.Entry<String, DebugOptions> _iter349 : struct.component_debug.entrySet())
- {
- oprot.writeString(_iter349.getKey());
- _iter349.getValue().write(oprot);
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.sched_status != null) {
- if (struct.is_set_sched_status()) {
- oprot.writeFieldBegin(SCHED_STATUS_FIELD_DESC);
- oprot.writeString(struct.sched_status);
- oprot.writeFieldEnd();
- }
- }
- if (struct.owner != null) {
- if (struct.is_set_owner()) {
- oprot.writeFieldBegin(OWNER_FIELD_DESC);
- oprot.writeString(struct.owner);
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_replication_count()) {
- oprot.writeFieldBegin(REPLICATION_COUNT_FIELD_DESC);
- oprot.writeI32(struct.replication_count);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_requested_memonheap()) {
- oprot.writeFieldBegin(REQUESTED_MEMONHEAP_FIELD_DESC);
- oprot.writeDouble(struct.requested_memonheap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_requested_memoffheap()) {
- oprot.writeFieldBegin(REQUESTED_MEMOFFHEAP_FIELD_DESC);
- oprot.writeDouble(struct.requested_memoffheap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_requested_cpu()) {
- oprot.writeFieldBegin(REQUESTED_CPU_FIELD_DESC);
- oprot.writeDouble(struct.requested_cpu);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_assigned_memonheap()) {
- oprot.writeFieldBegin(ASSIGNED_MEMONHEAP_FIELD_DESC);
- oprot.writeDouble(struct.assigned_memonheap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_assigned_memoffheap()) {
- oprot.writeFieldBegin(ASSIGNED_MEMOFFHEAP_FIELD_DESC);
- oprot.writeDouble(struct.assigned_memoffheap);
- oprot.writeFieldEnd();
- }
- if (struct.is_set_assigned_cpu()) {
- oprot.writeFieldBegin(ASSIGNED_CPU_FIELD_DESC);
- oprot.writeDouble(struct.assigned_cpu);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class TopologyInfoTupleSchemeFactory implements SchemeFactory {
- public TopologyInfoTupleScheme getScheme() {
- return new TopologyInfoTupleScheme();
- }
- }
-
- private static class TopologyInfoTupleScheme extends TupleScheme<TopologyInfo> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, TopologyInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.id);
- oprot.writeString(struct.name);
- oprot.writeI32(struct.uptime_secs);
- {
- oprot.writeI32(struct.executors.size());
- for (ExecutorSummary _iter350 : struct.executors)
- {
- _iter350.write(oprot);
- }
- }
- oprot.writeString(struct.status);
- {
- oprot.writeI32(struct.errors.size());
- for (Map.Entry<String, List<ErrorInfo>> _iter351 : struct.errors.entrySet())
- {
- oprot.writeString(_iter351.getKey());
- {
- oprot.writeI32(_iter351.getValue().size());
- for (ErrorInfo _iter352 : _iter351.getValue())
- {
- _iter352.write(oprot);
- }
- }
- }
- }
- BitSet optionals = new BitSet();
- if (struct.is_set_component_debug()) {
- optionals.set(0);
- }
- if (struct.is_set_sched_status()) {
- optionals.set(1);
- }
- if (struct.is_set_owner()) {
- optionals.set(2);
- }
- if (struct.is_set_replication_count()) {
- optionals.set(3);
- }
- if (struct.is_set_requested_memonheap()) {
- optionals.set(4);
- }
- if (struct.is_set_requested_memoffheap()) {
- optionals.set(5);
- }
- if (struct.is_set_requested_cpu()) {
- optionals.set(6);
- }
- if (struct.is_set_assigned_memonheap()) {
- optionals.set(7);
- }
- if (struct.is_set_assigned_memoffheap()) {
- optionals.set(8);
- }
- if (struct.is_set_assigned_cpu()) {
- optionals.set(9);
- }
- oprot.writeBitSet(optionals, 10);
- if (struct.is_set_component_debug()) {
- {
- oprot.writeI32(struct.component_debug.size());
- for (Map.Entry<String, DebugOptions> _iter353 : struct.component_debug.entrySet())
- {
- oprot.writeString(_iter353.getKey());
- _iter353.getValue().write(oprot);
- }
- }
- }
- if (struct.is_set_sched_status()) {
- oprot.writeString(struct.sched_status);
- }
- if (struct.is_set_owner()) {
- oprot.writeString(struct.owner);
- }
- if (struct.is_set_replication_count()) {
- oprot.writeI32(struct.replication_count);
- }
- if (struct.is_set_requested_memonheap()) {
- oprot.writeDouble(struct.requested_memonheap);
- }
- if (struct.is_set_requested_memoffheap()) {
- oprot.writeDouble(struct.requested_memoffheap);
- }
- if (struct.is_set_requested_cpu()) {
- oprot.writeDouble(struct.requested_cpu);
- }
- if (struct.is_set_assigned_memonheap()) {
- oprot.writeDouble(struct.assigned_memonheap);
- }
- if (struct.is_set_assigned_memoffheap()) {
- oprot.writeDouble(struct.assigned_memoffheap);
- }
- if (struct.is_set_assigned_cpu()) {
- oprot.writeDouble(struct.assigned_cpu);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, TopologyInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.id = iprot.readString();
- struct.set_id_isSet(true);
- struct.name = iprot.readString();
- struct.set_name_isSet(true);
- struct.uptime_secs = iprot.readI32();
- struct.set_uptime_secs_isSet(true);
- {
- org.apache.thrift.protocol.TList _list354 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.executors = new ArrayList<ExecutorSummary>(_list354.size);
- ExecutorSummary _elem355;
- for (int _i356 = 0; _i356 < _list354.size; ++_i356)
- {
- _elem355 = new ExecutorSummary();
- _elem355.read(iprot);
- struct.executors.add(_elem355);
- }
- }
- struct.set_executors_isSet(true);
- struct.status = iprot.readString();
- struct.set_status_isSet(true);
- {
- org.apache.thrift.protocol.TMap _map357 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, iprot.readI32());
- struct.errors = new HashMap<String,List<ErrorInfo>>(2*_map357.size);
- String _key358;
- List<ErrorInfo> _val359;
- for (int _i360 = 0; _i360 < _map357.size; ++_i360)
- {
- _key358 = iprot.readString();
- {
- org.apache.thrift.protocol.TList _list361 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- _val359 = new ArrayList<ErrorInfo>(_list361.size);
- ErrorInfo _elem362;
- for (int _i363 = 0; _i363 < _list361.size; ++_i363)
- {
- _elem362 = new ErrorInfo();
- _elem362.read(iprot);
- _val359.add(_elem362);
- }
- }
- struct.errors.put(_key358, _val359);
- }
- }
- struct.set_errors_isSet(true);
- BitSet incoming = iprot.readBitSet(10);
- if (incoming.get(0)) {
- {
- org.apache.thrift.protocol.TMap _map364 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.component_debug = new HashMap<String,DebugOptions>(2*_map364.size);
- String _key365;
- DebugOptions _val366;
- for (int _i367 = 0; _i367 < _map364.size; ++_i367)
- {
- _key365 = iprot.readString();
- _val366 = new DebugOptions();
- _val366.read(iprot);
- struct.component_debug.put(_key365, _val366);
- }
- }
- struct.set_component_debug_isSet(true);
- }
- if (incoming.get(1)) {
- struct.sched_status = iprot.readString();
- struct.set_sched_status_isSet(true);
- }
- if (incoming.get(2)) {
- struct.owner = iprot.readString();
- struct.set_owner_isSet(true);
- }
- if (incoming.get(3)) {
- struct.replication_count = iprot.readI32();
- struct.set_replication_count_isSet(true);
- }
- if (incoming.get(4)) {
- struct.requested_memonheap = iprot.readDouble();
- struct.set_requested_memonheap_isSet(true);
- }
- if (incoming.get(5)) {
- struct.requested_memoffheap = iprot.readDouble();
- struct.set_requested_memoffheap_isSet(true);
- }
- if (incoming.get(6)) {
- struct.requested_cpu = iprot.readDouble();
- struct.set_requested_cpu_isSet(true);
- }
- if (incoming.get(7)) {
- struct.assigned_memonheap = iprot.readDouble();
- struct.set_assigned_memonheap_isSet(true);
- }
- if (incoming.get(8)) {
- struct.assigned_memoffheap = iprot.readDouble();
- struct.set_assigned_memoffheap_isSet(true);
- }
- if (incoming.get(9)) {
- struct.assigned_cpu = iprot.readDouble();
- struct.set_assigned_cpu_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/TopologyInitialStatus.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/TopologyInitialStatus.java b/storm-core/src/jvm/backtype/storm/generated/TopologyInitialStatus.java
deleted file mode 100644
index 5cf2894..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/TopologyInitialStatus.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum TopologyInitialStatus implements org.apache.thrift.TEnum {
- ACTIVE(1),
- INACTIVE(2);
-
- private final int value;
-
- private TopologyInitialStatus(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static TopologyInitialStatus findByValue(int value) {
- switch (value) {
- case 1:
- return ACTIVE;
- case 2:
- return INACTIVE;
- default:
- return null;
- }
- }
-}
[47/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
deleted file mode 100644
index 1ad88f9..0000000
--- a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
+++ /dev/null
@@ -1,1232 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.daemon.logviewer
- (:use compojure.core)
- (:use [clojure.set :only [difference intersection]])
- (:use [clojure.string :only [blank? split]])
- (:use [hiccup core page-helpers form-helpers])
- (:use [org.apache.storm config util log timer])
- (:use [org.apache.storm.ui helpers])
- (:import [org.apache.storm.utils Utils VersionInfo])
- (:import [org.slf4j LoggerFactory])
- (:import [java.util Arrays ArrayList HashSet])
- (:import [java.util.zip GZIPInputStream])
- (:import [org.apache.logging.log4j LogManager])
- (:import [org.apache.logging.log4j.core Appender LoggerContext])
- (:import [org.apache.logging.log4j.core.appender RollingFileAppender])
- (:import [java.io BufferedInputStream File FileFilter FileInputStream
- InputStream InputStreamReader])
- (:import [java.nio.file Files Path Paths DirectoryStream])
- (:import [java.nio ByteBuffer])
- (:import [org.apache.storm.utils Utils])
- (:import [org.apache.storm.daemon DirectoryCleaner])
- (:import [org.yaml.snakeyaml Yaml]
- [org.yaml.snakeyaml.constructor SafeConstructor])
- (:import [org.apache.storm.ui InvalidRequestException]
- [org.apache.storm.security.auth AuthUtils])
- (:require [org.apache.storm.daemon common [supervisor :as supervisor]])
- (:require [compojure.route :as route]
- [compojure.handler :as handler]
- [ring.middleware.keyword-params]
- [ring.util.codec :as codec]
- [ring.util.response :as resp]
- [clojure.string :as string])
- (:require [metrics.meters :refer [defmeter mark!]])
- (:use [org.apache.storm.daemon.common :only [start-metrics-reporters]])
- (:gen-class))
-
-(def ^:dynamic *STORM-CONF* (read-storm-config))
-(def STORM-VERSION (VersionInfo/getVersion))
-
-(defmeter logviewer:num-log-page-http-requests)
-(defmeter logviewer:num-daemonlog-page-http-requests)
-(defmeter logviewer:num-download-log-file-http-requests)
-(defmeter logviewer:num-download-log-daemon-file-http-requests)
-(defmeter logviewer:num-list-logs-http-requests)
-
-(defn cleanup-cutoff-age-millis [conf now-millis]
- (- now-millis (* (conf LOGVIEWER-CLEANUP-AGE-MINS) 60 1000)))
-
-(defn get-stream-for-dir
- [^File f]
- (try (Files/newDirectoryStream (.toPath f))
- (catch Exception ex (log-error ex) nil)))
-
-(defn- last-modifiedtime-worker-logdir
- "Return the last modified time for all log files in a worker's log dir.
- Using stream rather than File.listFiles is to avoid large mem usage
- when a directory has too many files"
- [^File log-dir]
- (let [^DirectoryStream stream (get-stream-for-dir log-dir)
- dir-modified (.lastModified log-dir)
- last-modified (try (reduce
- (fn [maximum path]
- (let [curr (.lastModified (.toFile path))]
- (if (> curr maximum)
- curr
- maximum)))
- dir-modified
- stream)
- (catch Exception ex
- (log-error ex) dir-modified)
- (finally
- (if (instance? DirectoryStream stream)
- (.close stream))))]
- last-modified))
-
-(defn get-size-for-logdir
- "Return the sum of lengths for all log files in a worker's log dir.
- Using stream rather than File.listFiles is to avoid large mem usage
- when a directory has too many files"
- [log-dir]
- (let [^DirectoryStream stream (get-stream-for-dir log-dir)]
- (reduce
- (fn [sum path]
- (let [size (.length (.toFile path))]
- (+ sum size)))
- 0
- stream)))
-
-(defn mk-FileFilter-for-log-cleanup [conf now-millis]
- (let [cutoff-age-millis (cleanup-cutoff-age-millis conf now-millis)]
- (reify FileFilter (^boolean accept [this ^File file]
- (boolean (and
- (not (.isFile file))
- (<= (last-modifiedtime-worker-logdir file) cutoff-age-millis)))))))
-
-(defn select-dirs-for-cleanup [conf now-millis root-dir]
- (let [file-filter (mk-FileFilter-for-log-cleanup conf now-millis)]
- (reduce clojure.set/union
- (sorted-set)
- (for [^File topo-dir (.listFiles (File. root-dir))]
- (into [] (.listFiles topo-dir file-filter))))))
-
-(defn get-topo-port-workerlog
- "Return the path of the worker log with the format of topoId/port/worker.log.*"
- [^File file]
- (clojure.string/join file-path-separator
- (take-last 3
- (split (.getCanonicalPath file) (re-pattern file-path-separator)))))
-
-(defn get-metadata-file-for-log-root-name [root-name root-dir]
- (let [metaFile (clojure.java.io/file root-dir "metadata"
- (str root-name ".yaml"))]
- (if (.exists metaFile)
- metaFile
- (do
- (log-warn "Could not find " (.getCanonicalPath metaFile)
- " to clean up for " root-name)
- nil))))
-
-(defn get-metadata-file-for-wroker-logdir [logdir]
- (let [metaFile (clojure.java.io/file logdir "worker.yaml")]
- (if (.exists metaFile)
- metaFile
- (do
- (log-warn "Could not find " (.getCanonicalPath metaFile)
- " to clean up for " logdir)
- nil))))
-
-(defn get-worker-id-from-metadata-file [metaFile]
- (get (clojure-from-yaml-file metaFile) "worker-id"))
-
-(defn get-topo-owner-from-metadata-file [metaFile]
- (get (clojure-from-yaml-file metaFile) TOPOLOGY-SUBMITTER-USER))
-
-(defn identify-worker-log-dirs [log-dirs]
- "return the workerid to worker-log-dir map"
- (into {} (for [logdir log-dirs
- :let [metaFile (get-metadata-file-for-wroker-logdir logdir)]]
- (if metaFile
- {(get-worker-id-from-metadata-file metaFile) logdir}
- {"" logdir})))) ;; an old directory that has no yaml file will be treated as a dead dir for deleting
-
-(defn get-alive-ids
- [conf now-secs]
- (->>
- (supervisor/read-worker-heartbeats conf)
- (remove
- #(or (not (val %))
- (supervisor/is-worker-hb-timed-out? now-secs
- (val %)
- conf)))
- keys
- set))
-
-(defn get-dead-worker-dirs
- "Return a sorted set of java.io.Files that were written by workers that are
- now dead"
- [conf now-secs log-dirs]
- (if (empty? log-dirs)
- (sorted-set)
- (let [alive-ids (get-alive-ids conf now-secs)
- id->dir (identify-worker-log-dirs log-dirs)]
- (apply sorted-set
- (for [[id dir] id->dir
- :when (not (contains? alive-ids id))]
- dir)))))
-
-(defn get-all-worker-dirs [^File root-dir]
- (reduce clojure.set/union
- (sorted-set)
- (for [^File topo-dir (.listFiles root-dir)]
- (into [] (.listFiles topo-dir)))))
-
-(defn get-alive-worker-dirs
- "Return a sorted set of java.io.Files that were written by workers that are
- now active"
- [conf root-dir]
- (let [alive-ids (get-alive-ids conf (current-time-secs))
- log-dirs (get-all-worker-dirs root-dir)
- id->dir (identify-worker-log-dirs log-dirs)]
- (apply sorted-set
- (for [[id dir] id->dir
- :when (contains? alive-ids id)]
- (.getCanonicalPath dir)))))
-
-(defn get-all-logs-for-rootdir [^File log-dir]
- (reduce concat
- (for [port-dir (get-all-worker-dirs log-dir)]
- (into [] (DirectoryCleaner/getFilesForDir port-dir)))))
-
-(defn is-active-log [^File file]
- (re-find #"\.(log|err|out|current|yaml|pid)$" (.getName file)))
-
-(defn sum-file-size
- "Given a sequence of Files, sum their sizes."
- [files]
- (reduce #(+ %1 (.length %2)) 0 files))
-
-(defn per-workerdir-cleanup!
- "Delete the oldest files in each overloaded worker log dir"
- [^File root-dir size ^DirectoryCleaner cleaner]
- (dofor [worker-dir (get-all-worker-dirs root-dir)]
- (.deleteOldestWhileTooLarge cleaner (ArrayList. [worker-dir]) size true nil)))
-
-(defn global-log-cleanup!
- "Delete the oldest files in overloaded worker-artifacts globally"
- [^File root-dir size ^DirectoryCleaner cleaner]
- (let [worker-dirs (ArrayList. (get-all-worker-dirs root-dir))
- alive-worker-dirs (HashSet. (get-alive-worker-dirs *STORM-CONF* root-dir))]
- (.deleteOldestWhileTooLarge cleaner worker-dirs size false alive-worker-dirs)))
-
-(defn cleanup-empty-topodir!
- "Delete the topo dir if it contains zero port dirs"
- [^File dir]
- (let [topodir (.getParentFile dir)]
- (if (empty? (.listFiles topodir))
- (rmr (.getCanonicalPath topodir)))))
-
-(defn cleanup-fn!
- "Delete old log dirs for which the workers are no longer alive"
- [log-root-dir]
- (let [now-secs (current-time-secs)
- old-log-dirs (select-dirs-for-cleanup *STORM-CONF*
- (* now-secs 1000)
- log-root-dir)
- total-size (*STORM-CONF* LOGVIEWER-MAX-SUM-WORKER-LOGS-SIZE-MB)
- per-dir-size (*STORM-CONF* LOGVIEWER-MAX-PER-WORKER-LOGS-SIZE-MB)
- per-dir-size (min per-dir-size (* total-size 0.5))
- cleaner (DirectoryCleaner.)
- dead-worker-dirs (get-dead-worker-dirs *STORM-CONF*
- now-secs
- old-log-dirs)]
- (log-debug "log cleanup: now=" now-secs
- " old log dirs " (pr-str (map #(.getName %) old-log-dirs))
- " dead worker dirs " (pr-str
- (map #(.getName %) dead-worker-dirs)))
- (dofor [dir dead-worker-dirs]
- (let [path (.getCanonicalPath dir)]
- (log-message "Cleaning up: Removing " path)
- (try (rmr path)
- (cleanup-empty-topodir! dir)
- (catch Exception ex (log-error ex)))))
- (per-workerdir-cleanup! (File. log-root-dir) (* per-dir-size (* 1024 1024)) cleaner)
- (let [size (* total-size (* 1024 1024))]
- (global-log-cleanup! (File. log-root-dir) size cleaner))))
-
-(defn start-log-cleaner! [conf log-root-dir]
- (let [interval-secs (conf LOGVIEWER-CLEANUP-INTERVAL-SECS)]
- (when interval-secs
- (log-debug "starting log cleanup thread at interval: " interval-secs)
- (schedule-recurring (mk-timer :thread-name "logviewer-cleanup"
- :kill-fn (fn [t]
- (log-error t "Error when doing logs cleanup")
- (exit-process! 20 "Error when doing log cleanup")))
- 0 ;; Start immediately.
- interval-secs
- (fn [] (cleanup-fn! log-root-dir))))))
-
-(defn- skip-bytes
- "FileInputStream#skip may not work the first time, so ensure it successfully
- skips the given number of bytes."
- [^InputStream stream n]
- (loop [skipped 0]
- (let [skipped (+ skipped (.skip stream (- n skipped)))]
- (if (< skipped n) (recur skipped)))))
-
-(defn logfile-matches-filter?
- [log-file-name]
- (let [regex-string (str "worker.log.*")
- regex-pattern (re-pattern regex-string)]
- (not= (re-seq regex-pattern (.toString log-file-name)) nil)))
-
-(defn page-file
- ([path tail]
- (let [zip-file? (.endsWith path ".gz")
- flen (if zip-file? (Utils/zipFileSize (clojure.java.io/file path)) (.length (clojure.java.io/file path)))
- skip (- flen tail)]
- (page-file path skip tail)))
- ([path start length]
- (let [zip-file? (.endsWith path ".gz")
- flen (if zip-file? (Utils/zipFileSize (clojure.java.io/file path)) (.length (clojure.java.io/file path)))]
- (with-open [input (if zip-file? (GZIPInputStream. (FileInputStream. path)) (FileInputStream. path))
- output (java.io.ByteArrayOutputStream.)]
- (if (>= start flen)
- (throw
- (InvalidRequestException. "Cannot start past the end of the file")))
- (if (> start 0) (skip-bytes input start))
- (let [buffer (make-array Byte/TYPE 1024)]
- (loop []
- (when (< (.size output) length)
- (let [size (.read input buffer 0 (min 1024 (- length (.size output))))]
- (when (pos? size)
- (.write output buffer 0 size)
- (recur)))))
- (.toString output))))))
-
-(defn get-log-user-group-whitelist [fname]
- (let [wl-file (get-log-metadata-file fname)
- m (clojure-from-yaml-file wl-file)]
- (if (not-nil? m)
- (do
- (let [user-wl (.get m LOGS-USERS)
- user-wl (if user-wl user-wl [])
- group-wl (.get m LOGS-GROUPS)
- group-wl (if group-wl group-wl [])]
- [user-wl group-wl]))
- nil)))
-
-(def igroup-mapper (AuthUtils/GetGroupMappingServiceProviderPlugin *STORM-CONF*))
-(defn user-groups
- [user]
- (if (blank? user) [] (.getGroups igroup-mapper user)))
-
-(defn authorized-log-user? [user fname conf]
- (if (or (blank? user) (blank? fname) (nil? (get-log-user-group-whitelist fname)))
- nil
- (let [groups (user-groups user)
- [user-wl group-wl] (get-log-user-group-whitelist fname)
- logs-users (concat (conf LOGS-USERS)
- (conf NIMBUS-ADMINS)
- user-wl)
- logs-groups (concat (conf LOGS-GROUPS)
- group-wl)]
- (or (some #(= % user) logs-users)
- (< 0 (.size (intersection (set groups) (set logs-groups))))))))
-
-(defn log-root-dir
- "Given an appender name, as configured, get the parent directory of the appender's log file.
- Note that if anything goes wrong, this will throw an Error and exit."
- [appender-name]
- (let [appender (.getAppender (.getConfiguration (LogManager/getContext)) appender-name)]
- (if (and appender-name appender (instance? RollingFileAppender appender))
- (.getParent (File. (.getFileName appender)))
- (throw
- (RuntimeException. "Log viewer could not find configured appender, or the appender is not a FileAppender. Please check that the appender name configured in storm and log4j agree.")))))
-
-(defnk to-btn-link
- "Create a link that is formatted like a button"
- [url text :enabled true]
- [:a {:href (java.net.URI. url)
- :class (str "btn btn-default " (if enabled "enabled" "disabled"))} text])
-
-(defn search-file-form [fname is-daemon]
- [[:form {:action "logviewer_search.html" :id "search-box"}
- "Search this file:"
- [:input {:type "text" :name "search"}]
- [:input {:type "hidden" :name "is-daemon" :value is-daemon}]
- [:input {:type "hidden" :name "file" :value fname}]
- [:input {:type "submit" :value "Search"}]]])
-
-(defn log-file-selection-form [log-files type]
- [[:form {:action type :id "list-of-files"}
- (drop-down "file" log-files)
- [:input {:type "submit" :value "Switch file"}]]])
-
-(defn pager-links [fname start length file-size type]
- (let [prev-start (max 0 (- start length))
- next-start (if (> file-size 0)
- (min (max 0 (- file-size length)) (+ start length))
- (+ start length))]
- [[:div
- (concat
- [(to-btn-link (url (str "/" type)
- {:file fname
- :start (max 0 (- start length))
- :length length})
- "Prev" :enabled (< prev-start start))]
- [(to-btn-link (url (str "/" type)
- {:file fname
- :start 0
- :length length}) "First")]
- [(to-btn-link (url (str "/" type)
- {:file fname
- :length length})
- "Last")]
- [(to-btn-link (url (str "/" type)
- {:file fname
- :start (min (max 0 (- file-size length))
- (+ start length))
- :length length})
- "Next" :enabled (> next-start start))])]]))
-
-(defn- download-link [fname]
- [[:p (link-to (url-format "/download/%s" fname) "Download Full File")]])
-
-(defn- daemon-download-link [fname]
- [[:p (link-to (url-format "/daemondownload/%s" fname) "Download Full File")]])
-
-(defn- is-txt-file [fname]
- (re-find #"\.(log.*|txt|yaml|pid)$" fname))
-
-(def default-bytes-per-page 51200)
-
-(defn log-page [fname start length grep user root-dir]
- (if (or (blank? (*STORM-CONF* UI-FILTER))
- (authorized-log-user? user fname *STORM-CONF*))
- (let [file (.getCanonicalFile (File. root-dir fname))
- path (.getCanonicalPath file)
- zip-file? (.endsWith path ".gz")
- topo-dir (.getParentFile (.getParentFile file))]
- (if (and (.exists file)
- (= (.getCanonicalFile (File. root-dir))
- (.getParentFile topo-dir)))
- (let [file-length (if zip-file? (Utils/zipFileSize (clojure.java.io/file path)) (.length (clojure.java.io/file path)))
- log-files (reduce clojure.set/union
- (sorted-set)
- (for [^File port-dir (.listFiles topo-dir)]
- (into [] (filter #(.isFile %) (DirectoryCleaner/getFilesForDir port-dir))))) ;all types of files included
- files-str (for [file log-files]
- (get-topo-port-workerlog file))
- reordered-files-str (conj (filter #(not= fname %) files-str) fname)
- length (if length
- (min 10485760 length)
- default-bytes-per-page)
- log-string (escape-html
- (if (is-txt-file fname)
- (if start
- (page-file path start length)
- (page-file path length))
- "This is a binary file and cannot display! You may download the full file."))
- start (or start (- file-length length))]
- (if grep
- (html [:pre#logContent
- (if grep
- (->> (.split log-string "\n")
- (filter #(.contains % grep))
- (string/join "\n"))
- log-string)])
- (let [pager-data (if (is-txt-file fname) (pager-links fname start length file-length "log") nil)]
- (html (concat (search-file-form fname "no")
- (log-file-selection-form reordered-files-str "log") ; list all files for this topology
- pager-data
- (download-link fname)
- [[:pre#logContent log-string]]
- pager-data)))))
- (-> (resp/response "Page not found")
- (resp/status 404))))
- (if (nil? (get-log-user-group-whitelist fname))
- (-> (resp/response "Page not found")
- (resp/status 404))
- (unauthorized-user-html user))))
-
-(defn daemonlog-page [fname start length grep user root-dir]
- (let [file (.getCanonicalFile (File. root-dir fname))
- file-length (.length file)
- path (.getCanonicalPath file)
- zip-file? (.endsWith path ".gz")]
- (if (and (= (.getCanonicalFile (File. root-dir))
- (.getParentFile file))
- (.exists file))
- (let [file-length (if zip-file? (Utils/zipFileSize (clojure.java.io/file path)) (.length (clojure.java.io/file path)))
- length (if length
- (min 10485760 length)
- default-bytes-per-page)
- log-files (into [] (filter #(.isFile %) (.listFiles (File. root-dir)))) ;all types of files included
- files-str (for [file log-files]
- (.getName file))
- reordered-files-str (conj (filter #(not= fname %) files-str) fname)
- log-string (escape-html
- (if (is-txt-file fname)
- (if start
- (page-file path start length)
- (page-file path length))
- "This is a binary file and cannot display! You may download the full file."))
- start (or start (- file-length length))]
- (if grep
- (html [:pre#logContent
- (if grep
- (->> (.split log-string "\n")
- (filter #(.contains % grep))
- (string/join "\n"))
- log-string)])
- (let [pager-data (if (is-txt-file fname) (pager-links fname start length file-length "daemonlog") nil)]
- (html (concat (search-file-form fname "yes")
- (log-file-selection-form reordered-files-str "daemonlog") ; list all daemon logs
- pager-data
- (daemon-download-link fname)
- [[:pre#logContent log-string]]
- pager-data)))))
- (-> (resp/response "Page not found")
- (resp/status 404)))))
-
-(defnk download-log-file [fname req resp user ^String root-dir :is-daemon false]
- (let [file (.getCanonicalFile (File. root-dir fname))]
- (if (.exists file)
-
- (if (or is-daemon
- (or (blank? (*STORM-CONF* UI-FILTER))
- (authorized-log-user? user fname *STORM-CONF*)))
- (-> (resp/response file)
- (resp/content-type "application/octet-stream"))
- (unauthorized-user-html user))
- (-> (resp/response "Page not found")
- (resp/status 404)))))
-
-(def grep-max-search-size 1024)
-(def grep-buf-size 2048)
-(def grep-context-size 128)
-
-(defn logviewer-port
- []
- (int (*STORM-CONF* LOGVIEWER-PORT)))
-
-(defn url-to-match-centered-in-log-page
- [needle fname offset port]
- (let [host (local-hostname)
- port (logviewer-port)
- fname (clojure.string/join file-path-separator (take-last 3 (split fname (re-pattern file-path-separator))))]
- (url (str "http://" host ":" port "/log")
- {:file fname
- :start (max 0
- (- offset
- (int (/ default-bytes-per-page 2))
- (int (/ (alength needle) -2)))) ;; Addition
- :length default-bytes-per-page})))
-
-(defn url-to-match-centered-in-log-page-daemon-file
- [needle fname offset port]
- (let [host (local-hostname)
- port (logviewer-port)
- fname (clojure.string/join file-path-separator (take-last 1 (split fname (re-pattern file-path-separator))))]
- (url (str "http://" host ":" port "/daemonlog")
- {:file fname
- :start (max 0
- (- offset
- (int (/ default-bytes-per-page 2))
- (int (/ (alength needle) -2)))) ;; Addition
- :length default-bytes-per-page})))
-
-(defnk mk-match-data
- [^bytes needle ^ByteBuffer haystack haystack-offset file-offset fname
- :is-daemon false :before-bytes nil :after-bytes nil]
- (let [url (if is-daemon
- (url-to-match-centered-in-log-page-daemon-file needle
- fname
- file-offset
- (*STORM-CONF* LOGVIEWER-PORT))
- (url-to-match-centered-in-log-page needle
- fname
- file-offset
- (*STORM-CONF* LOGVIEWER-PORT)))
- haystack-bytes (.array haystack)
- before-string (if (>= haystack-offset grep-context-size)
- (String. haystack-bytes
- (- haystack-offset grep-context-size)
- grep-context-size
- "UTF-8")
- (let [num-desired (max 0 (- grep-context-size
- haystack-offset))
- before-size (if before-bytes
- (alength before-bytes)
- 0)
- num-expected (min before-size num-desired)]
- (if (pos? num-expected)
- (str (String. before-bytes
- (- before-size num-expected)
- num-expected
- "UTF-8")
- (String. haystack-bytes
- 0
- haystack-offset
- "UTF-8"))
- (String. haystack-bytes
- 0
- haystack-offset
- "UTF-8"))))
- after-string (let [needle-size (alength needle)
- after-offset (+ haystack-offset needle-size)
- haystack-size (.limit haystack)]
- (if (< (+ after-offset grep-context-size) haystack-size)
- (String. haystack-bytes
- after-offset
- grep-context-size
- "UTF-8")
- (let [num-desired (- grep-context-size
- (- haystack-size after-offset))
- after-size (if after-bytes
- (alength after-bytes)
- 0)
- num-expected (min after-size num-desired)]
- (if (pos? num-expected)
- (str (String. haystack-bytes
- after-offset
- (- haystack-size after-offset)
- "UTF-8")
- (String. after-bytes 0 num-expected "UTF-8"))
- (String. haystack-bytes
- after-offset
- (- haystack-size after-offset)
- "UTF-8")))))]
- {"byteOffset" file-offset
- "beforeString" before-string
- "afterString" after-string
- "matchString" (String. needle "UTF-8")
- "logviewerURL" url}))
-
-(defn- try-read-ahead!
- "Tries once to read ahead in the stream to fill the context and resets the
- stream to its position before the call."
- [^BufferedInputStream stream haystack offset file-len bytes-read]
- (let [num-expected (min (- file-len bytes-read)
- grep-context-size)
- after-bytes (byte-array num-expected)]
- (.mark stream num-expected)
- ;; Only try reading once.
- (.read stream after-bytes 0 num-expected)
- (.reset stream)
- after-bytes))
-
-(defn offset-of-bytes
- "Searches a given byte array for a match of a sub-array of bytes. Returns
- the offset to the byte that matches, or -1 if no match was found."
- [^bytes buf ^bytes value init-offset]
- {:pre [(> (alength value) 0)
- (not (neg? init-offset))]}
- (loop [offset init-offset
- candidate-offset init-offset
- val-offset 0]
- (if-not (pos? (- (alength value) val-offset))
- ;; Found
- candidate-offset
- (if (>= offset (alength buf))
- ;; We ran out of buffer for the search.
- -1
- (if (not= (aget value val-offset) (aget buf offset))
- ;; The match at this candidate offset failed, so start over with the
- ;; next candidate byte from the buffer.
- (let [new-offset (inc candidate-offset)]
- (recur new-offset new-offset 0))
- ;; So far it matches. Keep going...
- (recur (inc offset) candidate-offset (inc val-offset)))))))
-
-(defn- buffer-substring-search!
- "As the file is read into a buffer, 1/2 the buffer's size at a time, we
- search the buffer for matches of the substring and return a list of zero or
- more matches."
- [is-daemon file file-len offset-to-buf init-buf-offset stream bytes-skipped
- bytes-read ^ByteBuffer haystack ^bytes needle initial-matches num-matches
- ^bytes before-bytes]
- (loop [buf-offset init-buf-offset
- matches initial-matches]
- (let [offset (offset-of-bytes (.array haystack) needle buf-offset)]
- (if (and (< (count matches) num-matches) (not (neg? offset)))
- (let [file-offset (+ offset-to-buf offset)
- bytes-needed-after-match (- (.limit haystack)
- grep-context-size
- (alength needle))
- before-arg (if (< offset grep-context-size) before-bytes)
- after-arg (if (> offset bytes-needed-after-match)
- (try-read-ahead! stream
- haystack
- offset
- file-len
- bytes-read))]
- (recur (+ offset (alength needle))
- (conj matches
- (mk-match-data needle
- haystack
- offset
- file-offset
- (.getCanonicalPath file)
- :is-daemon is-daemon
- :before-bytes before-arg
- :after-bytes after-arg))))
- (let [before-str-to-offset (min (.limit haystack)
- grep-max-search-size)
- before-str-from-offset (max 0 (- before-str-to-offset
- grep-context-size))
- new-before-bytes (Arrays/copyOfRange (.array haystack)
- before-str-from-offset
- before-str-to-offset)
- ;; It's OK if new-byte-offset is negative. This is normal if
- ;; we are out of bytes to read from a small file.
- new-byte-offset (if (>= (count matches) num-matches)
- (+ (get (last matches) "byteOffset")
- (alength needle))
- (+ bytes-skipped
- bytes-read
- (- grep-max-search-size)))]
- [matches new-byte-offset new-before-bytes])))))
-
-(defn- mk-grep-response
- "This response data only includes a next byte offset if there is more of the
- file to read."
- [search-bytes offset matches next-byte-offset]
- (merge {"searchString" (String. search-bytes "UTF-8")
- "startByteOffset" offset
- "matches" matches}
- (and next-byte-offset {"nextByteOffset" next-byte-offset})))
-
-(defn rotate-grep-buffer!
- [^ByteBuffer buf ^BufferedInputStream stream total-bytes-read file file-len]
- (let [buf-arr (.array buf)]
- ;; Copy the 2nd half of the buffer to the first half.
- (System/arraycopy buf-arr
- grep-max-search-size
- buf-arr
- 0
- grep-max-search-size)
- ;; Zero-out the 2nd half to prevent accidental matches.
- (Arrays/fill buf-arr
- grep-max-search-size
- (count buf-arr)
- (byte 0))
- ;; Fill the 2nd half with new bytes from the stream.
- (let [bytes-read (.read stream
- buf-arr
- grep-max-search-size
- (min file-len grep-max-search-size))]
- (.limit buf (+ grep-max-search-size bytes-read))
- (swap! total-bytes-read + bytes-read))))
-
-(defnk substring-search
- "Searches for a substring in a log file, starting at the given offset,
- returning the given number of matches, surrounded by the given number of
- context lines. Other information is included to be useful for progressively
- searching through a file for display in a UI. The search string must
- grep-max-search-size bytes or fewer when decoded with UTF-8."
- [file ^String search-string :is-daemon false :num-matches 10 :start-byte-offset 0]
- {:pre [(not (empty? search-string))
- (<= (count (.getBytes search-string "UTF-8")) grep-max-search-size)]}
- (let [zip-file? (.endsWith (.getName file) ".gz")
- f-input-steam (FileInputStream. file)
- gzipped-input-stream (if zip-file?
- (GZIPInputStream. f-input-steam)
- f-input-steam)
- stream ^BufferedInputStream (BufferedInputStream.
- gzipped-input-stream)
- file-len (if zip-file? (Utils/zipFileSize file) (.length file))
- buf ^ByteBuffer (ByteBuffer/allocate grep-buf-size)
- buf-arr ^bytes (.array buf)
- string nil
- total-bytes-read (atom 0)
- matches []
- search-bytes ^bytes (.getBytes search-string "UTF-8")
- num-matches (or num-matches 10)
- start-byte-offset (or start-byte-offset 0)]
- ;; Start at the part of the log file we are interested in.
- ;; Allow searching when start-byte-offset == file-len so it doesn't blow up on 0-length files
- (if (> start-byte-offset file-len)
- (throw
- (InvalidRequestException. "Cannot search past the end of the file")))
- (when (> start-byte-offset 0)
- (skip-bytes stream start-byte-offset))
- (java.util.Arrays/fill buf-arr (byte 0))
- (let [bytes-read (.read stream buf-arr 0 (min file-len grep-buf-size))]
- (.limit buf bytes-read)
- (swap! total-bytes-read + bytes-read))
- (loop [initial-matches []
- init-buf-offset 0
- byte-offset start-byte-offset
- before-bytes nil]
- (let [[matches new-byte-offset new-before-bytes]
- (buffer-substring-search!
- is-daemon
- file
- file-len
- byte-offset
- init-buf-offset
- stream
- start-byte-offset
- @total-bytes-read
- buf
- search-bytes
- initial-matches
- num-matches
- before-bytes)]
- (if (and (< (count matches) num-matches)
- (< (+ @total-bytes-read start-byte-offset) file-len))
- (let [;; The start index is positioned to find any possible
- ;; occurrence search string that did not quite fit in the
- ;; buffer on the previous read.
- new-buf-offset (- (min (.limit ^ByteBuffer buf)
- grep-max-search-size)
- (alength search-bytes))]
- (rotate-grep-buffer! buf stream total-bytes-read file file-len)
- (when (< @total-bytes-read 0)
- (throw (InvalidRequestException. "Cannot search past the end of the file")))
- (recur matches
- new-buf-offset
- new-byte-offset
- new-before-bytes))
- (merge {"isDaemon" (if is-daemon "yes" "no")}
- (mk-grep-response search-bytes
- start-byte-offset
- matches
- (if-not (and (< (count matches) num-matches)
- (>= @total-bytes-read file-len))
- (let [next-byte-offset (+ (get (last matches)
- "byteOffset")
- (alength search-bytes))]
- (if (> file-len next-byte-offset)
- next-byte-offset))))))))))
-
-(defn- try-parse-int-param
- [nam value]
- (try
- (Integer/parseInt value)
- (catch java.lang.NumberFormatException e
- (->
- (str "Could not parse " nam " to an integer")
- (InvalidRequestException. e)
- throw))))
-
-(defn search-log-file
- [fname user ^String root-dir is-daemon search num-matches offset callback origin]
- (let [file (.getCanonicalFile (File. root-dir fname))]
- (if (.exists file)
- (if (or is-daemon
- (or (blank? (*STORM-CONF* UI-FILTER))
- (authorized-log-user? user fname *STORM-CONF*)))
- (let [num-matches-int (if num-matches
- (try-parse-int-param "num-matches"
- num-matches))
- offset-int (if offset
- (try-parse-int-param "start-byte-offset" offset))]
- (try
- (if (and (not (empty? search))
- <= (count (.getBytes search "UTF-8")) grep-max-search-size)
- (json-response
- (merge {"isDaemon" (if is-daemon "yes" "no")}
- (substring-search file
- search
- :is-daemon is-daemon
- :num-matches num-matches-int
- :start-byte-offset offset-int))
-
- callback
- :headers {"Access-Control-Allow-Origin" origin
- "Access-Control-Allow-Credentials" "true"})
- (throw
- (InvalidRequestException.
- (str "Search substring must be between 1 and 1024 UTF-8 "
- "bytes in size (inclusive)"))))
- (catch Exception ex
- (json-response (exception->json ex) callback :status 500))))
- (json-response (unauthorized-user-json user) callback :status 401))
- (json-response {"error" "Not Found"
- "errorMessage" "The file was not found on this node."}
- callback
- :status 404))))
-
-(defn find-n-matches [logs n file-offset offset search]
- (let [logs (drop file-offset logs)
- wrap-matches-fn (fn [matches]
- {"fileOffset" file-offset
- "searchString" search
- "matches" matches})]
- (loop [matches []
- logs logs
- offset offset
- file-offset file-offset
- match-count 0]
- (if (empty? logs)
- (wrap-matches-fn matches)
- (let [these-matches (try
- (log-debug "Looking through " (first logs))
- (substring-search (first logs)
- search
- :num-matches (- n match-count)
- :start-byte-offset offset)
- (catch InvalidRequestException e
- (log-error e "Can't search past end of file.")
- {}))
- file-name (get-topo-port-workerlog (first logs))
- new-matches (conj matches
- (merge these-matches
- { "fileName" file-name
- "port" (first (take-last 2 (split (.getCanonicalPath (first logs)) (re-pattern file-path-separator))))}))
- new-count (+ match-count (count (these-matches "matches")))]
- (if (empty? these-matches)
- (recur matches (rest logs) 0 (+ file-offset 1) match-count)
- (if (>= new-count n)
- (wrap-matches-fn new-matches)
- (recur new-matches (rest logs) 0 (+ file-offset 1) new-count))))))))
-
-(defn logs-for-port
- "Get the filtered, authorized, sorted log files for a port."
- [user port-dir]
- (let [filter-authorized-fn (fn [user logs]
- (filter #(or
- (blank? (*STORM-CONF* UI-FILTER))
- (authorized-log-user? user (get-topo-port-workerlog %) *STORM-CONF*)) logs))]
- (sort #(compare (.lastModified %2) (.lastModified %1))
- (filter-authorized-fn
- user
- (filter #(re-find worker-log-filename-pattern (.getName %)) (DirectoryCleaner/getFilesForDir port-dir))))))
-
-(defn deep-search-logs-for-topology
- [topology-id user ^String root-dir search num-matches port file-offset offset search-archived? callback origin]
- (json-response
- (if (or (not search) (not (.exists (File. (str root-dir file-path-separator topology-id)))))
- []
- (let [file-offset (if file-offset (Integer/parseInt file-offset) 0)
- offset (if offset (Integer/parseInt offset) 0)
- num-matches (or (Integer/parseInt num-matches) 1)
- port-dirs (vec (.listFiles (File. (str root-dir file-path-separator topology-id))))
- logs-for-port-fn (partial logs-for-port user)]
- (if (or (not port) (= "*" port))
- ;; Check for all ports
- (let [filtered-logs (filter (comp not empty?) (map logs-for-port-fn port-dirs))]
- (if search-archived?
- (map #(find-n-matches % num-matches 0 0 search)
- filtered-logs)
- (map #(find-n-matches % num-matches 0 0 search)
- (map (comp vector first) filtered-logs))))
- ;; Check just the one port
- (if (not (contains? (into #{} (map str (*STORM-CONF* SUPERVISOR-SLOTS-PORTS))) port))
- []
- (let [port-dir (File. (str root-dir file-path-separator topology-id file-path-separator port))]
- (if (or (not (.exists port-dir)) (empty? (logs-for-port user port-dir)))
- []
- (let [filtered-logs (logs-for-port user port-dir)]
- (if search-archived?
- (find-n-matches filtered-logs num-matches file-offset offset search)
- (find-n-matches [(first filtered-logs)] num-matches 0 offset search)))))))))
- callback
- :headers {"Access-Control-Allow-Origin" origin
- "Access-Control-Allow-Credentials" "true"}))
-
-(defn log-template
- ([body] (log-template body nil nil))
- ([body fname user]
- (html4
- [:head
- [:title (str (escape-html fname) " - Storm Log Viewer")]
- (include-css "/css/bootstrap-3.3.1.min.css")
- (include-css "/css/jquery.dataTables.1.10.4.min.css")
- (include-css "/css/style.css")
- ]
- [:body
- (concat
- (when (not (blank? user)) [[:div.ui-user [:p "User: " user]]])
- [[:div.ui-note [:p "Note: the drop-list shows at most 1024 files for each worker directory."]]]
- [[:h3 (escape-html fname)]]
- (seq body))
- ])))
-
-(def http-creds-handler (AuthUtils/GetUiHttpCredentialsPlugin *STORM-CONF*))
-
-(defn- parse-long-from-map [m k]
- (try
- (Long/parseLong (k m))
- (catch NumberFormatException ex
- (throw (InvalidRequestException.
- (str "Could not make an integer out of the query parameter '"
- (name k) "'")
- ex)))))
-
-(defn list-log-files
- [user topoId port log-root callback origin]
- (let [file-results
- (if (nil? topoId)
- (if (nil? port)
- (get-all-logs-for-rootdir (File. log-root))
- (reduce concat
- (for [topo-dir (.listFiles (File. log-root))]
- (reduce concat
- (for [port-dir (.listFiles topo-dir)]
- (if (= (str port) (.getName port-dir))
- (into [] (DirectoryCleaner/getFilesForDir port-dir))))))))
- (if (nil? port)
- (let [topo-dir (File. (str log-root file-path-separator topoId))]
- (if (.exists topo-dir)
- (reduce concat
- (for [port-dir (.listFiles topo-dir)]
- (into [] (DirectoryCleaner/getFilesForDir port-dir))))
- []))
- (let [port-dir (get-worker-dir-from-root log-root topoId port)]
- (if (.exists port-dir)
- (into [] (DirectoryCleaner/getFilesForDir port-dir))
- []))))
- file-strs (sort (for [file file-results]
- (get-topo-port-workerlog file)))]
- (json-response file-strs
- callback
- :headers {"Access-Control-Allow-Origin" origin
- "Access-Control-Allow-Credentials" "true"})))
-
-(defn get-profiler-dump-files
- [dir]
- (filter (comp not nil?)
- (for [f (DirectoryCleaner/getFilesForDir dir)]
- (let [name (.getName f)]
- (if (or
- (.endsWith name ".txt")
- (.endsWith name ".jfr")
- (.endsWith name ".bin"))
- (.getName f))))))
-
-(defroutes log-routes
- (GET "/log" [:as req & m]
- (try
- (mark! logviewer:num-log-page-http-requests)
- (let [servlet-request (:servlet-request req)
- log-root (:log-root req)
- user (.getUserName http-creds-handler servlet-request)
- start (if (:start m) (parse-long-from-map m :start))
- length (if (:length m) (parse-long-from-map m :length))
- file (url-decode (:file m))]
- (log-template (log-page file start length (:grep m) user log-root)
- file user))
- (catch InvalidRequestException ex
- (log-error ex)
- (ring-response-from-exception ex))))
- (GET "/dumps/:topo-id/:host-port/:filename"
- [:as {:keys [servlet-request servlet-response log-root]} topo-id host-port filename &m]
- (let [user (.getUserName http-creds-handler servlet-request)
- port (second (split host-port #":"))
- dir (File. (str log-root
- file-path-separator
- topo-id
- file-path-separator
- port))
- file (File. (str log-root
- file-path-separator
- topo-id
- file-path-separator
- port
- file-path-separator
- filename))]
- (if (and (.exists dir) (.exists file))
- (if (or (blank? (*STORM-CONF* UI-FILTER))
- (authorized-log-user? user
- (str topo-id file-path-separator port file-path-separator "worker.log")
- *STORM-CONF*))
- (-> (resp/response file)
- (resp/content-type "application/octet-stream"))
- (unauthorized-user-html user))
- (-> (resp/response "Page not found")
- (resp/status 404)))))
- (GET "/dumps/:topo-id/:host-port"
- [:as {:keys [servlet-request servlet-response log-root]} topo-id host-port &m]
- (let [user (.getUserName http-creds-handler servlet-request)
- port (second (split host-port #":"))
- dir (File. (str log-root
- file-path-separator
- topo-id
- file-path-separator
- port))]
- (if (.exists dir)
- (if (or (blank? (*STORM-CONF* UI-FILTER))
- (authorized-log-user? user
- (str topo-id file-path-separator port file-path-separator "worker.log")
- *STORM-CONF*))
- (html4
- [:head
- [:title "File Dumps - Storm Log Viewer"]
- (include-css "/css/bootstrap-3.3.1.min.css")
- (include-css "/css/jquery.dataTables.1.10.4.min.css")
- (include-css "/css/style.css")]
- [:body
- [:ul
- (for [file (get-profiler-dump-files dir)]
- [:li
- [:a {:href (str "/dumps/" topo-id "/" host-port "/" file)} file ]])]])
- (unauthorized-user-html user))
- (-> (resp/response "Page not found")
- (resp/status 404)))))
- (GET "/daemonlog" [:as req & m]
- (try
- (mark! logviewer:num-daemonlog-page-http-requests)
- (let [servlet-request (:servlet-request req)
- daemonlog-root (:daemonlog-root req)
- user (.getUserName http-creds-handler servlet-request)
- start (if (:start m) (parse-long-from-map m :start))
- length (if (:length m) (parse-long-from-map m :length))
- file (url-decode (:file m))]
- (log-template (daemonlog-page file start length (:grep m) user daemonlog-root)
- file user))
- (catch InvalidRequestException ex
- (log-error ex)
- (ring-response-from-exception ex))))
- (GET "/download/:file" [:as {:keys [servlet-request servlet-response log-root]} file & m]
- (try
- (mark! logviewer:num-download-log-file-http-requests)
- (let [user (.getUserName http-creds-handler servlet-request)]
- (download-log-file file servlet-request servlet-response user log-root))
- (catch InvalidRequestException ex
- (log-error ex)
- (ring-response-from-exception ex))))
- (GET "/daemondownload/:file" [:as {:keys [servlet-request servlet-response daemonlog-root]} file & m]
- (try
- (mark! logviewer:num-download-log-daemon-file-http-requests)
- (let [user (.getUserName http-creds-handler servlet-request)]
- (download-log-file file servlet-request servlet-response user daemonlog-root :is-daemon true))
- (catch InvalidRequestException ex
- (log-error ex)
- (ring-response-from-exception ex))))
- (GET "/search/:file" [:as {:keys [servlet-request servlet-response log-root daemonlog-root]} file & m]
- ;; We do not use servlet-response here, but do not remove it from the
- ;; :keys list, or this rule could stop working when an authentication
- ;; filter is configured.
- (try
- (let [user (.getUserName http-creds-handler servlet-request)
- is-daemon (= (:is-daemon m) "yes")]
- (search-log-file (url-decode file)
- user
- (if is-daemon daemonlog-root log-root)
- is-daemon
- (:search-string m)
- (:num-matches m)
- (:start-byte-offset m)
- (:callback m)
- (.getHeader servlet-request "Origin")))
- (catch InvalidRequestException ex
- (log-error ex)
- (json-response (exception->json ex) (:callback m) :status 400))))
- (GET "/deepSearch/:topo-id" [:as {:keys [servlet-request servlet-response log-root]} topo-id & m]
- ;; We do not use servlet-response here, but do not remove it from the
- ;; :keys list, or this rule could stop working when an authentication
- ;; filter is configured.
- (try
- (let [user (.getUserName http-creds-handler servlet-request)]
- (deep-search-logs-for-topology topo-id
- user
- log-root
- (:search-string m)
- (:num-matches m)
- (:port m)
- (:start-file-offset m)
- (:start-byte-offset m)
- (:search-archived m)
- (:callback m)
- (.getHeader servlet-request "Origin")))
- (catch InvalidRequestException ex
- (log-error ex)
- (json-response (exception->json ex) (:callback m) :status 400))))
- (GET "/searchLogs" [:as req & m]
- (try
- (let [servlet-request (:servlet-request req)
- user (.getUserName http-creds-handler servlet-request)]
- (list-log-files user
- (:topoId m)
- (:port m)
- (:log-root req)
- (:callback m)
- (.getHeader servlet-request "Origin")))
- (catch InvalidRequestException ex
- (log-error ex)
- (json-response (exception->json ex) (:callback m) :status 400))))
- (GET "/listLogs" [:as req & m]
- (try
- (mark! logviewer:num-list-logs-http-requests)
- (let [servlet-request (:servlet-request req)
- user (.getUserName http-creds-handler servlet-request)]
- (list-log-files user
- (:topoId m)
- (:port m)
- (:log-root req)
- (:callback m)
- (.getHeader servlet-request "Origin")))
- (catch InvalidRequestException ex
- (log-error ex)
- (json-response (exception->json ex) (:callback m) :status 400))))
- (route/resources "/")
- (route/not-found "Page not found"))
-
-(defn conf-middleware
- "For passing the storm configuration with each request."
- [app log-root daemonlog-root]
- (fn [req]
- (app (assoc req :log-root log-root :daemonlog-root daemonlog-root))))
-
-(defn start-logviewer! [conf log-root-dir daemonlog-root-dir]
- (try
- (let [header-buffer-size (int (.get conf UI-HEADER-BUFFER-BYTES))
- filter-class (conf UI-FILTER)
- filter-params (conf UI-FILTER-PARAMS)
- logapp (handler/api (-> log-routes
- requests-middleware)) ;; query params as map
- middle (conf-middleware logapp log-root-dir daemonlog-root-dir)
- filters-confs (if (conf UI-FILTER)
- [{:filter-class filter-class
- :filter-params (or (conf UI-FILTER-PARAMS) {})}]
- [])
- filters-confs (concat filters-confs
- [{:filter-class "org.eclipse.jetty.servlets.GzipFilter"
- :filter-name "Gzipper"
- :filter-params {}}])
- https-port (int (or (conf LOGVIEWER-HTTPS-PORT) 0))
- keystore-path (conf LOGVIEWER-HTTPS-KEYSTORE-PATH)
- keystore-pass (conf LOGVIEWER-HTTPS-KEYSTORE-PASSWORD)
- keystore-type (conf LOGVIEWER-HTTPS-KEYSTORE-TYPE)
- key-password (conf LOGVIEWER-HTTPS-KEY-PASSWORD)
- truststore-path (conf LOGVIEWER-HTTPS-TRUSTSTORE-PATH)
- truststore-password (conf LOGVIEWER-HTTPS-TRUSTSTORE-PASSWORD)
- truststore-type (conf LOGVIEWER-HTTPS-TRUSTSTORE-TYPE)
- want-client-auth (conf LOGVIEWER-HTTPS-WANT-CLIENT-AUTH)
- need-client-auth (conf LOGVIEWER-HTTPS-NEED-CLIENT-AUTH)]
- (storm-run-jetty {:port (int (conf LOGVIEWER-PORT))
- :configurator (fn [server]
- (config-ssl server
- https-port
- keystore-path
- keystore-pass
- keystore-type
- key-password
- truststore-path
- truststore-password
- truststore-type
- want-client-auth
- need-client-auth)
- (config-filter server middle filters-confs))}))
- (catch Exception ex
- (log-error ex))))
-
-(defn -main []
- (let [conf (read-storm-config)
- log-root (worker-artifacts-root conf)
- daemonlog-root (log-root-dir (conf LOGVIEWER-APPENDER-NAME))]
- (setup-default-uncaught-exception-handler)
- (start-log-cleaner! conf log-root)
- (log-message "Starting logviewer server for storm version '"
- STORM-VERSION
- "'")
- (start-logviewer! conf log-root daemonlog-root)
- (start-metrics-reporters conf)))
[44/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/daemon/worker.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/worker.clj b/storm-core/src/clj/backtype/storm/daemon/worker.clj
deleted file mode 100644
index 1326672..0000000
--- a/storm-core/src/clj/backtype/storm/daemon/worker.clj
+++ /dev/null
@@ -1,768 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.daemon.worker
- (:use [org.apache.storm.daemon common])
- (:use [org.apache.storm config log util timer local-state])
- (:require [clj-time.core :as time])
- (:require [clj-time.coerce :as coerce])
- (:require [org.apache.storm.daemon [executor :as executor]])
- (:require [org.apache.storm [disruptor :as disruptor] [cluster :as cluster]])
- (:require [clojure.set :as set])
- (:require [org.apache.storm.messaging.loader :as msg-loader])
- (:import [java.util.concurrent Executors]
- [org.apache.storm.hooks IWorkerHook BaseWorkerHook])
- (:import [java.util ArrayList HashMap])
- (:import [org.apache.storm.utils Utils TransferDrainer ThriftTopologyUtils WorkerBackpressureThread DisruptorQueue])
- (:import [org.apache.storm.grouping LoadMapping])
- (:import [org.apache.storm.messaging TransportFactory])
- (:import [org.apache.storm.messaging TaskMessage IContext IConnection ConnectionWithStatus ConnectionWithStatus$Status])
- (:import [org.apache.storm.daemon Shutdownable])
- (:import [org.apache.storm.serialization KryoTupleSerializer])
- (:import [org.apache.storm.generated StormTopology])
- (:import [org.apache.storm.tuple AddressedTuple Fields])
- (:import [org.apache.storm.task WorkerTopologyContext])
- (:import [org.apache.storm Constants])
- (:import [org.apache.storm.security.auth AuthUtils])
- (:import [org.apache.storm.cluster ClusterStateContext DaemonType])
- (:import [javax.security.auth Subject])
- (:import [java.security PrivilegedExceptionAction])
- (:import [org.apache.logging.log4j LogManager])
- (:import [org.apache.logging.log4j Level])
- (:import [org.apache.logging.log4j.core.config LoggerConfig])
- (:import [org.apache.storm.generated LogConfig LogLevelAction])
- (:gen-class))
-
-(defmulti mk-suicide-fn cluster-mode)
-
-(defn read-worker-executors [storm-conf storm-cluster-state storm-id assignment-id port assignment-versions]
- (log-message "Reading Assignments.")
- (let [assignment (:executor->node+port (.assignment-info storm-cluster-state storm-id nil))]
- (doall
- (concat
- [Constants/SYSTEM_EXECUTOR_ID]
- (mapcat (fn [[executor loc]]
- (if (= loc [assignment-id port])
- [executor]
- ))
- assignment)))))
-
-(defnk do-executor-heartbeats [worker :executors nil]
- ;; stats is how we know what executors are assigned to this worker
- (let [stats (if-not executors
- (into {} (map (fn [e] {e nil}) (:executors worker)))
- (->> executors
- (map (fn [e] {(executor/get-executor-id e) (executor/render-stats e)}))
- (apply merge)))
- zk-hb {:storm-id (:storm-id worker)
- :executor-stats stats
- :uptime ((:uptime worker))
- :time-secs (current-time-secs)
- }]
- ;; do the zookeeper heartbeat
- (try
- (.worker-heartbeat! (:storm-cluster-state worker) (:storm-id worker) (:assignment-id worker) (:port worker) zk-hb)
- (catch Exception exc
- (log-error exc "Worker failed to write heartbeats to ZK or Pacemaker...will retry")))))
-
-(defn do-heartbeat [worker]
- (let [conf (:conf worker)
- state (worker-state conf (:worker-id worker))]
- ;; do the local-file-system heartbeat.
- (ls-worker-heartbeat! state (current-time-secs) (:storm-id worker) (:executors worker) (:port worker))
- (.cleanup state 60) ; this is just in case supervisor is down so that disk doesn't fill up.
- ; it shouldn't take supervisor 120 seconds between listing dir and reading it
-
- ))
-
-(defn worker-outbound-tasks
- "Returns seq of task-ids that receive messages from this worker"
- [worker]
- (let [context (worker-context worker)
- components (mapcat
- (fn [task-id]
- (->> (.getComponentId context (int task-id))
- (.getTargets context)
- vals
- (map keys)
- (apply concat)))
- (:task-ids worker))]
- (-> worker
- :task->component
- reverse-map
- (select-keys components)
- vals
- flatten
- set )))
-
-(defn get-dest
- [^AddressedTuple addressed-tuple]
- "get the destination for an AddressedTuple"
- (.getDest addressed-tuple))
-
-(defn mk-transfer-local-fn [worker]
- (let [short-executor-receive-queue-map (:short-executor-receive-queue-map worker)
- task->short-executor (:task->short-executor worker)
- task-getter (comp #(get task->short-executor %) get-dest)]
- (fn [tuple-batch]
- (let [grouped (fast-group-by task-getter tuple-batch)]
- (fast-map-iter [[short-executor pairs] grouped]
- (let [q (short-executor-receive-queue-map short-executor)]
- (if q
- (disruptor/publish q pairs)
- (log-warn "Received invalid messages for unknown tasks. Dropping... ")
- )))))))
-
-(defn- assert-can-serialize [^KryoTupleSerializer serializer tuple-batch]
- "Check that all of the tuples can be serialized by serializing them."
- (fast-list-iter [[task tuple :as pair] tuple-batch]
- (.serialize serializer tuple)))
-
-(defn- mk-backpressure-handler [executors]
- "make a handler that checks and updates worker's backpressure flag"
- (disruptor/worker-backpressure-handler
- (fn [worker]
- (let [storm-id (:storm-id worker)
- assignment-id (:assignment-id worker)
- port (:port worker)
- storm-cluster-state (:storm-cluster-state worker)
- prev-backpressure-flag @(:backpressure worker)
- ;; the backpressure flag is true if at least one of the disruptor queues has throttle-on
- curr-backpressure-flag (if executors
- (or (.getThrottleOn (:transfer-queue worker))
- (reduce #(or %1 %2) (map #(.get-backpressure-flag %1) executors)))
- prev-backpressure-flag)]
- ;; update the worker's backpressure flag to zookeeper only when it has changed
- (when (not= prev-backpressure-flag curr-backpressure-flag)
- (try
- (log-debug "worker backpressure flag changing from " prev-backpressure-flag " to " curr-backpressure-flag)
- (.worker-backpressure! storm-cluster-state storm-id assignment-id port curr-backpressure-flag)
- ;; doing the local reset after the zk update succeeds is very important to avoid a bad state upon zk exception
- (reset! (:backpressure worker) curr-backpressure-flag)
- (catch Exception exc
- (log-error exc "workerBackpressure update failed when connecting to ZK ... will retry"))))
- ))))
-
-(defn- mk-disruptor-backpressure-handler [worker]
- "make a handler for the worker's send disruptor queue to
- check highWaterMark and lowWaterMark for backpressure"
- (disruptor/disruptor-backpressure-handler
- (fn []
- (log-debug "worker " (:worker-id worker) " transfer-queue is congested, set backpressure flag true")
- (WorkerBackpressureThread/notifyBackpressureChecker (:backpressure-trigger worker)))
- (fn []
- (log-debug "worker " (:worker-id worker) " transfer-queue is not congested, set backpressure flag false")
- (WorkerBackpressureThread/notifyBackpressureChecker (:backpressure-trigger worker)))))
-
-(defn mk-transfer-fn [worker]
- (let [local-tasks (-> worker :task-ids set)
- local-transfer (:transfer-local-fn worker)
- ^DisruptorQueue transfer-queue (:transfer-queue worker)
- task->node+port (:cached-task->node+port worker)
- try-serialize-local ((:storm-conf worker) TOPOLOGY-TESTING-ALWAYS-TRY-SERIALIZE)
-
- transfer-fn
- (fn [^KryoTupleSerializer serializer tuple-batch]
- (let [^ArrayList local (ArrayList.)
- ^HashMap remoteMap (HashMap.)]
- (fast-list-iter [^AddressedTuple addressed-tuple tuple-batch]
- (let [task (.getDest addressed-tuple)
- tuple (.getTuple addressed-tuple)]
- (if (local-tasks task)
- (.add local addressed-tuple)
-
- ;;Using java objects directly to avoid performance issues in java code
- (do
- (when (not (.get remoteMap task))
- (.put remoteMap task (ArrayList.)))
- (let [^ArrayList remote (.get remoteMap task)]
- (if (not-nil? task)
- (.add remote (TaskMessage. task ^bytes (.serialize serializer tuple)))
- (log-warn "Can't transfer tuple - task value is nil. tuple type: " (pr-str (type tuple)) " and information: " (pr-str tuple)))
- )))))
-
- (when (not (.isEmpty local)) (local-transfer local))
- (when (not (.isEmpty remoteMap)) (disruptor/publish transfer-queue remoteMap))))]
- (if try-serialize-local
- (do
- (log-warn "WILL TRY TO SERIALIZE ALL TUPLES (Turn off " TOPOLOGY-TESTING-ALWAYS-TRY-SERIALIZE " for production)")
- (fn [^KryoTupleSerializer serializer tuple-batch]
- (assert-can-serialize serializer tuple-batch)
- (transfer-fn serializer tuple-batch)))
- transfer-fn)))
-
-(defn- mk-receive-queue-map [storm-conf executors]
- (->> executors
- ;; TODO: this depends on the type of executor
- (map (fn [e] [e (disruptor/disruptor-queue (str "receive-queue" e)
- (storm-conf TOPOLOGY-EXECUTOR-RECEIVE-BUFFER-SIZE)
- (storm-conf TOPOLOGY-DISRUPTOR-WAIT-TIMEOUT-MILLIS)
- :batch-size (storm-conf TOPOLOGY-DISRUPTOR-BATCH-SIZE)
- :batch-timeout (storm-conf TOPOLOGY-DISRUPTOR-BATCH-TIMEOUT-MILLIS))]))
- (into {})
- ))
-
-(defn- stream->fields [^StormTopology topology component]
- (->> (ThriftTopologyUtils/getComponentCommon topology component)
- .get_streams
- (map (fn [[s info]] [s (Fields. (.get_output_fields info))]))
- (into {})
- (HashMap.)))
-
-(defn component->stream->fields [^StormTopology topology]
- (->> (ThriftTopologyUtils/getComponentIds topology)
- (map (fn [c] [c (stream->fields topology c)]))
- (into {})
- (HashMap.)))
-
-(defn- mk-default-resources [worker]
- (let [conf (:conf worker)
- thread-pool-size (int (conf TOPOLOGY-WORKER-SHARED-THREAD-POOL-SIZE))]
- {WorkerTopologyContext/SHARED_EXECUTOR (Executors/newFixedThreadPool thread-pool-size)}
- ))
-
-(defn- mk-user-resources [worker]
- ;;TODO: need to invoke a hook provided by the topology, giving it a chance to create user resources.
- ;; this would be part of the initialization hook
- ;; need to separate workertopologycontext into WorkerContext and WorkerUserContext.
- ;; actually just do it via interfaces. just need to make sure to hide setResource from tasks
- {})
-
-(defn mk-halting-timer [timer-name]
- (mk-timer :kill-fn (fn [t]
- (log-error t "Error when processing event")
- (exit-process! 20 "Error when processing an event")
- )
- :timer-name timer-name))
-
-(defn worker-data [conf mq-context storm-id assignment-id port worker-id storm-conf cluster-state storm-cluster-state]
- (let [assignment-versions (atom {})
- executors (set (read-worker-executors storm-conf storm-cluster-state storm-id assignment-id port assignment-versions))
- transfer-queue (disruptor/disruptor-queue "worker-transfer-queue" (storm-conf TOPOLOGY-TRANSFER-BUFFER-SIZE)
- (storm-conf TOPOLOGY-DISRUPTOR-WAIT-TIMEOUT-MILLIS)
- :batch-size (storm-conf TOPOLOGY-DISRUPTOR-BATCH-SIZE)
- :batch-timeout (storm-conf TOPOLOGY-DISRUPTOR-BATCH-TIMEOUT-MILLIS))
- executor-receive-queue-map (mk-receive-queue-map storm-conf executors)
-
- receive-queue-map (->> executor-receive-queue-map
- (mapcat (fn [[e queue]] (for [t (executor-id->tasks e)] [t queue])))
- (into {}))
-
- topology (read-supervisor-topology conf storm-id)
- mq-context (if mq-context
- mq-context
- (TransportFactory/makeContext storm-conf))]
-
- (recursive-map
- :conf conf
- :mq-context mq-context
- :receiver (.bind ^IContext mq-context storm-id port)
- :storm-id storm-id
- :assignment-id assignment-id
- :port port
- :worker-id worker-id
- :cluster-state cluster-state
- :storm-cluster-state storm-cluster-state
- ;; when worker bootup, worker will start to setup initial connections to
- ;; other workers. When all connection is ready, we will enable this flag
- ;; and spout and bolt will be activated.
- :worker-active-flag (atom false)
- :storm-active-atom (atom false)
- :storm-component->debug-atom (atom {})
- :executors executors
- :task-ids (->> receive-queue-map keys (map int) sort)
- :storm-conf storm-conf
- :topology topology
- :system-topology (system-topology! storm-conf topology)
- :heartbeat-timer (mk-halting-timer "heartbeat-timer")
- :refresh-load-timer (mk-halting-timer "refresh-load-timer")
- :refresh-connections-timer (mk-halting-timer "refresh-connections-timer")
- :refresh-credentials-timer (mk-halting-timer "refresh-credentials-timer")
- :reset-log-levels-timer (mk-halting-timer "reset-log-levels-timer")
- :refresh-active-timer (mk-halting-timer "refresh-active-timer")
- :executor-heartbeat-timer (mk-halting-timer "executor-heartbeat-timer")
- :refresh-backpressure-timer (mk-halting-timer "refresh-backpressure-timer")
- :user-timer (mk-halting-timer "user-timer")
- :task->component (HashMap. (storm-task-info topology storm-conf)) ; for optimized access when used in tasks later on
- :component->stream->fields (component->stream->fields (:system-topology <>))
- :component->sorted-tasks (->> (:task->component <>) reverse-map (map-val sort))
- :endpoint-socket-lock (mk-rw-lock)
- :cached-node+port->socket (atom {})
- :cached-task->node+port (atom {})
- :transfer-queue transfer-queue
- :executor-receive-queue-map executor-receive-queue-map
- :short-executor-receive-queue-map (map-key first executor-receive-queue-map)
- :task->short-executor (->> executors
- (mapcat (fn [e] (for [t (executor-id->tasks e)] [t (first e)])))
- (into {})
- (HashMap.))
- :suicide-fn (mk-suicide-fn conf)
- :uptime (uptime-computer)
- :default-shared-resources (mk-default-resources <>)
- :user-shared-resources (mk-user-resources <>)
- :transfer-local-fn (mk-transfer-local-fn <>)
- :transfer-fn (mk-transfer-fn <>)
- :load-mapping (LoadMapping.)
- :assignment-versions assignment-versions
- :backpressure (atom false) ;; whether this worker is going slow
- :backpressure-trigger (Object.) ;; a trigger for synchronization with executors
- :throttle-on (atom false) ;; whether throttle is activated for spouts
- )))
-
-(defn- endpoint->string [[node port]]
- (str port "/" node))
-
-(defn string->endpoint [^String s]
- (let [[port-str node] (.split s "/" 2)]
- [node (Integer/valueOf port-str)]
- ))
-
-(def LOAD-REFRESH-INTERVAL-MS 5000)
-
-(defn mk-refresh-load [worker]
- (let [local-tasks (set (:task-ids worker))
- remote-tasks (set/difference (worker-outbound-tasks worker) local-tasks)
- short-executor-receive-queue-map (:short-executor-receive-queue-map worker)
- next-update (atom 0)]
- (fn this
- ([]
- (let [^LoadMapping load-mapping (:load-mapping worker)
- local-pop (map-val (fn [queue]
- (let [q-metrics (.getMetrics queue)]
- (/ (double (.population q-metrics)) (.capacity q-metrics))))
- short-executor-receive-queue-map)
- remote-load (reduce merge (for [[np conn] @(:cached-node+port->socket worker)] (into {} (.getLoad conn remote-tasks))))
- now (System/currentTimeMillis)]
- (.setLocal load-mapping local-pop)
- (.setRemote load-mapping remote-load)
- (when (> now @next-update)
- (.sendLoadMetrics (:receiver worker) local-pop)
- (reset! next-update (+ LOAD-REFRESH-INTERVAL-MS now))))))))
-
-(defn mk-refresh-connections [worker]
- (let [outbound-tasks (worker-outbound-tasks worker)
- conf (:conf worker)
- storm-cluster-state (:storm-cluster-state worker)
- storm-id (:storm-id worker)]
- (fn this
- ([]
- (this (fn [& ignored] (schedule (:refresh-connections-timer worker) 0 this))))
- ([callback]
- (let [version (.assignment-version storm-cluster-state storm-id callback)
- assignment (if (= version (:version (get @(:assignment-versions worker) storm-id)))
- (:data (get @(:assignment-versions worker) storm-id))
- (let [new-assignment (.assignment-info-with-version storm-cluster-state storm-id callback)]
- (swap! (:assignment-versions worker) assoc storm-id new-assignment)
- (:data new-assignment)))
- my-assignment (-> assignment
- :executor->node+port
- to-task->node+port
- (select-keys outbound-tasks)
- (#(map-val endpoint->string %)))
- ;; we dont need a connection for the local tasks anymore
- needed-assignment (->> my-assignment
- (filter-key (complement (-> worker :task-ids set))))
- needed-connections (-> needed-assignment vals set)
- needed-tasks (-> needed-assignment keys)
-
- current-connections (set (keys @(:cached-node+port->socket worker)))
- new-connections (set/difference needed-connections current-connections)
- remove-connections (set/difference current-connections needed-connections)]
- (swap! (:cached-node+port->socket worker)
- #(HashMap. (merge (into {} %1) %2))
- (into {}
- (dofor [endpoint-str new-connections
- :let [[node port] (string->endpoint endpoint-str)]]
- [endpoint-str
- (.connect
- ^IContext (:mq-context worker)
- storm-id
- ((:node->host assignment) node)
- port)
- ]
- )))
- (write-locked (:endpoint-socket-lock worker)
- (reset! (:cached-task->node+port worker)
- (HashMap. my-assignment)))
- (doseq [endpoint remove-connections]
- (.close (get @(:cached-node+port->socket worker) endpoint)))
- (apply swap!
- (:cached-node+port->socket worker)
- #(HashMap. (apply dissoc (into {} %1) %&))
- remove-connections)
-
- )))))
-
-(defn refresh-storm-active
- ([worker]
- (refresh-storm-active worker (fn [& ignored] (schedule (:refresh-active-timer worker) 0 (partial refresh-storm-active worker)))))
- ([worker callback]
- (let [base (.storm-base (:storm-cluster-state worker) (:storm-id worker) callback)]
- (reset!
- (:storm-active-atom worker)
- (and (= :active (-> base :status :type)) @(:worker-active-flag worker)))
- (reset! (:storm-component->debug-atom worker) (-> base :component->debug))
- (log-debug "Event debug options " @(:storm-component->debug-atom worker)))))
-
-;; TODO: consider having a max batch size besides what disruptor does automagically to prevent latency issues
-(defn mk-transfer-tuples-handler [worker]
- (let [^DisruptorQueue transfer-queue (:transfer-queue worker)
- drainer (TransferDrainer.)
- node+port->socket (:cached-node+port->socket worker)
- task->node+port (:cached-task->node+port worker)
- endpoint-socket-lock (:endpoint-socket-lock worker)
- ]
- (disruptor/clojure-handler
- (fn [packets _ batch-end?]
- (.add drainer packets)
-
- (when batch-end?
- (read-locked endpoint-socket-lock
- (let [node+port->socket @node+port->socket
- task->node+port @task->node+port]
- (.send drainer task->node+port node+port->socket)))
- (.clear drainer))))))
-
-;; Check whether this messaging connection is ready to send data
-(defn is-connection-ready [^IConnection connection]
- (if (instance? ConnectionWithStatus connection)
- (let [^ConnectionWithStatus connection connection
- status (.status connection)]
- (= status ConnectionWithStatus$Status/Ready))
- true))
-
-;; all connections are ready
-(defn all-connections-ready [worker]
- (let [connections (vals @(:cached-node+port->socket worker))]
- (every? is-connection-ready connections)))
-
-;; we will wait all connections to be ready and then activate the spout/bolt
-;; when the worker bootup
-(defn activate-worker-when-all-connections-ready
- [worker]
- (let [timer (:refresh-active-timer worker)
- delay-secs 0
- recur-secs 1]
- (schedule timer
- delay-secs
- (fn this []
- (if (all-connections-ready worker)
- (do
- (log-message "All connections are ready for worker " (:assignment-id worker) ":" (:port worker)
- " with id "(:worker-id worker))
- (reset! (:worker-active-flag worker) true))
- (schedule timer recur-secs this :check-active false)
- )))))
-
-(defn register-callbacks [worker]
- (log-message "Registering IConnectionCallbacks for " (:assignment-id worker) ":" (:port worker))
- (msg-loader/register-callback (:transfer-local-fn worker)
- (:receiver worker)
- (:storm-conf worker)
- (worker-context worker)))
-
-(defn- close-resources [worker]
- (let [dr (:default-shared-resources worker)]
- (log-message "Shutting down default resources")
- (.shutdownNow (get dr WorkerTopologyContext/SHARED_EXECUTOR))
- (log-message "Shut down default resources")))
-
-(defn- get-logger-levels []
- (into {}
- (let [logger-config (.getConfiguration (LogManager/getContext false))]
- (for [[logger-name logger] (.getLoggers logger-config)]
- {logger-name (.getLevel logger)}))))
-
-(defn set-logger-level [logger-context logger-name new-level]
- (let [config (.getConfiguration logger-context)
- logger-config (.getLoggerConfig config logger-name)]
- (if (not (= (.getName logger-config) logger-name))
- ;; create a new config. Make it additive (true) s.t. inherit
- ;; parents appenders
- (let [new-logger-config (LoggerConfig. logger-name new-level true)]
- (log-message "Adding config for: " new-logger-config " with level: " new-level)
- (.addLogger config logger-name new-logger-config))
- (do
- (log-message "Setting " logger-config " log level to: " new-level)
- (.setLevel logger-config new-level)))))
-
-;; function called on timer to reset log levels last set to DEBUG
-;; also called from process-log-config-change
-(defn reset-log-levels [latest-log-config-atom]
- (let [latest-log-config @latest-log-config-atom
- logger-context (LogManager/getContext false)]
- (doseq [[logger-name logger-setting] (sort latest-log-config)]
- (let [timeout (:timeout logger-setting)
- target-log-level (:target-log-level logger-setting)
- reset-log-level (:reset-log-level logger-setting)]
- (when (> (coerce/to-long (time/now)) timeout)
- (log-message logger-name ": Resetting level to " reset-log-level)
- (set-logger-level logger-context logger-name reset-log-level)
- (swap! latest-log-config-atom
- (fn [prev]
- (dissoc prev logger-name))))))
- (.updateLoggers logger-context)))
-
-;; when a new log level is received from zookeeper, this function is called
-(defn process-log-config-change [latest-log-config original-log-levels log-config]
- (when log-config
- (log-debug "Processing received log config: " log-config)
- ;; merge log configs together
- (let [loggers (.get_named_logger_level log-config)
- logger-context (LogManager/getContext false)]
- (def new-log-configs
- (into {}
- ;; merge named log levels
- (for [[msg-logger-name logger-level] loggers]
- (let [logger-name (if (= msg-logger-name "ROOT")
- LogManager/ROOT_LOGGER_NAME
- msg-logger-name)]
- ;; the new-timeouts map now contains logger => timeout
- (when (.is_set_reset_log_level_timeout_epoch logger-level)
- {logger-name {:action (.get_action logger-level)
- :target-log-level (Level/toLevel (.get_target_log_level logger-level))
- :reset-log-level (or (.get @original-log-levels logger-name) (Level/INFO))
- :timeout (.get_reset_log_level_timeout_epoch logger-level)}})))))
-
- ;; look for deleted log timeouts
- (doseq [[logger-name logger-val] (sort @latest-log-config)]
- (when (not (contains? new-log-configs logger-name))
- ;; if we had a timeout, but the timeout is no longer active
- (set-logger-level
- logger-context logger-name (:reset-log-level logger-val))))
-
- ;; apply new log settings we just received
- ;; the merged configs are only for the reset logic
- (doseq [[msg-logger-name logger-level] (sort (into {} (.get_named_logger_level log-config)))]
- (let [logger-name (if (= msg-logger-name "ROOT")
- LogManager/ROOT_LOGGER_NAME
- msg-logger-name)
- level (Level/toLevel (.get_target_log_level logger-level))
- action (.get_action logger-level)]
- (if (= action LogLevelAction/UPDATE)
- (set-logger-level logger-context logger-name level))))
-
- (.updateLoggers logger-context)
- (reset! latest-log-config new-log-configs)
- (log-debug "New merged log config is " @latest-log-config))))
-
-(defn run-worker-start-hooks [worker]
- (let [topology (:topology worker)
- topo-conf (:storm-conf worker)
- worker-topology-context (worker-context worker)
- hooks (.get_worker_hooks topology)]
- (dofor [hook hooks]
- (let [hook-bytes (Utils/toByteArray hook)
- deser-hook (Utils/javaDeserialize hook-bytes BaseWorkerHook)]
- (.start deser-hook topo-conf worker-topology-context)))))
-
-(defn run-worker-shutdown-hooks [worker]
- (let [topology (:topology worker)
- hooks (.get_worker_hooks topology)]
- (dofor [hook hooks]
- (let [hook-bytes (Utils/toByteArray hook)
- deser-hook (Utils/javaDeserialize hook-bytes BaseWorkerHook)]
- (.shutdown deser-hook)))))
-
-;; TODO: should worker even take the storm-id as input? this should be
-;; deducable from cluster state (by searching through assignments)
-;; what about if there's inconsistency in assignments? -> but nimbus
-;; should guarantee this consistency
-(defserverfn mk-worker [conf shared-mq-context storm-id assignment-id port worker-id]
- (log-message "Launching worker for " storm-id " on " assignment-id ":" port " with id " worker-id
- " and conf " conf)
- (if-not (local-mode? conf)
- (redirect-stdio-to-slf4j!))
- ;; because in local mode, its not a separate
- ;; process. supervisor will register it in this case
- (when (= :distributed (cluster-mode conf))
- (let [pid (process-pid)]
- (touch (worker-pid-path conf worker-id pid))
- (spit (worker-artifacts-pid-path conf storm-id port) pid)))
-
- (declare establish-log-setting-callback)
-
- ;; start out with empty list of timeouts
- (def latest-log-config (atom {}))
- (def original-log-levels (atom {}))
-
- (let [storm-conf (read-supervisor-storm-conf conf storm-id)
- storm-conf (override-login-config-with-system-property storm-conf)
- acls (Utils/getWorkerACL storm-conf)
- cluster-state (cluster/mk-distributed-cluster-state conf :auth-conf storm-conf :acls acls :context (ClusterStateContext. DaemonType/WORKER))
- storm-cluster-state (cluster/mk-storm-cluster-state cluster-state :acls acls)
- initial-credentials (.credentials storm-cluster-state storm-id nil)
- auto-creds (AuthUtils/GetAutoCredentials storm-conf)
- subject (AuthUtils/populateSubject nil auto-creds initial-credentials)]
- (Subject/doAs subject (reify PrivilegedExceptionAction
- (run [this]
- (let [worker (worker-data conf shared-mq-context storm-id assignment-id port worker-id storm-conf cluster-state storm-cluster-state)
- heartbeat-fn #(do-heartbeat worker)
-
- ;; do this here so that the worker process dies if this fails
- ;; it's important that worker heartbeat to supervisor ASAP when launching so that the supervisor knows it's running (and can move on)
- _ (heartbeat-fn)
-
- executors (atom nil)
- ;; launch heartbeat threads immediately so that slow-loading tasks don't cause the worker to timeout
- ;; to the supervisor
- _ (schedule-recurring (:heartbeat-timer worker) 0 (conf WORKER-HEARTBEAT-FREQUENCY-SECS) heartbeat-fn)
- _ (schedule-recurring (:executor-heartbeat-timer worker) 0 (conf TASK-HEARTBEAT-FREQUENCY-SECS) #(do-executor-heartbeats worker :executors @executors))
-
- _ (register-callbacks worker)
-
- refresh-connections (mk-refresh-connections worker)
- refresh-load (mk-refresh-load worker)
-
- _ (refresh-connections nil)
-
- _ (activate-worker-when-all-connections-ready worker)
-
- _ (refresh-storm-active worker nil)
-
- _ (run-worker-start-hooks worker)
-
- _ (reset! executors (dofor [e (:executors worker)] (executor/mk-executor worker e initial-credentials)))
-
- transfer-tuples (mk-transfer-tuples-handler worker)
-
- transfer-thread (disruptor/consume-loop* (:transfer-queue worker) transfer-tuples)
-
- disruptor-handler (mk-disruptor-backpressure-handler worker)
- _ (.registerBackpressureCallback (:transfer-queue worker) disruptor-handler)
- _ (-> (.setHighWaterMark (:transfer-queue worker) ((:storm-conf worker) BACKPRESSURE-DISRUPTOR-HIGH-WATERMARK))
- (.setLowWaterMark ((:storm-conf worker) BACKPRESSURE-DISRUPTOR-LOW-WATERMARK))
- (.setEnableBackpressure ((:storm-conf worker) TOPOLOGY-BACKPRESSURE-ENABLE)))
- backpressure-handler (mk-backpressure-handler @executors)
- backpressure-thread (WorkerBackpressureThread. (:backpressure-trigger worker) worker backpressure-handler)
- _ (if ((:storm-conf worker) TOPOLOGY-BACKPRESSURE-ENABLE)
- (.start backpressure-thread))
- topology-backpressure-callback (fn cb [& ignored]
- (let [throttle-on (.topology-backpressure storm-cluster-state storm-id cb)]
- (reset! (:throttle-on worker) throttle-on)))
- _ (if ((:storm-conf worker) TOPOLOGY-BACKPRESSURE-ENABLE)
- (.topology-backpressure storm-cluster-state storm-id topology-backpressure-callback))
-
- shutdown* (fn []
- (log-message "Shutting down worker " storm-id " " assignment-id " " port)
- (doseq [[_ socket] @(:cached-node+port->socket worker)]
- ;; this will do best effort flushing since the linger period
- ;; was set on creation
- (.close socket))
- (log-message "Terminating messaging context")
- (log-message "Shutting down executors")
- (doseq [executor @executors] (.shutdown executor))
- (log-message "Shut down executors")
-
- ;;this is fine because the only time this is shared is when it's a local context,
- ;;in which case it's a noop
- (.term ^IContext (:mq-context worker))
- (log-message "Shutting down transfer thread")
- (disruptor/halt-with-interrupt! (:transfer-queue worker))
-
- (.interrupt transfer-thread)
- (.join transfer-thread)
- (log-message "Shut down transfer thread")
- (.terminate backpressure-thread)
- (log-message "Shut down backpressure thread")
- (cancel-timer (:heartbeat-timer worker))
- (cancel-timer (:refresh-connections-timer worker))
- (cancel-timer (:refresh-credentials-timer worker))
- (cancel-timer (:refresh-active-timer worker))
- (cancel-timer (:executor-heartbeat-timer worker))
- (cancel-timer (:user-timer worker))
- (cancel-timer (:refresh-load-timer worker))
-
- (close-resources worker)
-
- (log-message "Trigger any worker shutdown hooks")
- (run-worker-shutdown-hooks worker)
-
- (.remove-worker-heartbeat! (:storm-cluster-state worker) storm-id assignment-id port)
- (.remove-worker-backpressure! (:storm-cluster-state worker) storm-id assignment-id port)
-
- (log-message "Disconnecting from storm cluster state context")
- (.disconnect (:storm-cluster-state worker))
- (.close (:cluster-state worker))
- (log-message "Shut down worker " storm-id " " assignment-id " " port))
- ret (reify
- Shutdownable
- (shutdown
- [this]
- (shutdown*))
- DaemonCommon
- (waiting? [this]
- (and
- (timer-waiting? (:heartbeat-timer worker))
- (timer-waiting? (:refresh-connections-timer worker))
- (timer-waiting? (:refresh-load-timer worker))
- (timer-waiting? (:refresh-credentials-timer worker))
- (timer-waiting? (:refresh-active-timer worker))
- (timer-waiting? (:executor-heartbeat-timer worker))
- (timer-waiting? (:user-timer worker))
- ))
- )
- credentials (atom initial-credentials)
- check-credentials-changed (fn []
- (let [new-creds (.credentials (:storm-cluster-state worker) storm-id nil)]
- (when-not (= new-creds @credentials) ;;This does not have to be atomic, worst case we update when one is not needed
- (AuthUtils/updateSubject subject auto-creds new-creds)
- (dofor [e @executors] (.credentials-changed e new-creds))
- (reset! credentials new-creds))))
- check-log-config-changed (fn []
- (let [log-config (.topology-log-config (:storm-cluster-state worker) storm-id nil)]
- (process-log-config-change latest-log-config original-log-levels log-config)
- (establish-log-setting-callback)))]
- (reset! original-log-levels (get-logger-levels))
- (log-message "Started with log levels: " @original-log-levels)
-
- (defn establish-log-setting-callback []
- (.topology-log-config (:storm-cluster-state worker) storm-id (fn [args] (check-log-config-changed))))
-
- (establish-log-setting-callback)
- (.credentials (:storm-cluster-state worker) storm-id (fn [args] (check-credentials-changed)))
- (schedule-recurring (:refresh-credentials-timer worker) 0 (conf TASK-CREDENTIALS-POLL-SECS)
- (fn [& args]
- (check-credentials-changed)))
-
- (if ((:storm-conf worker) TOPOLOGY-BACKPRESSURE-ENABLE)
- (schedule-recurring (:refresh-backpressure-timer worker) 0 (conf TASK-BACKPRESSURE-POLL-SECS) topology-backpressure-callback))
-
- ;; The jitter allows the clients to get the data at different times, and avoids thundering herd
- (when-not (.get conf TOPOLOGY-DISABLE-LOADAWARE-MESSAGING)
- (schedule-recurring-with-jitter (:refresh-load-timer worker) 0 1 500 refresh-load))
- (schedule-recurring (:refresh-connections-timer worker) 0 (conf TASK-REFRESH-POLL-SECS) refresh-connections)
- (schedule-recurring (:reset-log-levels-timer worker) 0 (conf WORKER-LOG-LEVEL-RESET-POLL-SECS) (fn [] (reset-log-levels latest-log-config)))
- (schedule-recurring (:refresh-active-timer worker) 0 (conf TASK-REFRESH-POLL-SECS) (partial refresh-storm-active worker))
-
- (log-message "Worker has topology config " (redact-value (:storm-conf worker) STORM-ZOOKEEPER-TOPOLOGY-AUTH-PAYLOAD))
- (log-message "Worker " worker-id " for storm " storm-id " on " assignment-id ":" port " has finished loading")
- ret
- ))))))
-
-(defmethod mk-suicide-fn
- :local [conf]
- (fn [] (exit-process! 1 "Worker died")))
-
-(defmethod mk-suicide-fn
- :distributed [conf]
- (fn [] (exit-process! 1 "Worker died")))
-
-(defn -main [storm-id assignment-id port-str worker-id]
- (let [conf (read-storm-config)]
- (setup-default-uncaught-exception-handler)
- (validate-distributed-mode! conf)
- (let [worker (mk-worker conf nil storm-id assignment-id (Integer/parseInt port-str) worker-id)]
- (add-shutdown-hook-with-force-kill-in-1-sec #(.shutdown worker)))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/disruptor.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/disruptor.clj b/storm-core/src/clj/backtype/storm/disruptor.clj
deleted file mode 100644
index 1546b3f..0000000
--- a/storm-core/src/clj/backtype/storm/disruptor.clj
+++ /dev/null
@@ -1,89 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.disruptor
- (:import [org.apache.storm.utils DisruptorQueue WorkerBackpressureCallback DisruptorBackpressureCallback])
- (:import [com.lmax.disruptor.dsl ProducerType])
- (:require [clojure [string :as str]])
- (:require [clojure [set :as set]])
- (:use [clojure walk])
- (:use [org.apache.storm util log]))
-
-(def PRODUCER-TYPE
- {:multi-threaded ProducerType/MULTI
- :single-threaded ProducerType/SINGLE})
-
-(defnk disruptor-queue
- [^String queue-name buffer-size timeout :producer-type :multi-threaded :batch-size 100 :batch-timeout 1]
- (DisruptorQueue. queue-name
- (PRODUCER-TYPE producer-type) buffer-size
- timeout batch-size batch-timeout))
-
-(defn clojure-handler
- [afn]
- (reify com.lmax.disruptor.EventHandler
- (onEvent
- [this o seq-id batchEnd?]
- (afn o seq-id batchEnd?))))
-
-(defn disruptor-backpressure-handler
- [afn-high-wm afn-low-wm]
- (reify DisruptorBackpressureCallback
- (highWaterMark
- [this]
- (afn-high-wm))
- (lowWaterMark
- [this]
- (afn-low-wm))))
-
-(defn worker-backpressure-handler
- [afn]
- (reify WorkerBackpressureCallback
- (onEvent
- [this o]
- (afn o))))
-
-(defmacro handler
- [& args]
- `(clojure-handler (fn ~@args)))
-
-(defn publish
- [^DisruptorQueue q o]
- (.publish q o))
-
-(defn consume-batch
- [^DisruptorQueue queue handler]
- (.consumeBatch queue handler))
-
-(defn consume-batch-when-available
- [^DisruptorQueue queue handler]
- (.consumeBatchWhenAvailable queue handler))
-
-(defn halt-with-interrupt!
- [^DisruptorQueue queue]
- (.haltWithInterrupt queue))
-
-(defnk consume-loop*
- [^DisruptorQueue queue handler
- :kill-fn (fn [error] (exit-process! 1 "Async loop died!"))]
- (async-loop
- (fn [] (consume-batch-when-available queue handler) 0)
- :kill-fn kill-fn
- :thread-name (.getName queue)))
-
-(defmacro consume-loop [queue & handler-args]
- `(let [handler# (handler ~@handler-args)]
- (consume-loop* ~queue handler#)))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/event.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/event.clj b/storm-core/src/clj/backtype/storm/event.clj
deleted file mode 100644
index edc7616..0000000
--- a/storm-core/src/clj/backtype/storm/event.clj
+++ /dev/null
@@ -1,71 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.event
- (:use [org.apache.storm log util])
- (:import [org.apache.storm.utils Time Utils])
- (:import [java.io InterruptedIOException])
- (:import [java.util.concurrent LinkedBlockingQueue TimeUnit]))
-
-(defprotocol EventManager
- (add [this event-fn])
- (waiting? [this])
- (shutdown [this]))
-
-(defn event-manager
- "Creates a thread to respond to events. Any error will cause process to halt"
- [daemon?]
- (let [added (atom 0)
- processed (atom 0)
- ^LinkedBlockingQueue queue (LinkedBlockingQueue.)
- running (atom true)
- runner (Thread.
- (fn []
- (try-cause
- (while @running
- (let [r (.take queue)]
- (r)
- (swap! processed inc)))
- (catch InterruptedIOException t
- (log-message "Event manager interrupted while doing IO"))
- (catch InterruptedException t
- (log-message "Event manager interrupted"))
- (catch Throwable t
- (log-error t "Error when processing event")
- (exit-process! 20 "Error when processing an event")))))]
- (.setDaemon runner daemon?)
- (.start runner)
- (reify
- EventManager
-
- (add
- [this event-fn]
- ;; should keep track of total added and processed to know if this is finished yet
- (when-not @running
- (throw (RuntimeException. "Cannot add events to a shutdown event manager")))
- (swap! added inc)
- (.put queue event-fn))
-
- (waiting?
- [this]
- (or (Time/isThreadWaiting runner)
- (= @processed @added)))
-
- (shutdown
- [this]
- (reset! running false)
- (.interrupt runner)
- (.join runner)))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/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
deleted file mode 100644
index a95a85b..0000000
--- a/storm-core/src/clj/backtype/storm/local_state.clj
+++ /dev/null
@@ -1,131 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.local-state
- (:use [org.apache.storm log util])
- (:import [org.apache.storm.generated StormTopology
- InvalidTopologyException GlobalStreamId
- LSSupervisorId LSApprovedWorkers
- LSSupervisorAssignments LocalAssignment
- ExecutorInfo LSWorkerHeartbeat
- LSTopoHistory LSTopoHistoryList
- WorkerResources])
- (:import [org.apache.storm.utils LocalState]))
-
-(def LS-WORKER-HEARTBEAT "worker-heartbeat")
-(def LS-ID "supervisor-id")
-(def LS-LOCAL-ASSIGNMENTS "local-assignments")
-(def LS-APPROVED-WORKERS "approved-workers")
-(def LS-TOPO-HISTORY "topo-hist")
-
-(defn ->LSTopoHistory
- [{topoid :topoid timestamp :timestamp users :users groups :groups}]
- (LSTopoHistory. topoid timestamp users groups))
-
-(defn ->topo-history
- [thrift-topo-hist]
- {
- :topoid (.get_topology_id thrift-topo-hist)
- :timestamp (.get_time_stamp thrift-topo-hist)
- :users (.get_users thrift-topo-hist)
- :groups (.get_groups thrift-topo-hist)})
-
-(defn ls-topo-hist!
- [^LocalState local-state hist-list]
- (.put local-state LS-TOPO-HISTORY
- (LSTopoHistoryList. (map ->LSTopoHistory hist-list))))
-
-(defn ls-topo-hist
- [^LocalState local-state]
- (if-let [thrift-hist-list (.get local-state LS-TOPO-HISTORY)]
- (map ->topo-history (.get_topo_history thrift-hist-list))))
-
-(defn ls-supervisor-id!
- [^LocalState local-state ^String id]
- (.put local-state LS-ID (LSSupervisorId. id)))
-
-(defn ls-supervisor-id
- [^LocalState local-state]
- (if-let [super-id (.get local-state LS-ID)]
- (.get_supervisor_id super-id)))
-
-(defn ls-approved-workers!
- [^LocalState local-state workers]
- (.put local-state LS-APPROVED-WORKERS (LSApprovedWorkers. workers)))
-
-(defn ls-approved-workers
- [^LocalState local-state]
- (if-let [tmp (.get local-state LS-APPROVED-WORKERS)]
- (into {} (.get_approved_workers tmp))))
-
-(defn ->ExecutorInfo
- [[low high]] (ExecutorInfo. low high))
-
-(defn ->ExecutorInfo-list
- [executors]
- (map ->ExecutorInfo executors))
-
-(defn ->executor-list
- [executors]
- (into []
- (for [exec-info executors]
- [(.get_task_start exec-info) (.get_task_end exec-info)])))
-
-(defn ->LocalAssignment
- [{storm-id :storm-id executors :executors resources :resources}]
- (let [assignment (LocalAssignment. storm-id (->ExecutorInfo-list executors))]
- (if resources (.set_resources assignment
- (doto (WorkerResources. )
- (.set_mem_on_heap (first resources))
- (.set_mem_off_heap (second resources))
- (.set_cpu (last resources)))))
- assignment))
-
-(defn mk-local-assignment
- [storm-id executors resources]
- {:storm-id storm-id :executors executors :resources resources})
-
-(defn ->local-assignment
- [^LocalAssignment thrift-local-assignment]
- (mk-local-assignment
- (.get_topology_id thrift-local-assignment)
- (->executor-list (.get_executors thrift-local-assignment))
- (.get_resources thrift-local-assignment)))
-
-(defn ls-local-assignments!
- [^LocalState local-state assignments]
- (let [local-assignment-map (map-val ->LocalAssignment assignments)]
- (.put local-state LS-LOCAL-ASSIGNMENTS
- (LSSupervisorAssignments. local-assignment-map))))
-
-(defn ls-local-assignments
- [^LocalState local-state]
- (if-let [thrift-local-assignments (.get local-state LS-LOCAL-ASSIGNMENTS)]
- (map-val
- ->local-assignment
- (.get_assignments thrift-local-assignments))))
-
-(defn ls-worker-heartbeat!
- [^LocalState local-state time-secs storm-id executors port]
- (.put local-state LS-WORKER-HEARTBEAT (LSWorkerHeartbeat. time-secs storm-id (->ExecutorInfo-list executors) port) false))
-
-(defn ls-worker-heartbeat
- [^LocalState local-state]
- (if-let [worker-hb (.get local-state LS-WORKER-HEARTBEAT)]
- {:time-secs (.get_time_secs worker-hb)
- :storm-id (.get_topology_id worker-hb)
- :executors (->executor-list (.get_executors worker-hb))
- :port (.get_port worker-hb)}))
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/log.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/log.clj b/storm-core/src/clj/backtype/storm/log.clj
deleted file mode 100644
index 96570e3..0000000
--- a/storm-core/src/clj/backtype/storm/log.clj
+++ /dev/null
@@ -1,56 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.log
- (:require [clojure.tools.logging :as log])
- (:use [clojure pprint])
- (:import [java.io StringWriter]))
-
-(defmacro log-message
- [& args]
- `(log/info (str ~@args)))
-
-(defmacro log-error
- [e & args]
- `(log/log :error ~e (str ~@args)))
-
-(defmacro log-debug
- [& args]
- `(log/debug (str ~@args)))
-
-(defmacro log-warn-error
- [e & args]
- `(log/warn (str ~@args) ~e))
-
-(defmacro log-warn
- [& args]
- `(log/warn (str ~@args)))
-
-(defn log-capture!
- [& args]
- (apply log/log-capture! args))
-
-(defn log-stream
- [& args]
- (apply log/log-stream args))
-
-(defmacro log-pprint
- [& args]
- `(let [^StringWriter writer# (StringWriter.)]
- (doall
- (for [object# [~@args]]
- (pprint object# writer#)))
- (log-message "\n" writer#)))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/messaging/loader.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/messaging/loader.clj b/storm-core/src/clj/backtype/storm/messaging/loader.clj
deleted file mode 100644
index b190ab0..0000000
--- a/storm-core/src/clj/backtype/storm/messaging/loader.clj
+++ /dev/null
@@ -1,34 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.messaging.loader
- (:import [org.apache.storm.messaging IConnection DeserializingConnectionCallback])
- (:require [org.apache.storm.messaging [local :as local]]))
-
-(defn mk-local-context []
- (local/mk-context))
-
-(defn- mk-connection-callback
- "make an IConnectionCallback"
- [transfer-local-fn storm-conf worker-context]
- (DeserializingConnectionCallback. storm-conf
- worker-context
- (fn [batch]
- (transfer-local-fn batch))))
-
-(defn register-callback
- "register the local-transfer-fn with the server"
- [transfer-local-fn ^IConnection socket storm-conf worker-context]
- (.registerRecv socket (mk-connection-callback transfer-local-fn storm-conf worker-context)))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/messaging/local.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/messaging/local.clj b/storm-core/src/clj/backtype/storm/messaging/local.clj
deleted file mode 100644
index 32fbb34..0000000
--- a/storm-core/src/clj/backtype/storm/messaging/local.clj
+++ /dev/null
@@ -1,23 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.messaging.local
- (:import [org.apache.storm.messaging IContext])
- (:import [org.apache.storm.messaging.local Context]))
-
-(defn mk-context []
- (let [context (Context.)]
- (.prepare ^IContext context nil)
- context))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/metric/testing.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/metric/testing.clj b/storm-core/src/clj/backtype/storm/metric/testing.clj
deleted file mode 100644
index a8ec438..0000000
--- a/storm-core/src/clj/backtype/storm/metric/testing.clj
+++ /dev/null
@@ -1,68 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.metric.testing
- "This namespace is for AOT dependent metrics testing code."
- (:gen-class))
-
-(letfn [(for- [threader arg seq-exprs body]
- `(reduce #(%2 %1)
- ~arg
- (for ~seq-exprs
- (fn [arg#] (~threader arg# ~@body)))))]
- (defmacro for->
- "Apply a thread expression to a sequence.
- eg.
- (-> 1
- (for-> [x [1 2 3]]
- (+ x)))
- => 7"
- {:indent 1}
- [arg seq-exprs & body]
- (for- 'clojure.core/-> arg seq-exprs body)))
-
-(gen-class
- :name clojure.storm.metric.testing.FakeMetricConsumer
- :implements [org.apache.storm.metric.api.IMetricsConsumer]
- :prefix "impl-")
-
-(def buffer (atom nil))
-
-(defn impl-prepare [this conf argument ctx error-reporter]
- (reset! buffer {}))
-
-(defn impl-cleanup [this]
- (reset! buffer {}))
-
-(defn vec-conj [coll x] (if coll
- (conj coll x)
- [x]))
-
-(defn expand-complex-datapoint [dp]
- (if (or (map? (.value dp))
- (instance? java.util.AbstractMap (.value dp)))
- (into [] (for [[k v] (.value dp)]
- [(str (.name dp) "/" k) v]))
- [[(.name dp) (.value dp)]]))
-
-(defn impl-handleDataPoints [this task-info data-points]
- (swap! buffer
- (fn [old]
- (-> old
- (for-> [dp data-points
- [name val] (expand-complex-datapoint dp)]
- (update-in [(.srcComponentId task-info) name (.srcTaskId task-info)] vec-conj val))))))
-
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/pacemaker/pacemaker.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/pacemaker/pacemaker.clj b/storm-core/src/clj/backtype/storm/pacemaker/pacemaker.clj
deleted file mode 100644
index 70313e4..0000000
--- a/storm-core/src/clj/backtype/storm/pacemaker/pacemaker.clj
+++ /dev/null
@@ -1,241 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.pacemaker.pacemaker
- (:import [org.apache.storm.pacemaker PacemakerServer IServerMessageHandler]
- [java.util.concurrent ConcurrentHashMap]
- [java.util.concurrent.atomic AtomicInteger]
- [org.apache.storm.generated HBNodes
- HBServerMessageType HBMessage HBMessageData HBPulse]
- [org.apache.storm.utils VersionInfo])
- (:use [clojure.string :only [replace-first split]]
- [org.apache.storm log config util])
- (:require [clojure.java.jmx :as jmx])
- (:gen-class))
-
-(def STORM-VERSION (VersionInfo/getVersion))
-
-;; Stats Functions
-
-(def sleep-seconds 60)
-
-
-(defn- check-and-set-loop [stats key new & {:keys [compare new-fn]
- :or {compare (fn [new old] true)
- new-fn (fn [new old] new)}}]
- (loop []
- (let [old (.get (key stats))
- new (new-fn new old)]
- (if (compare new old)
- (if (.compareAndSet (key stats) old new)
- nil
- (recur))
- nil))))
-
-(defn- set-average [stats size]
- (check-and-set-loop
- stats
- :average-heartbeat-size
- size
- :new-fn (fn [new old]
- (let [count (.get (:send-pulse-count stats))]
- ; Weighted average
- (/ (+ new (* count old)) (+ count 1))))))
-
-(defn- set-largest [stats size]
- (check-and-set-loop
- stats
- :largest-heartbeat-size
- size
- :compare #'>))
-
-(defn- report-stats [heartbeats stats last-five-s]
- (loop []
- (let [send-count (.getAndSet (:send-pulse-count stats) 0)
- received-size (.getAndSet (:total-received-size stats) 0)
- get-count (.getAndSet (:get-pulse-count stats) 0)
- sent-size (.getAndSet (:total-sent-size stats) 0)
- largest (.getAndSet (:largest-heartbeat-size stats) 0)
- average (.getAndSet (:average-heartbeat-size stats) 0)
- total-keys (.size heartbeats)]
- (log-debug "\nReceived " send-count " heartbeats totaling " received-size " bytes,\n"
- "Sent " get-count " heartbeats totaling " sent-size " bytes,\n"
- "The largest heartbeat was " largest " bytes,\n"
- "The average heartbeat was " average " bytes,\n"
- "Pacemaker contained " total-keys " total keys\n"
- "in the last " sleep-seconds " second(s)")
- (dosync (ref-set last-five-s
- {:send-pulse-count send-count
- :total-received-size received-size
- :get-pulse-count get-count
- :total-sent-size sent-size
- :largest-heartbeat-size largest
- :average-heartbeat-size average
- :total-keys total-keys})))
- (Thread/sleep (* 1000 sleep-seconds))
- (recur)))
-
-;; JMX stuff
-(defn register [last-five-s]
- (jmx/register-mbean
- (jmx/create-bean
- last-five-s)
- "org.apache.storm.pacemaker.pacemaker:stats=Stats_Last_5_Seconds"))
-
-
-;; Pacemaker Functions
-
-(defn hb-data []
- (ConcurrentHashMap.))
-
-(defn create-path [^String path heartbeats]
- (HBMessage. HBServerMessageType/CREATE_PATH_RESPONSE nil))
-
-(defn exists [^String path heartbeats]
- (let [it-does (.containsKey heartbeats path)]
- (log-debug (str "Checking if path [" path "] exists..." it-does "."))
- (HBMessage. HBServerMessageType/EXISTS_RESPONSE
- (HBMessageData/boolval it-does))))
-
-(defn send-pulse [^HBPulse pulse heartbeats pacemaker-stats]
- (let [id (.get_id pulse)
- details (.get_details pulse)]
- (log-debug (str "Saving Pulse for id [" id "] data [" + (str details) "]."))
-
- (.incrementAndGet (:send-pulse-count pacemaker-stats))
- (.addAndGet (:total-received-size pacemaker-stats) (alength details))
- (set-largest pacemaker-stats (alength details))
- (set-average pacemaker-stats (alength details))
-
- (.put heartbeats id details)
- (HBMessage. HBServerMessageType/SEND_PULSE_RESPONSE nil)))
-
-(defn get-all-pulse-for-path [^String path heartbeats]
- (HBMessage. HBServerMessageType/GET_ALL_PULSE_FOR_PATH_RESPONSE nil))
-
-(defn get-all-nodes-for-path [^String path ^ConcurrentHashMap heartbeats]
- (log-debug "List all nodes for path " path)
- (HBMessage. HBServerMessageType/GET_ALL_NODES_FOR_PATH_RESPONSE
- (HBMessageData/nodes
- (HBNodes. (distinct (for [k (.keySet heartbeats)
- :let [trimmed-k (first
- (filter #(not (= "" %))
- (split (replace-first k path "") #"/")))]
- :when (and
- (not (nil? trimmed-k))
- (= (.indexOf k path) 0))]
- trimmed-k))))))
-
-(defn get-pulse [^String path heartbeats pacemaker-stats]
- (let [details (.get heartbeats path)]
- (log-debug (str "Getting Pulse for path [" path "]...data " (str details) "]."))
-
-
- (.incrementAndGet (:get-pulse-count pacemaker-stats))
- (if details
- (.addAndGet (:total-sent-size pacemaker-stats) (alength details)))
-
- (HBMessage. HBServerMessageType/GET_PULSE_RESPONSE
- (HBMessageData/pulse
- (doto (HBPulse. ) (.set_id path) (.set_details details))))))
-
-(defn delete-pulse-id [^String path heartbeats]
- (log-debug (str "Deleting Pulse for id [" path "]."))
- (.remove heartbeats path)
- (HBMessage. HBServerMessageType/DELETE_PULSE_ID_RESPONSE nil))
-
-(defn delete-path [^String path heartbeats]
- (let [prefix (if (= \/ (last path)) path (str path "/"))]
- (doseq [k (.keySet heartbeats)
- :when (= (.indexOf k prefix) 0)]
- (delete-pulse-id k heartbeats)))
- (HBMessage. HBServerMessageType/DELETE_PATH_RESPONSE nil))
-
-(defn not-authorized []
- (HBMessage. HBServerMessageType/NOT_AUTHORIZED nil))
-
-(defn mk-handler [conf]
- (let [heartbeats ^ConcurrentHashMap (hb-data)
- pacemaker-stats {:send-pulse-count (AtomicInteger.)
- :total-received-size (AtomicInteger.)
- :get-pulse-count (AtomicInteger.)
- :total-sent-size (AtomicInteger.)
- :largest-heartbeat-size (AtomicInteger.)
- :average-heartbeat-size (AtomicInteger.)}
- last-five (ref {:send-pulse-count 0
- :total-received-size 0
- :get-pulse-count 0
- :total-sent-size 0
- :largest-heartbeat-size 0
- :average-heartbeat-size 0
- :total-keys 0})
- stats-thread (Thread. (fn [] (report-stats heartbeats pacemaker-stats last-five)))]
- (.setDaemon stats-thread true)
- (.start stats-thread)
- (register last-five)
- (reify
- IServerMessageHandler
- (^HBMessage handleMessage [this ^HBMessage request ^boolean authenticated]
- (let [response
- (condp = (.get_type request)
- HBServerMessageType/CREATE_PATH
- (create-path (.get_path (.get_data request)) heartbeats)
-
- HBServerMessageType/EXISTS
- (if authenticated
- (exists (.get_path (.get_data request)) heartbeats)
- (not-authorized))
-
- HBServerMessageType/SEND_PULSE
- (send-pulse (.get_pulse (.get_data request)) heartbeats pacemaker-stats)
-
- HBServerMessageType/GET_ALL_PULSE_FOR_PATH
- (if authenticated
- (get-all-pulse-for-path (.get_path (.get_data request)) heartbeats)
- (not-authorized))
-
- HBServerMessageType/GET_ALL_NODES_FOR_PATH
- (if authenticated
- (get-all-nodes-for-path (.get_path (.get_data request)) heartbeats)
- (not-authorized))
-
- HBServerMessageType/GET_PULSE
- (if authenticated
- (get-pulse (.get_path (.get_data request)) heartbeats pacemaker-stats)
- (not-authorized))
-
- HBServerMessageType/DELETE_PATH
- (delete-path (.get_path (.get_data request)) heartbeats)
-
- HBServerMessageType/DELETE_PULSE_ID
- (delete-pulse-id (.get_path (.get_data request)) heartbeats)
-
- ; Otherwise
- (log-message "Got Unexpected Type: " (.get_type request)))]
-
- (.set_message_id response (.get_message_id request))
- response)))))
-
-(defn launch-server! []
- (log-message "Starting pacemaker server for storm version '"
- STORM-VERSION
- "'")
- (let [conf (override-login-config-with-system-property (read-storm-config))]
- (PacemakerServer. (mk-handler conf) conf)))
-
-(defn -main []
- (redirect-stdio-to-slf4j!)
- (launch-server!))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/pacemaker/pacemaker_state_factory.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/pacemaker/pacemaker_state_factory.clj b/storm-core/src/clj/backtype/storm/pacemaker/pacemaker_state_factory.clj
deleted file mode 100644
index cede59e..0000000
--- a/storm-core/src/clj/backtype/storm/pacemaker/pacemaker_state_factory.clj
+++ /dev/null
@@ -1,125 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.pacemaker.pacemaker-state-factory
- (:require [org.apache.storm.pacemaker pacemaker]
- [org.apache.storm.cluster-state [zookeeper-state-factory :as zk-factory]]
- [org.apache.storm
- [config :refer :all]
- [cluster :refer :all]
- [log :refer :all]
- [util :as util]])
- (:import [org.apache.storm.generated
- HBExecutionException HBServerMessageType HBMessage
- HBMessageData HBPulse]
- [org.apache.storm.cluster_state zookeeper_state_factory]
- [org.apache.storm.cluster ClusterState]
- [org.apache.storm.pacemaker PacemakerClient])
- (:gen-class
- :implements [org.apache.storm.cluster.ClusterStateFactory]))
-
-;; So we can mock the client for testing
-(defn makeClient [conf]
- (PacemakerClient. conf))
-
-(defn makeZKState [conf auth-conf acls context]
- (.mkState (zookeeper_state_factory.) conf auth-conf acls context))
-
-(def max-retries 10)
-
-(defn -mkState [this conf auth-conf acls context]
- (let [zk-state (makeZKState conf auth-conf acls context)
- pacemaker-client (makeClient conf)]
-
- (reify
- ClusterState
- ;; Let these pass through to the zk-state. We only want to handle heartbeats.
- (register [this callback] (.register zk-state callback))
- (unregister [this callback] (.unregister zk-state callback))
- (set_ephemeral_node [this path data acls] (.set_ephemeral_node zk-state path data acls))
- (create_sequential [this path data acls] (.create_sequential zk-state path data acls))
- (set_data [this path data acls] (.set_data zk-state path data acls))
- (delete_node [this path] (.delete_node zk-state path))
- (delete_node_blobstore [this path nimbus-host-port-info] (.delete_node_blobstore zk-state path nimbus-host-port-info))
- (get_data [this path watch?] (.get_data zk-state path watch?))
- (get_data_with_version [this path watch?] (.get_data_with_version zk-state path watch?))
- (get_version [this path watch?] (.get_version zk-state path watch?))
- (get_children [this path watch?] (.get_children zk-state path watch?))
- (mkdirs [this path acls] (.mkdirs zk-state path acls))
- (node_exists [this path watch?] (.node_exists zk-state path watch?))
- (add_listener [this listener] (.add_listener zk-state listener))
- (sync_path [this path] (.sync_path zk-state path))
-
- (set_worker_hb [this path data acls]
- (util/retry-on-exception
- max-retries
- "set_worker_hb"
- #(let [response
- (.send pacemaker-client
- (HBMessage. HBServerMessageType/SEND_PULSE
- (HBMessageData/pulse
- (doto (HBPulse.)
- (.set_id path)
- (.set_details data)))))]
- (if (= (.get_type response) HBServerMessageType/SEND_PULSE_RESPONSE)
- :ok
- (throw (HBExecutionException. "Invalid Response Type"))))))
-
- (delete_worker_hb [this path]
- (util/retry-on-exception
- max-retries
- "delete_worker_hb"
- #(let [response
- (.send pacemaker-client
- (HBMessage. HBServerMessageType/DELETE_PATH
- (HBMessageData/path path)))]
- (if (= (.get_type response) HBServerMessageType/DELETE_PATH_RESPONSE)
- :ok
- (throw (HBExecutionException. "Invalid Response Type"))))))
-
- (get_worker_hb [this path watch?]
- (util/retry-on-exception
- max-retries
- "get_worker_hb"
- #(let [response
- (.send pacemaker-client
- (HBMessage. HBServerMessageType/GET_PULSE
- (HBMessageData/path path)))]
- (if (= (.get_type response) HBServerMessageType/GET_PULSE_RESPONSE)
- (try
- (.get_details (.get_pulse (.get_data response)))
- (catch Exception e
- (throw (HBExecutionException. (.toString e)))))
- (throw (HBExecutionException. "Invalid Response Type"))))))
-
- (get_worker_hb_children [this path watch?]
- (util/retry-on-exception
- max-retries
- "get_worker_hb_children"
- #(let [response
- (.send pacemaker-client
- (HBMessage. HBServerMessageType/GET_ALL_NODES_FOR_PATH
- (HBMessageData/path path)))]
- (if (= (.get_type response) HBServerMessageType/GET_ALL_NODES_FOR_PATH_RESPONSE)
- (try
- (into [] (.get_pulseIds (.get_nodes (.get_data response))))
- (catch Exception e
- (throw (HBExecutionException. (.toString e)))))
- (throw (HBExecutionException. "Invalid Response Type"))))))
-
- (close [this]
- (.close zk-state)
- (.close pacemaker-client)))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/process_simulator.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/process_simulator.clj b/storm-core/src/clj/backtype/storm/process_simulator.clj
deleted file mode 100644
index 03c3dd9..0000000
--- a/storm-core/src/clj/backtype/storm/process_simulator.clj
+++ /dev/null
@@ -1,51 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.process-simulator
- (:use [org.apache.storm log util]))
-
-(def pid-counter (mk-counter))
-
-(def process-map (atom {}))
-
-(def kill-lock (Object.))
-
-(defn register-process [pid shutdownable]
- (swap! process-map assoc pid shutdownable))
-
-(defn process-handle
- [pid]
- (@process-map pid))
-
-(defn all-processes
- []
- (vals @process-map))
-
-(defn kill-process
- "Uses `locking` in case cluster shuts down while supervisor is
- killing a task"
- [pid]
- (locking kill-lock
- (log-message "Killing process " pid)
- (let [shutdownable (process-handle pid)]
- (swap! process-map dissoc pid)
- (when shutdownable
- (.shutdown shutdownable)))))
-
-(defn kill-all-processes
- []
- (doseq [pid (keys @process-map)]
- (kill-process pid)))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/scheduler/DefaultScheduler.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/scheduler/DefaultScheduler.clj b/storm-core/src/clj/backtype/storm/scheduler/DefaultScheduler.clj
deleted file mode 100644
index f6f89f8..0000000
--- a/storm-core/src/clj/backtype/storm/scheduler/DefaultScheduler.clj
+++ /dev/null
@@ -1,77 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.scheduler.DefaultScheduler
- (:use [org.apache.storm util config])
- (:require [org.apache.storm.scheduler.EvenScheduler :as EvenScheduler])
- (:import [org.apache.storm.scheduler IScheduler Topologies
- Cluster TopologyDetails WorkerSlot SchedulerAssignment
- EvenScheduler ExecutorDetails])
- (:gen-class
- :implements [org.apache.storm.scheduler.IScheduler]))
-
-(defn- bad-slots [existing-slots num-executors num-workers]
- (if (= 0 num-workers)
- '()
- (let [distribution (atom (integer-divided num-executors num-workers))
- keepers (atom {})]
- (doseq [[node+port executor-list] existing-slots :let [executor-count (count executor-list)]]
- (when (pos? (get @distribution executor-count 0))
- (swap! keepers assoc node+port executor-list)
- (swap! distribution update-in [executor-count] dec)
- ))
- (->> @keepers
- keys
- (apply dissoc existing-slots)
- keys
- (map (fn [[node port]]
- (WorkerSlot. node port)))))))
-
-(defn slots-can-reassign [^Cluster cluster slots]
- (->> slots
- (filter
- (fn [[node port]]
- (if-not (.isBlackListed cluster node)
- (if-let [supervisor (.getSupervisorById cluster node)]
- (.contains (.getAllPorts supervisor) (int port))
- ))))))
-
-(defn -prepare [this conf]
- )
-
-(defn default-schedule [^Topologies topologies ^Cluster cluster]
- (let [needs-scheduling-topologies (.needsSchedulingTopologies cluster topologies)]
- (doseq [^TopologyDetails topology needs-scheduling-topologies
- :let [topology-id (.getId topology)
- available-slots (->> (.getAvailableSlots cluster)
- (map #(vector (.getNodeId %) (.getPort %))))
- all-executors (->> topology
- .getExecutors
- (map #(vector (.getStartTask %) (.getEndTask %)))
- set)
- alive-assigned (EvenScheduler/get-alive-assigned-node+port->executors cluster topology-id)
- alive-executors (->> alive-assigned vals (apply concat) set)
- can-reassign-slots (slots-can-reassign cluster (keys alive-assigned))
- total-slots-to-use (min (.getNumWorkers topology)
- (+ (count can-reassign-slots) (count available-slots)))
- bad-slots (if (or (> total-slots-to-use (count alive-assigned))
- (not= alive-executors all-executors))
- (bad-slots alive-assigned (count all-executors) total-slots-to-use)
- [])]]
- (.freeSlots cluster bad-slots)
- (EvenScheduler/schedule-topologies-evenly (Topologies. {topology-id topology}) cluster))))
-
-(defn -schedule [this ^Topologies topologies ^Cluster cluster]
- (default-schedule topologies cluster))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/scheduler/EvenScheduler.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/scheduler/EvenScheduler.clj b/storm-core/src/clj/backtype/storm/scheduler/EvenScheduler.clj
deleted file mode 100644
index 783da26..0000000
--- a/storm-core/src/clj/backtype/storm/scheduler/EvenScheduler.clj
+++ /dev/null
@@ -1,81 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.scheduler.EvenScheduler
- (:use [org.apache.storm util log config])
- (:require [clojure.set :as set])
- (:import [org.apache.storm.scheduler IScheduler Topologies
- Cluster TopologyDetails WorkerSlot ExecutorDetails])
- (:gen-class
- :implements [org.apache.storm.scheduler.IScheduler]))
-
-(defn sort-slots [all-slots]
- (let [split-up (sort-by count > (vals (group-by first all-slots)))]
- (apply interleave-all split-up)
- ))
-
-(defn get-alive-assigned-node+port->executors [cluster topology-id]
- (let [existing-assignment (.getAssignmentById cluster topology-id)
- executor->slot (if existing-assignment
- (.getExecutorToSlot existing-assignment)
- {})
- executor->node+port (into {} (for [[^ExecutorDetails executor ^WorkerSlot slot] executor->slot
- :let [executor [(.getStartTask executor) (.getEndTask executor)]
- node+port [(.getNodeId slot) (.getPort slot)]]]
- {executor node+port}))
- alive-assigned (reverse-map executor->node+port)]
- alive-assigned))
-
-(defn- schedule-topology [^TopologyDetails topology ^Cluster cluster]
- (let [topology-id (.getId topology)
- available-slots (->> (.getAvailableSlots cluster)
- (map #(vector (.getNodeId %) (.getPort %))))
- all-executors (->> topology
- .getExecutors
- (map #(vector (.getStartTask %) (.getEndTask %)))
- set)
- alive-assigned (get-alive-assigned-node+port->executors cluster topology-id)
- total-slots-to-use (min (.getNumWorkers topology)
- (+ (count available-slots) (count alive-assigned)))
- reassign-slots (take (- total-slots-to-use (count alive-assigned))
- (sort-slots available-slots))
- reassign-executors (sort (set/difference all-executors (set (apply concat (vals alive-assigned)))))
- reassignment (into {}
- (map vector
- reassign-executors
- ;; for some reason it goes into infinite loop without limiting the repeat-seq
- (repeat-seq (count reassign-executors) reassign-slots)))]
- (when-not (empty? reassignment)
- (log-message "Available slots: " (pr-str available-slots))
- )
- reassignment))
-
-(defn schedule-topologies-evenly [^Topologies topologies ^Cluster cluster]
- (let [needs-scheduling-topologies (.needsSchedulingTopologies cluster topologies)]
- (doseq [^TopologyDetails topology needs-scheduling-topologies
- :let [topology-id (.getId topology)
- new-assignment (schedule-topology topology cluster)
- node+port->executors (reverse-map new-assignment)]]
- (doseq [[node+port executors] node+port->executors
- :let [^WorkerSlot slot (WorkerSlot. (first node+port) (last node+port))
- executors (for [[start-task end-task] executors]
- (ExecutorDetails. start-task end-task))]]
- (.assign cluster slot topology-id executors)))))
-
-(defn -prepare [this conf]
- )
-
-(defn -schedule [this ^Topologies topologies ^Cluster cluster]
- (schedule-topologies-evenly topologies cluster))
[25/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ErrorInfo.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ErrorInfo.java b/storm-core/src/jvm/backtype/storm/generated/ErrorInfo.java
deleted file mode 100644
index 2ab536d..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ErrorInfo.java
+++ /dev/null
@@ -1,714 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ErrorInfo implements org.apache.thrift.TBase<ErrorInfo, ErrorInfo._Fields>, java.io.Serializable, Cloneable, Comparable<ErrorInfo> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ErrorInfo");
-
- private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField ERROR_TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("error_time_secs", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)3);
- private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)4);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ErrorInfoStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ErrorInfoTupleSchemeFactory());
- }
-
- private String error; // required
- private int error_time_secs; // required
- private String host; // optional
- private int port; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- ERROR((short)1, "error"),
- ERROR_TIME_SECS((short)2, "error_time_secs"),
- HOST((short)3, "host"),
- PORT((short)4, "port");
-
- private static final Map<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: // ERROR
- return ERROR;
- case 2: // ERROR_TIME_SECS
- return ERROR_TIME_SECS;
- case 3: // HOST
- return HOST;
- case 4: // PORT
- return PORT;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _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 __ERROR_TIME_SECS_ISSET_ID = 0;
- private static final int __PORT_ISSET_ID = 1;
- private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.HOST,_Fields.PORT};
- 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.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.ERROR_TIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("error_time_secs", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", 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(ErrorInfo.class, metaDataMap);
- }
-
- public ErrorInfo() {
- }
-
- public ErrorInfo(
- String error,
- int error_time_secs)
- {
- this();
- this.error = error;
- this.error_time_secs = error_time_secs;
- set_error_time_secs_isSet(true);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ErrorInfo(ErrorInfo other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.is_set_error()) {
- this.error = other.error;
- }
- this.error_time_secs = other.error_time_secs;
- if (other.is_set_host()) {
- this.host = other.host;
- }
- this.port = other.port;
- }
-
- public ErrorInfo deepCopy() {
- return new ErrorInfo(this);
- }
-
- @Override
- public void clear() {
- this.error = null;
- set_error_time_secs_isSet(false);
- this.error_time_secs = 0;
- this.host = null;
- set_port_isSet(false);
- this.port = 0;
- }
-
- public String get_error() {
- return this.error;
- }
-
- public void set_error(String error) {
- this.error = error;
- }
-
- public void unset_error() {
- this.error = null;
- }
-
- /** Returns true if field error is set (has been assigned a value) and false otherwise */
- public boolean is_set_error() {
- return this.error != null;
- }
-
- public void set_error_isSet(boolean value) {
- if (!value) {
- this.error = null;
- }
- }
-
- public int get_error_time_secs() {
- return this.error_time_secs;
- }
-
- public void set_error_time_secs(int error_time_secs) {
- this.error_time_secs = error_time_secs;
- set_error_time_secs_isSet(true);
- }
-
- public void unset_error_time_secs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERROR_TIME_SECS_ISSET_ID);
- }
-
- /** Returns true if field error_time_secs is set (has been assigned a value) and false otherwise */
- public boolean is_set_error_time_secs() {
- return EncodingUtils.testBit(__isset_bitfield, __ERROR_TIME_SECS_ISSET_ID);
- }
-
- public void set_error_time_secs_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERROR_TIME_SECS_ISSET_ID, value);
- }
-
- public String get_host() {
- return this.host;
- }
-
- public void set_host(String host) {
- this.host = host;
- }
-
- public void unset_host() {
- this.host = null;
- }
-
- /** Returns true if field host is set (has been assigned a value) and false otherwise */
- public boolean is_set_host() {
- return this.host != null;
- }
-
- public void set_host_isSet(boolean value) {
- if (!value) {
- this.host = null;
- }
- }
-
- public int get_port() {
- return this.port;
- }
-
- public void set_port(int port) {
- this.port = port;
- set_port_isSet(true);
- }
-
- public void unset_port() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID);
- }
-
- /** Returns true if field port is set (has been assigned a value) and false otherwise */
- public boolean is_set_port() {
- return EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID);
- }
-
- public void set_port_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ERROR:
- if (value == null) {
- unset_error();
- } else {
- set_error((String)value);
- }
- break;
-
- case ERROR_TIME_SECS:
- if (value == null) {
- unset_error_time_secs();
- } else {
- set_error_time_secs((Integer)value);
- }
- break;
-
- case HOST:
- if (value == null) {
- unset_host();
- } else {
- set_host((String)value);
- }
- break;
-
- case PORT:
- if (value == null) {
- unset_port();
- } else {
- set_port((Integer)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ERROR:
- return get_error();
-
- case ERROR_TIME_SECS:
- return get_error_time_secs();
-
- case HOST:
- return get_host();
-
- case PORT:
- return get_port();
-
- }
- 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 ERROR:
- return is_set_error();
- case ERROR_TIME_SECS:
- return is_set_error_time_secs();
- case HOST:
- return is_set_host();
- case PORT:
- return is_set_port();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ErrorInfo)
- return this.equals((ErrorInfo)that);
- return false;
- }
-
- public boolean equals(ErrorInfo that) {
- if (that == null)
- return false;
-
- boolean this_present_error = true && this.is_set_error();
- boolean that_present_error = true && that.is_set_error();
- if (this_present_error || that_present_error) {
- if (!(this_present_error && that_present_error))
- return false;
- if (!this.error.equals(that.error))
- return false;
- }
-
- boolean this_present_error_time_secs = true;
- boolean that_present_error_time_secs = true;
- if (this_present_error_time_secs || that_present_error_time_secs) {
- if (!(this_present_error_time_secs && that_present_error_time_secs))
- return false;
- if (this.error_time_secs != that.error_time_secs)
- return false;
- }
-
- boolean this_present_host = true && this.is_set_host();
- boolean that_present_host = true && that.is_set_host();
- if (this_present_host || that_present_host) {
- if (!(this_present_host && that_present_host))
- return false;
- if (!this.host.equals(that.host))
- return false;
- }
-
- boolean this_present_port = true && this.is_set_port();
- boolean that_present_port = true && that.is_set_port();
- if (this_present_port || that_present_port) {
- if (!(this_present_port && that_present_port))
- return false;
- if (this.port != that.port)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_error = true && (is_set_error());
- list.add(present_error);
- if (present_error)
- list.add(error);
-
- boolean present_error_time_secs = true;
- list.add(present_error_time_secs);
- if (present_error_time_secs)
- list.add(error_time_secs);
-
- boolean present_host = true && (is_set_host());
- list.add(present_host);
- if (present_host)
- list.add(host);
-
- boolean present_port = true && (is_set_port());
- list.add(present_port);
- if (present_port)
- list.add(port);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ErrorInfo other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_error()).compareTo(other.is_set_error());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_error()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_error_time_secs()).compareTo(other.is_set_error_time_secs());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_error_time_secs()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error_time_secs, other.error_time_secs);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_host()).compareTo(other.is_set_host());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_host()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, other.host);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_port()).compareTo(other.is_set_port());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_port()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port);
- 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("ErrorInfo(");
- boolean first = true;
-
- sb.append("error:");
- if (this.error == null) {
- sb.append("null");
- } else {
- sb.append(this.error);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("error_time_secs:");
- sb.append(this.error_time_secs);
- first = false;
- if (is_set_host()) {
- if (!first) sb.append(", ");
- sb.append("host:");
- if (this.host == null) {
- sb.append("null");
- } else {
- sb.append(this.host);
- }
- first = false;
- }
- if (is_set_port()) {
- if (!first) sb.append(", ");
- sb.append("port:");
- sb.append(this.port);
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_error()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'error' is unset! Struct:" + toString());
- }
-
- if (!is_set_error_time_secs()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'error_time_secs' 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 ErrorInfoStandardSchemeFactory implements SchemeFactory {
- public ErrorInfoStandardScheme getScheme() {
- return new ErrorInfoStandardScheme();
- }
- }
-
- private static class ErrorInfoStandardScheme extends StandardScheme<ErrorInfo> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ErrorInfo 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: // ERROR
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.error = iprot.readString();
- struct.set_error_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // ERROR_TIME_SECS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.error_time_secs = iprot.readI32();
- struct.set_error_time_secs_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // HOST
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.host = iprot.readString();
- struct.set_host_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // PORT
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.port = iprot.readI32();
- struct.set_port_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, ErrorInfo struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.error != null) {
- oprot.writeFieldBegin(ERROR_FIELD_DESC);
- oprot.writeString(struct.error);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(ERROR_TIME_SECS_FIELD_DESC);
- oprot.writeI32(struct.error_time_secs);
- oprot.writeFieldEnd();
- if (struct.host != null) {
- if (struct.is_set_host()) {
- oprot.writeFieldBegin(HOST_FIELD_DESC);
- oprot.writeString(struct.host);
- oprot.writeFieldEnd();
- }
- }
- if (struct.is_set_port()) {
- oprot.writeFieldBegin(PORT_FIELD_DESC);
- oprot.writeI32(struct.port);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ErrorInfoTupleSchemeFactory implements SchemeFactory {
- public ErrorInfoTupleScheme getScheme() {
- return new ErrorInfoTupleScheme();
- }
- }
-
- private static class ErrorInfoTupleScheme extends TupleScheme<ErrorInfo> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ErrorInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.error);
- oprot.writeI32(struct.error_time_secs);
- BitSet optionals = new BitSet();
- if (struct.is_set_host()) {
- optionals.set(0);
- }
- if (struct.is_set_port()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.is_set_host()) {
- oprot.writeString(struct.host);
- }
- if (struct.is_set_port()) {
- oprot.writeI32(struct.port);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ErrorInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.error = iprot.readString();
- struct.set_error_isSet(true);
- struct.error_time_secs = iprot.readI32();
- struct.set_error_time_secs_isSet(true);
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.host = iprot.readString();
- struct.set_host_isSet(true);
- }
- if (incoming.get(1)) {
- struct.port = iprot.readI32();
- struct.set_port_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ExecutorAggregateStats.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ExecutorAggregateStats.java b/storm-core/src/jvm/backtype/storm/generated/ExecutorAggregateStats.java
deleted file mode 100644
index 5bc85e0..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ExecutorAggregateStats.java
+++ /dev/null
@@ -1,526 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ExecutorAggregateStats implements org.apache.thrift.TBase<ExecutorAggregateStats, ExecutorAggregateStats._Fields>, java.io.Serializable, Cloneable, Comparable<ExecutorAggregateStats> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecutorAggregateStats");
-
- private static final org.apache.thrift.protocol.TField EXEC_SUMMARY_FIELD_DESC = new org.apache.thrift.protocol.TField("exec_summary", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("stats", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ExecutorAggregateStatsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ExecutorAggregateStatsTupleSchemeFactory());
- }
-
- private ExecutorSummary exec_summary; // optional
- private ComponentAggregateStats stats; // 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 {
- EXEC_SUMMARY((short)1, "exec_summary"),
- STATS((short)2, "stats");
-
- 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: // EXEC_SUMMARY
- return EXEC_SUMMARY;
- case 2: // STATS
- return STATS;
- 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.EXEC_SUMMARY,_Fields.STATS};
- 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.EXEC_SUMMARY, new org.apache.thrift.meta_data.FieldMetaData("exec_summary", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ExecutorSummary.class)));
- tmpMap.put(_Fields.STATS, new org.apache.thrift.meta_data.FieldMetaData("stats", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentAggregateStats.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecutorAggregateStats.class, metaDataMap);
- }
-
- public ExecutorAggregateStats() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ExecutorAggregateStats(ExecutorAggregateStats other) {
- if (other.is_set_exec_summary()) {
- this.exec_summary = new ExecutorSummary(other.exec_summary);
- }
- if (other.is_set_stats()) {
- this.stats = new ComponentAggregateStats(other.stats);
- }
- }
-
- public ExecutorAggregateStats deepCopy() {
- return new ExecutorAggregateStats(this);
- }
-
- @Override
- public void clear() {
- this.exec_summary = null;
- this.stats = null;
- }
-
- public ExecutorSummary get_exec_summary() {
- return this.exec_summary;
- }
-
- public void set_exec_summary(ExecutorSummary exec_summary) {
- this.exec_summary = exec_summary;
- }
-
- public void unset_exec_summary() {
- this.exec_summary = null;
- }
-
- /** Returns true if field exec_summary is set (has been assigned a value) and false otherwise */
- public boolean is_set_exec_summary() {
- return this.exec_summary != null;
- }
-
- public void set_exec_summary_isSet(boolean value) {
- if (!value) {
- this.exec_summary = null;
- }
- }
-
- public ComponentAggregateStats get_stats() {
- return this.stats;
- }
-
- public void set_stats(ComponentAggregateStats stats) {
- this.stats = stats;
- }
-
- public void unset_stats() {
- this.stats = null;
- }
-
- /** Returns true if field stats is set (has been assigned a value) and false otherwise */
- public boolean is_set_stats() {
- return this.stats != null;
- }
-
- public void set_stats_isSet(boolean value) {
- if (!value) {
- this.stats = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case EXEC_SUMMARY:
- if (value == null) {
- unset_exec_summary();
- } else {
- set_exec_summary((ExecutorSummary)value);
- }
- break;
-
- case STATS:
- if (value == null) {
- unset_stats();
- } else {
- set_stats((ComponentAggregateStats)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case EXEC_SUMMARY:
- return get_exec_summary();
-
- case STATS:
- return get_stats();
-
- }
- 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 EXEC_SUMMARY:
- return is_set_exec_summary();
- case STATS:
- return is_set_stats();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ExecutorAggregateStats)
- return this.equals((ExecutorAggregateStats)that);
- return false;
- }
-
- public boolean equals(ExecutorAggregateStats that) {
- if (that == null)
- return false;
-
- boolean this_present_exec_summary = true && this.is_set_exec_summary();
- boolean that_present_exec_summary = true && that.is_set_exec_summary();
- if (this_present_exec_summary || that_present_exec_summary) {
- if (!(this_present_exec_summary && that_present_exec_summary))
- return false;
- if (!this.exec_summary.equals(that.exec_summary))
- return false;
- }
-
- boolean this_present_stats = true && this.is_set_stats();
- boolean that_present_stats = true && that.is_set_stats();
- if (this_present_stats || that_present_stats) {
- if (!(this_present_stats && that_present_stats))
- return false;
- if (!this.stats.equals(that.stats))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_exec_summary = true && (is_set_exec_summary());
- list.add(present_exec_summary);
- if (present_exec_summary)
- list.add(exec_summary);
-
- boolean present_stats = true && (is_set_stats());
- list.add(present_stats);
- if (present_stats)
- list.add(stats);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ExecutorAggregateStats other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_exec_summary()).compareTo(other.is_set_exec_summary());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_exec_summary()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.exec_summary, other.exec_summary);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_stats()).compareTo(other.is_set_stats());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_stats()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stats, other.stats);
- 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("ExecutorAggregateStats(");
- boolean first = true;
-
- if (is_set_exec_summary()) {
- sb.append("exec_summary:");
- if (this.exec_summary == null) {
- sb.append("null");
- } else {
- sb.append(this.exec_summary);
- }
- first = false;
- }
- if (is_set_stats()) {
- if (!first) sb.append(", ");
- sb.append("stats:");
- if (this.stats == null) {
- sb.append("null");
- } else {
- sb.append(this.stats);
- }
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- if (exec_summary != null) {
- exec_summary.validate();
- }
- if (stats != null) {
- stats.validate();
- }
- }
-
- 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 ExecutorAggregateStatsStandardSchemeFactory implements SchemeFactory {
- public ExecutorAggregateStatsStandardScheme getScheme() {
- return new ExecutorAggregateStatsStandardScheme();
- }
- }
-
- private static class ExecutorAggregateStatsStandardScheme extends StandardScheme<ExecutorAggregateStats> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ExecutorAggregateStats 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: // EXEC_SUMMARY
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.exec_summary = new ExecutorSummary();
- struct.exec_summary.read(iprot);
- struct.set_exec_summary_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // STATS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.stats = new ComponentAggregateStats();
- struct.stats.read(iprot);
- struct.set_stats_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, ExecutorAggregateStats struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.exec_summary != null) {
- if (struct.is_set_exec_summary()) {
- oprot.writeFieldBegin(EXEC_SUMMARY_FIELD_DESC);
- struct.exec_summary.write(oprot);
- oprot.writeFieldEnd();
- }
- }
- if (struct.stats != null) {
- if (struct.is_set_stats()) {
- oprot.writeFieldBegin(STATS_FIELD_DESC);
- struct.stats.write(oprot);
- oprot.writeFieldEnd();
- }
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ExecutorAggregateStatsTupleSchemeFactory implements SchemeFactory {
- public ExecutorAggregateStatsTupleScheme getScheme() {
- return new ExecutorAggregateStatsTupleScheme();
- }
- }
-
- private static class ExecutorAggregateStatsTupleScheme extends TupleScheme<ExecutorAggregateStats> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ExecutorAggregateStats struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.is_set_exec_summary()) {
- optionals.set(0);
- }
- if (struct.is_set_stats()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.is_set_exec_summary()) {
- struct.exec_summary.write(oprot);
- }
- if (struct.is_set_stats()) {
- struct.stats.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ExecutorAggregateStats struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.exec_summary = new ExecutorSummary();
- struct.exec_summary.read(iprot);
- struct.set_exec_summary_isSet(true);
- }
- if (incoming.get(1)) {
- struct.stats = new ComponentAggregateStats();
- struct.stats.read(iprot);
- struct.set_stats_isSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ExecutorInfo.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ExecutorInfo.java b/storm-core/src/jvm/backtype/storm/generated/ExecutorInfo.java
deleted file mode 100644
index b3d7bab..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ExecutorInfo.java
+++ /dev/null
@@ -1,499 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class ExecutorInfo implements org.apache.thrift.TBase<ExecutorInfo, ExecutorInfo._Fields>, java.io.Serializable, Cloneable, Comparable<ExecutorInfo> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecutorInfo");
-
- private static final org.apache.thrift.protocol.TField TASK_START_FIELD_DESC = new org.apache.thrift.protocol.TField("task_start", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField TASK_END_FIELD_DESC = new org.apache.thrift.protocol.TField("task_end", org.apache.thrift.protocol.TType.I32, (short)2);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ExecutorInfoStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ExecutorInfoTupleSchemeFactory());
- }
-
- private int task_start; // required
- private int task_end; // 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 {
- TASK_START((short)1, "task_start"),
- TASK_END((short)2, "task_end");
-
- 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: // TASK_START
- return TASK_START;
- case 2: // TASK_END
- return TASK_END;
- 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 __TASK_START_ISSET_ID = 0;
- private static final int __TASK_END_ISSET_ID = 1;
- private byte __isset_bitfield = 0;
- 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.TASK_START, new org.apache.thrift.meta_data.FieldMetaData("task_start", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.TASK_END, new org.apache.thrift.meta_data.FieldMetaData("task_end", 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(ExecutorInfo.class, metaDataMap);
- }
-
- public ExecutorInfo() {
- }
-
- public ExecutorInfo(
- int task_start,
- int task_end)
- {
- this();
- this.task_start = task_start;
- set_task_start_isSet(true);
- this.task_end = task_end;
- set_task_end_isSet(true);
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ExecutorInfo(ExecutorInfo other) {
- __isset_bitfield = other.__isset_bitfield;
- this.task_start = other.task_start;
- this.task_end = other.task_end;
- }
-
- public ExecutorInfo deepCopy() {
- return new ExecutorInfo(this);
- }
-
- @Override
- public void clear() {
- set_task_start_isSet(false);
- this.task_start = 0;
- set_task_end_isSet(false);
- this.task_end = 0;
- }
-
- public int get_task_start() {
- return this.task_start;
- }
-
- public void set_task_start(int task_start) {
- this.task_start = task_start;
- set_task_start_isSet(true);
- }
-
- public void unset_task_start() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TASK_START_ISSET_ID);
- }
-
- /** Returns true if field task_start is set (has been assigned a value) and false otherwise */
- public boolean is_set_task_start() {
- return EncodingUtils.testBit(__isset_bitfield, __TASK_START_ISSET_ID);
- }
-
- public void set_task_start_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TASK_START_ISSET_ID, value);
- }
-
- public int get_task_end() {
- return this.task_end;
- }
-
- public void set_task_end(int task_end) {
- this.task_end = task_end;
- set_task_end_isSet(true);
- }
-
- public void unset_task_end() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TASK_END_ISSET_ID);
- }
-
- /** Returns true if field task_end is set (has been assigned a value) and false otherwise */
- public boolean is_set_task_end() {
- return EncodingUtils.testBit(__isset_bitfield, __TASK_END_ISSET_ID);
- }
-
- public void set_task_end_isSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TASK_END_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TASK_START:
- if (value == null) {
- unset_task_start();
- } else {
- set_task_start((Integer)value);
- }
- break;
-
- case TASK_END:
- if (value == null) {
- unset_task_end();
- } else {
- set_task_end((Integer)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TASK_START:
- return get_task_start();
-
- case TASK_END:
- return get_task_end();
-
- }
- 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 TASK_START:
- return is_set_task_start();
- case TASK_END:
- return is_set_task_end();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ExecutorInfo)
- return this.equals((ExecutorInfo)that);
- return false;
- }
-
- public boolean equals(ExecutorInfo that) {
- if (that == null)
- return false;
-
- boolean this_present_task_start = true;
- boolean that_present_task_start = true;
- if (this_present_task_start || that_present_task_start) {
- if (!(this_present_task_start && that_present_task_start))
- return false;
- if (this.task_start != that.task_start)
- return false;
- }
-
- boolean this_present_task_end = true;
- boolean that_present_task_end = true;
- if (this_present_task_end || that_present_task_end) {
- if (!(this_present_task_end && that_present_task_end))
- return false;
- if (this.task_end != that.task_end)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
-
- boolean present_task_start = true;
- list.add(present_task_start);
- if (present_task_start)
- list.add(task_start);
-
- boolean present_task_end = true;
- list.add(present_task_end);
- if (present_task_end)
- list.add(task_end);
-
- return list.hashCode();
- }
-
- @Override
- public int compareTo(ExecutorInfo other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(is_set_task_start()).compareTo(other.is_set_task_start());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_task_start()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.task_start, other.task_start);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(is_set_task_end()).compareTo(other.is_set_task_end());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (is_set_task_end()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.task_end, other.task_end);
- 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("ExecutorInfo(");
- boolean first = true;
-
- sb.append("task_start:");
- sb.append(this.task_start);
- first = false;
- if (!first) sb.append(", ");
- sb.append("task_end:");
- sb.append(this.task_end);
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!is_set_task_start()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'task_start' is unset! Struct:" + toString());
- }
-
- if (!is_set_task_end()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'task_end' 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 ExecutorInfoStandardSchemeFactory implements SchemeFactory {
- public ExecutorInfoStandardScheme getScheme() {
- return new ExecutorInfoStandardScheme();
- }
- }
-
- private static class ExecutorInfoStandardScheme extends StandardScheme<ExecutorInfo> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ExecutorInfo 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: // TASK_START
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.task_start = iprot.readI32();
- struct.set_task_start_isSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // TASK_END
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.task_end = iprot.readI32();
- struct.set_task_end_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, ExecutorInfo struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldBegin(TASK_START_FIELD_DESC);
- oprot.writeI32(struct.task_start);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(TASK_END_FIELD_DESC);
- oprot.writeI32(struct.task_end);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ExecutorInfoTupleSchemeFactory implements SchemeFactory {
- public ExecutorInfoTupleScheme getScheme() {
- return new ExecutorInfoTupleScheme();
- }
- }
-
- private static class ExecutorInfoTupleScheme extends TupleScheme<ExecutorInfo> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ExecutorInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeI32(struct.task_start);
- oprot.writeI32(struct.task_end);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ExecutorInfo struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.task_start = iprot.readI32();
- struct.set_task_start_isSet(true);
- struct.task_end = iprot.readI32();
- struct.set_task_end_isSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/jvm/backtype/storm/generated/ExecutorSpecificStats.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/generated/ExecutorSpecificStats.java b/storm-core/src/jvm/backtype/storm/generated/ExecutorSpecificStats.java
deleted file mode 100644
index d91f197..0000000
--- a/storm-core/src/jvm/backtype/storm/generated/ExecutorSpecificStats.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Autogenerated by Thrift Compiler (0.9.3)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.storm.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-public class ExecutorSpecificStats extends org.apache.thrift.TUnion<ExecutorSpecificStats, ExecutorSpecificStats._Fields> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecutorSpecificStats");
- private static final org.apache.thrift.protocol.TField BOLT_FIELD_DESC = new org.apache.thrift.protocol.TField("bolt", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField SPOUT_FIELD_DESC = new org.apache.thrift.protocol.TField("spout", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- BOLT((short)1, "bolt"),
- SPOUT((short)2, "spout");
-
- 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: // BOLT
- return BOLT;
- case 2: // SPOUT
- return SPOUT;
- 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;
- }
- }
-
- 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.BOLT, new org.apache.thrift.meta_data.FieldMetaData("bolt", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BoltStats.class)));
- tmpMap.put(_Fields.SPOUT, new org.apache.thrift.meta_data.FieldMetaData("spout", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SpoutStats.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecutorSpecificStats.class, metaDataMap);
- }
-
- public ExecutorSpecificStats() {
- super();
- }
-
- public ExecutorSpecificStats(_Fields setField, Object value) {
- super(setField, value);
- }
-
- public ExecutorSpecificStats(ExecutorSpecificStats other) {
- super(other);
- }
- public ExecutorSpecificStats deepCopy() {
- return new ExecutorSpecificStats(this);
- }
-
- public static ExecutorSpecificStats bolt(BoltStats value) {
- ExecutorSpecificStats x = new ExecutorSpecificStats();
- x.set_bolt(value);
- return x;
- }
-
- public static ExecutorSpecificStats spout(SpoutStats value) {
- ExecutorSpecificStats x = new ExecutorSpecificStats();
- x.set_spout(value);
- return x;
- }
-
-
- @Override
- protected void checkType(_Fields setField, Object value) throws ClassCastException {
- switch (setField) {
- case BOLT:
- if (value instanceof BoltStats) {
- break;
- }
- throw new ClassCastException("Was expecting value of type BoltStats for field 'bolt', but got " + value.getClass().getSimpleName());
- case SPOUT:
- if (value instanceof SpoutStats) {
- break;
- }
- throw new ClassCastException("Was expecting value of type SpoutStats for field 'spout', but got " + value.getClass().getSimpleName());
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(field.id);
- if (setField != null) {
- switch (setField) {
- case BOLT:
- if (field.type == BOLT_FIELD_DESC.type) {
- BoltStats bolt;
- bolt = new BoltStats();
- bolt.read(iprot);
- return bolt;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- case SPOUT:
- if (field.type == SPOUT_FIELD_DESC.type) {
- SpoutStats spout;
- spout = new SpoutStats();
- spout.read(iprot);
- return spout;
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- return null;
- }
- }
-
- @Override
- protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case BOLT:
- BoltStats bolt = (BoltStats)value_;
- bolt.write(oprot);
- return;
- case SPOUT:
- SpoutStats spout = (SpoutStats)value_;
- spout.write(oprot);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
- _Fields setField = _Fields.findByThriftId(fieldID);
- if (setField != null) {
- switch (setField) {
- case BOLT:
- BoltStats bolt;
- bolt = new BoltStats();
- bolt.read(iprot);
- return bolt;
- case SPOUT:
- SpoutStats spout;
- spout = new SpoutStats();
- spout.read(iprot);
- return spout;
- default:
- throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
- }
- } else {
- throw new TProtocolException("Couldn't find a field with field id " + fieldID);
- }
- }
-
- @Override
- protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- switch (setField_) {
- case BOLT:
- BoltStats bolt = (BoltStats)value_;
- bolt.write(oprot);
- return;
- case SPOUT:
- SpoutStats spout = (SpoutStats)value_;
- spout.write(oprot);
- return;
- default:
- throw new IllegalStateException("Cannot write union with unknown field " + setField_);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) {
- switch (setField) {
- case BOLT:
- return BOLT_FIELD_DESC;
- case SPOUT:
- return SPOUT_FIELD_DESC;
- default:
- throw new IllegalArgumentException("Unknown field id " + setField);
- }
- }
-
- @Override
- protected org.apache.thrift.protocol.TStruct getStructDesc() {
- return STRUCT_DESC;
- }
-
- @Override
- protected _Fields enumForId(short id) {
- return _Fields.findByThriftIdOrThrow(id);
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
-
- public BoltStats get_bolt() {
- if (getSetField() == _Fields.BOLT) {
- return (BoltStats)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'bolt' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_bolt(BoltStats value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.BOLT;
- value_ = value;
- }
-
- public SpoutStats get_spout() {
- if (getSetField() == _Fields.SPOUT) {
- return (SpoutStats)getFieldValue();
- } else {
- throw new RuntimeException("Cannot get field 'spout' because union is currently set to " + getFieldDesc(getSetField()).name);
- }
- }
-
- public void set_spout(SpoutStats value) {
- if (value == null) throw new NullPointerException();
- setField_ = _Fields.SPOUT;
- value_ = value;
- }
-
- public boolean is_set_bolt() {
- return setField_ == _Fields.BOLT;
- }
-
-
- public boolean is_set_spout() {
- return setField_ == _Fields.SPOUT;
- }
-
-
- public boolean equals(Object other) {
- if (other instanceof ExecutorSpecificStats) {
- return equals((ExecutorSpecificStats)other);
- } else {
- return false;
- }
- }
-
- public boolean equals(ExecutorSpecificStats other) {
- return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue());
- }
-
- @Override
- public int compareTo(ExecutorSpecificStats other) {
- int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField());
- if (lastComparison == 0) {
- return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue());
- }
- return lastComparison;
- }
-
-
- @Override
- public int hashCode() {
- List<Object> list = new ArrayList<Object>();
- list.add(this.getClass().getName());
- org.apache.thrift.TFieldIdEnum setField = getSetField();
- if (setField != null) {
- list.add(setField.getThriftFieldId());
- Object value = getFieldValue();
- if (value instanceof org.apache.thrift.TEnum) {
- list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
- } else {
- list.add(value);
- }
- }
- return list.hashCode();
- }
- 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);
- }
- }
-
-
-}
[56/59] [abbrv] storm git commit: Adding isReady
Posted by ka...@apache.org.
Adding isReady
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/ab276fe5
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/ab276fe5
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/ab276fe5
Branch: refs/heads/1.x-branch
Commit: ab276fe5c3f4b0abf5d1712011f5d37bd845f120
Parents: 8e121dc
Author: Kyle Nusbaum <Ky...@gmail.com>
Authored: Tue Oct 11 14:41:41 2016 -0500
Committer: Kyle Nusbaum <Ky...@gmail.com>
Committed: Tue Oct 11 14:41:41 2016 -0500
----------------------------------------------------------------------
.../src/jvm/org/apache/storm/pacemaker/PacemakerClient.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/ab276fe5/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
index cbbfe7f..eefc493 100644
--- a/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
+++ b/storm-core/src/jvm/org/apache/storm/pacemaker/PacemakerClient.java
@@ -130,6 +130,10 @@ public class PacemakerClient implements ISaslClient {
}
}
+ public boolean isReady() {
+ return ready.get();
+ }
+
@Override
public synchronized void channelConnected(Channel channel) {
Channel oldChannel = channelRef.get();
[40/59] [abbrv] [partial] storm git commit: Ported successfully.
Posted by ka...@apache.org.
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/util.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/util.clj b/storm-core/src/clj/backtype/storm/util.clj
deleted file mode 100644
index 75ea0dc..0000000
--- a/storm-core/src/clj/backtype/storm/util.clj
+++ /dev/null
@@ -1,1134 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.util
- (:import [java.net InetAddress])
- (:import [java.util Map Map$Entry List ArrayList Collection Iterator HashMap])
- (:import [java.io FileReader FileNotFoundException])
- (:import [java.nio.file Paths])
- (:import [org.apache.storm Config])
- (:import [org.apache.storm.utils Time Container ClojureTimerTask Utils
- MutableObject MutableInt])
- (:import [org.apache.storm.security.auth NimbusPrincipal])
- (:import [javax.security.auth Subject])
- (:import [java.util UUID Random ArrayList List Collections])
- (:import [java.util.zip ZipFile])
- (:import [java.util.concurrent.locks ReentrantReadWriteLock])
- (:import [java.util.concurrent Semaphore])
- (:import [java.nio.file Files Paths])
- (:import [java.nio.file.attribute FileAttribute])
- (:import [java.io File FileOutputStream RandomAccessFile StringWriter
- PrintWriter BufferedReader InputStreamReader IOException])
- (:import [java.lang.management ManagementFactory])
- (:import [org.apache.commons.exec DefaultExecutor CommandLine])
- (:import [org.apache.commons.io FileUtils])
- (:import [org.apache.storm.logging ThriftAccessLogger])
- (:import [org.apache.commons.exec ExecuteException])
- (:import [org.json.simple JSONValue])
- (:import [org.yaml.snakeyaml Yaml]
- [org.yaml.snakeyaml.constructor SafeConstructor])
- (:require [clojure [string :as str]])
- (:import [clojure.lang RT])
- (:require [clojure [set :as set]])
- (:require [clojure.java.io :as io])
- (:use [clojure walk])
- (:require [ring.util.codec :as codec])
- (:use [org.apache.storm log]))
-
-(defn wrap-in-runtime
- "Wraps an exception in a RuntimeException if needed"
- [^Exception e]
- (if (instance? RuntimeException e)
- e
- (RuntimeException. e)))
-
-(def on-windows?
- (= "Windows_NT" (System/getenv "OS")))
-
-(def file-path-separator
- (System/getProperty "file.separator"))
-
-(def class-path-separator
- (System/getProperty "path.separator"))
-
-(defn is-absolute-path? [path]
- (.isAbsolute (Paths/get path (into-array String []))))
-
-(defmacro defalias
- "Defines an alias for a var: a new var with the same root binding (if
- any) and similar metadata. The metadata of the alias is its initial
- metadata (as provided by def) merged into the metadata of the original."
- ([name orig]
- `(do
- (alter-meta!
- (if (.hasRoot (var ~orig))
- (def ~name (.getRawRoot (var ~orig)))
- (def ~name))
- ;; When copying metadata, disregard {:macro false}.
- ;; Workaround for http://www.assembla.com/spaces/clojure/tickets/273
- #(conj (dissoc % :macro)
- (apply dissoc (meta (var ~orig)) (remove #{:macro} (keys %)))))
- (var ~name)))
- ([name orig doc]
- (list `defalias (with-meta name (assoc (meta name) :doc doc)) orig)))
-
-;; name-with-attributes by Konrad Hinsen:
-(defn name-with-attributes
- "To be used in macro definitions.
- Handles optional docstrings and attribute maps for a name to be defined
- in a list of macro arguments. If the first macro argument is a string,
- it is added as a docstring to name and removed from the macro argument
- list. If afterwards the first macro argument is a map, its entries are
- added to the name's metadata map and the map is removed from the
- macro argument list. The return value is a vector containing the name
- with its extended metadata map and the list of unprocessed macro
- arguments."
- [name macro-args]
- (let [[docstring macro-args] (if (string? (first macro-args))
- [(first macro-args) (next macro-args)]
- [nil macro-args])
- [attr macro-args] (if (map? (first macro-args))
- [(first macro-args) (next macro-args)]
- [{} macro-args])
- attr (if docstring
- (assoc attr :doc docstring)
- attr)
- attr (if (meta name)
- (conj (meta name) attr)
- attr)]
- [(with-meta name attr) macro-args]))
-
-(defmacro defnk
- "Define a function accepting keyword arguments. Symbols up to the first
- keyword in the parameter list are taken as positional arguments. Then
- an alternating sequence of keywords and defaults values is expected. The
- values of the keyword arguments are available in the function body by
- virtue of the symbol corresponding to the keyword (cf. :keys destructuring).
- defnk accepts an optional docstring as well as an optional metadata map."
- [fn-name & fn-tail]
- (let [[fn-name [args & body]] (name-with-attributes fn-name fn-tail)
- [pos kw-vals] (split-with symbol? args)
- syms (map #(-> % name symbol) (take-nth 2 kw-vals))
- values (take-nth 2 (rest kw-vals))
- sym-vals (apply hash-map (interleave syms values))
- de-map {:keys (vec syms) :or sym-vals}]
- `(defn ~fn-name
- [~@pos & options#]
- (let [~de-map (apply hash-map options#)]
- ~@body))))
-
-(defn find-first
- "Returns the first item of coll for which (pred item) returns logical true.
- Consumes sequences up to the first match, will consume the entire sequence
- and return nil if no match is found."
- [pred coll]
- (first (filter pred coll)))
-
-(defn dissoc-in
- "Dissociates an entry from a nested associative structure returning a new
- nested structure. keys is a sequence of keys. Any empty maps that result
- will not be present in the new structure."
- [m [k & ks :as keys]]
- (if ks
- (if-let [nextmap (get m k)]
- (let [newmap (dissoc-in nextmap ks)]
- (if (seq newmap)
- (assoc m k newmap)
- (dissoc m k)))
- m)
- (dissoc m k)))
-
-(defn indexed
- "Returns a lazy sequence of [index, item] pairs, where items come
- from 's' and indexes count up from zero.
-
- (indexed '(a b c d)) => ([0 a] [1 b] [2 c] [3 d])"
- [s]
- (map vector (iterate inc 0) s))
-
-(defn positions
- "Returns a lazy sequence containing the positions at which pred
- is true for items in coll."
- [pred coll]
- (for [[idx elt] (indexed coll) :when (pred elt)] idx))
-
-(defn exception-cause?
- [klass ^Throwable t]
- (->> (iterate #(.getCause ^Throwable %) t)
- (take-while identity)
- (some (partial instance? klass))
- boolean))
-
-(defmacro thrown-cause?
- [klass & body]
- `(try
- ~@body
- false
- (catch Throwable t#
- (exception-cause? ~klass t#))))
-
-(defmacro thrown-cause-with-msg?
- [klass re & body]
- `(try
- ~@body
- false
- (catch Throwable t#
- (and (re-matches ~re (.getMessage t#))
- (exception-cause? ~klass t#)))))
-
-(defmacro forcat
- [[args aseq] & body]
- `(mapcat (fn [~args]
- ~@body)
- ~aseq))
-
-(defmacro try-cause
- [& body]
- (let [checker (fn [form]
- (or (not (sequential? form))
- (not= 'catch (first form))))
- [code guards] (split-with checker body)
- error-local (gensym "t")
- guards (forcat [[_ klass local & guard-body] guards]
- `((exception-cause? ~klass ~error-local)
- (let [~local ~error-local]
- ~@guard-body
- )))]
- `(try ~@code
- (catch Throwable ~error-local
- (cond ~@guards
- true (throw ~error-local)
- )))))
-
-(defn local-hostname
- []
- (.getCanonicalHostName (InetAddress/getLocalHost)))
-
-(def memoized-local-hostname (memoize local-hostname))
-
-;; checks conf for STORM_LOCAL_HOSTNAME.
-;; when unconfigured, falls back to (memoized) guess by `local-hostname`.
-(defn hostname
- [conf]
- (conf Config/STORM_LOCAL_HOSTNAME (memoized-local-hostname)))
-
-(letfn [(try-port [port]
- (with-open [socket (java.net.ServerSocket. port)]
- (.getLocalPort socket)))]
- (defn available-port
- ([] (try-port 0))
- ([preferred]
- (try
- (try-port preferred)
- (catch java.io.IOException e
- (available-port))))))
-
-(defn uuid []
- (str (UUID/randomUUID)))
-
-(defn current-time-secs
- []
- (Time/currentTimeSecs))
-
-(defn current-time-millis
- []
- (Time/currentTimeMillis))
-
-(defn secs-to-millis-long
- [secs]
- (long (* (long 1000) secs)))
-
-(defn clojurify-structure
- [s]
- (prewalk (fn [x]
- (cond (instance? Map x) (into {} x)
- (instance? List x) (vec x)
- ;; (Boolean. false) does not evaluate to false in an if.
- ;; This fixes that.
- (instance? Boolean x) (boolean x)
- true x))
- s))
-
-(defmacro with-file-lock
- [path & body]
- `(let [f# (File. ~path)
- _# (.createNewFile f#)
- rf# (RandomAccessFile. f# "rw")
- lock# (.. rf# (getChannel) (lock))]
- (try
- ~@body
- (finally
- (.release lock#)
- (.close rf#)))))
-
-(defn tokenize-path
- [^String path]
- (let [toks (.split path "/")]
- (vec (filter (complement empty?) toks))))
-
-(defn assoc-conj
- [m k v]
- (merge-with concat m {k [v]}))
-
-;; returns [ones in first set not in second, ones in second set not in first]
-(defn set-delta
- [old curr]
- (let [s1 (set old)
- s2 (set curr)]
- [(set/difference s1 s2) (set/difference s2 s1)]))
-
-(defn parent-path
- [path]
- (let [toks (tokenize-path path)]
- (str "/" (str/join "/" (butlast toks)))))
-
-(defn toks->path
- [toks]
- (str "/" (str/join "/" toks)))
-
-(defn normalize-path
- [^String path]
- (toks->path (tokenize-path path)))
-
-(defn map-val
- [afn amap]
- (into {}
- (for [[k v] amap]
- [k (afn v)])))
-
-(defn filter-val
- [afn amap]
- (into {} (filter (fn [[k v]] (afn v)) amap)))
-
-(defn filter-key
- [afn amap]
- (into {} (filter (fn [[k v]] (afn k)) amap)))
-
-(defn map-key
- [afn amap]
- (into {} (for [[k v] amap] [(afn k) v])))
-
-(defn separate
- [pred aseq]
- [(filter pred aseq) (filter (complement pred) aseq)])
-
-(defn full-path
- [parent name]
- (let [toks (tokenize-path parent)]
- (toks->path (conj toks name))))
-
-(def not-nil? (complement nil?))
-
-(defn barr
- [& vals]
- (byte-array (map byte vals)))
-
-(defn exit-process!
- [val & msg]
- (log-error (RuntimeException. (str msg)) "Halting process: " msg)
- (.exit (Runtime/getRuntime) val))
-
-(defn sum
- [vals]
- (reduce + vals))
-
-(defn repeat-seq
- ([aseq]
- (apply concat (repeat aseq)))
- ([amt aseq]
- (apply concat (repeat amt aseq))))
-
-(defn div
- "Perform floating point division on the arguments."
- [f & rest]
- (apply / (double f) rest))
-
-(defn defaulted
- [val default]
- (if val val default))
-
-(defn mk-counter
- ([] (mk-counter 1))
- ([start-val]
- (let [val (atom (dec start-val))]
- (fn [] (swap! val inc)))))
-
-(defmacro for-times [times & body]
- `(for [i# (range ~times)]
- ~@body))
-
-(defmacro dofor [& body]
- `(doall (for ~@body)))
-
-(defn reverse-map
- "{:a 1 :b 1 :c 2} -> {1 [:a :b] 2 :c}"
- [amap]
- (reduce (fn [m [k v]]
- (let [existing (get m v [])]
- (assoc m v (conj existing k))))
- {} amap))
-
-(defmacro print-vars [& vars]
- (let [prints (for [v vars] `(println ~(str v) ~v))]
- `(do ~@prints)))
-
-(defn process-pid
- "Gets the pid of this JVM. Hacky because Java doesn't provide a real way to do this."
- []
- (let [name (.getName (ManagementFactory/getRuntimeMXBean))
- split (.split name "@")]
- (when-not (= 2 (count split))
- (throw (RuntimeException. (str "Got unexpected process name: " name))))
- (first split)))
-
-(defn exec-command! [command]
- (let [[comm-str & args] (seq (.split command " "))
- command (CommandLine. comm-str)]
- (doseq [a args]
- (.addArgument command a))
- (.execute (DefaultExecutor.) command)))
-
-(defn extract-dir-from-jar [jarpath dir destdir]
- (try-cause
- (with-open [jarpath (ZipFile. jarpath)]
- (let [entries (enumeration-seq (.entries jarpath))]
- (doseq [file (filter (fn [entry](and (not (.isDirectory entry)) (.startsWith (.getName entry) dir))) entries)]
- (.mkdirs (.getParentFile (File. destdir (.getName file))))
- (with-open [out (FileOutputStream. (File. destdir (.getName file)))]
- (io/copy (.getInputStream jarpath file) out)))))
- (catch IOException e
- (log-message "Could not extract " dir " from " jarpath))))
-
-(defn sleep-secs [secs]
- (when (pos? secs)
- (Time/sleep (* (long secs) 1000))))
-
-(defn sleep-until-secs [target-secs]
- (Time/sleepUntil (* (long target-secs) 1000)))
-
-(def ^:const sig-kill 9)
-
-(def ^:const sig-term 15)
-
-(defn send-signal-to-process
- [pid signum]
- (try-cause
- (exec-command! (str (if on-windows?
- (if (== signum sig-kill) "taskkill /f /pid " "taskkill /pid ")
- (str "kill -" signum " "))
- pid))
- (catch ExecuteException e
- (log-message "Error when trying to kill " pid ". Process is probably already dead."))))
-
-(defn read-and-log-stream
- [prefix stream]
- (try
- (let [reader (BufferedReader. (InputStreamReader. stream))]
- (loop []
- (if-let [line (.readLine reader)]
- (do
- (log-warn (str prefix ":" line))
- (recur)))))
- (catch IOException e
- (log-warn "Error while trying to log stream" e))))
-
-(defn force-kill-process
- [pid]
- (send-signal-to-process pid sig-kill))
-
-(defn kill-process-with-sig-term
- [pid]
- (send-signal-to-process pid sig-term))
-
-(defn add-shutdown-hook-with-force-kill-in-1-sec
- "adds the user supplied function as a shutdown hook for cleanup.
- Also adds a function that sleeps for a second and then sends kill -9 to process to avoid any zombie process in case
- cleanup function hangs."
- [func]
- (.addShutdownHook (Runtime/getRuntime) (Thread. #(func)))
- (.addShutdownHook (Runtime/getRuntime) (Thread. #((sleep-secs 1)
- (.halt (Runtime/getRuntime) 20)))))
-
-(defprotocol SmartThread
- (start [this])
- (join [this])
- (interrupt [this])
- (sleeping? [this]))
-
-;; afn returns amount of time to sleep
-(defnk async-loop [afn
- :daemon false
- :kill-fn (fn [error] (exit-process! 1 "Async loop died!"))
- :priority Thread/NORM_PRIORITY
- :factory? false
- :start true
- :thread-name nil]
- (let [thread (Thread.
- (fn []
- (try-cause
- (let [afn (if factory? (afn) afn)]
- (loop []
- (let [sleep-time (afn)]
- (when-not (nil? sleep-time)
- (sleep-secs sleep-time)
- (recur))
- )))
- (catch InterruptedException e
- (log-message "Async loop interrupted!")
- )
- (catch Throwable t
- (log-error t "Async loop died!")
- (kill-fn t)))))]
- (.setDaemon thread daemon)
- (.setPriority thread priority)
- (when-not (clojure.string/blank? thread-name)
- ;; if thead-name is blank, just use the default thread name
- (.setName thread (str (.getName thread) "-" thread-name)))
- (when start
- (.start thread))
- ;; should return object that supports stop, interrupt, join, and waiting?
- (reify SmartThread
- (start
- [this]
- (.start thread))
- (join
- [this]
- (.join thread))
- (interrupt
- [this]
- (.interrupt thread))
- (sleeping?
- [this]
- (Time/isThreadWaiting thread)))))
-
-(defn shell-cmd
- [command]
- (->> command
- (map #(str \' (clojure.string/escape % {\' "'\"'\"'"}) \'))
- (clojure.string/join " ")))
-
-(defn script-file-path [dir]
- (str dir file-path-separator "storm-worker-script.sh"))
-
-(defn container-file-path [dir]
- (str dir file-path-separator "launch_container.sh"))
-
-(defnk write-script
- [dir command :environment {}]
- (let [script-src (str "#!/bin/bash\n" (clojure.string/join "" (map (fn [[k v]] (str (shell-cmd ["export" (str k "=" v)]) ";\n")) environment)) "\nexec " (shell-cmd command) ";")
- script-path (script-file-path dir)
- _ (spit script-path script-src)]
- script-path
- ))
-
-(defnk launch-process
- [command :environment {} :log-prefix nil :exit-code-callback nil :directory nil]
- (let [builder (ProcessBuilder. command)
- process-env (.environment builder)]
- (when directory (.directory builder directory))
- (.redirectErrorStream builder true)
- (doseq [[k v] environment]
- (.put process-env k v))
- (let [process (.start builder)]
- (if (or log-prefix exit-code-callback)
- (async-loop
- (fn []
- (if log-prefix
- (read-and-log-stream log-prefix (.getInputStream process)))
- (when exit-code-callback
- (try
- (.waitFor process)
- (catch InterruptedException e
- (log-message log-prefix " interrupted.")))
- (exit-code-callback (.exitValue process)))
- nil)))
- process)))
-
-(defn exists-file?
- [path]
- (.exists (File. path)))
-
-(defn rmr
- [path]
- (log-debug "Rmr path " path)
- (when (exists-file? path)
- (try
- (FileUtils/forceDelete (File. path))
- (catch FileNotFoundException e))))
-
-(defn rmpath
- "Removes file or directory at the path. Not recursive. Throws exception on failure"
- [path]
- (log-debug "Removing path " path)
- (when (exists-file? path)
- (let [deleted? (.delete (File. path))]
- (when-not deleted?
- (throw (RuntimeException. (str "Failed to delete " path)))))))
-
-(defn local-mkdirs
- [path]
- (log-debug "Making dirs at " path)
- (FileUtils/forceMkdir (File. path)))
-
-(defn touch
- [path]
- (log-debug "Touching file at " path)
- (let [success? (do (if on-windows? (.mkdirs (.getParentFile (File. path))))
- (.createNewFile (File. path)))]
- (when-not success?
- (throw (RuntimeException. (str "Failed to touch " path))))))
-
-(defn create-symlink!
- "Create symlink is to the target"
- ([path-dir target-dir file-name]
- (create-symlink! path-dir target-dir file-name file-name))
- ([path-dir target-dir from-file-name to-file-name]
- (let [path (str path-dir file-path-separator from-file-name)
- target (str target-dir file-path-separator to-file-name)
- empty-array (make-array String 0)
- attrs (make-array FileAttribute 0)
- abs-path (.toAbsolutePath (Paths/get path empty-array))
- abs-target (.toAbsolutePath (Paths/get target empty-array))]
- (log-debug "Creating symlink [" abs-path "] to [" abs-target "]")
- (if (not (.exists (.toFile abs-path)))
- (Files/createSymbolicLink abs-path abs-target attrs)))))
-
-(defn read-dir-contents
- [dir]
- (if (exists-file? dir)
- (let [content-files (.listFiles (File. dir))]
- (map #(.getName ^File %) content-files))
- []))
-
-(defn compact
- [aseq]
- (filter (complement nil?) aseq))
-
-(defn current-classpath
- []
- (System/getProperty "java.class.path"))
-
-(defn get-full-jars
- [dir]
- (map #(str dir file-path-separator %) (filter #(.endsWith % ".jar") (read-dir-contents dir))))
-
-(defn worker-classpath
- []
- (let [storm-dir (System/getProperty "storm.home")
- storm-lib-dir (str storm-dir file-path-separator "lib")
- storm-conf-dir (if-let [confdir (System/getenv "STORM_CONF_DIR")]
- confdir
- (str storm-dir file-path-separator "conf"))
- storm-extlib-dir (str storm-dir file-path-separator "extlib")
- extcp (System/getenv "STORM_EXT_CLASSPATH")]
- (if (nil? storm-dir)
- (current-classpath)
- (str/join class-path-separator
- (remove nil? (concat (get-full-jars storm-lib-dir) (get-full-jars storm-extlib-dir) [extcp] [storm-conf-dir]))))))
-
-(defn add-to-classpath
- [classpath paths]
- (if (empty? paths)
- classpath
- (str/join class-path-separator (cons classpath paths))))
-
-(defn ^ReentrantReadWriteLock mk-rw-lock
- []
- (ReentrantReadWriteLock.))
-
-(defmacro read-locked
- [rw-lock & body]
- (let [lock (with-meta rw-lock {:tag `ReentrantReadWriteLock})]
- `(let [rlock# (.readLock ~lock)]
- (try (.lock rlock#)
- ~@body
- (finally (.unlock rlock#))))))
-
-(defmacro write-locked
- [rw-lock & body]
- (let [lock (with-meta rw-lock {:tag `ReentrantReadWriteLock})]
- `(let [wlock# (.writeLock ~lock)]
- (try (.lock wlock#)
- ~@body
- (finally (.unlock wlock#))))))
-
-(defn time-delta
- [time-secs]
- (- (current-time-secs) time-secs))
-
-(defn time-delta-ms
- [time-ms]
- (- (System/currentTimeMillis) (long time-ms)))
-
-(defn parse-int
- [str]
- (Integer/valueOf str))
-
-(defn integer-divided
- [sum num-pieces]
- (clojurify-structure (Utils/integerDivided sum num-pieces)))
-
-(defn collectify
- [obj]
- (if (or (sequential? obj) (instance? Collection obj))
- obj
- [obj]))
-
-(defn to-json
- [obj]
- (JSONValue/toJSONString obj))
-
-(defn from-json
- [^String str]
- (if str
- (clojurify-structure
- (JSONValue/parse str))
- nil))
-
-(defmacro letlocals
- [& body]
- (let [[tobind lexpr] (split-at (dec (count body)) body)
- binded (vec (mapcat (fn [e]
- (if (and (list? e) (= 'bind (first e)))
- [(second e) (last e)]
- ['_ e]
- ))
- tobind))]
- `(let ~binded
- ~(first lexpr))))
-
-(defn remove-first
- [pred aseq]
- (let [[b e] (split-with (complement pred) aseq)]
- (when (empty? e)
- (throw (IllegalArgumentException. "Nothing to remove")))
- (concat b (rest e))))
-
-(defn assoc-non-nil
- [m k v]
- (if v (assoc m k v) m))
-
-(defn multi-set
- "Returns a map of elem to count"
- [aseq]
- (apply merge-with +
- (map #(hash-map % 1) aseq)))
-
-(defn set-var-root*
- [avar val]
- (alter-var-root avar (fn [avar] val)))
-
-(defmacro set-var-root
- [var-sym val]
- `(set-var-root* (var ~var-sym) ~val))
-
-(defmacro with-var-roots
- [bindings & body]
- (let [settings (partition 2 bindings)
- tmpvars (repeatedly (count settings) (partial gensym "old"))
- vars (map first settings)
- savevals (vec (mapcat (fn [t v] [t v]) tmpvars vars))
- setters (for [[v s] settings] `(set-var-root ~v ~s))
- restorers (map (fn [v s] `(set-var-root ~v ~s)) vars tmpvars)]
- `(let ~savevals
- ~@setters
- (try
- ~@body
- (finally
- ~@restorers)))))
-
-(defn map-diff
- "Returns mappings in m2 that aren't in m1"
- [m1 m2]
- (into {} (filter (fn [[k v]] (not= v (m1 k))) m2)))
-
-(defn select-keys-pred
- [pred amap]
- (into {} (filter (fn [[k v]] (pred k)) amap)))
-
-(defn rotating-random-range
- [choices]
- (let [rand (Random.)
- choices (ArrayList. choices)]
- (Collections/shuffle choices rand)
- [(MutableInt. -1) choices rand]))
-
-(defn acquire-random-range-id
- [[^MutableInt curr ^List state ^Random rand]]
- (when (>= (.increment curr) (.size state))
- (.set curr 0)
- (Collections/shuffle state rand))
- (.get state (.get curr)))
-
-; this can be rewritten to be tail recursive
-(defn interleave-all
- [& colls]
- (if (empty? colls)
- []
- (let [colls (filter (complement empty?) colls)
- my-elems (map first colls)
- rest-elems (apply interleave-all (map rest colls))]
- (concat my-elems rest-elems))))
-
-(defn any-intersection
- [& sets]
- (let [elem->count (multi-set (apply concat sets))]
- (-> (filter-val #(> % 1) elem->count)
- keys)))
-
-(defn between?
- "val >= lower and val <= upper"
- [val lower upper]
- (and (>= val lower)
- (<= val upper)))
-
-(defmacro benchmark
- [& body]
- `(let [l# (doall (range 1000000))]
- (time
- (doseq [i# l#]
- ~@body))))
-
-(defn rand-sampler
- [freq]
- (let [r (java.util.Random.)]
- (fn [] (= 0 (.nextInt r freq)))))
-
-(defn even-sampler
- [freq]
- (let [freq (int freq)
- start (int 0)
- r (java.util.Random.)
- curr (MutableInt. -1)
- target (MutableInt. (.nextInt r freq))]
- (with-meta
- (fn []
- (let [i (.increment curr)]
- (when (>= i freq)
- (.set curr start)
- (.set target (.nextInt r freq))))
- (= (.get curr) (.get target)))
- {:rate freq})))
-
-(defn sampler-rate
- [sampler]
- (:rate (meta sampler)))
-
-(defn class-selector
- [obj & args]
- (class obj))
-
-(defn uptime-computer []
- (let [start-time (current-time-secs)]
- (fn [] (time-delta start-time))))
-
-(defn stringify-error [error]
- (let [result (StringWriter.)
- printer (PrintWriter. result)]
- (.printStackTrace error printer)
- (.toString result)))
-
-(defn nil-to-zero
- [v]
- (or v 0))
-
-(defmacro with-error-reaction
- [afn & body]
- `(try ~@body
- (catch Throwable t# (~afn t#))))
-
-(defn container
- []
- (Container.))
-
-(defn container-set! [^Container container obj]
- (set! (. container object) obj)
- container)
-
-(defn container-get [^Container container]
- (. container object))
-
-(defn to-millis [secs]
- (* 1000 (long secs)))
-
-(defn throw-runtime [& strs]
- (throw (RuntimeException. (apply str strs))))
-
-(defn redirect-stdio-to-slf4j!
- []
- ;; set-var-root doesn't work with *out* and *err*, so digging much deeper here
- ;; Unfortunately, this code seems to work at the REPL but not when spawned as worker processes
- ;; it might have something to do with being a child process
- ;; (set! (. (.getThreadBinding RT/OUT) val)
- ;; (java.io.OutputStreamWriter.
- ;; (log-stream :info "STDIO")))
- ;; (set! (. (.getThreadBinding RT/ERR) val)
- ;; (PrintWriter.
- ;; (java.io.OutputStreamWriter.
- ;; (log-stream :error "STDIO"))
- ;; true))
- (log-capture! "STDIO"))
-
-(defn spy
- [prefix val]
- (log-message prefix ": " val)
- val)
-
-(defn zip-contains-dir?
- [zipfile target]
- (let [entries (->> zipfile (ZipFile.) .entries enumeration-seq (map (memfn getName)))]
- (boolean (some #(.startsWith % (str target "/")) entries))))
-
-(defn url-encode
- [s]
- (codec/url-encode s))
-
-(defn url-decode
- [s]
- (codec/url-decode s))
-
-(defn join-maps
- [& maps]
- (let [all-keys (apply set/union (for [m maps] (-> m keys set)))]
- (into {} (for [k all-keys]
- [k (for [m maps] (m k))]))))
-
-(defn partition-fixed
- [max-num-chunks aseq]
- (if (zero? max-num-chunks)
- []
- (let [chunks (->> (integer-divided (count aseq) max-num-chunks)
- (#(dissoc % 0))
- (sort-by (comp - first))
- (mapcat (fn [[size amt]] (repeat amt size)))
- )]
- (loop [result []
- [chunk & rest-chunks] chunks
- data aseq]
- (if (nil? chunk)
- result
- (let [[c rest-data] (split-at chunk data)]
- (recur (conj result c)
- rest-chunks
- rest-data)))))))
-
-
-(defn assoc-apply-self
- [curr key afn]
- (assoc curr key (afn curr)))
-
-(defmacro recursive-map
- [& forms]
- (->> (partition 2 forms)
- (map (fn [[key form]] `(assoc-apply-self ~key (fn [~'<>] ~form))))
- (concat `(-> {}))))
-
-(defn current-stack-trace
- []
- (->> (Thread/currentThread)
- .getStackTrace
- (map str)
- (str/join "\n")))
-
-(defn get-iterator
- [^Iterable alist]
- (if alist (.iterator alist)))
-
-(defn iter-has-next?
- [^Iterator iter]
- (if iter (.hasNext iter) false))
-
-(defn iter-next
- [^Iterator iter]
- (.next iter))
-
-(defmacro fast-list-iter
- [pairs & body]
- (let [pairs (partition 2 pairs)
- lists (map second pairs)
- elems (map first pairs)
- iters (map (fn [_] (gensym)) lists)
- bindings (->> (map (fn [i l] [i `(get-iterator ~l)]) iters lists)
- (apply concat))
- tests (map (fn [i] `(iter-has-next? ~i)) iters)
- assignments (->> (map (fn [e i] [e `(iter-next ~i)]) elems iters)
- (apply concat))]
- `(let [~@bindings]
- (while (and ~@tests)
- (let [~@assignments]
- ~@body)))))
-
-(defn fast-list-map
- [afn alist]
- (let [ret (ArrayList.)]
- (fast-list-iter [e alist]
- (.add ret (afn e)))
- ret))
-
-(defmacro fast-list-for
- [[e alist] & body]
- `(fast-list-map (fn [~e] ~@body) ~alist))
-
-(defn map-iter
- [^Map amap]
- (if amap (-> amap .entrySet .iterator)))
-
-(defn convert-entry
- [^Map$Entry entry]
- [(.getKey entry) (.getValue entry)])
-
-(defmacro fast-map-iter
- [[bind amap] & body]
- `(let [iter# (map-iter ~amap)]
- (while (iter-has-next? iter#)
- (let [entry# (iter-next iter#)
- ~bind (convert-entry entry#)]
- ~@body))))
-
-(defn fast-first
- [^List alist]
- (.get alist 0))
-
-(defmacro get-with-default
- [amap key default-val]
- `(let [curr# (.get ~amap ~key)]
- (if curr#
- curr#
- (do
- (let [new# ~default-val]
- (.put ~amap ~key new#)
- new#)))))
-
-(defn fast-group-by
- [afn alist]
- (let [ret (HashMap.)]
- (fast-list-iter
- [e alist]
- (let [key (afn e)
- ^List curr (get-with-default ret key (ArrayList.))]
- (.add curr e)))
- ret))
-
-(defn new-instance
- [klass]
- (let [klass (if (string? klass) (Class/forName klass) klass)]
- (.newInstance klass)))
-
-(defn get-configured-class
- [conf config-key]
- (if (.get conf config-key) (new-instance (.get conf config-key)) nil))
-
-(defmacro -<>
- ([x] x)
- ([x form] (if (seq? form)
- (with-meta
- (let [[begin [_ & end]] (split-with #(not= % '<>) form)]
- (concat begin [x] end))
- (meta form))
- (list form x)))
- ([x form & more] `(-<> (-<> ~x ~form) ~@more)))
-
-(defn logs-filename
- [storm-id port]
- (str storm-id file-path-separator port file-path-separator "worker.log"))
-
-(def worker-log-filename-pattern #"^worker.log(.*)")
-
-(defn event-logs-filename
- [storm-id port]
- (str storm-id file-path-separator port file-path-separator "events.log"))
-
-(defn clojure-from-yaml-file [yamlFile]
- (try
- (with-open [reader (java.io.FileReader. yamlFile)]
- (clojurify-structure (.load (Yaml. (SafeConstructor.)) reader)))
- (catch Exception ex
- (log-error ex) {})))
-
-(defn hashmap-to-persistent [^HashMap m]
- (zipmap (.keySet m) (.values m)))
-
-(defn retry-on-exception
- "Retries specific function on exception based on retries count"
- [retries task-description f & args]
- (let [res (try {:value (apply f args)}
- (catch Exception e
- (if (<= 0 retries)
- (throw e)
- {:exception e})))]
- (if (:exception res)
- (do
- (log-error (:exception res) (str "Failed to " task-description ". Will make [" retries "] more attempts."))
- (recur (dec retries) task-description f args))
- (do
- (log-debug (str "Successful " task-description "."))
- (:value res)))))
-
-(defn setup-default-uncaught-exception-handler
- "Set a default uncaught exception handler to handle exceptions not caught in other threads."
- []
- (Thread/setDefaultUncaughtExceptionHandler
- (proxy [Thread$UncaughtExceptionHandler] []
- (uncaughtException [thread thrown]
- (try
- (Utils/handleUncaughtException thrown)
- (catch Error err
- (do
- (log-error err "Received error in main thread.. terminating server...")
- (.exit (Runtime/getRuntime) -2))))))))
-
-(defn redact-value
- "Hides value for k in coll for printing coll safely"
- [coll k]
- (if (contains? coll k)
- (assoc coll k (apply str (repeat (count (coll k)) "#")))
- coll))
-
-(defn- log-thrift-access-base
- [request-id remoteAddress principal operation]
- (str "Request ID: " request-id
- " access from: " remoteAddress
- " principal: " principal
- " operation: " operation))
-
-(defn log-thrift-access
- [request-id remoteAddress principal operation storm-name access-result]
- (doto
- (ThriftAccessLogger.)
- (.log (str (log-thrift-access-base request-id remoteAddress principal operation)
- (if storm-name
- (str " storm-name: " storm-name) "")
- (if access-result
- (str " access result: " access-result) "")))))
-
-(defn log-thrift-access-function
- [request-id remoteAddress principal operation function]
- (doto
- (ThriftAccessLogger.)
- (.log (str (log-thrift-access-base request-id remoteAddress principal operation)
- (if function
- (str " function: " function) "")))))
-
-(def DISALLOWED-KEY-NAME-STRS #{"/" "." ":" "\\"})
-
-(defn validate-key-name!
- [name]
- (if (some #(.contains name %) DISALLOWED-KEY-NAME-STRS)
- (throw (RuntimeException.
- (str "Key name cannot contain any of the following: " (pr-str DISALLOWED-KEY-NAME-STRS))))
- (if (clojure.string/blank? name)
- (throw (RuntimeException.
- ("Key name cannot be blank"))))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/backtype/storm/zookeeper.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/zookeeper.clj b/storm-core/src/clj/backtype/storm/zookeeper.clj
deleted file mode 100644
index 2b5da55..0000000
--- a/storm-core/src/clj/backtype/storm/zookeeper.clj
+++ /dev/null
@@ -1,327 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-
-(ns org.apache.storm.zookeeper
- (:require [clojure.set :as set])
- (:import [org.apache.curator.retry RetryNTimes]
- [org.apache.storm Config])
- (:import [org.apache.curator.framework.api CuratorEvent CuratorEventType CuratorListener UnhandledErrorListener])
- (:import [org.apache.curator.framework.state ConnectionStateListener])
- (:import [org.apache.curator.framework CuratorFramework CuratorFrameworkFactory])
- (:import [org.apache.curator.framework.recipes.leader LeaderLatch LeaderLatch$State Participant LeaderLatchListener])
- (:import [org.apache.zookeeper ZooKeeper Watcher KeeperException$NoNodeException
- ZooDefs ZooDefs$Ids CreateMode WatchedEvent Watcher$Event Watcher$Event$KeeperState
- Watcher$Event$EventType KeeperException$NodeExistsException])
- (:import [org.apache.zookeeper.data Stat])
- (:import [org.apache.zookeeper.server ZooKeeperServer NIOServerCnxnFactory])
- (:import [java.net InetSocketAddress BindException InetAddress])
- (:import [org.apache.storm.nimbus ILeaderElector NimbusInfo])
- (:import [java.io File])
- (:import [java.util List Map])
- (:import [org.apache.storm.utils Utils ZookeeperAuthInfo]
- (org.apache.storm.blobstore KeyFilter BlobStore))
- (:use [org.apache.storm util log config]))
-
-(def zk-keeper-states
- {Watcher$Event$KeeperState/Disconnected :disconnected
- Watcher$Event$KeeperState/SyncConnected :connected
- Watcher$Event$KeeperState/AuthFailed :auth-failed
- Watcher$Event$KeeperState/Expired :expired})
-
-(def zk-event-types
- {Watcher$Event$EventType/None :none
- Watcher$Event$EventType/NodeCreated :node-created
- Watcher$Event$EventType/NodeDeleted :node-deleted
- Watcher$Event$EventType/NodeDataChanged :node-data-changed
- Watcher$Event$EventType/NodeChildrenChanged :node-children-changed})
-
-(defn- default-watcher
- [state type path]
- (log-message "Zookeeper state update: " state type path))
-
-(defnk mk-client
- [conf servers port
- :root ""
- :watcher default-watcher
- :auth-conf nil]
- (let [fk (Utils/newCurator conf servers port root (when auth-conf (ZookeeperAuthInfo. auth-conf)))]
- (.. fk
- (getCuratorListenable)
- (addListener
- (reify CuratorListener
- (^void eventReceived [this ^CuratorFramework _fk ^CuratorEvent e]
- (when (= (.getType e) CuratorEventType/WATCHED)
- (let [^WatchedEvent event (.getWatchedEvent e)]
- (watcher (zk-keeper-states (.getState event))
- (zk-event-types (.getType event))
- (.getPath event))))))))
- ;; (.. fk
- ;; (getUnhandledErrorListenable)
- ;; (addListener
- ;; (reify UnhandledErrorListener
- ;; (unhandledError [this msg error]
- ;; (if (or (exception-cause? InterruptedException error)
- ;; (exception-cause? java.nio.channels.ClosedByInterruptException error))
- ;; (do (log-warn-error error "Zookeeper exception " msg)
- ;; (let [to-throw (InterruptedException.)]
- ;; (.initCause to-throw error)
- ;; (throw to-throw)
- ;; ))
- ;; (do (log-error error "Unrecoverable Zookeeper error " msg)
- ;; (halt-process! 1 "Unrecoverable Zookeeper error")))
- ;; ))))
- (.start fk)
- fk))
-
-(def zk-create-modes
- {:ephemeral CreateMode/EPHEMERAL
- :persistent CreateMode/PERSISTENT
- :sequential CreateMode/PERSISTENT_SEQUENTIAL})
-
-(defn create-node
- ([^CuratorFramework zk ^String path ^bytes data mode acls]
- (let [mode (zk-create-modes mode)]
- (try
- (.. zk (create) (creatingParentsIfNeeded) (withMode mode) (withACL acls) (forPath (normalize-path path) data))
- (catch Exception e (throw (wrap-in-runtime e))))))
- ([^CuratorFramework zk ^String path ^bytes data acls]
- (create-node zk path data :persistent acls)))
-
-(defn exists-node?
- [^CuratorFramework zk ^String path watch?]
- ((complement nil?)
- (try
- (if watch?
- (.. zk (checkExists) (watched) (forPath (normalize-path path)))
- (.. zk (checkExists) (forPath (normalize-path path))))
- (catch Exception e (throw (wrap-in-runtime e))))))
-
-(defnk delete-node
- [^CuratorFramework zk ^String path]
- (let [path (normalize-path path)]
- (when (exists-node? zk path false)
- (try-cause (.. zk (delete) (deletingChildrenIfNeeded) (forPath (normalize-path path)))
- (catch KeeperException$NoNodeException e
- ;; do nothing
- (log-message "exception" e)
- )
- (catch Exception e (throw (wrap-in-runtime e)))))))
-
-(defn mkdirs
- [^CuratorFramework zk ^String path acls]
- (let [path (normalize-path path)]
- (when-not (or (= path "/") (exists-node? zk path false))
- (mkdirs zk (parent-path path) acls)
- (try-cause
- (create-node zk path (barr 7) :persistent acls)
- (catch KeeperException$NodeExistsException e
- ;; this can happen when multiple clients doing mkdir at same time
- ))
- )))
-
-(defn sync-path
- [^CuratorFramework zk ^String path]
- (try
- (.. zk (sync) (forPath (normalize-path path)))
- (catch Exception e (throw (wrap-in-runtime e)))))
-
-
-(defn add-listener [^CuratorFramework zk ^ConnectionStateListener listener]
- (.. zk (getConnectionStateListenable) (addListener listener)))
-
-(defn get-data
- [^CuratorFramework zk ^String path watch?]
- (let [path (normalize-path path)]
- (try-cause
- (if (exists-node? zk path watch?)
- (if watch?
- (.. zk (getData) (watched) (forPath path))
- (.. zk (getData) (forPath path))))
- (catch KeeperException$NoNodeException e
- ;; this is fine b/c we still have a watch from the successful exists call
- nil )
- (catch Exception e (throw (wrap-in-runtime e))))))
-
-(defn get-data-with-version
- [^CuratorFramework zk ^String path watch?]
- (let [stats (org.apache.zookeeper.data.Stat. )
- path (normalize-path path)]
- (try-cause
- (if-let [data
- (if (exists-node? zk path watch?)
- (if watch?
- (.. zk (getData) (watched) (storingStatIn stats) (forPath path))
- (.. zk (getData) (storingStatIn stats) (forPath path))))]
- {:data data
- :version (.getVersion stats)})
- (catch KeeperException$NoNodeException e
- ;; this is fine b/c we still have a watch from the successful exists call
- nil ))))
-
-(defn get-version
-[^CuratorFramework zk ^String path watch?]
- (if-let [stats
- (if watch?
- (.. zk (checkExists) (watched) (forPath (normalize-path path)))
- (.. zk (checkExists) (forPath (normalize-path path))))]
- (.getVersion stats)
- nil))
-
-(defn get-children
- [^CuratorFramework zk ^String path watch?]
- (try
- (if watch?
- (.. zk (getChildren) (watched) (forPath (normalize-path path)))
- (.. zk (getChildren) (forPath (normalize-path path))))
- (catch Exception e (throw (wrap-in-runtime e)))))
-
-(defn delete-node-blobstore
- "Deletes the state inside the zookeeper for a key, for which the
- contents of the key starts with nimbus host port information"
- [^CuratorFramework zk ^String parent-path ^String host-port-info]
- (let [parent-path (normalize-path parent-path)
- child-path-list (if (exists-node? zk parent-path false)
- (into [] (get-children zk parent-path false))
- [])]
- (doseq [child child-path-list]
- (when (.startsWith child host-port-info)
- (log-debug "delete-node " "child" child)
- (delete-node zk (str parent-path "/" child))))))
-
-(defn set-data
- [^CuratorFramework zk ^String path ^bytes data]
- (try
- (.. zk (setData) (forPath (normalize-path path) data))
- (catch Exception e (throw (wrap-in-runtime e)))))
-
-(defn exists
- [^CuratorFramework zk ^String path watch?]
- (exists-node? zk path watch?))
-
-(defnk mk-inprocess-zookeeper
- [localdir :port nil]
- (let [localfile (File. localdir)
- zk (ZooKeeperServer. localfile localfile 2000)
- [retport factory]
- (loop [retport (if port port 2000)]
- (if-let [factory-tmp
- (try-cause
- (doto (NIOServerCnxnFactory.)
- (.configure (InetSocketAddress. retport) 0))
- (catch BindException e
- (when (> (inc retport) (if port port 65535))
- (throw (RuntimeException.
- "No port is available to launch an inprocess zookeeper.")))))]
- [retport factory-tmp]
- (recur (inc retport))))]
- (log-message "Starting inprocess zookeeper at port " retport " and dir " localdir)
- (.startup factory zk)
- [retport factory]))
-
-(defn shutdown-inprocess-zookeeper
- [handle]
- (.shutdown handle))
-
-(defn- to-NimbusInfo [^Participant participant]
- (let
- [id (if (clojure.string/blank? (.getId participant))
- (throw (RuntimeException. "No nimbus leader participant host found, have you started your nimbus hosts?"))
- (.getId participant))
- nimbus-info (NimbusInfo/parse id)]
- (.setLeader nimbus-info (.isLeader participant))
- nimbus-info))
-
-(defn- code-ids [blob-store]
- (let [to-id (reify KeyFilter
- (filter [this key] (get-id-from-blob-key key)))]
- (set (.filterAndListKeys blob-store to-id))))
-
-(defn leader-latch-listener-impl
- "Leader latch listener that will be invoked when we either gain or lose leadership"
- [conf zk blob-store leader-latch]
- (let [hostname (.getCanonicalHostName (InetAddress/getLocalHost))
- STORMS-ROOT (str (conf STORM-ZOOKEEPER-ROOT) "/storms")]
- (reify LeaderLatchListener
- (^void isLeader[this]
- (log-message (str hostname " gained leadership, checking if it has all the topology code locally."))
- (let [active-topology-ids (set (get-children zk STORMS-ROOT false))
- local-topology-ids (set (code-ids blob-store))
- diff-topology (set/difference active-topology-ids local-topology-ids)]
- (log-message "active-topology-ids [" (clojure.string/join "," active-topology-ids)
- "] local-topology-ids [" (clojure.string/join "," local-topology-ids)
- "] diff-topology [" (clojure.string/join "," diff-topology) "]")
- (if (empty? diff-topology)
- (log-message "Accepting leadership, all active topology found localy.")
- (do
- (log-message "code for all active topologies not available locally, giving up leadership.")
- (.close leader-latch)))))
- (^void notLeader[this]
- (log-message (str hostname " lost leadership."))))))
-
-(defn zk-leader-elector
- "Zookeeper Implementation of ILeaderElector."
- [conf blob-store]
- (let [servers (conf STORM-ZOOKEEPER-SERVERS)
- zk (mk-client conf (conf STORM-ZOOKEEPER-SERVERS) (conf STORM-ZOOKEEPER-PORT) :auth-conf conf)
- leader-lock-path (str (conf STORM-ZOOKEEPER-ROOT) "/leader-lock")
- id (.toHostPortString (NimbusInfo/fromConf conf))
- leader-latch (atom (LeaderLatch. zk leader-lock-path id))
- leader-latch-listener (atom (leader-latch-listener-impl conf zk blob-store @leader-latch))
- ]
- (reify ILeaderElector
- (prepare [this conf]
- (log-message "no-op for zookeeper implementation"))
-
- (^void addToLeaderLockQueue [this]
- ;if this latch is already closed, we need to create new instance.
- (if (.equals LeaderLatch$State/CLOSED (.getState @leader-latch))
- (do
- (reset! leader-latch (LeaderLatch. zk leader-lock-path id))
- (reset! leader-latch-listener (leader-latch-listener-impl conf zk blob-store @leader-latch))
- (log-message "LeaderLatch was in closed state. Resetted the leaderLatch and listeners.")
- ))
-
- ;Only if the latch is not already started we invoke start.
- (if (.equals LeaderLatch$State/LATENT (.getState @leader-latch))
- (do
- (.addListener @leader-latch @leader-latch-listener)
- (.start @leader-latch)
- (log-message "Queued up for leader lock."))
- (log-message "Node already in queue for leader lock.")))
-
- (^void removeFromLeaderLockQueue [this]
- ;Only started latches can be closed.
- (if (.equals LeaderLatch$State/STARTED (.getState @leader-latch))
- (do
- (.close @leader-latch)
- (log-message "Removed from leader lock queue."))
- (log-message "leader latch is not started so no removeFromLeaderLockQueue needed.")))
-
- (^boolean isLeader [this]
- (.hasLeadership @leader-latch))
-
- (^NimbusInfo getLeader [this]
- (to-NimbusInfo (.getLeader @leader-latch)))
-
- (^List getAllNimbuses [this]
- (let [participants (.getParticipants @leader-latch)]
- (map (fn [^Participant participant]
- (to-NimbusInfo participant))
- participants)))
-
- (^void close[this]
- (log-message "closing zookeeper connection of leader elector.")
- (.close zk)))))
http://git-wip-us.apache.org/repos/asf/storm/blob/a6171bd6/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj b/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
index 1f9b306..eda477c 100644
--- a/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
+++ b/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
@@ -19,6 +19,7 @@
[org.apache.storm.cluster-state [zookeeper-state-factory :as zk-factory]]
[org.apache.storm
[config :refer :all]
+ [converter :as converter]
[cluster :refer :all]
[log :refer :all]
[util :as util]])
@@ -27,7 +28,7 @@
HBMessageData HBPulse ClusterWorkerHeartbeat]
[org.apache.storm.cluster_state zookeeper_state_factory]
[org.apache.storm.cluster ClusterState]
- [backtype.storm.utils Utils]
+ [org.apache.storm.utils Utils]
[org.apache.storm.pacemaker PacemakerClient])
(:gen-class
:implements [org.apache.storm.cluster.ClusterStateFactory]))
@@ -39,7 +40,7 @@
(defn clojurify-details [details]
(if details
- (clojurify-zk-worker-hb (maybe-deserialize details ClusterWorkerHeartbeat))))
+ (converter/clojurify-zk-worker-hb (maybe-deserialize details ClusterWorkerHeartbeat))))
(defn get-wk-hb-time-secs-pair [details-set]
(for [details details-set]