public ExecutorInfo deepCopy() { return new ExecutorInfo(this); }
/** * Prettified executor info. * @param e from Nimbus call * @return prettified executor info string */ public static String prettyExecutorInfo(ExecutorInfo e) { return "[" + e.get_task_start() + "-" + e.get_task_end() + "]"; }
static List<ExecutorInfo> mkExecutorInfoList(int... executors) { ArrayList<ExecutorInfo> ret = new ArrayList<>(executors.length); for (int exec : executors) { ExecutorInfo execInfo = new ExecutorInfo(); execInfo.set_task_start(exec); execInfo.set_task_end(exec); ret.add(execInfo); } return ret; }
@Override public void clear() { set_task_start_isSet(false); this.task_start = 0; set_task_end_isSet(false); this.task_end = 0; }
public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case TASK_START: if (value == null) { unset_task_start(); } else { set_task_start((java.lang.Integer)value); } break; case TASK_END: if (value == null) { unset_task_end(); } else { set_task_end((java.lang.Integer)value); } break; } }
@Override public void read(org.apache.storm.thrift.protocol.TProtocol prot, SupervisorWorkerHeartbeat struct) throws org.apache.storm.thrift.TException { org.apache.storm.thrift.protocol.TTupleProtocol iprot = (org.apache.storm.thrift.protocol.TTupleProtocol) prot; struct.storm_id = iprot.readString(); struct.set_storm_id_isSet(true); { org.apache.storm.thrift.protocol.TList _list875 = new org.apache.storm.thrift.protocol.TList(org.apache.storm.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.executors = new java.util.ArrayList<ExecutorInfo>(_list875.size); ExecutorInfo _elem876; for (int _i877 = 0; _i877 < _list875.size; ++_i877) { _elem876 = new ExecutorInfo(); _elem876.read(iprot); struct.executors.add(_elem876); } } struct.set_executors_isSet(true); struct.time_secs = iprot.readI32(); struct.set_time_secs_isSet(true); } }
public void validate() throws org.apache.storm.thrift.TException { // check for required fields if (!is_set_task_start()) { throw new org.apache.storm.thrift.protocol.TProtocolException("Required field 'task_start' is unset! Struct:" + toString()); } if (!is_set_task_end()) { throw new org.apache.storm.thrift.protocol.TProtocolException("Required field 'task_end' is unset! Struct:" + toString()); } // check for sub-struct validity }
if (schemeField.type == org.apache.storm.thrift.protocol.TType.I32) { struct.task_start = iprot.readI32(); struct.set_task_start_isSet(true); } else { org.apache.storm.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.storm.thrift.protocol.TType.I32) { struct.task_end = iprot.readI32(); struct.set_task_end_isSet(true); } else { org.apache.storm.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
/** 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 java.lang.IllegalArgumentException(); } switch (field) { case TASK_START: return is_set_task_start(); case TASK_END: return is_set_task_end(); } throw new java.lang.IllegalStateException(); }
common.taskToComponent.get(execInfo.get_task_start()), nodeToHost.get(ni.get_node()), ni.get_port_iterator().next().intValue(), (Integer) heartbeat.getOrDefault("uptime", 0));
@Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ExecutorInfo) return this.equals((ExecutorInfo)that); return false; }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.storm.thrift.protocol.TCompactProtocol(new org.apache.storm.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.storm.thrift.TException te) { throw new java.io.IOException(te); } }
public void set_task_end(int task_end) { this.task_end = task_end; set_task_end_isSet(true); }
@Override public void read(org.apache.storm.thrift.protocol.TProtocol prot, LSWorkerHeartbeat struct) throws org.apache.storm.thrift.TException { org.apache.storm.thrift.protocol.TTupleProtocol iprot = (org.apache.storm.thrift.protocol.TTupleProtocol) prot; struct.time_secs = iprot.readI32(); struct.set_time_secs_isSet(true); struct.topology_id = iprot.readString(); struct.set_topology_id_isSet(true); { org.apache.storm.thrift.protocol.TList _list825 = new org.apache.storm.thrift.protocol.TList(org.apache.storm.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.executors = new java.util.ArrayList<ExecutorInfo>(_list825.size); ExecutorInfo _elem826; for (int _i827 = 0; _i827 < _list825.size; ++_i827) { _elem826 = new ExecutorInfo(); _elem826.read(iprot); struct.executors.add(_elem826); } } struct.set_executors_isSet(true); struct.port = iprot.readI32(); struct.set_port_isSet(true); } }
public void setFieldValue(_Fields field, Object value) { switch (field) { case TASK_START: if (value == null) { unset_task_start(); } else { set_task_start((Integer)value); } break; case TASK_END: if (value == null) { unset_task_end(); } else { set_task_end((Integer)value); } break; } }
public ExecutorInfo( int task_start, int task_end) { this(); this.task_start = task_start; set_task_start_isSet(true); this.task_end = task_end; set_task_end_isSet(true); }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!is_set_task_start()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'task_start' is unset! Struct:" + toString()); } if (!is_set_task_end()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'task_end' is unset! Struct:" + toString()); } // check for sub-struct validity }
if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.task_start = iprot.readI32(); struct.set_task_start_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.task_end = iprot.readI32(); struct.set_task_end_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public int compareTo(ExecutorInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.valueOf(is_set_task_start()).compareTo(other.is_set_task_start()); if (lastComparison != 0) { return lastComparison; } if (is_set_task_start()) { lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.task_start, other.task_start); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(is_set_task_end()).compareTo(other.is_set_task_end()); if (lastComparison != 0) { return lastComparison; } if (is_set_task_end()) { lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.task_end, other.task_end); if (lastComparison != 0) { return lastComparison; } } return 0; }
if (!(this_present_executor_info && that_present_executor_info)) return false; if (!this.executor_info.equals(that.executor_info)) return false;