You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2018/01/22 21:23:44 UTC
[5/7] storm git commit: STORM-2887: store metrics into RocksDB
http://git-wip-us.apache.org/repos/asf/storm/blob/48e23a99/storm-client/src/jvm/org/apache/storm/generated/Nimbus.java
----------------------------------------------------------------------
diff --git a/storm-client/src/jvm/org/apache/storm/generated/Nimbus.java b/storm-client/src/jvm/org/apache/storm/generated/Nimbus.java
index ea4dcc9..8b02548 100644
--- a/storm-client/src/jvm/org/apache/storm/generated/Nimbus.java
+++ b/storm-client/src/jvm/org/apache/storm/generated/Nimbus.java
@@ -170,6 +170,8 @@ public class Nimbus {
public List<OwnerResourceSummary> getOwnerResourceSummaries(String owner) throws AuthorizationException, org.apache.thrift.TException;
+ public void processWorkerMetrics(WorkerMetrics metrics) throws org.apache.thrift.TException;
+
}
public interface AsyncIface {
@@ -266,6 +268,8 @@ public class Nimbus {
public void getOwnerResourceSummaries(String owner, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void processWorkerMetrics(WorkerMetrics metrics, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
@@ -1522,6 +1526,26 @@ public class Nimbus {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getOwnerResourceSummaries failed: unknown result");
}
+ public void processWorkerMetrics(WorkerMetrics metrics) throws org.apache.thrift.TException
+ {
+ send_processWorkerMetrics(metrics);
+ recv_processWorkerMetrics();
+ }
+
+ public void send_processWorkerMetrics(WorkerMetrics metrics) throws org.apache.thrift.TException
+ {
+ processWorkerMetrics_args args = new processWorkerMetrics_args();
+ args.set_metrics(metrics);
+ sendBase("processWorkerMetrics", args);
+ }
+
+ public void recv_processWorkerMetrics() throws org.apache.thrift.TException
+ {
+ processWorkerMetrics_result result = new processWorkerMetrics_result();
+ receiveBase(result, "processWorkerMetrics");
+ return;
+ }
+
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
@@ -3090,6 +3114,38 @@ public class Nimbus {
}
}
+ public void processWorkerMetrics(WorkerMetrics metrics, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ processWorkerMetrics_call method_call = new processWorkerMetrics_call(metrics, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class processWorkerMetrics_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private WorkerMetrics metrics;
+ public processWorkerMetrics_call(WorkerMetrics metrics, 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.metrics = metrics;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("processWorkerMetrics", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ processWorkerMetrics_args args = new processWorkerMetrics_args();
+ args.set_metrics(metrics);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public void getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ (new Client(prot)).recv_processWorkerMetrics();
+ }
+ }
+
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
@@ -3149,6 +3205,7 @@ public class Nimbus {
processMap.put("getUserTopology", new getUserTopology());
processMap.put("getTopologyHistory", new getTopologyHistory());
processMap.put("getOwnerResourceSummaries", new getOwnerResourceSummaries());
+ processMap.put("processWorkerMetrics", new processWorkerMetrics());
return processMap;
}
@@ -4293,6 +4350,26 @@ public class Nimbus {
}
}
+ public static class processWorkerMetrics<I extends Iface> extends org.apache.thrift.ProcessFunction<I, processWorkerMetrics_args> {
+ public processWorkerMetrics() {
+ super("processWorkerMetrics");
+ }
+
+ public processWorkerMetrics_args getEmptyArgsInstance() {
+ return new processWorkerMetrics_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public processWorkerMetrics_result getResult(I iface, processWorkerMetrics_args args) throws org.apache.thrift.TException {
+ processWorkerMetrics_result result = new processWorkerMetrics_result();
+ iface.processWorkerMetrics(args.metrics);
+ return result;
+ }
+ }
+
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
@@ -4352,6 +4429,7 @@ public class Nimbus {
processMap.put("getUserTopology", new getUserTopology());
processMap.put("getTopologyHistory", new getTopologyHistory());
processMap.put("getOwnerResourceSummaries", new getOwnerResourceSummaries());
+ processMap.put("processWorkerMetrics", new processWorkerMetrics());
return processMap;
}
@@ -7070,6 +7148,56 @@ public class Nimbus {
}
}
+ public static class processWorkerMetrics<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, processWorkerMetrics_args, Void> {
+ public processWorkerMetrics() {
+ super("processWorkerMetrics");
+ }
+
+ public processWorkerMetrics_args getEmptyArgsInstance() {
+ return new processWorkerMetrics_args();
+ }
+
+ public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Void>() {
+ public void onComplete(Void o) {
+ processWorkerMetrics_result result = new processWorkerMetrics_result();
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ processWorkerMetrics_result result = new processWorkerMetrics_result();
+ {
+ 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, processWorkerMetrics_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+ iface.processWorkerMetrics(args.metrics,resultHandler);
+ }
+ }
+
}
public static class submitTopology_args implements org.apache.thrift.TBase<submitTopology_args, submitTopology_args._Fields>, java.io.Serializable, Cloneable, Comparable<submitTopology_args> {
@@ -18287,14 +18415,14 @@ public class Nimbus {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list866 = iprot.readListBegin();
- struct.success = new ArrayList<ProfileRequest>(_list866.size);
- ProfileRequest _elem867;
- for (int _i868 = 0; _i868 < _list866.size; ++_i868)
+ org.apache.thrift.protocol.TList _list894 = iprot.readListBegin();
+ struct.success = new ArrayList<ProfileRequest>(_list894.size);
+ ProfileRequest _elem895;
+ for (int _i896 = 0; _i896 < _list894.size; ++_i896)
{
- _elem867 = new ProfileRequest();
- _elem867.read(iprot);
- struct.success.add(_elem867);
+ _elem895 = new ProfileRequest();
+ _elem895.read(iprot);
+ struct.success.add(_elem895);
}
iprot.readListEnd();
}
@@ -18320,9 +18448,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 _iter869 : struct.success)
+ for (ProfileRequest _iter897 : struct.success)
{
- _iter869.write(oprot);
+ _iter897.write(oprot);
}
oprot.writeListEnd();
}
@@ -18353,9 +18481,9 @@ public class Nimbus {
if (struct.is_set_success()) {
{
oprot.writeI32(struct.success.size());
- for (ProfileRequest _iter870 : struct.success)
+ for (ProfileRequest _iter898 : struct.success)
{
- _iter870.write(oprot);
+ _iter898.write(oprot);
}
}
}
@@ -18367,14 +18495,14 @@ public class Nimbus {
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list871 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new ArrayList<ProfileRequest>(_list871.size);
- ProfileRequest _elem872;
- for (int _i873 = 0; _i873 < _list871.size; ++_i873)
+ org.apache.thrift.protocol.TList _list899 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<ProfileRequest>(_list899.size);
+ ProfileRequest _elem900;
+ for (int _i901 = 0; _i901 < _list899.size; ++_i901)
{
- _elem872 = new ProfileRequest();
- _elem872.read(iprot);
- struct.success.add(_elem872);
+ _elem900 = new ProfileRequest();
+ _elem900.read(iprot);
+ struct.success.add(_elem900);
}
}
struct.set_success_isSet(true);
@@ -48137,14 +48265,14 @@ public class Nimbus {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list874 = iprot.readListBegin();
- struct.success = new ArrayList<OwnerResourceSummary>(_list874.size);
- OwnerResourceSummary _elem875;
- for (int _i876 = 0; _i876 < _list874.size; ++_i876)
+ org.apache.thrift.protocol.TList _list902 = iprot.readListBegin();
+ struct.success = new ArrayList<OwnerResourceSummary>(_list902.size);
+ OwnerResourceSummary _elem903;
+ for (int _i904 = 0; _i904 < _list902.size; ++_i904)
{
- _elem875 = new OwnerResourceSummary();
- _elem875.read(iprot);
- struct.success.add(_elem875);
+ _elem903 = new OwnerResourceSummary();
+ _elem903.read(iprot);
+ struct.success.add(_elem903);
}
iprot.readListEnd();
}
@@ -48179,9 +48307,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 (OwnerResourceSummary _iter877 : struct.success)
+ for (OwnerResourceSummary _iter905 : struct.success)
{
- _iter877.write(oprot);
+ _iter905.write(oprot);
}
oprot.writeListEnd();
}
@@ -48220,9 +48348,9 @@ public class Nimbus {
if (struct.is_set_success()) {
{
oprot.writeI32(struct.success.size());
- for (OwnerResourceSummary _iter878 : struct.success)
+ for (OwnerResourceSummary _iter906 : struct.success)
{
- _iter878.write(oprot);
+ _iter906.write(oprot);
}
}
}
@@ -48237,14 +48365,14 @@ public class Nimbus {
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list879 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new ArrayList<OwnerResourceSummary>(_list879.size);
- OwnerResourceSummary _elem880;
- for (int _i881 = 0; _i881 < _list879.size; ++_i881)
+ org.apache.thrift.protocol.TList _list907 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<OwnerResourceSummary>(_list907.size);
+ OwnerResourceSummary _elem908;
+ for (int _i909 = 0; _i909 < _list907.size; ++_i909)
{
- _elem880 = new OwnerResourceSummary();
- _elem880.read(iprot);
- struct.success.add(_elem880);
+ _elem908 = new OwnerResourceSummary();
+ _elem908.read(iprot);
+ struct.success.add(_elem908);
}
}
struct.set_success_isSet(true);
@@ -48259,4 +48387,613 @@ public class Nimbus {
}
+ public static class processWorkerMetrics_args implements org.apache.thrift.TBase<processWorkerMetrics_args, processWorkerMetrics_args._Fields>, java.io.Serializable, Cloneable, Comparable<processWorkerMetrics_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("processWorkerMetrics_args");
+
+ private static final org.apache.thrift.protocol.TField METRICS_FIELD_DESC = new org.apache.thrift.protocol.TField("metrics", 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 processWorkerMetrics_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new processWorkerMetrics_argsTupleSchemeFactory());
+ }
+
+ private WorkerMetrics metrics; // 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 {
+ METRICS((short)1, "metrics");
+
+ 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: // METRICS
+ return METRICS;
+ 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.METRICS, new org.apache.thrift.meta_data.FieldMetaData("metrics", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkerMetrics.class)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(processWorkerMetrics_args.class, metaDataMap);
+ }
+
+ public processWorkerMetrics_args() {
+ }
+
+ public processWorkerMetrics_args(
+ WorkerMetrics metrics)
+ {
+ this();
+ this.metrics = metrics;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public processWorkerMetrics_args(processWorkerMetrics_args other) {
+ if (other.is_set_metrics()) {
+ this.metrics = new WorkerMetrics(other.metrics);
+ }
+ }
+
+ public processWorkerMetrics_args deepCopy() {
+ return new processWorkerMetrics_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.metrics = null;
+ }
+
+ public WorkerMetrics get_metrics() {
+ return this.metrics;
+ }
+
+ public void set_metrics(WorkerMetrics metrics) {
+ this.metrics = metrics;
+ }
+
+ public void unset_metrics() {
+ this.metrics = null;
+ }
+
+ /** Returns true if field metrics is set (has been assigned a value) and false otherwise */
+ public boolean is_set_metrics() {
+ return this.metrics != null;
+ }
+
+ public void set_metrics_isSet(boolean value) {
+ if (!value) {
+ this.metrics = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case METRICS:
+ if (value == null) {
+ unset_metrics();
+ } else {
+ set_metrics((WorkerMetrics)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case METRICS:
+ return get_metrics();
+
+ }
+ 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 METRICS:
+ return is_set_metrics();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof processWorkerMetrics_args)
+ return this.equals((processWorkerMetrics_args)that);
+ return false;
+ }
+
+ public boolean equals(processWorkerMetrics_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_metrics = true && this.is_set_metrics();
+ boolean that_present_metrics = true && that.is_set_metrics();
+ if (this_present_metrics || that_present_metrics) {
+ if (!(this_present_metrics && that_present_metrics))
+ return false;
+ if (!this.metrics.equals(that.metrics))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_metrics = true && (is_set_metrics());
+ list.add(present_metrics);
+ if (present_metrics)
+ list.add(metrics);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(processWorkerMetrics_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(is_set_metrics()).compareTo(other.is_set_metrics());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (is_set_metrics()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metrics, other.metrics);
+ 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("processWorkerMetrics_args(");
+ boolean first = true;
+
+ sb.append("metrics:");
+ if (this.metrics == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.metrics);
+ }
+ 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 (metrics != null) {
+ metrics.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 processWorkerMetrics_argsStandardSchemeFactory implements SchemeFactory {
+ public processWorkerMetrics_argsStandardScheme getScheme() {
+ return new processWorkerMetrics_argsStandardScheme();
+ }
+ }
+
+ private static class processWorkerMetrics_argsStandardScheme extends StandardScheme<processWorkerMetrics_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, processWorkerMetrics_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: // METRICS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.metrics = new WorkerMetrics();
+ struct.metrics.read(iprot);
+ struct.set_metrics_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, processWorkerMetrics_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.metrics != null) {
+ oprot.writeFieldBegin(METRICS_FIELD_DESC);
+ struct.metrics.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class processWorkerMetrics_argsTupleSchemeFactory implements SchemeFactory {
+ public processWorkerMetrics_argsTupleScheme getScheme() {
+ return new processWorkerMetrics_argsTupleScheme();
+ }
+ }
+
+ private static class processWorkerMetrics_argsTupleScheme extends TupleScheme<processWorkerMetrics_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, processWorkerMetrics_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.is_set_metrics()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.is_set_metrics()) {
+ struct.metrics.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, processWorkerMetrics_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.metrics = new WorkerMetrics();
+ struct.metrics.read(iprot);
+ struct.set_metrics_isSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class processWorkerMetrics_result implements org.apache.thrift.TBase<processWorkerMetrics_result, processWorkerMetrics_result._Fields>, java.io.Serializable, Cloneable, Comparable<processWorkerMetrics_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("processWorkerMetrics_result");
+
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new processWorkerMetrics_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new processWorkerMetrics_resultTupleSchemeFactory());
+ }
+
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+;
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(processWorkerMetrics_result.class, metaDataMap);
+ }
+
+ public processWorkerMetrics_result() {
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public processWorkerMetrics_result(processWorkerMetrics_result other) {
+ }
+
+ public processWorkerMetrics_result deepCopy() {
+ return new processWorkerMetrics_result(this);
+ }
+
+ @Override
+ public void clear() {
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof processWorkerMetrics_result)
+ return this.equals((processWorkerMetrics_result)that);
+ return false;
+ }
+
+ public boolean equals(processWorkerMetrics_result that) {
+ if (that == null)
+ return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(processWorkerMetrics_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("processWorkerMetrics_result(");
+ boolean first = true;
+
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class processWorkerMetrics_resultStandardSchemeFactory implements SchemeFactory {
+ public processWorkerMetrics_resultStandardScheme getScheme() {
+ return new processWorkerMetrics_resultStandardScheme();
+ }
+ }
+
+ private static class processWorkerMetrics_resultStandardScheme extends StandardScheme<processWorkerMetrics_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, processWorkerMetrics_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) {
+ 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, processWorkerMetrics_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class processWorkerMetrics_resultTupleSchemeFactory implements SchemeFactory {
+ public processWorkerMetrics_resultTupleScheme getScheme() {
+ return new processWorkerMetrics_resultTupleScheme();
+ }
+ }
+
+ private static class processWorkerMetrics_resultTupleScheme extends TupleScheme<processWorkerMetrics_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, processWorkerMetrics_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, processWorkerMetrics_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ }
+ }
+
+ }
+
}
http://git-wip-us.apache.org/repos/asf/storm/blob/48e23a99/storm-client/src/jvm/org/apache/storm/generated/StormBase.java
----------------------------------------------------------------------
diff --git a/storm-client/src/jvm/org/apache/storm/generated/StormBase.java b/storm-client/src/jvm/org/apache/storm/generated/StormBase.java
index b1b205c..733da58 100644
--- a/storm-client/src/jvm/org/apache/storm/generated/StormBase.java
+++ b/storm-client/src/jvm/org/apache/storm/generated/StormBase.java
@@ -1252,15 +1252,15 @@ public class StormBase implements org.apache.thrift.TBase<StormBase, StormBase._
case 4: // COMPONENT_EXECUTORS
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
- org.apache.thrift.protocol.TMap _map732 = iprot.readMapBegin();
- struct.component_executors = new HashMap<String,Integer>(2*_map732.size);
- String _key733;
- int _val734;
- for (int _i735 = 0; _i735 < _map732.size; ++_i735)
+ org.apache.thrift.protocol.TMap _map752 = iprot.readMapBegin();
+ struct.component_executors = new HashMap<String,Integer>(2*_map752.size);
+ String _key753;
+ int _val754;
+ for (int _i755 = 0; _i755 < _map752.size; ++_i755)
{
- _key733 = iprot.readString();
- _val734 = iprot.readI32();
- struct.component_executors.put(_key733, _val734);
+ _key753 = iprot.readString();
+ _val754 = iprot.readI32();
+ struct.component_executors.put(_key753, _val754);
}
iprot.readMapEnd();
}
@@ -1305,16 +1305,16 @@ public class StormBase implements org.apache.thrift.TBase<StormBase, StormBase._
case 9: // COMPONENT_DEBUG
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
- org.apache.thrift.protocol.TMap _map736 = iprot.readMapBegin();
- struct.component_debug = new HashMap<String,DebugOptions>(2*_map736.size);
- String _key737;
- DebugOptions _val738;
- for (int _i739 = 0; _i739 < _map736.size; ++_i739)
+ org.apache.thrift.protocol.TMap _map756 = iprot.readMapBegin();
+ struct.component_debug = new HashMap<String,DebugOptions>(2*_map756.size);
+ String _key757;
+ DebugOptions _val758;
+ for (int _i759 = 0; _i759 < _map756.size; ++_i759)
{
- _key737 = iprot.readString();
- _val738 = new DebugOptions();
- _val738.read(iprot);
- struct.component_debug.put(_key737, _val738);
+ _key757 = iprot.readString();
+ _val758 = new DebugOptions();
+ _val758.read(iprot);
+ struct.component_debug.put(_key757, _val758);
}
iprot.readMapEnd();
}
@@ -1370,10 +1370,10 @@ public class StormBase implements org.apache.thrift.TBase<StormBase, StormBase._
oprot.writeFieldBegin(COMPONENT_EXECUTORS_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.component_executors.size()));
- for (Map.Entry<String, Integer> _iter740 : struct.component_executors.entrySet())
+ for (Map.Entry<String, Integer> _iter760 : struct.component_executors.entrySet())
{
- oprot.writeString(_iter740.getKey());
- oprot.writeI32(_iter740.getValue());
+ oprot.writeString(_iter760.getKey());
+ oprot.writeI32(_iter760.getValue());
}
oprot.writeMapEnd();
}
@@ -1411,10 +1411,10 @@ public class StormBase implements org.apache.thrift.TBase<StormBase, StormBase._
oprot.writeFieldBegin(COMPONENT_DEBUG_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.component_debug.size()));
- for (Map.Entry<String, DebugOptions> _iter741 : struct.component_debug.entrySet())
+ for (Map.Entry<String, DebugOptions> _iter761 : struct.component_debug.entrySet())
{
- oprot.writeString(_iter741.getKey());
- _iter741.getValue().write(oprot);
+ oprot.writeString(_iter761.getKey());
+ _iter761.getValue().write(oprot);
}
oprot.writeMapEnd();
}
@@ -1484,10 +1484,10 @@ public class StormBase implements org.apache.thrift.TBase<StormBase, StormBase._
if (struct.is_set_component_executors()) {
{
oprot.writeI32(struct.component_executors.size());
- for (Map.Entry<String, Integer> _iter742 : struct.component_executors.entrySet())
+ for (Map.Entry<String, Integer> _iter762 : struct.component_executors.entrySet())
{
- oprot.writeString(_iter742.getKey());
- oprot.writeI32(_iter742.getValue());
+ oprot.writeString(_iter762.getKey());
+ oprot.writeI32(_iter762.getValue());
}
}
}
@@ -1506,10 +1506,10 @@ public class StormBase implements org.apache.thrift.TBase<StormBase, StormBase._
if (struct.is_set_component_debug()) {
{
oprot.writeI32(struct.component_debug.size());
- for (Map.Entry<String, DebugOptions> _iter743 : struct.component_debug.entrySet())
+ for (Map.Entry<String, DebugOptions> _iter763 : struct.component_debug.entrySet())
{
- oprot.writeString(_iter743.getKey());
- _iter743.getValue().write(oprot);
+ oprot.writeString(_iter763.getKey());
+ _iter763.getValue().write(oprot);
}
}
}
@@ -1533,15 +1533,15 @@ public class StormBase implements org.apache.thrift.TBase<StormBase, StormBase._
BitSet incoming = iprot.readBitSet(8);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TMap _map744 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32());
- struct.component_executors = new HashMap<String,Integer>(2*_map744.size);
- String _key745;
- int _val746;
- for (int _i747 = 0; _i747 < _map744.size; ++_i747)
+ org.apache.thrift.protocol.TMap _map764 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32());
+ struct.component_executors = new HashMap<String,Integer>(2*_map764.size);
+ String _key765;
+ int _val766;
+ for (int _i767 = 0; _i767 < _map764.size; ++_i767)
{
- _key745 = iprot.readString();
- _val746 = iprot.readI32();
- struct.component_executors.put(_key745, _val746);
+ _key765 = iprot.readString();
+ _val766 = iprot.readI32();
+ struct.component_executors.put(_key765, _val766);
}
}
struct.set_component_executors_isSet(true);
@@ -1565,16 +1565,16 @@ public class StormBase implements org.apache.thrift.TBase<StormBase, StormBase._
}
if (incoming.get(5)) {
{
- org.apache.thrift.protocol.TMap _map748 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.component_debug = new HashMap<String,DebugOptions>(2*_map748.size);
- String _key749;
- DebugOptions _val750;
- for (int _i751 = 0; _i751 < _map748.size; ++_i751)
+ org.apache.thrift.protocol.TMap _map768 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.component_debug = new HashMap<String,DebugOptions>(2*_map768.size);
+ String _key769;
+ DebugOptions _val770;
+ for (int _i771 = 0; _i771 < _map768.size; ++_i771)
{
- _key749 = iprot.readString();
- _val750 = new DebugOptions();
- _val750.read(iprot);
- struct.component_debug.put(_key749, _val750);
+ _key769 = iprot.readString();
+ _val770 = new DebugOptions();
+ _val770.read(iprot);
+ struct.component_debug.put(_key769, _val770);
}
}
struct.set_component_debug_isSet(true);
http://git-wip-us.apache.org/repos/asf/storm/blob/48e23a99/storm-client/src/jvm/org/apache/storm/generated/TopologyHistoryInfo.java
----------------------------------------------------------------------
diff --git a/storm-client/src/jvm/org/apache/storm/generated/TopologyHistoryInfo.java b/storm-client/src/jvm/org/apache/storm/generated/TopologyHistoryInfo.java
index 0fc7cab..51a7625 100644
--- a/storm-client/src/jvm/org/apache/storm/generated/TopologyHistoryInfo.java
+++ b/storm-client/src/jvm/org/apache/storm/generated/TopologyHistoryInfo.java
@@ -364,13 +364,13 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist
case 1: // TOPO_IDS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list842 = iprot.readListBegin();
- struct.topo_ids = new ArrayList<String>(_list842.size);
- String _elem843;
- for (int _i844 = 0; _i844 < _list842.size; ++_i844)
+ org.apache.thrift.protocol.TList _list862 = iprot.readListBegin();
+ struct.topo_ids = new ArrayList<String>(_list862.size);
+ String _elem863;
+ for (int _i864 = 0; _i864 < _list862.size; ++_i864)
{
- _elem843 = iprot.readString();
- struct.topo_ids.add(_elem843);
+ _elem863 = iprot.readString();
+ struct.topo_ids.add(_elem863);
}
iprot.readListEnd();
}
@@ -396,9 +396,9 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist
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 _iter845 : struct.topo_ids)
+ for (String _iter865 : struct.topo_ids)
{
- oprot.writeString(_iter845);
+ oprot.writeString(_iter865);
}
oprot.writeListEnd();
}
@@ -429,9 +429,9 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist
if (struct.is_set_topo_ids()) {
{
oprot.writeI32(struct.topo_ids.size());
- for (String _iter846 : struct.topo_ids)
+ for (String _iter866 : struct.topo_ids)
{
- oprot.writeString(_iter846);
+ oprot.writeString(_iter866);
}
}
}
@@ -443,13 +443,13 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list847 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.topo_ids = new ArrayList<String>(_list847.size);
- String _elem848;
- for (int _i849 = 0; _i849 < _list847.size; ++_i849)
+ org.apache.thrift.protocol.TList _list867 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.topo_ids = new ArrayList<String>(_list867.size);
+ String _elem868;
+ for (int _i869 = 0; _i869 < _list867.size; ++_i869)
{
- _elem848 = iprot.readString();
- struct.topo_ids.add(_elem848);
+ _elem868 = iprot.readString();
+ struct.topo_ids.add(_elem868);
}
}
struct.set_topo_ids_isSet(true);
http://git-wip-us.apache.org/repos/asf/storm/blob/48e23a99/storm-client/src/jvm/org/apache/storm/generated/WorkerMetricList.java
----------------------------------------------------------------------
diff --git a/storm-client/src/jvm/org/apache/storm/generated/WorkerMetricList.java b/storm-client/src/jvm/org/apache/storm/generated/WorkerMetricList.java
new file mode 100644
index 0000000..0bf95b5
--- /dev/null
+++ b/storm-client/src/jvm/org/apache/storm/generated/WorkerMetricList.java
@@ -0,0 +1,466 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.storm.generated;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
+public class WorkerMetricList implements org.apache.thrift.TBase<WorkerMetricList, WorkerMetricList._Fields>, java.io.Serializable, Cloneable, Comparable<WorkerMetricList> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkerMetricList");
+
+ private static final org.apache.thrift.protocol.TField METRICS_FIELD_DESC = new org.apache.thrift.protocol.TField("metrics", 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 WorkerMetricListStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new WorkerMetricListTupleSchemeFactory());
+ }
+
+ private List<WorkerMetricPoint> metrics; // 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 {
+ METRICS((short)1, "metrics");
+
+ 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: // METRICS
+ return METRICS;
+ 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.METRICS, new org.apache.thrift.meta_data.FieldMetaData("metrics", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkerMetricPoint.class))));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WorkerMetricList.class, metaDataMap);
+ }
+
+ public WorkerMetricList() {
+ }
+
+ public WorkerMetricList(
+ List<WorkerMetricPoint> metrics)
+ {
+ this();
+ this.metrics = metrics;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public WorkerMetricList(WorkerMetricList other) {
+ if (other.is_set_metrics()) {
+ List<WorkerMetricPoint> __this__metrics = new ArrayList<WorkerMetricPoint>(other.metrics.size());
+ for (WorkerMetricPoint other_element : other.metrics) {
+ __this__metrics.add(new WorkerMetricPoint(other_element));
+ }
+ this.metrics = __this__metrics;
+ }
+ }
+
+ public WorkerMetricList deepCopy() {
+ return new WorkerMetricList(this);
+ }
+
+ @Override
+ public void clear() {
+ this.metrics = null;
+ }
+
+ public int get_metrics_size() {
+ return (this.metrics == null) ? 0 : this.metrics.size();
+ }
+
+ public java.util.Iterator<WorkerMetricPoint> get_metrics_iterator() {
+ return (this.metrics == null) ? null : this.metrics.iterator();
+ }
+
+ public void add_to_metrics(WorkerMetricPoint elem) {
+ if (this.metrics == null) {
+ this.metrics = new ArrayList<WorkerMetricPoint>();
+ }
+ this.metrics.add(elem);
+ }
+
+ public List<WorkerMetricPoint> get_metrics() {
+ return this.metrics;
+ }
+
+ public void set_metrics(List<WorkerMetricPoint> metrics) {
+ this.metrics = metrics;
+ }
+
+ public void unset_metrics() {
+ this.metrics = null;
+ }
+
+ /** Returns true if field metrics is set (has been assigned a value) and false otherwise */
+ public boolean is_set_metrics() {
+ return this.metrics != null;
+ }
+
+ public void set_metrics_isSet(boolean value) {
+ if (!value) {
+ this.metrics = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case METRICS:
+ if (value == null) {
+ unset_metrics();
+ } else {
+ set_metrics((List<WorkerMetricPoint>)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case METRICS:
+ return get_metrics();
+
+ }
+ 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 METRICS:
+ return is_set_metrics();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof WorkerMetricList)
+ return this.equals((WorkerMetricList)that);
+ return false;
+ }
+
+ public boolean equals(WorkerMetricList that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_metrics = true && this.is_set_metrics();
+ boolean that_present_metrics = true && that.is_set_metrics();
+ if (this_present_metrics || that_present_metrics) {
+ if (!(this_present_metrics && that_present_metrics))
+ return false;
+ if (!this.metrics.equals(that.metrics))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_metrics = true && (is_set_metrics());
+ list.add(present_metrics);
+ if (present_metrics)
+ list.add(metrics);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(WorkerMetricList other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(is_set_metrics()).compareTo(other.is_set_metrics());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (is_set_metrics()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metrics, other.metrics);
+ 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("WorkerMetricList(");
+ boolean first = true;
+
+ sb.append("metrics:");
+ if (this.metrics == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.metrics);
+ }
+ 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 WorkerMetricListStandardSchemeFactory implements SchemeFactory {
+ public WorkerMetricListStandardScheme getScheme() {
+ return new WorkerMetricListStandardScheme();
+ }
+ }
+
+ private static class WorkerMetricListStandardScheme extends StandardScheme<WorkerMetricList> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, WorkerMetricList 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: // METRICS
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list870 = iprot.readListBegin();
+ struct.metrics = new ArrayList<WorkerMetricPoint>(_list870.size);
+ WorkerMetricPoint _elem871;
+ for (int _i872 = 0; _i872 < _list870.size; ++_i872)
+ {
+ _elem871 = new WorkerMetricPoint();
+ _elem871.read(iprot);
+ struct.metrics.add(_elem871);
+ }
+ iprot.readListEnd();
+ }
+ struct.set_metrics_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, WorkerMetricList struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.metrics != null) {
+ oprot.writeFieldBegin(METRICS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.metrics.size()));
+ for (WorkerMetricPoint _iter873 : struct.metrics)
+ {
+ _iter873.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class WorkerMetricListTupleSchemeFactory implements SchemeFactory {
+ public WorkerMetricListTupleScheme getScheme() {
+ return new WorkerMetricListTupleScheme();
+ }
+ }
+
+ private static class WorkerMetricListTupleScheme extends TupleScheme<WorkerMetricList> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, WorkerMetricList struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.is_set_metrics()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.is_set_metrics()) {
+ {
+ oprot.writeI32(struct.metrics.size());
+ for (WorkerMetricPoint _iter874 : struct.metrics)
+ {
+ _iter874.write(oprot);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, WorkerMetricList struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ {
+ org.apache.thrift.protocol.TList _list875 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.metrics = new ArrayList<WorkerMetricPoint>(_list875.size);
+ WorkerMetricPoint _elem876;
+ for (int _i877 = 0; _i877 < _list875.size; ++_i877)
+ {
+ _elem876 = new WorkerMetricPoint();
+ _elem876.read(iprot);
+ struct.metrics.add(_elem876);
+ }
+ }
+ struct.set_metrics_isSet(true);
+ }
+ }
+ }
+
+}
+