http://git-wip-us.apache.org/repos/asf/storm/blob/7029aee5/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 new file mode 100644 index 0000000..2209168 --- /dev/null +++ b/storm-core/src/jvm/backtype/storm/generated/AccessControl.java @@ -0,0 +1,627 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 backtype.storm.generated; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.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 = backtype.storm.generated.AccessControlType.findByValue(iprot.readI32()); + struct.set_type_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // ACCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.access = iprot.readI32(); + struct.set_access_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, AccessControl struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.type != null) { + oprot.writeFieldBegin(TYPE_FIELD_DESC); + oprot.writeI32(struct.type.getValue()); + oprot.writeFieldEnd(); + } + if (struct.name != null) { + if (struct.is_set_name()) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldBegin(ACCESS_FIELD_DESC); + oprot.writeI32(struct.access); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class AccessControlTupleSchemeFactory implements SchemeFactory { + public AccessControlTupleScheme getScheme() { + return new AccessControlTupleScheme(); + } + } + + private static class AccessControlTupleScheme extends TupleScheme<AccessControl> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, AccessControl struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.type.getValue()); + oprot.writeI32(struct.access); + BitSet optionals = new BitSet(); + if (struct.is_set_name()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_name()) { + oprot.writeString(struct.name); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, AccessControl struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.type = backtype.storm.generated.AccessControlType.findByValue(iprot.readI32()); + struct.set_type_isSet(true); + struct.access = iprot.readI32(); + struct.set_access_isSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } + } + } + +} +
http://git-wip-us.apache.org/repos/asf/storm/blob/7029aee5/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 new file mode 100644 index 0000000..3a9aa70 --- /dev/null +++ b/storm-core/src/jvm/backtype/storm/generated/AccessControlType.java @@ -0,0 +1,62 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 backtype.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/7029aee5/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 index cc9bb19..cf59c05 100644 --- a/storm-core/src/jvm/backtype/storm/generated/Assignment.java +++ b/storm-core/src/jvm/backtype/storm/generated/Assignment.java @@ -787,15 +787,15 @@ public class Assignment implements org.apache.thrift.TBase<Assignment, Assignmen case 2: // NODE_HOST if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map532 = iprot.readMapBegin(); - struct.node_host = new HashMap<String,String>(2*_map532.size); - String _key533; - String _val534; - for (int _i535 = 0; _i535 < _map532.size; ++_i535) + org.apache.thrift.protocol.TMap _map548 = iprot.readMapBegin(); + struct.node_host = new HashMap<String,String>(2*_map548.size); + String _key549; + String _val550; + for (int _i551 = 0; _i551 < _map548.size; ++_i551) { - _key533 = iprot.readString(); - _val534 = iprot.readString(); - struct.node_host.put(_key533, _val534); + _key549 = iprot.readString(); + _val550 = iprot.readString(); + struct.node_host.put(_key549, _val550); } iprot.readMapEnd(); } @@ -807,26 +807,26 @@ public class Assignment implements org.apache.thrift.TBase<Assignment, Assignmen case 3: // EXECUTOR_NODE_PORT if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map536 = iprot.readMapBegin(); - struct.executor_node_port = new HashMap<List<Long>,NodeInfo>(2*_map536.size); - List<Long> _key537; - NodeInfo _val538; - for (int _i539 = 0; _i539 < _map536.size; ++_i539) + org.apache.thrift.protocol.TMap _map552 = iprot.readMapBegin(); + struct.executor_node_port = new HashMap<List<Long>,NodeInfo>(2*_map552.size); + List<Long> _key553; + NodeInfo _val554; + for (int _i555 = 0; _i555 < _map552.size; ++_i555) { { - org.apache.thrift.protocol.TList _list540 = iprot.readListBegin(); - _key537 = new ArrayList<Long>(_list540.size); - long _elem541; - for (int _i542 = 0; _i542 < _list540.size; ++_i542) + org.apache.thrift.protocol.TList _list556 = iprot.readListBegin(); + _key553 = new ArrayList<Long>(_list556.size); + long _elem557; + for (int _i558 = 0; _i558 < _list556.size; ++_i558) { - _elem541 = iprot.readI64(); - _key537.add(_elem541); + _elem557 = iprot.readI64(); + _key553.add(_elem557); } iprot.readListEnd(); } - _val538 = new NodeInfo(); - _val538.read(iprot); - struct.executor_node_port.put(_key537, _val538); + _val554 = new NodeInfo(); + _val554.read(iprot); + struct.executor_node_port.put(_key553, _val554); } iprot.readMapEnd(); } @@ -838,25 +838,25 @@ public class Assignment implements org.apache.thrift.TBase<Assignment, Assignmen case 4: // EXECUTOR_START_TIME_SECS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map543 = iprot.readMapBegin(); - struct.executor_start_time_secs = new HashMap<List<Long>,Long>(2*_map543.size); - List<Long> _key544; - long _val545; - for (int _i546 = 0; _i546 < _map543.size; ++_i546) + org.apache.thrift.protocol.TMap _map559 = iprot.readMapBegin(); + struct.executor_start_time_secs = new HashMap<List<Long>,Long>(2*_map559.size); + List<Long> _key560; + long _val561; + for (int _i562 = 0; _i562 < _map559.size; ++_i562) { { - org.apache.thrift.protocol.TList _list547 = iprot.readListBegin(); - _key544 = new ArrayList<Long>(_list547.size); - long _elem548; - for (int _i549 = 0; _i549 < _list547.size; ++_i549) + org.apache.thrift.protocol.TList _list563 = iprot.readListBegin(); + _key560 = new ArrayList<Long>(_list563.size); + long _elem564; + for (int _i565 = 0; _i565 < _list563.size; ++_i565) { - _elem548 = iprot.readI64(); - _key544.add(_elem548); + _elem564 = iprot.readI64(); + _key560.add(_elem564); } iprot.readListEnd(); } - _val545 = iprot.readI64(); - struct.executor_start_time_secs.put(_key544, _val545); + _val561 = iprot.readI64(); + struct.executor_start_time_secs.put(_key560, _val561); } iprot.readMapEnd(); } @@ -868,17 +868,17 @@ public class Assignment implements org.apache.thrift.TBase<Assignment, Assignmen case 5: // WORKER_RESOURCES if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map550 = iprot.readMapBegin(); - struct.worker_resources = new HashMap<NodeInfo,WorkerResources>(2*_map550.size); - NodeInfo _key551; - WorkerResources _val552; - for (int _i553 = 0; _i553 < _map550.size; ++_i553) + org.apache.thrift.protocol.TMap _map566 = iprot.readMapBegin(); + struct.worker_resources = new HashMap<NodeInfo,WorkerResources>(2*_map566.size); + NodeInfo _key567; + WorkerResources _val568; + for (int _i569 = 0; _i569 < _map566.size; ++_i569) { - _key551 = new NodeInfo(); - _key551.read(iprot); - _val552 = new WorkerResources(); - _val552.read(iprot); - struct.worker_resources.put(_key551, _val552); + _key567 = new NodeInfo(); + _key567.read(iprot); + _val568 = new WorkerResources(); + _val568.read(iprot); + struct.worker_resources.put(_key567, _val568); } iprot.readMapEnd(); } @@ -910,10 +910,10 @@ public class Assignment implements org.apache.thrift.TBase<Assignment, Assignmen 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> _iter554 : struct.node_host.entrySet()) + for (Map.Entry<String, String> _iter570 : struct.node_host.entrySet()) { - oprot.writeString(_iter554.getKey()); - oprot.writeString(_iter554.getValue()); + oprot.writeString(_iter570.getKey()); + oprot.writeString(_iter570.getValue()); } oprot.writeMapEnd(); } @@ -925,17 +925,17 @@ public class Assignment implements org.apache.thrift.TBase<Assignment, Assignmen 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> _iter555 : struct.executor_node_port.entrySet()) + for (Map.Entry<List<Long>, NodeInfo> _iter571 : struct.executor_node_port.entrySet()) { { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, _iter555.getKey().size())); - for (long _iter556 : _iter555.getKey()) + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, _iter571.getKey().size())); + for (long _iter572 : _iter571.getKey()) { - oprot.writeI64(_iter556); + oprot.writeI64(_iter572); } oprot.writeListEnd(); } - _iter555.getValue().write(oprot); + _iter571.getValue().write(oprot); } oprot.writeMapEnd(); } @@ -947,17 +947,17 @@ public class Assignment implements org.apache.thrift.TBase<Assignment, Assignmen 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> _iter557 : struct.executor_start_time_secs.entrySet()) + for (Map.Entry<List<Long>, Long> _iter573 : struct.executor_start_time_secs.entrySet()) { { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, _iter557.getKey().size())); - for (long _iter558 : _iter557.getKey()) + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, _iter573.getKey().size())); + for (long _iter574 : _iter573.getKey()) { - oprot.writeI64(_iter558); + oprot.writeI64(_iter574); } oprot.writeListEnd(); } - oprot.writeI64(_iter557.getValue()); + oprot.writeI64(_iter573.getValue()); } oprot.writeMapEnd(); } @@ -969,10 +969,10 @@ public class Assignment implements org.apache.thrift.TBase<Assignment, Assignmen 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> _iter559 : struct.worker_resources.entrySet()) + for (Map.Entry<NodeInfo, WorkerResources> _iter575 : struct.worker_resources.entrySet()) { - _iter559.getKey().write(oprot); - _iter559.getValue().write(oprot); + _iter575.getKey().write(oprot); + _iter575.getValue().write(oprot); } oprot.writeMapEnd(); } @@ -1014,52 +1014,52 @@ public class Assignment implements org.apache.thrift.TBase<Assignment, Assignmen if (struct.is_set_node_host()) { { oprot.writeI32(struct.node_host.size()); - for (Map.Entry<String, String> _iter560 : struct.node_host.entrySet()) + for (Map.Entry<String, String> _iter576 : struct.node_host.entrySet()) { - oprot.writeString(_iter560.getKey()); - oprot.writeString(_iter560.getValue()); + oprot.writeString(_iter576.getKey()); + oprot.writeString(_iter576.getValue()); } } } if (struct.is_set_executor_node_port()) { { oprot.writeI32(struct.executor_node_port.size()); - for (Map.Entry<List<Long>, NodeInfo> _iter561 : struct.executor_node_port.entrySet()) + for (Map.Entry<List<Long>, NodeInfo> _iter577 : struct.executor_node_port.entrySet()) { { - oprot.writeI32(_iter561.getKey().size()); - for (long _iter562 : _iter561.getKey()) + oprot.writeI32(_iter577.getKey().size()); + for (long _iter578 : _iter577.getKey()) { - oprot.writeI64(_iter562); + oprot.writeI64(_iter578); } } - _iter561.getValue().write(oprot); + _iter577.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> _iter563 : struct.executor_start_time_secs.entrySet()) + for (Map.Entry<List<Long>, Long> _iter579 : struct.executor_start_time_secs.entrySet()) { { - oprot.writeI32(_iter563.getKey().size()); - for (long _iter564 : _iter563.getKey()) + oprot.writeI32(_iter579.getKey().size()); + for (long _iter580 : _iter579.getKey()) { - oprot.writeI64(_iter564); + oprot.writeI64(_iter580); } } - oprot.writeI64(_iter563.getValue()); + oprot.writeI64(_iter579.getValue()); } } } if (struct.is_set_worker_resources()) { { oprot.writeI32(struct.worker_resources.size()); - for (Map.Entry<NodeInfo, WorkerResources> _iter565 : struct.worker_resources.entrySet()) + for (Map.Entry<NodeInfo, WorkerResources> _iter581 : struct.worker_resources.entrySet()) { - _iter565.getKey().write(oprot); - _iter565.getValue().write(oprot); + _iter581.getKey().write(oprot); + _iter581.getValue().write(oprot); } } } @@ -1073,81 +1073,81 @@ public class Assignment implements org.apache.thrift.TBase<Assignment, Assignmen BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map566 = 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*_map566.size); - String _key567; - String _val568; - for (int _i569 = 0; _i569 < _map566.size; ++_i569) + org.apache.thrift.protocol.TMap _map582 = 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*_map582.size); + String _key583; + String _val584; + for (int _i585 = 0; _i585 < _map582.size; ++_i585) { - _key567 = iprot.readString(); - _val568 = iprot.readString(); - struct.node_host.put(_key567, _val568); + _key583 = iprot.readString(); + _val584 = iprot.readString(); + struct.node_host.put(_key583, _val584); } } struct.set_node_host_isSet(true); } if (incoming.get(1)) { { - org.apache.thrift.protocol.TMap _map570 = 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*_map570.size); - List<Long> _key571; - NodeInfo _val572; - for (int _i573 = 0; _i573 < _map570.size; ++_i573) + org.apache.thrift.protocol.TMap _map586 = 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*_map586.size); + List<Long> _key587; + NodeInfo _val588; + for (int _i589 = 0; _i589 < _map586.size; ++_i589) { { - org.apache.thrift.protocol.TList _list574 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); - _key571 = new ArrayList<Long>(_list574.size); - long _elem575; - for (int _i576 = 0; _i576 < _list574.size; ++_i576) + org.apache.thrift.protocol.TList _list590 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + _key587 = new ArrayList<Long>(_list590.size); + long _elem591; + for (int _i592 = 0; _i592 < _list590.size; ++_i592) { - _elem575 = iprot.readI64(); - _key571.add(_elem575); + _elem591 = iprot.readI64(); + _key587.add(_elem591); } } - _val572 = new NodeInfo(); - _val572.read(iprot); - struct.executor_node_port.put(_key571, _val572); + _val588 = new NodeInfo(); + _val588.read(iprot); + struct.executor_node_port.put(_key587, _val588); } } struct.set_executor_node_port_isSet(true); } if (incoming.get(2)) { { - org.apache.thrift.protocol.TMap _map577 = 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*_map577.size); - List<Long> _key578; - long _val579; - for (int _i580 = 0; _i580 < _map577.size; ++_i580) + org.apache.thrift.protocol.TMap _map593 = 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*_map593.size); + List<Long> _key594; + long _val595; + for (int _i596 = 0; _i596 < _map593.size; ++_i596) { { - org.apache.thrift.protocol.TList _list581 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); - _key578 = new ArrayList<Long>(_list581.size); - long _elem582; - for (int _i583 = 0; _i583 < _list581.size; ++_i583) + org.apache.thrift.protocol.TList _list597 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + _key594 = new ArrayList<Long>(_list597.size); + long _elem598; + for (int _i599 = 0; _i599 < _list597.size; ++_i599) { - _elem582 = iprot.readI64(); - _key578.add(_elem582); + _elem598 = iprot.readI64(); + _key594.add(_elem598); } } - _val579 = iprot.readI64(); - struct.executor_start_time_secs.put(_key578, _val579); + _val595 = iprot.readI64(); + struct.executor_start_time_secs.put(_key594, _val595); } } struct.set_executor_start_time_secs_isSet(true); } if (incoming.get(3)) { { - org.apache.thrift.protocol.TMap _map584 = 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*_map584.size); - NodeInfo _key585; - WorkerResources _val586; - for (int _i587 = 0; _i587 < _map584.size; ++_i587) + org.apache.thrift.protocol.TMap _map600 = 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*_map600.size); + NodeInfo _key601; + WorkerResources _val602; + for (int _i603 = 0; _i603 < _map600.size; ++_i603) { - _key585 = new NodeInfo(); - _key585.read(iprot); - _val586 = new WorkerResources(); - _val586.read(iprot); - struct.worker_resources.put(_key585, _val586); + _key601 = new NodeInfo(); + _key601.read(iprot); + _val602 = new WorkerResources(); + _val602.read(iprot); + struct.worker_resources.put(_key601, _val602); } } struct.set_worker_resources_isSet(true); http://git-wip-us.apache.org/repos/asf/storm/blob/7029aee5/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 new file mode 100644 index 0000000..f01c4eb --- /dev/null +++ b/storm-core/src/jvm/backtype/storm/generated/BeginDownloadResult.java @@ -0,0 +1,608 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 backtype.storm.generated; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.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/7029aee5/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 index a1b7e2e..2754abd 100644 --- a/storm-core/src/jvm/backtype/storm/generated/ClusterWorkerHeartbeat.java +++ b/storm-core/src/jvm/backtype/storm/generated/ClusterWorkerHeartbeat.java @@ -635,17 +635,17 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo case 2: // EXECUTOR_STATS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map608 = iprot.readMapBegin(); - struct.executor_stats = new HashMap<ExecutorInfo,ExecutorStats>(2*_map608.size); - ExecutorInfo _key609; - ExecutorStats _val610; - for (int _i611 = 0; _i611 < _map608.size; ++_i611) + org.apache.thrift.protocol.TMap _map624 = iprot.readMapBegin(); + struct.executor_stats = new HashMap<ExecutorInfo,ExecutorStats>(2*_map624.size); + ExecutorInfo _key625; + ExecutorStats _val626; + for (int _i627 = 0; _i627 < _map624.size; ++_i627) { - _key609 = new ExecutorInfo(); - _key609.read(iprot); - _val610 = new ExecutorStats(); - _val610.read(iprot); - struct.executor_stats.put(_key609, _val610); + _key625 = new ExecutorInfo(); + _key625.read(iprot); + _val626 = new ExecutorStats(); + _val626.read(iprot); + struct.executor_stats.put(_key625, _val626); } iprot.readMapEnd(); } @@ -692,10 +692,10 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo 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> _iter612 : struct.executor_stats.entrySet()) + for (Map.Entry<ExecutorInfo, ExecutorStats> _iter628 : struct.executor_stats.entrySet()) { - _iter612.getKey().write(oprot); - _iter612.getValue().write(oprot); + _iter628.getKey().write(oprot); + _iter628.getValue().write(oprot); } oprot.writeMapEnd(); } @@ -727,10 +727,10 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo oprot.writeString(struct.storm_id); { oprot.writeI32(struct.executor_stats.size()); - for (Map.Entry<ExecutorInfo, ExecutorStats> _iter613 : struct.executor_stats.entrySet()) + for (Map.Entry<ExecutorInfo, ExecutorStats> _iter629 : struct.executor_stats.entrySet()) { - _iter613.getKey().write(oprot); - _iter613.getValue().write(oprot); + _iter629.getKey().write(oprot); + _iter629.getValue().write(oprot); } } oprot.writeI32(struct.time_secs); @@ -743,17 +743,17 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo struct.storm_id = iprot.readString(); struct.set_storm_id_isSet(true); { - org.apache.thrift.protocol.TMap _map614 = 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*_map614.size); - ExecutorInfo _key615; - ExecutorStats _val616; - for (int _i617 = 0; _i617 < _map614.size; ++_i617) + org.apache.thrift.protocol.TMap _map630 = 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*_map630.size); + ExecutorInfo _key631; + ExecutorStats _val632; + for (int _i633 = 0; _i633 < _map630.size; ++_i633) { - _key615 = new ExecutorInfo(); - _key615.read(iprot); - _val616 = new ExecutorStats(); - _val616.read(iprot); - struct.executor_stats.put(_key615, _val616); + _key631 = new ExecutorInfo(); + _key631.read(iprot); + _val632 = new ExecutorStats(); + _val632.read(iprot); + struct.executor_stats.put(_key631, _val632); } } struct.set_executor_stats_isSet(true); http://git-wip-us.apache.org/repos/asf/storm/blob/7029aee5/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 index b6fc526..84bac76 100644 --- a/storm-core/src/jvm/backtype/storm/generated/HBNodes.java +++ b/storm-core/src/jvm/backtype/storm/generated/HBNodes.java @@ -364,13 +364,13 @@ public class HBNodes implements org.apache.thrift.TBase<HBNodes, HBNodes._Fields case 1: // PULSE_IDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list706 = iprot.readListBegin(); - struct.pulseIds = new ArrayList<String>(_list706.size); - String _elem707; - for (int _i708 = 0; _i708 < _list706.size; ++_i708) + org.apache.thrift.protocol.TList _list730 = iprot.readListBegin(); + struct.pulseIds = new ArrayList<String>(_list730.size); + String _elem731; + for (int _i732 = 0; _i732 < _list730.size; ++_i732) { - _elem707 = iprot.readString(); - struct.pulseIds.add(_elem707); + _elem731 = iprot.readString(); + struct.pulseIds.add(_elem731); } iprot.readListEnd(); } @@ -396,9 +396,9 @@ public class HBNodes implements org.apache.thrift.TBase<HBNodes, HBNodes._Fields 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 _iter709 : struct.pulseIds) + for (String _iter733 : struct.pulseIds) { - oprot.writeString(_iter709); + oprot.writeString(_iter733); } oprot.writeListEnd(); } @@ -429,9 +429,9 @@ public class HBNodes implements org.apache.thrift.TBase<HBNodes, HBNodes._Fields if (struct.is_set_pulseIds()) { { oprot.writeI32(struct.pulseIds.size()); - for (String _iter710 : struct.pulseIds) + for (String _iter734 : struct.pulseIds) { - oprot.writeString(_iter710); + oprot.writeString(_iter734); } } } @@ -443,13 +443,13 @@ public class HBNodes implements org.apache.thrift.TBase<HBNodes, HBNodes._Fields BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list711 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.pulseIds = new ArrayList<String>(_list711.size); - String _elem712; - for (int _i713 = 0; _i713 < _list711.size; ++_i713) + org.apache.thrift.protocol.TList _list735 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.pulseIds = new ArrayList<String>(_list735.size); + String _elem736; + for (int _i737 = 0; _i737 < _list735.size; ++_i737) { - _elem712 = iprot.readString(); - struct.pulseIds.add(_elem712); + _elem736 = iprot.readString(); + struct.pulseIds.add(_elem736); } } struct.set_pulseIds_isSet(true); http://git-wip-us.apache.org/repos/asf/storm/blob/7029aee5/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 index 4767068..65de1cc 100644 --- a/storm-core/src/jvm/backtype/storm/generated/HBRecords.java +++ b/storm-core/src/jvm/backtype/storm/generated/HBRecords.java @@ -367,14 +367,14 @@ public class HBRecords implements org.apache.thrift.TBase<HBRecords, HBRecords._ case 1: // PULSES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list698 = iprot.readListBegin(); - struct.pulses = new ArrayList<HBPulse>(_list698.size); - HBPulse _elem699; - for (int _i700 = 0; _i700 < _list698.size; ++_i700) + org.apache.thrift.protocol.TList _list722 = iprot.readListBegin(); + struct.pulses = new ArrayList<HBPulse>(_list722.size); + HBPulse _elem723; + for (int _i724 = 0; _i724 < _list722.size; ++_i724) { - _elem699 = new HBPulse(); - _elem699.read(iprot); - struct.pulses.add(_elem699); + _elem723 = new HBPulse(); + _elem723.read(iprot); + struct.pulses.add(_elem723); } iprot.readListEnd(); } @@ -400,9 +400,9 @@ public class HBRecords implements org.apache.thrift.TBase<HBRecords, HBRecords._ oprot.writeFieldBegin(PULSES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.pulses.size())); - for (HBPulse _iter701 : struct.pulses) + for (HBPulse _iter725 : struct.pulses) { - _iter701.write(oprot); + _iter725.write(oprot); } oprot.writeListEnd(); } @@ -433,9 +433,9 @@ public class HBRecords implements org.apache.thrift.TBase<HBRecords, HBRecords._ if (struct.is_set_pulses()) { { oprot.writeI32(struct.pulses.size()); - for (HBPulse _iter702 : struct.pulses) + for (HBPulse _iter726 : struct.pulses) { - _iter702.write(oprot); + _iter726.write(oprot); } } } @@ -447,14 +447,14 @@ public class HBRecords implements org.apache.thrift.TBase<HBRecords, HBRecords._ BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list703 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.pulses = new ArrayList<HBPulse>(_list703.size); - HBPulse _elem704; - for (int _i705 = 0; _i705 < _list703.size; ++_i705) + org.apache.thrift.protocol.TList _list727 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.pulses = new ArrayList<HBPulse>(_list727.size); + HBPulse _elem728; + for (int _i729 = 0; _i729 < _list727.size; ++_i729) { - _elem704 = new HBPulse(); - _elem704.read(iprot); - struct.pulses.add(_elem704); + _elem728 = new HBPulse(); + _elem728.read(iprot); + struct.pulses.add(_elem728); } } struct.set_pulses_isSet(true);
