http://git-wip-us.apache.org/repos/asf/storm/blob/22cf0acb/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 new file mode 100644 index 0000000..0483285 --- /dev/null +++ b/storm-core/src/jvm/backtype/storm/generated/LSTopoHistoryList.java @@ -0,0 +1,460 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Autogenerated by Thrift Compiler (0.9.2) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package backtype.storm.generated; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-11-4") +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 _list672 = iprot.readListBegin(); + struct.topo_history = new ArrayList<LSTopoHistory>(_list672.size); + LSTopoHistory _elem673; + for (int _i674 = 0; _i674 < _list672.size; ++_i674) + { + _elem673 = new LSTopoHistory(); + _elem673.read(iprot); + struct.topo_history.add(_elem673); + } + 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 _iter675 : struct.topo_history) + { + _iter675.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 _iter676 : struct.topo_history) + { + _iter676.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 _list677 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.topo_history = new ArrayList<LSTopoHistory>(_list677.size); + LSTopoHistory _elem678; + for (int _i679 = 0; _i679 < _list677.size; ++_i679) + { + _elem678 = new LSTopoHistory(); + _elem678.read(iprot); + struct.topo_history.add(_elem678); + } + } + struct.set_topo_history_isSet(true); + } + } + +} +
http://git-wip-us.apache.org/repos/asf/storm/blob/22cf0acb/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 index 9b2229f..b0d007b 100644 --- a/storm-core/src/jvm/backtype/storm/generated/Nimbus.java +++ b/storm-core/src/jvm/backtype/storm/generated/Nimbus.java @@ -51,7 +51,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-11-2") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-11-4") public class Nimbus { public interface Iface { @@ -132,6 +132,8 @@ public class Nimbus { */ 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 { @@ -190,6 +192,8 @@ public class Nimbus { 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 { @@ -944,6 +948,32 @@ public class Nimbus { 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> { @@ -1889,6 +1919,38 @@ public class Nimbus { } } + public void getTopologyHistory(String user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getTopologyHistory_call method_call = new getTopologyHistory_call(user, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getTopologyHistory_call extends org.apache.thrift.async.TAsyncMethodCall { + private String user; + public getTopologyHistory_call(String user, 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.user = user; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getTopologyHistory", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getTopologyHistory_args args = new getTopologyHistory_args(); + args.set_user(user); + args.write(prot); + prot.writeMessageEnd(); + } + + public TopologyHistoryInfo 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_getTopologyHistory(); + } + } + } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { @@ -1929,6 +1991,7 @@ public class Nimbus { processMap.put("getTopologyConf", new getTopologyConf()); processMap.put("getTopology", new getTopology()); processMap.put("getUserTopology", new getUserTopology()); + processMap.put("getTopologyHistory", new getTopologyHistory()); return processMap; } @@ -2604,6 +2667,30 @@ public class Nimbus { } } + public static class getTopologyHistory<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getTopologyHistory_args> { + public getTopologyHistory() { + super("getTopologyHistory"); + } + + public getTopologyHistory_args getEmptyArgsInstance() { + return new getTopologyHistory_args(); + } + + protected boolean isOneway() { + return false; + } + + public getTopologyHistory_result getResult(I iface, getTopologyHistory_args args) throws org.apache.thrift.TException { + getTopologyHistory_result result = new getTopologyHistory_result(); + try { + result.success = iface.getTopologyHistory(args.user); + } catch (AuthorizationException aze) { + result.aze = aze; + } + return result; + } + } + } public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { @@ -2644,6 +2731,7 @@ public class Nimbus { processMap.put("getTopologyConf", new getTopologyConf()); processMap.put("getTopology", new getTopology()); processMap.put("getUserTopology", new getUserTopology()); + processMap.put("getTopologyHistory", new getTopologyHistory()); return processMap; } @@ -4249,6 +4337,63 @@ public class Nimbus { } } + public static class getTopologyHistory<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getTopologyHistory_args, TopologyHistoryInfo> { + public getTopologyHistory() { + super("getTopologyHistory"); + } + + public getTopologyHistory_args getEmptyArgsInstance() { + return new getTopologyHistory_args(); + } + + public AsyncMethodCallback<TopologyHistoryInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<TopologyHistoryInfo>() { + public void onComplete(TopologyHistoryInfo o) { + getTopologyHistory_result result = new getTopologyHistory_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; + getTopologyHistory_result result = new getTopologyHistory_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, getTopologyHistory_args args, org.apache.thrift.async.AsyncMethodCallback<TopologyHistoryInfo> resultHandler) throws TException { + iface.getTopologyHistory(args.user,resultHandler); + } + } + } public static class submitTopology_args implements org.apache.thrift.TBase<submitTopology_args, submitTopology_args._Fields>, java.io.Serializable, Cloneable, Comparable<submitTopology_args> { @@ -15466,14 +15611,14 @@ public class Nimbus { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list666 = iprot.readListBegin(); - struct.success = new ArrayList<ProfileRequest>(_list666.size); - ProfileRequest _elem667; - for (int _i668 = 0; _i668 < _list666.size; ++_i668) + org.apache.thrift.protocol.TList _list698 = iprot.readListBegin(); + struct.success = new ArrayList<ProfileRequest>(_list698.size); + ProfileRequest _elem699; + for (int _i700 = 0; _i700 < _list698.size; ++_i700) { - _elem667 = new ProfileRequest(); - _elem667.read(iprot); - struct.success.add(_elem667); + _elem699 = new ProfileRequest(); + _elem699.read(iprot); + struct.success.add(_elem699); } iprot.readListEnd(); } @@ -15499,9 +15644,9 @@ public class Nimbus { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (ProfileRequest _iter669 : struct.success) + for (ProfileRequest _iter701 : struct.success) { - _iter669.write(oprot); + _iter701.write(oprot); } oprot.writeListEnd(); } @@ -15532,9 +15677,9 @@ public class Nimbus { if (struct.is_set_success()) { { oprot.writeI32(struct.success.size()); - for (ProfileRequest _iter670 : struct.success) + for (ProfileRequest _iter702 : struct.success) { - _iter670.write(oprot); + _iter702.write(oprot); } } } @@ -15546,14 +15691,14 @@ public class Nimbus { BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list671 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<ProfileRequest>(_list671.size); - ProfileRequest _elem672; - for (int _i673 = 0; _i673 < _list671.size; ++_i673) + org.apache.thrift.protocol.TList _list703 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<ProfileRequest>(_list703.size); + ProfileRequest _elem704; + for (int _i705 = 0; _i705 < _list703.size; ++_i705) { - _elem672 = new ProfileRequest(); - _elem672.read(iprot); - struct.success.add(_elem672); + _elem704 = new ProfileRequest(); + _elem704.read(iprot); + struct.success.add(_elem704); } } struct.set_success_isSet(true); @@ -29090,4 +29235,831 @@ public class Nimbus { } + public static class getTopologyHistory_args implements org.apache.thrift.TBase<getTopologyHistory_args, getTopologyHistory_args._Fields>, java.io.Serializable, Cloneable, Comparable<getTopologyHistory_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopologyHistory_args"); + + private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", 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 getTopologyHistory_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getTopologyHistory_argsTupleSchemeFactory()); + } + + private String user; // 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 { + USER((short)1, "user"); + + 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: // USER + return USER; + 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.USER, new org.apache.thrift.meta_data.FieldMetaData("user", 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(getTopologyHistory_args.class, metaDataMap); + } + + public getTopologyHistory_args() { + } + + public getTopologyHistory_args( + String user) + { + this(); + this.user = user; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getTopologyHistory_args(getTopologyHistory_args other) { + if (other.is_set_user()) { + this.user = other.user; + } + } + + public getTopologyHistory_args deepCopy() { + return new getTopologyHistory_args(this); + } + + @Override + public void clear() { + this.user = null; + } + + public String get_user() { + return this.user; + } + + public void set_user(String user) { + this.user = user; + } + + public void unset_user() { + this.user = null; + } + + /** Returns true if field user is set (has been assigned a value) and false otherwise */ + public boolean is_set_user() { + return this.user != null; + } + + public void set_user_isSet(boolean value) { + if (!value) { + this.user = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case USER: + if (value == null) { + unset_user(); + } else { + set_user((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case USER: + return get_user(); + + } + 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 USER: + return is_set_user(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getTopologyHistory_args) + return this.equals((getTopologyHistory_args)that); + return false; + } + + public boolean equals(getTopologyHistory_args that) { + if (that == null) + return false; + + boolean this_present_user = true && this.is_set_user(); + boolean that_present_user = true && that.is_set_user(); + if (this_present_user || that_present_user) { + if (!(this_present_user && that_present_user)) + return false; + if (!this.user.equals(that.user)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List<Object> list = new ArrayList<Object>(); + + boolean present_user = true && (is_set_user()); + list.add(present_user); + if (present_user) + list.add(user); + + return list.hashCode(); + } + + @Override + public int compareTo(getTopologyHistory_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(is_set_user()).compareTo(other.is_set_user()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_user()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user); + 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("getTopologyHistory_args("); + boolean first = true; + + sb.append("user:"); + if (this.user == null) { + sb.append("null"); + } else { + sb.append(this.user); + } + 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 getTopologyHistory_argsStandardSchemeFactory implements SchemeFactory { + public getTopologyHistory_argsStandardScheme getScheme() { + return new getTopologyHistory_argsStandardScheme(); + } + } + + private static class getTopologyHistory_argsStandardScheme extends StandardScheme<getTopologyHistory_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getTopologyHistory_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: // USER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.user = iprot.readString(); + struct.set_user_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, getTopologyHistory_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.user != null) { + oprot.writeFieldBegin(USER_FIELD_DESC); + oprot.writeString(struct.user); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getTopologyHistory_argsTupleSchemeFactory implements SchemeFactory { + public getTopologyHistory_argsTupleScheme getScheme() { + return new getTopologyHistory_argsTupleScheme(); + } + } + + private static class getTopologyHistory_argsTupleScheme extends TupleScheme<getTopologyHistory_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getTopologyHistory_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_user()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_user()) { + oprot.writeString(struct.user); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getTopologyHistory_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.user = iprot.readString(); + struct.set_user_isSet(true); + } + } + } + + } + + public static class getTopologyHistory_result implements org.apache.thrift.TBase<getTopologyHistory_result, getTopologyHistory_result._Fields>, java.io.Serializable, Cloneable, Comparable<getTopologyHistory_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopologyHistory_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 getTopologyHistory_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getTopologyHistory_resultTupleSchemeFactory()); + } + + private TopologyHistoryInfo 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, TopologyHistoryInfo.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(getTopologyHistory_result.class, metaDataMap); + } + + public getTopologyHistory_result() { + } + + public getTopologyHistory_result( + TopologyHistoryInfo success, + AuthorizationException aze) + { + this(); + this.success = success; + this.aze = aze; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getTopologyHistory_result(getTopologyHistory_result other) { + if (other.is_set_success()) { + this.success = new TopologyHistoryInfo(other.success); + } + if (other.is_set_aze()) { + this.aze = new AuthorizationException(other.aze); + } + } + + public getTopologyHistory_result deepCopy() { + return new getTopologyHistory_result(this); + } + + @Override + public void clear() { + this.success = null; + this.aze = null; + } + + public TopologyHistoryInfo get_success() { + return this.success; + } + + public void set_success(TopologyHistoryInfo 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((TopologyHistoryInfo)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 getTopologyHistory_result) + return this.equals((getTopologyHistory_result)that); + return false; + } + + public boolean equals(getTopologyHistory_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(getTopologyHistory_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("getTopologyHistory_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 getTopologyHistory_resultStandardSchemeFactory implements SchemeFactory { + public getTopologyHistory_resultStandardScheme getScheme() { + return new getTopologyHistory_resultStandardScheme(); + } + } + + private static class getTopologyHistory_resultStandardScheme extends StandardScheme<getTopologyHistory_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getTopologyHistory_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 TopologyHistoryInfo(); + 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, getTopologyHistory_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 getTopologyHistory_resultTupleSchemeFactory implements SchemeFactory { + public getTopologyHistory_resultTupleScheme getScheme() { + return new getTopologyHistory_resultTupleScheme(); + } + } + + private static class getTopologyHistory_resultTupleScheme extends TupleScheme<getTopologyHistory_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getTopologyHistory_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, getTopologyHistory_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new TopologyHistoryInfo(); + 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); + } + } + } + + } + } http://git-wip-us.apache.org/repos/asf/storm/blob/22cf0acb/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 new file mode 100644 index 0000000..8afaca3 --- /dev/null +++ b/storm-core/src/jvm/backtype/storm/generated/TopologyHistoryInfo.java @@ -0,0 +1,461 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Autogenerated by Thrift Compiler (0.9.2) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package backtype.storm.generated; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-11-4") +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 _list690 = iprot.readListBegin(); + struct.topo_ids = new ArrayList<String>(_list690.size); + String _elem691; + for (int _i692 = 0; _i692 < _list690.size; ++_i692) + { + _elem691 = iprot.readString(); + struct.topo_ids.add(_elem691); + } + 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 _iter693 : struct.topo_ids) + { + oprot.writeString(_iter693); + } + 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 _iter694 : struct.topo_ids) + { + oprot.writeString(_iter694); + } + } + } + } + + @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 _list695 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.topo_ids = new ArrayList<String>(_list695.size); + String _elem696; + for (int _i697 = 0; _i697 < _list695.size; ++_i697) + { + _elem696 = iprot.readString(); + struct.topo_ids.add(_elem696); + } + } + struct.set_topo_ids_isSet(true); + } + } + } + +} + http://git-wip-us.apache.org/repos/asf/storm/blob/22cf0acb/storm-core/src/py/storm/Nimbus-remote ---------------------------------------------------------------------- diff --git a/storm-core/src/py/storm/Nimbus-remote b/storm-core/src/py/storm/Nimbus-remote index 14acdc9..8f0dbc9 100644 --- a/storm-core/src/py/storm/Nimbus-remote +++ b/storm-core/src/py/storm/Nimbus-remote @@ -69,6 +69,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print(' string getTopologyConf(string id)') print(' StormTopology getTopology(string id)') print(' StormTopology getUserTopology(string id)') + print(' TopologyHistoryInfo getTopologyHistory(string user)') print('') sys.exit(0) @@ -287,6 +288,12 @@ elif cmd == 'getUserTopology': sys.exit(1) pp.pprint(client.getUserTopology(args[0],)) +elif cmd == 'getTopologyHistory': + if len(args) != 1: + print('getTopologyHistory requires 1 args') + sys.exit(1) + pp.pprint(client.getTopologyHistory(args[0],)) + else: print('Unrecognized method %s' % cmd) sys.exit(1) http://git-wip-us.apache.org/repos/asf/storm/blob/22cf0acb/storm-core/src/py/storm/Nimbus.py ---------------------------------------------------------------------- diff --git a/storm-core/src/py/storm/Nimbus.py b/storm-core/src/py/storm/Nimbus.py index a446654..a2d4c0b 100644 --- a/storm-core/src/py/storm/Nimbus.py +++ b/storm-core/src/py/storm/Nimbus.py @@ -247,6 +247,13 @@ class Iface: """ pass + def getTopologyHistory(self, user): + """ + Parameters: + - user + """ + pass + class Client(Iface): def __init__(self, iprot, oprot=None): @@ -1195,6 +1202,39 @@ class Client(Iface): raise result.aze raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserTopology failed: unknown result"); + def getTopologyHistory(self, user): + """ + Parameters: + - user + """ + self.send_getTopologyHistory(user) + return self.recv_getTopologyHistory() + + def send_getTopologyHistory(self, user): + self._oprot.writeMessageBegin('getTopologyHistory', TMessageType.CALL, self._seqid) + args = getTopologyHistory_args() + args.user = user + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getTopologyHistory(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getTopologyHistory_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.aze is not None: + raise result.aze + raise TApplicationException(TApplicationException.MISSING_RESULT, "getTopologyHistory failed: unknown result"); + class Processor(Iface, TProcessor): def __init__(self, handler): @@ -1227,6 +1267,7 @@ class Processor(Iface, TProcessor): self._processMap["getTopologyConf"] = Processor.process_getTopologyConf self._processMap["getTopology"] = Processor.process_getTopology self._processMap["getUserTopology"] = Processor.process_getUserTopology + self._processMap["getTopologyHistory"] = Processor.process_getTopologyHistory def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() @@ -1649,6 +1690,20 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_getTopologyHistory(self, seqid, iprot, oprot): + args = getTopologyHistory_args() + args.read(iprot) + iprot.readMessageEnd() + result = getTopologyHistory_result() + try: + result.success = self._handler.getTopologyHistory(args.user) + except AuthorizationException, aze: + result.aze = aze + oprot.writeMessageBegin("getTopologyHistory", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + # HELPER FUNCTIONS AND STRUCTURES @@ -3511,11 +3566,11 @@ class getComponentPendingProfileActions_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype599, _size596) = iprot.readListBegin() - for _i600 in xrange(_size596): - _elem601 = ProfileRequest() - _elem601.read(iprot) - self.success.append(_elem601) + (_etype627, _size624) = iprot.readListBegin() + for _i628 in xrange(_size624): + _elem629 = ProfileRequest() + _elem629.read(iprot) + self.success.append(_elem629) iprot.readListEnd() else: iprot.skip(ftype) @@ -3532,8 +3587,8 @@ class getComponentPendingProfileActions_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter602 in self.success: - iter602.write(oprot) + for iter630 in self.success: + iter630.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -5849,3 +5904,147 @@ class getUserTopology_result: def __ne__(self, other): return not (self == other) + +class getTopologyHistory_args: + """ + Attributes: + - user + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'user', None, None, ), # 1 + ) + + def __init__(self, user=None,): + self.user = user + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.user = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getTopologyHistory_args') + if self.user is not None: + oprot.writeFieldBegin('user', TType.STRING, 1) + oprot.writeString(self.user.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.user) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getTopologyHistory_result: + """ + Attributes: + - success + - aze + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (TopologyHistoryInfo, TopologyHistoryInfo.thrift_spec), None, ), # 0 + (1, TType.STRUCT, 'aze', (AuthorizationException, AuthorizationException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, aze=None,): + self.success = success + self.aze = aze + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = TopologyHistoryInfo() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.aze = AuthorizationException() + self.aze.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getTopologyHistory_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.aze is not None: + oprot.writeFieldBegin('aze', TType.STRUCT, 1) + self.aze.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.aze) + return value + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other)
