| /** |
| * 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 TopologyStats implements org.apache.thrift.TBase<TopologyStats, TopologyStats._Fields>, java.io.Serializable, Cloneable, Comparable<TopologyStats> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyStats"); |
| |
| private static final org.apache.thrift.protocol.TField WINDOW_TO_EMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_emitted", org.apache.thrift.protocol.TType.MAP, (short)1); |
| private static final org.apache.thrift.protocol.TField WINDOW_TO_TRANSFERRED_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_transferred", org.apache.thrift.protocol.TType.MAP, (short)2); |
| private static final org.apache.thrift.protocol.TField WINDOW_TO_COMPLETE_LATENCIES_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_complete_latencies_ms", org.apache.thrift.protocol.TType.MAP, (short)3); |
| private static final org.apache.thrift.protocol.TField WINDOW_TO_ACKED_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_acked", org.apache.thrift.protocol.TType.MAP, (short)4); |
| private static final org.apache.thrift.protocol.TField WINDOW_TO_FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("window_to_failed", org.apache.thrift.protocol.TType.MAP, (short)5); |
| |
| private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); |
| static { |
| schemes.put(StandardScheme.class, new TopologyStatsStandardSchemeFactory()); |
| schemes.put(TupleScheme.class, new TopologyStatsTupleSchemeFactory()); |
| } |
| |
| private Map<String,Long> window_to_emitted; // optional |
| private Map<String,Long> window_to_transferred; // optional |
| private Map<String,Double> window_to_complete_latencies_ms; // optional |
| private Map<String,Long> window_to_acked; // optional |
| private Map<String,Long> window_to_failed; // optional |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| WINDOW_TO_EMITTED((short)1, "window_to_emitted"), |
| WINDOW_TO_TRANSFERRED((short)2, "window_to_transferred"), |
| WINDOW_TO_COMPLETE_LATENCIES_MS((short)3, "window_to_complete_latencies_ms"), |
| WINDOW_TO_ACKED((short)4, "window_to_acked"), |
| WINDOW_TO_FAILED((short)5, "window_to_failed"); |
| |
| private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : EnumSet.allOf(_Fields.class)) { |
| byName.put(field.getFieldName(), field); |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, or null if its not found. |
| */ |
| public static _Fields findByThriftId(int fieldId) { |
| switch(fieldId) { |
| case 1: // WINDOW_TO_EMITTED |
| return WINDOW_TO_EMITTED; |
| case 2: // WINDOW_TO_TRANSFERRED |
| return WINDOW_TO_TRANSFERRED; |
| case 3: // WINDOW_TO_COMPLETE_LATENCIES_MS |
| return WINDOW_TO_COMPLETE_LATENCIES_MS; |
| case 4: // WINDOW_TO_ACKED |
| return WINDOW_TO_ACKED; |
| case 5: // WINDOW_TO_FAILED |
| return WINDOW_TO_FAILED; |
| default: |
| return null; |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, throwing an exception |
| * if it is not found. |
| */ |
| public static _Fields findByThriftIdOrThrow(int fieldId) { |
| _Fields fields = findByThriftId(fieldId); |
| if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); |
| return fields; |
| } |
| |
| /** |
| * Find the _Fields constant that matches name, or null if its not found. |
| */ |
| public static _Fields findByName(String name) { |
| return byName.get(name); |
| } |
| |
| private final short _thriftId; |
| private final String _fieldName; |
| |
| _Fields(short thriftId, String fieldName) { |
| _thriftId = thriftId; |
| _fieldName = fieldName; |
| } |
| |
| public short getThriftFieldId() { |
| return _thriftId; |
| } |
| |
| public String getFieldName() { |
| return _fieldName; |
| } |
| } |
| |
| // isset id assignments |
| private static final _Fields optionals[] = {_Fields.WINDOW_TO_EMITTED,_Fields.WINDOW_TO_TRANSFERRED,_Fields.WINDOW_TO_COMPLETE_LATENCIES_MS,_Fields.WINDOW_TO_ACKED,_Fields.WINDOW_TO_FAILED}; |
| public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.WINDOW_TO_EMITTED, new org.apache.thrift.meta_data.FieldMetaData("window_to_emitted", org.apache.thrift.TFieldRequirementType.OPTIONAL, |
| new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); |
| tmpMap.put(_Fields.WINDOW_TO_TRANSFERRED, new org.apache.thrift.meta_data.FieldMetaData("window_to_transferred", org.apache.thrift.TFieldRequirementType.OPTIONAL, |
| new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); |
| tmpMap.put(_Fields.WINDOW_TO_COMPLETE_LATENCIES_MS, new org.apache.thrift.meta_data.FieldMetaData("window_to_complete_latencies_ms", org.apache.thrift.TFieldRequirementType.OPTIONAL, |
| new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))); |
| tmpMap.put(_Fields.WINDOW_TO_ACKED, new org.apache.thrift.meta_data.FieldMetaData("window_to_acked", org.apache.thrift.TFieldRequirementType.OPTIONAL, |
| new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); |
| tmpMap.put(_Fields.WINDOW_TO_FAILED, new org.apache.thrift.meta_data.FieldMetaData("window_to_failed", org.apache.thrift.TFieldRequirementType.OPTIONAL, |
| new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); |
| metaDataMap = Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologyStats.class, metaDataMap); |
| } |
| |
| public TopologyStats() { |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public TopologyStats(TopologyStats other) { |
| if (other.is_set_window_to_emitted()) { |
| Map<String,Long> __this__window_to_emitted = new HashMap<String,Long>(other.window_to_emitted); |
| this.window_to_emitted = __this__window_to_emitted; |
| } |
| if (other.is_set_window_to_transferred()) { |
| Map<String,Long> __this__window_to_transferred = new HashMap<String,Long>(other.window_to_transferred); |
| this.window_to_transferred = __this__window_to_transferred; |
| } |
| if (other.is_set_window_to_complete_latencies_ms()) { |
| Map<String,Double> __this__window_to_complete_latencies_ms = new HashMap<String,Double>(other.window_to_complete_latencies_ms); |
| this.window_to_complete_latencies_ms = __this__window_to_complete_latencies_ms; |
| } |
| if (other.is_set_window_to_acked()) { |
| Map<String,Long> __this__window_to_acked = new HashMap<String,Long>(other.window_to_acked); |
| this.window_to_acked = __this__window_to_acked; |
| } |
| if (other.is_set_window_to_failed()) { |
| Map<String,Long> __this__window_to_failed = new HashMap<String,Long>(other.window_to_failed); |
| this.window_to_failed = __this__window_to_failed; |
| } |
| } |
| |
| public TopologyStats deepCopy() { |
| return new TopologyStats(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.window_to_emitted = null; |
| this.window_to_transferred = null; |
| this.window_to_complete_latencies_ms = null; |
| this.window_to_acked = null; |
| this.window_to_failed = null; |
| } |
| |
| public int get_window_to_emitted_size() { |
| return (this.window_to_emitted == null) ? 0 : this.window_to_emitted.size(); |
| } |
| |
| public void put_to_window_to_emitted(String key, long val) { |
| if (this.window_to_emitted == null) { |
| this.window_to_emitted = new HashMap<String,Long>(); |
| } |
| this.window_to_emitted.put(key, val); |
| } |
| |
| public Map<String,Long> get_window_to_emitted() { |
| return this.window_to_emitted; |
| } |
| |
| public void set_window_to_emitted(Map<String,Long> window_to_emitted) { |
| this.window_to_emitted = window_to_emitted; |
| } |
| |
| public void unset_window_to_emitted() { |
| this.window_to_emitted = null; |
| } |
| |
| /** Returns true if field window_to_emitted is set (has been assigned a value) and false otherwise */ |
| public boolean is_set_window_to_emitted() { |
| return this.window_to_emitted != null; |
| } |
| |
| public void set_window_to_emitted_isSet(boolean value) { |
| if (!value) { |
| this.window_to_emitted = null; |
| } |
| } |
| |
| public int get_window_to_transferred_size() { |
| return (this.window_to_transferred == null) ? 0 : this.window_to_transferred.size(); |
| } |
| |
| public void put_to_window_to_transferred(String key, long val) { |
| if (this.window_to_transferred == null) { |
| this.window_to_transferred = new HashMap<String,Long>(); |
| } |
| this.window_to_transferred.put(key, val); |
| } |
| |
| public Map<String,Long> get_window_to_transferred() { |
| return this.window_to_transferred; |
| } |
| |
| public void set_window_to_transferred(Map<String,Long> window_to_transferred) { |
| this.window_to_transferred = window_to_transferred; |
| } |
| |
| public void unset_window_to_transferred() { |
| this.window_to_transferred = null; |
| } |
| |
| /** Returns true if field window_to_transferred is set (has been assigned a value) and false otherwise */ |
| public boolean is_set_window_to_transferred() { |
| return this.window_to_transferred != null; |
| } |
| |
| public void set_window_to_transferred_isSet(boolean value) { |
| if (!value) { |
| this.window_to_transferred = null; |
| } |
| } |
| |
| public int get_window_to_complete_latencies_ms_size() { |
| return (this.window_to_complete_latencies_ms == null) ? 0 : this.window_to_complete_latencies_ms.size(); |
| } |
| |
| public void put_to_window_to_complete_latencies_ms(String key, double val) { |
| if (this.window_to_complete_latencies_ms == null) { |
| this.window_to_complete_latencies_ms = new HashMap<String,Double>(); |
| } |
| this.window_to_complete_latencies_ms.put(key, val); |
| } |
| |
| public Map<String,Double> get_window_to_complete_latencies_ms() { |
| return this.window_to_complete_latencies_ms; |
| } |
| |
| public void set_window_to_complete_latencies_ms(Map<String,Double> window_to_complete_latencies_ms) { |
| this.window_to_complete_latencies_ms = window_to_complete_latencies_ms; |
| } |
| |
| public void unset_window_to_complete_latencies_ms() { |
| this.window_to_complete_latencies_ms = null; |
| } |
| |
| /** Returns true if field window_to_complete_latencies_ms is set (has been assigned a value) and false otherwise */ |
| public boolean is_set_window_to_complete_latencies_ms() { |
| return this.window_to_complete_latencies_ms != null; |
| } |
| |
| public void set_window_to_complete_latencies_ms_isSet(boolean value) { |
| if (!value) { |
| this.window_to_complete_latencies_ms = null; |
| } |
| } |
| |
| public int get_window_to_acked_size() { |
| return (this.window_to_acked == null) ? 0 : this.window_to_acked.size(); |
| } |
| |
| public void put_to_window_to_acked(String key, long val) { |
| if (this.window_to_acked == null) { |
| this.window_to_acked = new HashMap<String,Long>(); |
| } |
| this.window_to_acked.put(key, val); |
| } |
| |
| public Map<String,Long> get_window_to_acked() { |
| return this.window_to_acked; |
| } |
| |
| public void set_window_to_acked(Map<String,Long> window_to_acked) { |
| this.window_to_acked = window_to_acked; |
| } |
| |
| public void unset_window_to_acked() { |
| this.window_to_acked = null; |
| } |
| |
| /** Returns true if field window_to_acked is set (has been assigned a value) and false otherwise */ |
| public boolean is_set_window_to_acked() { |
| return this.window_to_acked != null; |
| } |
| |
| public void set_window_to_acked_isSet(boolean value) { |
| if (!value) { |
| this.window_to_acked = null; |
| } |
| } |
| |
| public int get_window_to_failed_size() { |
| return (this.window_to_failed == null) ? 0 : this.window_to_failed.size(); |
| } |
| |
| public void put_to_window_to_failed(String key, long val) { |
| if (this.window_to_failed == null) { |
| this.window_to_failed = new HashMap<String,Long>(); |
| } |
| this.window_to_failed.put(key, val); |
| } |
| |
| public Map<String,Long> get_window_to_failed() { |
| return this.window_to_failed; |
| } |
| |
| public void set_window_to_failed(Map<String,Long> window_to_failed) { |
| this.window_to_failed = window_to_failed; |
| } |
| |
| public void unset_window_to_failed() { |
| this.window_to_failed = null; |
| } |
| |
| /** Returns true if field window_to_failed is set (has been assigned a value) and false otherwise */ |
| public boolean is_set_window_to_failed() { |
| return this.window_to_failed != null; |
| } |
| |
| public void set_window_to_failed_isSet(boolean value) { |
| if (!value) { |
| this.window_to_failed = null; |
| } |
| } |
| |
| public void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case WINDOW_TO_EMITTED: |
| if (value == null) { |
| unset_window_to_emitted(); |
| } else { |
| set_window_to_emitted((Map<String,Long>)value); |
| } |
| break; |
| |
| case WINDOW_TO_TRANSFERRED: |
| if (value == null) { |
| unset_window_to_transferred(); |
| } else { |
| set_window_to_transferred((Map<String,Long>)value); |
| } |
| break; |
| |
| case WINDOW_TO_COMPLETE_LATENCIES_MS: |
| if (value == null) { |
| unset_window_to_complete_latencies_ms(); |
| } else { |
| set_window_to_complete_latencies_ms((Map<String,Double>)value); |
| } |
| break; |
| |
| case WINDOW_TO_ACKED: |
| if (value == null) { |
| unset_window_to_acked(); |
| } else { |
| set_window_to_acked((Map<String,Long>)value); |
| } |
| break; |
| |
| case WINDOW_TO_FAILED: |
| if (value == null) { |
| unset_window_to_failed(); |
| } else { |
| set_window_to_failed((Map<String,Long>)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case WINDOW_TO_EMITTED: |
| return get_window_to_emitted(); |
| |
| case WINDOW_TO_TRANSFERRED: |
| return get_window_to_transferred(); |
| |
| case WINDOW_TO_COMPLETE_LATENCIES_MS: |
| return get_window_to_complete_latencies_ms(); |
| |
| case WINDOW_TO_ACKED: |
| return get_window_to_acked(); |
| |
| case WINDOW_TO_FAILED: |
| return get_window_to_failed(); |
| |
| } |
| throw new IllegalStateException(); |
| } |
| |
| /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ |
| public boolean isSet(_Fields field) { |
| if (field == null) { |
| throw new IllegalArgumentException(); |
| } |
| |
| switch (field) { |
| case WINDOW_TO_EMITTED: |
| return is_set_window_to_emitted(); |
| case WINDOW_TO_TRANSFERRED: |
| return is_set_window_to_transferred(); |
| case WINDOW_TO_COMPLETE_LATENCIES_MS: |
| return is_set_window_to_complete_latencies_ms(); |
| case WINDOW_TO_ACKED: |
| return is_set_window_to_acked(); |
| case WINDOW_TO_FAILED: |
| return is_set_window_to_failed(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof TopologyStats) |
| return this.equals((TopologyStats)that); |
| return false; |
| } |
| |
| public boolean equals(TopologyStats that) { |
| if (that == null) |
| return false; |
| |
| boolean this_present_window_to_emitted = true && this.is_set_window_to_emitted(); |
| boolean that_present_window_to_emitted = true && that.is_set_window_to_emitted(); |
| if (this_present_window_to_emitted || that_present_window_to_emitted) { |
| if (!(this_present_window_to_emitted && that_present_window_to_emitted)) |
| return false; |
| if (!this.window_to_emitted.equals(that.window_to_emitted)) |
| return false; |
| } |
| |
| boolean this_present_window_to_transferred = true && this.is_set_window_to_transferred(); |
| boolean that_present_window_to_transferred = true && that.is_set_window_to_transferred(); |
| if (this_present_window_to_transferred || that_present_window_to_transferred) { |
| if (!(this_present_window_to_transferred && that_present_window_to_transferred)) |
| return false; |
| if (!this.window_to_transferred.equals(that.window_to_transferred)) |
| return false; |
| } |
| |
| boolean this_present_window_to_complete_latencies_ms = true && this.is_set_window_to_complete_latencies_ms(); |
| boolean that_present_window_to_complete_latencies_ms = true && that.is_set_window_to_complete_latencies_ms(); |
| if (this_present_window_to_complete_latencies_ms || that_present_window_to_complete_latencies_ms) { |
| if (!(this_present_window_to_complete_latencies_ms && that_present_window_to_complete_latencies_ms)) |
| return false; |
| if (!this.window_to_complete_latencies_ms.equals(that.window_to_complete_latencies_ms)) |
| return false; |
| } |
| |
| boolean this_present_window_to_acked = true && this.is_set_window_to_acked(); |
| boolean that_present_window_to_acked = true && that.is_set_window_to_acked(); |
| if (this_present_window_to_acked || that_present_window_to_acked) { |
| if (!(this_present_window_to_acked && that_present_window_to_acked)) |
| return false; |
| if (!this.window_to_acked.equals(that.window_to_acked)) |
| return false; |
| } |
| |
| boolean this_present_window_to_failed = true && this.is_set_window_to_failed(); |
| boolean that_present_window_to_failed = true && that.is_set_window_to_failed(); |
| if (this_present_window_to_failed || that_present_window_to_failed) { |
| if (!(this_present_window_to_failed && that_present_window_to_failed)) |
| return false; |
| if (!this.window_to_failed.equals(that.window_to_failed)) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| List<Object> list = new ArrayList<Object>(); |
| |
| boolean present_window_to_emitted = true && (is_set_window_to_emitted()); |
| list.add(present_window_to_emitted); |
| if (present_window_to_emitted) |
| list.add(window_to_emitted); |
| |
| boolean present_window_to_transferred = true && (is_set_window_to_transferred()); |
| list.add(present_window_to_transferred); |
| if (present_window_to_transferred) |
| list.add(window_to_transferred); |
| |
| boolean present_window_to_complete_latencies_ms = true && (is_set_window_to_complete_latencies_ms()); |
| list.add(present_window_to_complete_latencies_ms); |
| if (present_window_to_complete_latencies_ms) |
| list.add(window_to_complete_latencies_ms); |
| |
| boolean present_window_to_acked = true && (is_set_window_to_acked()); |
| list.add(present_window_to_acked); |
| if (present_window_to_acked) |
| list.add(window_to_acked); |
| |
| boolean present_window_to_failed = true && (is_set_window_to_failed()); |
| list.add(present_window_to_failed); |
| if (present_window_to_failed) |
| list.add(window_to_failed); |
| |
| return list.hashCode(); |
| } |
| |
| @Override |
| public int compareTo(TopologyStats other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = Boolean.valueOf(is_set_window_to_emitted()).compareTo(other.is_set_window_to_emitted()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (is_set_window_to_emitted()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.window_to_emitted, other.window_to_emitted); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = Boolean.valueOf(is_set_window_to_transferred()).compareTo(other.is_set_window_to_transferred()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (is_set_window_to_transferred()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.window_to_transferred, other.window_to_transferred); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = Boolean.valueOf(is_set_window_to_complete_latencies_ms()).compareTo(other.is_set_window_to_complete_latencies_ms()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (is_set_window_to_complete_latencies_ms()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.window_to_complete_latencies_ms, other.window_to_complete_latencies_ms); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = Boolean.valueOf(is_set_window_to_acked()).compareTo(other.is_set_window_to_acked()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (is_set_window_to_acked()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.window_to_acked, other.window_to_acked); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = Boolean.valueOf(is_set_window_to_failed()).compareTo(other.is_set_window_to_failed()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (is_set_window_to_failed()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.window_to_failed, other.window_to_failed); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| schemes.get(iprot.getScheme()).getScheme().read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| schemes.get(oprot.getScheme()).getScheme().write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("TopologyStats("); |
| boolean first = true; |
| |
| if (is_set_window_to_emitted()) { |
| sb.append("window_to_emitted:"); |
| if (this.window_to_emitted == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.window_to_emitted); |
| } |
| first = false; |
| } |
| if (is_set_window_to_transferred()) { |
| if (!first) sb.append(", "); |
| sb.append("window_to_transferred:"); |
| if (this.window_to_transferred == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.window_to_transferred); |
| } |
| first = false; |
| } |
| if (is_set_window_to_complete_latencies_ms()) { |
| if (!first) sb.append(", "); |
| sb.append("window_to_complete_latencies_ms:"); |
| if (this.window_to_complete_latencies_ms == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.window_to_complete_latencies_ms); |
| } |
| first = false; |
| } |
| if (is_set_window_to_acked()) { |
| if (!first) sb.append(", "); |
| sb.append("window_to_acked:"); |
| if (this.window_to_acked == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.window_to_acked); |
| } |
| first = false; |
| } |
| if (is_set_window_to_failed()) { |
| if (!first) sb.append(", "); |
| sb.append("window_to_failed:"); |
| if (this.window_to_failed == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.window_to_failed); |
| } |
| first = false; |
| } |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class TopologyStatsStandardSchemeFactory implements SchemeFactory { |
| public TopologyStatsStandardScheme getScheme() { |
| return new TopologyStatsStandardScheme(); |
| } |
| } |
| |
| private static class TopologyStatsStandardScheme extends StandardScheme<TopologyStats> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, TopologyStats struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 1: // WINDOW_TO_EMITTED |
| if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { |
| { |
| org.apache.thrift.protocol.TMap _map352 = iprot.readMapBegin(); |
| struct.window_to_emitted = new HashMap<String,Long>(2*_map352.size); |
| String _key353; |
| long _val354; |
| for (int _i355 = 0; _i355 < _map352.size; ++_i355) |
| { |
| _key353 = iprot.readString(); |
| _val354 = iprot.readI64(); |
| struct.window_to_emitted.put(_key353, _val354); |
| } |
| iprot.readMapEnd(); |
| } |
| struct.set_window_to_emitted_isSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 2: // WINDOW_TO_TRANSFERRED |
| if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { |
| { |
| org.apache.thrift.protocol.TMap _map356 = iprot.readMapBegin(); |
| struct.window_to_transferred = new HashMap<String,Long>(2*_map356.size); |
| String _key357; |
| long _val358; |
| for (int _i359 = 0; _i359 < _map356.size; ++_i359) |
| { |
| _key357 = iprot.readString(); |
| _val358 = iprot.readI64(); |
| struct.window_to_transferred.put(_key357, _val358); |
| } |
| iprot.readMapEnd(); |
| } |
| struct.set_window_to_transferred_isSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 3: // WINDOW_TO_COMPLETE_LATENCIES_MS |
| if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { |
| { |
| org.apache.thrift.protocol.TMap _map360 = iprot.readMapBegin(); |
| struct.window_to_complete_latencies_ms = new HashMap<String,Double>(2*_map360.size); |
| String _key361; |
| double _val362; |
| for (int _i363 = 0; _i363 < _map360.size; ++_i363) |
| { |
| _key361 = iprot.readString(); |
| _val362 = iprot.readDouble(); |
| struct.window_to_complete_latencies_ms.put(_key361, _val362); |
| } |
| iprot.readMapEnd(); |
| } |
| struct.set_window_to_complete_latencies_ms_isSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 4: // WINDOW_TO_ACKED |
| if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { |
| { |
| org.apache.thrift.protocol.TMap _map364 = iprot.readMapBegin(); |
| struct.window_to_acked = new HashMap<String,Long>(2*_map364.size); |
| String _key365; |
| long _val366; |
| for (int _i367 = 0; _i367 < _map364.size; ++_i367) |
| { |
| _key365 = iprot.readString(); |
| _val366 = iprot.readI64(); |
| struct.window_to_acked.put(_key365, _val366); |
| } |
| iprot.readMapEnd(); |
| } |
| struct.set_window_to_acked_isSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 5: // WINDOW_TO_FAILED |
| if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { |
| { |
| org.apache.thrift.protocol.TMap _map368 = iprot.readMapBegin(); |
| struct.window_to_failed = new HashMap<String,Long>(2*_map368.size); |
| String _key369; |
| long _val370; |
| for (int _i371 = 0; _i371 < _map368.size; ++_i371) |
| { |
| _key369 = iprot.readString(); |
| _val370 = iprot.readI64(); |
| struct.window_to_failed.put(_key369, _val370); |
| } |
| iprot.readMapEnd(); |
| } |
| struct.set_window_to_failed_isSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, TopologyStats struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.window_to_emitted != null) { |
| if (struct.is_set_window_to_emitted()) { |
| oprot.writeFieldBegin(WINDOW_TO_EMITTED_FIELD_DESC); |
| { |
| oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, struct.window_to_emitted.size())); |
| for (Map.Entry<String, Long> _iter372 : struct.window_to_emitted.entrySet()) |
| { |
| oprot.writeString(_iter372.getKey()); |
| oprot.writeI64(_iter372.getValue()); |
| } |
| oprot.writeMapEnd(); |
| } |
| oprot.writeFieldEnd(); |
| } |
| } |
| if (struct.window_to_transferred != null) { |
| if (struct.is_set_window_to_transferred()) { |
| oprot.writeFieldBegin(WINDOW_TO_TRANSFERRED_FIELD_DESC); |
| { |
| oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, struct.window_to_transferred.size())); |
| for (Map.Entry<String, Long> _iter373 : struct.window_to_transferred.entrySet()) |
| { |
| oprot.writeString(_iter373.getKey()); |
| oprot.writeI64(_iter373.getValue()); |
| } |
| oprot.writeMapEnd(); |
| } |
| oprot.writeFieldEnd(); |
| } |
| } |
| if (struct.window_to_complete_latencies_ms != null) { |
| if (struct.is_set_window_to_complete_latencies_ms()) { |
| oprot.writeFieldBegin(WINDOW_TO_COMPLETE_LATENCIES_MS_FIELD_DESC); |
| { |
| oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, struct.window_to_complete_latencies_ms.size())); |
| for (Map.Entry<String, Double> _iter374 : struct.window_to_complete_latencies_ms.entrySet()) |
| { |
| oprot.writeString(_iter374.getKey()); |
| oprot.writeDouble(_iter374.getValue()); |
| } |
| oprot.writeMapEnd(); |
| } |
| oprot.writeFieldEnd(); |
| } |
| } |
| if (struct.window_to_acked != null) { |
| if (struct.is_set_window_to_acked()) { |
| oprot.writeFieldBegin(WINDOW_TO_ACKED_FIELD_DESC); |
| { |
| oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, struct.window_to_acked.size())); |
| for (Map.Entry<String, Long> _iter375 : struct.window_to_acked.entrySet()) |
| { |
| oprot.writeString(_iter375.getKey()); |
| oprot.writeI64(_iter375.getValue()); |
| } |
| oprot.writeMapEnd(); |
| } |
| oprot.writeFieldEnd(); |
| } |
| } |
| if (struct.window_to_failed != null) { |
| if (struct.is_set_window_to_failed()) { |
| oprot.writeFieldBegin(WINDOW_TO_FAILED_FIELD_DESC); |
| { |
| oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, struct.window_to_failed.size())); |
| for (Map.Entry<String, Long> _iter376 : struct.window_to_failed.entrySet()) |
| { |
| oprot.writeString(_iter376.getKey()); |
| oprot.writeI64(_iter376.getValue()); |
| } |
| oprot.writeMapEnd(); |
| } |
| oprot.writeFieldEnd(); |
| } |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class TopologyStatsTupleSchemeFactory implements SchemeFactory { |
| public TopologyStatsTupleScheme getScheme() { |
| return new TopologyStatsTupleScheme(); |
| } |
| } |
| |
| private static class TopologyStatsTupleScheme extends TupleScheme<TopologyStats> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, TopologyStats struct) throws org.apache.thrift.TException { |
| TTupleProtocol oprot = (TTupleProtocol) prot; |
| BitSet optionals = new BitSet(); |
| if (struct.is_set_window_to_emitted()) { |
| optionals.set(0); |
| } |
| if (struct.is_set_window_to_transferred()) { |
| optionals.set(1); |
| } |
| if (struct.is_set_window_to_complete_latencies_ms()) { |
| optionals.set(2); |
| } |
| if (struct.is_set_window_to_acked()) { |
| optionals.set(3); |
| } |
| if (struct.is_set_window_to_failed()) { |
| optionals.set(4); |
| } |
| oprot.writeBitSet(optionals, 5); |
| if (struct.is_set_window_to_emitted()) { |
| { |
| oprot.writeI32(struct.window_to_emitted.size()); |
| for (Map.Entry<String, Long> _iter377 : struct.window_to_emitted.entrySet()) |
| { |
| oprot.writeString(_iter377.getKey()); |
| oprot.writeI64(_iter377.getValue()); |
| } |
| } |
| } |
| if (struct.is_set_window_to_transferred()) { |
| { |
| oprot.writeI32(struct.window_to_transferred.size()); |
| for (Map.Entry<String, Long> _iter378 : struct.window_to_transferred.entrySet()) |
| { |
| oprot.writeString(_iter378.getKey()); |
| oprot.writeI64(_iter378.getValue()); |
| } |
| } |
| } |
| if (struct.is_set_window_to_complete_latencies_ms()) { |
| { |
| oprot.writeI32(struct.window_to_complete_latencies_ms.size()); |
| for (Map.Entry<String, Double> _iter379 : struct.window_to_complete_latencies_ms.entrySet()) |
| { |
| oprot.writeString(_iter379.getKey()); |
| oprot.writeDouble(_iter379.getValue()); |
| } |
| } |
| } |
| if (struct.is_set_window_to_acked()) { |
| { |
| oprot.writeI32(struct.window_to_acked.size()); |
| for (Map.Entry<String, Long> _iter380 : struct.window_to_acked.entrySet()) |
| { |
| oprot.writeString(_iter380.getKey()); |
| oprot.writeI64(_iter380.getValue()); |
| } |
| } |
| } |
| if (struct.is_set_window_to_failed()) { |
| { |
| oprot.writeI32(struct.window_to_failed.size()); |
| for (Map.Entry<String, Long> _iter381 : struct.window_to_failed.entrySet()) |
| { |
| oprot.writeString(_iter381.getKey()); |
| oprot.writeI64(_iter381.getValue()); |
| } |
| } |
| } |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, TopologyStats struct) throws org.apache.thrift.TException { |
| TTupleProtocol iprot = (TTupleProtocol) prot; |
| BitSet incoming = iprot.readBitSet(5); |
| if (incoming.get(0)) { |
| { |
| org.apache.thrift.protocol.TMap _map382 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32()); |
| struct.window_to_emitted = new HashMap<String,Long>(2*_map382.size); |
| String _key383; |
| long _val384; |
| for (int _i385 = 0; _i385 < _map382.size; ++_i385) |
| { |
| _key383 = iprot.readString(); |
| _val384 = iprot.readI64(); |
| struct.window_to_emitted.put(_key383, _val384); |
| } |
| } |
| struct.set_window_to_emitted_isSet(true); |
| } |
| if (incoming.get(1)) { |
| { |
| org.apache.thrift.protocol.TMap _map386 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32()); |
| struct.window_to_transferred = new HashMap<String,Long>(2*_map386.size); |
| String _key387; |
| long _val388; |
| for (int _i389 = 0; _i389 < _map386.size; ++_i389) |
| { |
| _key387 = iprot.readString(); |
| _val388 = iprot.readI64(); |
| struct.window_to_transferred.put(_key387, _val388); |
| } |
| } |
| struct.set_window_to_transferred_isSet(true); |
| } |
| if (incoming.get(2)) { |
| { |
| org.apache.thrift.protocol.TMap _map390 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); |
| struct.window_to_complete_latencies_ms = new HashMap<String,Double>(2*_map390.size); |
| String _key391; |
| double _val392; |
| for (int _i393 = 0; _i393 < _map390.size; ++_i393) |
| { |
| _key391 = iprot.readString(); |
| _val392 = iprot.readDouble(); |
| struct.window_to_complete_latencies_ms.put(_key391, _val392); |
| } |
| } |
| struct.set_window_to_complete_latencies_ms_isSet(true); |
| } |
| if (incoming.get(3)) { |
| { |
| org.apache.thrift.protocol.TMap _map394 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32()); |
| struct.window_to_acked = new HashMap<String,Long>(2*_map394.size); |
| String _key395; |
| long _val396; |
| for (int _i397 = 0; _i397 < _map394.size; ++_i397) |
| { |
| _key395 = iprot.readString(); |
| _val396 = iprot.readI64(); |
| struct.window_to_acked.put(_key395, _val396); |
| } |
| } |
| struct.set_window_to_acked_isSet(true); |
| } |
| if (incoming.get(4)) { |
| { |
| org.apache.thrift.protocol.TMap _map398 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32()); |
| struct.window_to_failed = new HashMap<String,Long>(2*_map398.size); |
| String _key399; |
| long _val400; |
| for (int _i401 = 0; _i401 < _map398.size; ++_i401) |
| { |
| _key399 = iprot.readString(); |
| _val400 = iprot.readI64(); |
| struct.window_to_failed.put(_key399, _val400); |
| } |
| } |
| struct.set_window_to_failed_isSet(true); |
| } |
| } |
| } |
| |
| } |
| |