Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add seqNo between Corona cluster manager and CoronaJobTracker

Summary:
seqNos are added to cluster manager and corona jobtracker transactions. heatbeat from JT will not change the seqNo. CM will
save the seqNo from JT, and expect that will be the next value from JT for any transaction other than heartbeta. if the seqNo
doens't match, CM will kill the JT. JT will save the seqNo from CM, and expect that will be the next value from CM. If the seqNo
doesn't match, JT will kill itself.

Test Plan:
the sleep sample(safeMode and normal mode), TestSessionDriver, TestLoadManager, TestClusterManager, TestPreemption,
TestResourceCheck

Reviewers: rvadali, aching

Reviewed By: rvadali

Task ID: 1794271
  • Loading branch information...
commit 238c6122b48c71409bbbf170043f0199ab7b4841 1 parent 1cee40e
jeanxu authored Alex Feinberg committed
5 singleNodeHadoop/coronaConf/mapred-site.xml
View
@@ -6,6 +6,11 @@
<configuration>
<property>
+ <name>cm.heartbeat.delay.max</name>
+ <value>300000</value>
+</property>
+
+<property>
<name>cm.config.reload.period.ms</name>
<value>5000</value>
<description>How often to reload the config</description>
7 src/contrib/corona/interface/ClusterManager.thrift
View
@@ -127,6 +127,11 @@ struct SessionInfo {
9: optional i64 deadline
}
+struct HeartbeatArgs{
+ 1: required ResourceRequestId requestId,
+ 2: required ResourceRequestId grantId,
+}
+
struct ClusterManagerInfo {
1: required string url,
2: required string jobHistoryLocation,
@@ -193,6 +198,8 @@ service ClusterManagerService {
// Heartbeat a session.
void sessionHeartbeat(1: SessionHandle handle) throws (1: InvalidSessionHandle e, 2: SafeModeException f),
+ void sessionHeartbeatV2(1: SessionHandle handle, 2: HeartbeatArgs heartbeatArgs) throws (1: InvalidSessionHandle e, 2: SafeModeException f),
+
// Request additional resources. A request is required for each resource
// requested.
void requestResource(1: SessionHandle handle, 2: list<ResourceRequest> requestList) throws (1: InvalidSessionHandle e, 2: SafeModeException f),
1,210 src/contrib/corona/src/gen-java/org/apache/hadoop/corona/ClusterManagerService.java
View
@@ -37,6 +37,8 @@
public void sessionHeartbeat(String handle) throws InvalidSessionHandle, SafeModeException, org.apache.thrift.TException;
+ public void sessionHeartbeatV2(String handle, HeartbeatArgs heartbeatArgs) throws InvalidSessionHandle, SafeModeException, org.apache.thrift.TException;
+
public void requestResource(String handle, List<ResourceRequest> requestList) throws InvalidSessionHandle, SafeModeException, org.apache.thrift.TException;
public void releaseResource(String handle, List<Integer> idList) throws InvalidSessionHandle, SafeModeException, org.apache.thrift.TException;
@@ -69,6 +71,8 @@
public void sessionHeartbeat(String handle, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.sessionHeartbeat_call> resultHandler) throws org.apache.thrift.TException;
+ public void sessionHeartbeatV2(String handle, HeartbeatArgs heartbeatArgs, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.sessionHeartbeatV2_call> resultHandler) throws org.apache.thrift.TException;
+
public void requestResource(String handle, List<ResourceRequest> requestList, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.requestResource_call> resultHandler) throws org.apache.thrift.TException;
public void releaseResource(String handle, List<Integer> idList, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.releaseResource_call> resultHandler) throws org.apache.thrift.TException;
@@ -244,6 +248,33 @@ public void recv_sessionHeartbeat() throws InvalidSessionHandle, SafeModeExcepti
return;
}
+ public void sessionHeartbeatV2(String handle, HeartbeatArgs heartbeatArgs) throws InvalidSessionHandle, SafeModeException, org.apache.thrift.TException
+ {
+ send_sessionHeartbeatV2(handle, heartbeatArgs);
+ recv_sessionHeartbeatV2();
+ }
+
+ public void send_sessionHeartbeatV2(String handle, HeartbeatArgs heartbeatArgs) throws org.apache.thrift.TException
+ {
+ sessionHeartbeatV2_args args = new sessionHeartbeatV2_args();
+ args.setHandle(handle);
+ args.setHeartbeatArgs(heartbeatArgs);
+ sendBase("sessionHeartbeatV2", args);
+ }
+
+ public void recv_sessionHeartbeatV2() throws InvalidSessionHandle, SafeModeException, org.apache.thrift.TException
+ {
+ sessionHeartbeatV2_result result = new sessionHeartbeatV2_result();
+ receiveBase(result, "sessionHeartbeatV2");
+ if (result.e != null) {
+ throw result.e;
+ }
+ if (result.f != null) {
+ throw result.f;
+ }
+ return;
+ }
+
public void requestResource(String handle, List<ResourceRequest> requestList) throws InvalidSessionHandle, SafeModeException, org.apache.thrift.TException
{
send_requestResource(handle, requestList);
@@ -651,6 +682,41 @@ public void getResult() throws InvalidSessionHandle, SafeModeException, org.apac
}
}
+ public void sessionHeartbeatV2(String handle, HeartbeatArgs heartbeatArgs, org.apache.thrift.async.AsyncMethodCallback<sessionHeartbeatV2_call> resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ sessionHeartbeatV2_call method_call = new sessionHeartbeatV2_call(handle, heartbeatArgs, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class sessionHeartbeatV2_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String handle;
+ private HeartbeatArgs heartbeatArgs;
+ public sessionHeartbeatV2_call(String handle, HeartbeatArgs heartbeatArgs, org.apache.thrift.async.AsyncMethodCallback<sessionHeartbeatV2_call> 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.handle = handle;
+ this.heartbeatArgs = heartbeatArgs;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sessionHeartbeatV2", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ sessionHeartbeatV2_args args = new sessionHeartbeatV2_args();
+ args.setHandle(handle);
+ args.setHeartbeatArgs(heartbeatArgs);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public void getResult() throws InvalidSessionHandle, SafeModeException, 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_sessionHeartbeatV2();
+ }
+ }
+
public void requestResource(String handle, List<ResourceRequest> requestList, org.apache.thrift.async.AsyncMethodCallback<requestResource_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
requestResource_call method_call = new requestResource_call(handle, requestList, resultHandler, this, ___protocolFactory, ___transport);
@@ -960,6 +1026,7 @@ protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ?
processMap.put("sessionUpdateInfo", new sessionUpdateInfo());
processMap.put("sessionEnd", new sessionEnd());
processMap.put("sessionHeartbeat", new sessionHeartbeat());
+ processMap.put("sessionHeartbeatV2", new sessionHeartbeatV2());
processMap.put("requestResource", new requestResource());
processMap.put("releaseResource", new releaseResource());
processMap.put("nodeHeartbeat", new nodeHeartbeat());
@@ -1080,6 +1147,28 @@ protected sessionHeartbeat_result getResult(I iface, sessionHeartbeat_args args)
}
}
+ private static class sessionHeartbeatV2<I extends Iface> extends org.apache.thrift.ProcessFunction<I, sessionHeartbeatV2_args> {
+ public sessionHeartbeatV2() {
+ super("sessionHeartbeatV2");
+ }
+
+ protected sessionHeartbeatV2_args getEmptyArgsInstance() {
+ return new sessionHeartbeatV2_args();
+ }
+
+ protected sessionHeartbeatV2_result getResult(I iface, sessionHeartbeatV2_args args) throws org.apache.thrift.TException {
+ sessionHeartbeatV2_result result = new sessionHeartbeatV2_result();
+ try {
+ iface.sessionHeartbeatV2(args.handle, args.heartbeatArgs);
+ } catch (InvalidSessionHandle e) {
+ result.e = e;
+ } catch (SafeModeException f) {
+ result.f = f;
+ }
+ return result;
+ }
+ }
+
private static class requestResource<I extends Iface> extends org.apache.thrift.ProcessFunction<I, requestResource_args> {
public requestResource() {
super("requestResource");
@@ -3442,7 +3531,795 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("sessionUpdateInfo_result(");
+ StringBuilder sb = new StringBuilder("sessionUpdateInfo_result(");
+ boolean first = true;
+
+ sb.append("e:");
+ if (this.e == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.e);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("f:");
+ if (this.f == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.f);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ }
+
+ 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);
+ }
+ }
+
+ }
+
+ public static class sessionEnd_args implements org.apache.thrift.TBase<sessionEnd_args, sessionEnd_args._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionEnd_args");
+
+ private static final org.apache.thrift.protocol.TField HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("handle", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)2);
+
+ public String handle; // required
+ /**
+ *
+ * @see SessionStatus
+ */
+ public SessionStatus status; // 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 {
+ HANDLE((short)1, "handle"),
+ /**
+ *
+ * @see SessionStatus
+ */
+ STATUS((short)2, "status");
+
+ 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: // HANDLE
+ return HANDLE;
+ case 2: // STATUS
+ return STATUS;
+ 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.HANDLE, new org.apache.thrift.meta_data.FieldMetaData("handle", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "SessionHandle")));
+ tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SessionStatus.class)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sessionEnd_args.class, metaDataMap);
+ }
+
+ public sessionEnd_args() {
+ }
+
+ public sessionEnd_args(
+ String handle,
+ SessionStatus status)
+ {
+ this();
+ this.handle = handle;
+ this.status = status;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public sessionEnd_args(sessionEnd_args other) {
+ if (other.isSetHandle()) {
+ this.handle = other.handle;
+ }
+ if (other.isSetStatus()) {
+ this.status = other.status;
+ }
+ }
+
+ public sessionEnd_args deepCopy() {
+ return new sessionEnd_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.handle = null;
+ this.status = null;
+ }
+
+ public String getHandle() {
+ return this.handle;
+ }
+
+ public sessionEnd_args setHandle(String handle) {
+ this.handle = handle;
+ return this;
+ }
+
+ public void unsetHandle() {
+ this.handle = null;
+ }
+
+ /** Returns true if field handle is set (has been assigned a value) and false otherwise */
+ public boolean isSetHandle() {
+ return this.handle != null;
+ }
+
+ public void setHandleIsSet(boolean value) {
+ if (!value) {
+ this.handle = null;
+ }
+ }
+
+ /**
+ *
+ * @see SessionStatus
+ */
+ public SessionStatus getStatus() {
+ return this.status;
+ }
+
+ /**
+ *
+ * @see SessionStatus
+ */
+ public sessionEnd_args setStatus(SessionStatus status) {
+ this.status = status;
+ return this;
+ }
+
+ public void unsetStatus() {
+ this.status = null;
+ }
+
+ /** Returns true if field status is set (has been assigned a value) and false otherwise */
+ public boolean isSetStatus() {
+ return this.status != null;
+ }
+
+ public void setStatusIsSet(boolean value) {
+ if (!value) {
+ this.status = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case HANDLE:
+ if (value == null) {
+ unsetHandle();
+ } else {
+ setHandle((String)value);
+ }
+ break;
+
+ case STATUS:
+ if (value == null) {
+ unsetStatus();
+ } else {
+ setStatus((SessionStatus)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case HANDLE:
+ return getHandle();
+
+ case STATUS:
+ return getStatus();
+
+ }
+ 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 HANDLE:
+ return isSetHandle();
+ case STATUS:
+ return isSetStatus();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof sessionEnd_args)
+ return this.equals((sessionEnd_args)that);
+ return false;
+ }
+
+ public boolean equals(sessionEnd_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_handle = true && this.isSetHandle();
+ boolean that_present_handle = true && that.isSetHandle();
+ if (this_present_handle || that_present_handle) {
+ if (!(this_present_handle && that_present_handle))
+ return false;
+ if (!this.handle.equals(that.handle))
+ return false;
+ }
+
+ boolean this_present_status = true && this.isSetStatus();
+ boolean that_present_status = true && that.isSetStatus();
+ if (this_present_status || that_present_status) {
+ if (!(this_present_status && that_present_status))
+ return false;
+ if (!this.status.equals(that.status))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(sessionEnd_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ sessionEnd_args typedOther = (sessionEnd_args)other;
+
+ lastComparison = Boolean.valueOf(isSetHandle()).compareTo(typedOther.isSetHandle());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetHandle()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.handle, typedOther.handle);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStatus()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
+ 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 {
+ org.apache.thrift.protocol.TField field;
+ iprot.readStructBegin();
+ while (true)
+ {
+ field = iprot.readFieldBegin();
+ if (field.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (field.id) {
+ case 1: // HANDLE
+ if (field.type == org.apache.thrift.protocol.TType.STRING) {
+ this.handle = iprot.readString();
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // STATUS
+ if (field.type == org.apache.thrift.protocol.TType.I32) {
+ this.status = SessionStatus.findByValue(iprot.readI32());
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (this.handle != null) {
+ oprot.writeFieldBegin(HANDLE_FIELD_DESC);
+ oprot.writeString(this.handle);
+ oprot.writeFieldEnd();
+ }
+ if (this.status != null) {
+ oprot.writeFieldBegin(STATUS_FIELD_DESC);
+ oprot.writeI32(this.status.getValue());
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("sessionEnd_args(");
+ boolean first = true;
+
+ sb.append("handle:");
+ if (this.handle == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.handle);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("status:");
+ if (this.status == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.status);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ }
+
+ 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);
+ }
+ }
+
+ }
+
+ public static class sessionEnd_result implements org.apache.thrift.TBase<sessionEnd_result, sessionEnd_result._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionEnd_result");
+
+ private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField F_FIELD_DESC = new org.apache.thrift.protocol.TField("f", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+
+ public InvalidSessionHandle e; // required
+ public SafeModeException f; // 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 {
+ E((short)1, "e"),
+ F((short)2, "f");
+
+ 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: // E
+ return E;
+ case 2: // F
+ return F;
+ 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.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.F, new org.apache.thrift.meta_data.FieldMetaData("f", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sessionEnd_result.class, metaDataMap);
+ }
+
+ public sessionEnd_result() {
+ }
+
+ public sessionEnd_result(
+ InvalidSessionHandle e,
+ SafeModeException f)
+ {
+ this();
+ this.e = e;
+ this.f = f;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public sessionEnd_result(sessionEnd_result other) {
+ if (other.isSetE()) {
+ this.e = new InvalidSessionHandle(other.e);
+ }
+ if (other.isSetF()) {
+ this.f = new SafeModeException(other.f);
+ }
+ }
+
+ public sessionEnd_result deepCopy() {
+ return new sessionEnd_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.e = null;
+ this.f = null;
+ }
+
+ public InvalidSessionHandle getE() {
+ return this.e;
+ }
+
+ public sessionEnd_result setE(InvalidSessionHandle e) {
+ this.e = e;
+ return this;
+ }
+
+ public void unsetE() {
+ this.e = null;
+ }
+
+ /** Returns true if field e is set (has been assigned a value) and false otherwise */
+ public boolean isSetE() {
+ return this.e != null;
+ }
+
+ public void setEIsSet(boolean value) {
+ if (!value) {
+ this.e = null;
+ }
+ }
+
+ public SafeModeException getF() {
+ return this.f;
+ }
+
+ public sessionEnd_result setF(SafeModeException f) {
+ this.f = f;
+ return this;
+ }
+
+ public void unsetF() {
+ this.f = null;
+ }
+
+ /** Returns true if field f is set (has been assigned a value) and false otherwise */
+ public boolean isSetF() {
+ return this.f != null;
+ }
+
+ public void setFIsSet(boolean value) {
+ if (!value) {
+ this.f = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case E:
+ if (value == null) {
+ unsetE();
+ } else {
+ setE((InvalidSessionHandle)value);
+ }
+ break;
+
+ case F:
+ if (value == null) {
+ unsetF();
+ } else {
+ setF((SafeModeException)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case E:
+ return getE();
+
+ case F:
+ return getF();
+
+ }
+ 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 E:
+ return isSetE();
+ case F:
+ return isSetF();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof sessionEnd_result)
+ return this.equals((sessionEnd_result)that);
+ return false;
+ }
+
+ public boolean equals(sessionEnd_result that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_e = true && this.isSetE();
+ boolean that_present_e = true && that.isSetE();
+ if (this_present_e || that_present_e) {
+ if (!(this_present_e && that_present_e))
+ return false;
+ if (!this.e.equals(that.e))
+ return false;
+ }
+
+ boolean this_present_f = true && this.isSetF();
+ boolean that_present_f = true && that.isSetF();
+ if (this_present_f || that_present_f) {
+ if (!(this_present_f && that_present_f))
+ return false;
+ if (!this.f.equals(that.f))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(sessionEnd_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ sessionEnd_result typedOther = (sessionEnd_result)other;
+
+ lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetE()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetF()).compareTo(typedOther.isSetF());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetF()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.f, typedOther.f);
+ 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 {
+ org.apache.thrift.protocol.TField field;
+ iprot.readStructBegin();
+ while (true)
+ {
+ field = iprot.readFieldBegin();
+ if (field.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (field.id) {
+ case 1: // E
+ if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
+ this.e = new InvalidSessionHandle();
+ this.e.read(iprot);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // F
+ if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
+ this.f = new SafeModeException();
+ this.f.read(iprot);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ oprot.writeStructBegin(STRUCT_DESC);
+
+ if (this.isSetE()) {
+ oprot.writeFieldBegin(E_FIELD_DESC);
+ this.e.write(oprot);
+ oprot.writeFieldEnd();
+ } else if (this.isSetF()) {
+ oprot.writeFieldBegin(F_FIELD_DESC);
+ this.f.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("sessionEnd_result(");
boolean first = true;
sb.append("e:");
@@ -3486,27 +4363,16 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException
}
- public static class sessionEnd_args implements org.apache.thrift.TBase<sessionEnd_args, sessionEnd_args._Fields>, java.io.Serializable, Cloneable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionEnd_args");
+ public static class sessionHeartbeat_args implements org.apache.thrift.TBase<sessionHeartbeat_args, sessionHeartbeat_args._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionHeartbeat_args");
private static final org.apache.thrift.protocol.TField HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("handle", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)2);
public String handle; // required
- /**
- *
- * @see SessionStatus
- */
- public SessionStatus status; // 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 {
- HANDLE((short)1, "handle"),
- /**
- *
- * @see SessionStatus
- */
- STATUS((short)2, "status");
+ HANDLE((short)1, "handle");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -3523,8 +4389,6 @@ public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // HANDLE
return HANDLE;
- case 2: // STATUS
- return STATUS;
default:
return null;
}
@@ -3571,51 +4435,43 @@ public String getFieldName() {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.HANDLE, new org.apache.thrift.meta_data.FieldMetaData("handle", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "SessionHandle")));
- tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SessionStatus.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sessionEnd_args.class, metaDataMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sessionHeartbeat_args.class, metaDataMap);
}
- public sessionEnd_args() {
+ public sessionHeartbeat_args() {
}
- public sessionEnd_args(
- String handle,
- SessionStatus status)
+ public sessionHeartbeat_args(
+ String handle)
{
this();
this.handle = handle;
- this.status = status;
}
/**
* Performs a deep copy on <i>other</i>.
*/
- public sessionEnd_args(sessionEnd_args other) {
+ public sessionHeartbeat_args(sessionHeartbeat_args other) {
if (other.isSetHandle()) {
this.handle = other.handle;
}
- if (other.isSetStatus()) {
- this.status = other.status;
- }
}
- public sessionEnd_args deepCopy() {
- return new sessionEnd_args(this);
+ public sessionHeartbeat_args deepCopy() {
+ return new sessionHeartbeat_args(this);
}
@Override
public void clear() {
this.handle = null;
- this.status = null;
}
public String getHandle() {
return this.handle;
}
- public sessionEnd_args setHandle(String handle) {
+ public sessionHeartbeat_args setHandle(String handle) {
this.handle = handle;
return this;
}
@@ -3635,38 +4491,6 @@ public void setHandleIsSet(boolean value) {
}
}
- /**
- *
- * @see SessionStatus
- */
- public SessionStatus getStatus() {
- return this.status;
- }
-
- /**
- *
- * @see SessionStatus
- */
- public sessionEnd_args setStatus(SessionStatus status) {
- this.status = status;
- return this;
- }
-
- public void unsetStatus() {
- this.status = null;
- }
-
- /** Returns true if field status is set (has been assigned a value) and false otherwise */
- public boolean isSetStatus() {
- return this.status != null;
- }
-
- public void setStatusIsSet(boolean value) {
- if (!value) {
- this.status = null;
- }
- }
-
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case HANDLE:
@@ -3677,14 +4501,6 @@ public void setFieldValue(_Fields field, Object value) {
}
break;
- case STATUS:
- if (value == null) {
- unsetStatus();
- } else {
- setStatus((SessionStatus)value);
- }
- break;
-
}
}
@@ -3693,9 +4509,6 @@ public Object getFieldValue(_Fields field) {
case HANDLE:
return getHandle();
- case STATUS:
- return getStatus();
-
}
throw new IllegalStateException();
}
@@ -3709,8 +4522,6 @@ public boolean isSet(_Fields field) {
switch (field) {
case HANDLE:
return isSetHandle();
- case STATUS:
- return isSetStatus();
}
throw new IllegalStateException();
}
@@ -3719,12 +4530,12 @@ public boolean isSet(_Fields field) {
public boolean equals(Object that) {
if (that == null)
return false;
- if (that instanceof sessionEnd_args)
- return this.equals((sessionEnd_args)that);
+ if (that instanceof sessionHeartbeat_args)
+ return this.equals((sessionHeartbeat_args)that);
return false;
}
- public boolean equals(sessionEnd_args that) {
+ public boolean equals(sessionHeartbeat_args that) {
if (that == null)
return false;
@@ -3737,15 +4548,6 @@ public boolean equals(sessionEnd_args that) {
return false;
}
- boolean this_present_status = true && this.isSetStatus();
- boolean that_present_status = true && that.isSetStatus();
- if (this_present_status || that_present_status) {
- if (!(this_present_status && that_present_status))
- return false;
- if (!this.status.equals(that.status))
- return false;
- }
-
return true;
}
@@ -3754,13 +4556,13 @@ public int hashCode() {
return 0;
}
- public int compareTo(sessionEnd_args other) {
+ public int compareTo(sessionHeartbeat_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
- sessionEnd_args typedOther = (sessionEnd_args)other;
+ sessionHeartbeat_args typedOther = (sessionHeartbeat_args)other;
lastComparison = Boolean.valueOf(isSetHandle()).compareTo(typedOther.isSetHandle());
if (lastComparison != 0) {
@@ -3772,16 +4574,6 @@ public int compareTo(sessionEnd_args other) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetStatus()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
return 0;
}
@@ -3806,13 +4598,6 @@ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.t
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
- case 2: // STATUS
- if (field.type == org.apache.thrift.protocol.TType.I32) {
- this.status = SessionStatus.findByValue(iprot.readI32());
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
@@ -3833,18 +4618,13 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.
oprot.writeString(this.handle);
oprot.writeFieldEnd();
}
- if (this.status != null) {
- oprot.writeFieldBegin(STATUS_FIELD_DESC);
- oprot.writeI32(this.status.getValue());
- oprot.writeFieldEnd();
- }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("sessionEnd_args(");
+ StringBuilder sb = new StringBuilder("sessionHeartbeat_args(");
boolean first = true;
sb.append("handle:");
@@ -3854,14 +4634,6 @@ public String toString() {
sb.append(this.handle);
}
first = false;
- if (!first) sb.append(", ");
- sb.append("status:");
- if (this.status == null) {
- sb.append("null");
- } else {
- sb.append(this.status);
- }
- first = false;
sb.append(")");
return sb.toString();
}
@@ -3888,8 +4660,8 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException
}
- public static class sessionEnd_result implements org.apache.thrift.TBase<sessionEnd_result, sessionEnd_result._Fields>, java.io.Serializable, Cloneable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionEnd_result");
+ public static class sessionHeartbeat_result implements org.apache.thrift.TBase<sessionHeartbeat_result, sessionHeartbeat_result._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionHeartbeat_result");
private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField F_FIELD_DESC = new org.apache.thrift.protocol.TField("f", org.apache.thrift.protocol.TType.STRUCT, (short)2);
@@ -3968,13 +4740,13 @@ public String getFieldName() {
tmpMap.put(_Fields.F, new org.apache.thrift.meta_data.FieldMetaData("f", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sessionEnd_result.class, metaDataMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sessionHeartbeat_result.class, metaDataMap);
}
- public sessionEnd_result() {
+ public sessionHeartbeat_result() {
}
- public sessionEnd_result(
+ public sessionHeartbeat_result(
InvalidSessionHandle e,
SafeModeException f)
{
@@ -3986,7 +4758,7 @@ public sessionEnd_result(
/**
* Performs a deep copy on <i>other</i>.
*/
- public sessionEnd_result(sessionEnd_result other) {
+ public sessionHeartbeat_result(sessionHeartbeat_result other) {
if (other.isSetE()) {
this.e = new InvalidSessionHandle(other.e);
}
@@ -3995,8 +4767,8 @@ public sessionEnd_result(sessionEnd_result other) {
}
}
- public sessionEnd_result deepCopy() {
- return new sessionEnd_result(this);
+ public sessionHeartbeat_result deepCopy() {
+ return new sessionHeartbeat_result(this);
}
@Override
@@ -4009,7 +4781,7 @@ public InvalidSessionHandle getE() {
return this.e;
}
- public sessionEnd_result setE(InvalidSessionHandle e) {
+ public sessionHeartbeat_result setE(InvalidSessionHandle e) {
this.e = e;
return this;
}
@@ -4033,7 +4805,7 @@ public SafeModeException getF() {
return this.f;
}
- public sessionEnd_result setF(SafeModeException f) {
+ public sessionHeartbeat_result setF(SafeModeException f) {
this.f = f;
return this;
}
@@ -4105,12 +4877,12 @@ public boolean isSet(_Fields field) {
public boolean equals(Object that) {
if (that == null)
return false;
- if (that instanceof sessionEnd_result)
- return this.equals((sessionEnd_result)that);
+ if (that instanceof sessionHeartbeat_result)
+ return this.equals((sessionHeartbeat_result)that);
return false;
}
- public boolean equals(sessionEnd_result that) {
+ public boolean equals(sessionHeartbeat_result that) {
if (that == null)
return false;
@@ -4140,13 +4912,13 @@ public int hashCode() {
return 0;
}
- public int compareTo(sessionEnd_result other) {
+ public int compareTo(sessionHeartbeat_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
- sessionEnd_result typedOther = (sessionEnd_result)other;
+ sessionHeartbeat_result typedOther = (sessionHeartbeat_result)other;
lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
if (lastComparison != 0) {
@@ -4230,7 +5002,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("sessionEnd_result(");
+ StringBuilder sb = new StringBuilder("sessionHeartbeat_result(");
boolean first = true;
sb.append("e:");
@@ -4274,16 +5046,19 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException
}
- public static class sessionHeartbeat_args implements org.apache.thrift.TBase<sessionHeartbeat_args, sessionHeartbeat_args._Fields>, java.io.Serializable, Cloneable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionHeartbeat_args");
+ public static class sessionHeartbeatV2_args implements org.apache.thrift.TBase<sessionHeartbeatV2_args, sessionHeartbeatV2_args._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionHeartbeatV2_args");
private static final org.apache.thrift.protocol.TField HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("handle", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField HEARTBEAT_ARGS_FIELD_DESC = new org.apache.thrift.protocol.TField("heartbeatArgs", org.apache.thrift.protocol.TType.STRUCT, (short)2);
public String handle; // required
+ public HeartbeatArgs heartbeatArgs; // 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 {
- HANDLE((short)1, "handle");
+ HANDLE((short)1, "handle"),
+ HEARTBEAT_ARGS((short)2, "heartbeatArgs");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -4300,6 +5075,8 @@ public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // HANDLE
return HANDLE;
+ case 2: // HEARTBEAT_ARGS
+ return HEARTBEAT_ARGS;
default:
return null;
}
@@ -4346,43 +5123,51 @@ public String getFieldName() {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.HANDLE, new org.apache.thrift.meta_data.FieldMetaData("handle", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "SessionHandle")));
+ tmpMap.put(_Fields.HEARTBEAT_ARGS, new org.apache.thrift.meta_data.FieldMetaData("heartbeatArgs", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HeartbeatArgs.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sessionHeartbeat_args.class, metaDataMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sessionHeartbeatV2_args.class, metaDataMap);
}
- public sessionHeartbeat_args() {
+ public sessionHeartbeatV2_args() {
}
- public sessionHeartbeat_args(
- String handle)
+ public sessionHeartbeatV2_args(
+ String handle,
+ HeartbeatArgs heartbeatArgs)
{
this();
this.handle = handle;
+ this.heartbeatArgs = heartbeatArgs;
}
/**
* Performs a deep copy on <i>other</i>.
*/
- public sessionHeartbeat_args(sessionHeartbeat_args other) {
+ public sessionHeartbeatV2_args(sessionHeartbeatV2_args other) {
if (other.isSetHandle()) {
this.handle = other.handle;
}
+ if (other.isSetHeartbeatArgs()) {
+ this.heartbeatArgs = new HeartbeatArgs(other.heartbeatArgs);
+ }
}
- public sessionHeartbeat_args deepCopy() {
- return new sessionHeartbeat_args(this);
+ public sessionHeartbeatV2_args deepCopy() {
+ return new sessionHeartbeatV2_args(this);
}
@Override
public void clear() {
this.handle = null;
+ this.heartbeatArgs = null;
}
public String getHandle() {
return this.handle;
}
- public sessionHeartbeat_args setHandle(String handle) {
+ public sessionHeartbeatV2_args setHandle(String handle) {
this.handle = handle;
return this;
}
@@ -4402,6 +5187,30 @@ public void setHandleIsSet(boolean value) {
}
}
+ public HeartbeatArgs getHeartbeatArgs() {
+ return this.heartbeatArgs;
+ }
+
+ public sessionHeartbeatV2_args setHeartbeatArgs(HeartbeatArgs heartbeatArgs) {
+ this.heartbeatArgs = heartbeatArgs;
+ return this;
+ }
+
+ public void unsetHeartbeatArgs() {
+ this.heartbeatArgs = null;
+ }
+
+ /** Returns true if field heartbeatArgs is set (has been assigned a value) and false otherwise */
+ public boolean isSetHeartbeatArgs() {
+ return this.heartbeatArgs != null;
+ }
+
+ public void setHeartbeatArgsIsSet(boolean value) {
+ if (!value) {
+ this.heartbeatArgs = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case HANDLE:
@@ -4412,6 +5221,14 @@ public void setFieldValue(_Fields field, Object value) {
}
break;
+ case HEARTBEAT_ARGS:
+ if (value == null) {
+ unsetHeartbeatArgs();
+ } else {
+ setHeartbeatArgs((HeartbeatArgs)value);
+ }
+ break;
+
}
}
@@ -4420,6 +5237,9 @@ public Object getFieldValue(_Fields field) {
case HANDLE:
return getHandle();
+ case HEARTBEAT_ARGS:
+ return getHeartbeatArgs();
+
}
throw new IllegalStateException();
}
@@ -4433,6 +5253,8 @@ public boolean isSet(_Fields field) {
switch (field) {
case HANDLE:
return isSetHandle();
+ case HEARTBEAT_ARGS:
+ return isSetHeartbeatArgs();
}
throw new IllegalStateException();
}
@@ -4441,12 +5263,12 @@ public boolean isSet(_Fields field) {
public boolean equals(Object that) {
if (that == null)
return false;
- if (that instanceof sessionHeartbeat_args)
- return this.equals((sessionHeartbeat_args)that);
+ if (that instanceof sessionHeartbeatV2_args)
+ return this.equals((sessionHeartbeatV2_args)that);
return false;
}
- public boolean equals(sessionHeartbeat_args that) {
+ public boolean equals(sessionHeartbeatV2_args that) {
if (that == null)
return false;
@@ -4459,6 +5281,15 @@ public boolean equals(sessionHeartbeat_args that) {
return false;
}
+ boolean this_present_heartbeatArgs = true && this.isSetHeartbeatArgs();
+ boolean that_present_heartbeatArgs = true && that.isSetHeartbeatArgs();
+ if (this_present_heartbeatArgs || that_present_heartbeatArgs) {
+ if (!(this_present_heartbeatArgs && that_present_heartbeatArgs))
+ return false;
+ if (!this.heartbeatArgs.equals(that.heartbeatArgs))
+ return false;
+ }
+
return true;
}
@@ -4467,13 +5298,13 @@ public int hashCode() {
return 0;
}
- public int compareTo(sessionHeartbeat_args other) {
+ public int compareTo(sessionHeartbeatV2_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
- sessionHeartbeat_args typedOther = (sessionHeartbeat_args)other;
+ sessionHeartbeatV2_args typedOther = (sessionHeartbeatV2_args)other;
lastComparison = Boolean.valueOf(isSetHandle()).compareTo(typedOther.isSetHandle());
if (lastComparison != 0) {
@@ -4485,6 +5316,16 @@ public int compareTo(sessionHeartbeat_args other) {
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetHeartbeatArgs()).compareTo(typedOther.isSetHeartbeatArgs());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetHeartbeatArgs()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.heartbeatArgs, typedOther.heartbeatArgs);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -4509,6 +5350,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.t
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
break;
+ case 2: // HEARTBEAT_ARGS
+ if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
+ this.heartbeatArgs = new HeartbeatArgs();
+ this.heartbeatArgs.read(iprot);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
@@ -4529,13 +5378,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.
oprot.writeString(this.handle);
oprot.writeFieldEnd();
}
+ if (this.heartbeatArgs != null) {
+ oprot.writeFieldBegin(HEARTBEAT_ARGS_FIELD_DESC);
+ this.heartbeatArgs.write(oprot);
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("sessionHeartbeat_args(");
+ StringBuilder sb = new StringBuilder("sessionHeartbeatV2_args(");
boolean first = true;
sb.append("handle:");
@@ -4545,6 +5399,14 @@ public String toString() {
sb.append(this.handle);
}
first = false;
+ if (!first) sb.append(", ");
+ sb.append("heartbeatArgs:");
+ if (this.heartbeatArgs == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.heartbeatArgs);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -4571,8 +5433,8 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException
}
- public static class sessionHeartbeat_result implements org.apache.thrift.TBase<sessionHeartbeat_result, sessionHeartbeat_result._Fields>, java.io.Serializable, Cloneable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionHeartbeat_result");
+ public static class sessionHeartbeatV2_result implements org.apache.thrift.TBase<sessionHeartbeatV2_result, sessionHeartbeatV2_result._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sessionHeartbeatV2_result");
private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField F_FIELD_DESC = new org.apache.thrift.protocol.TField("f", org.apache.thrift.protocol.TType.STRUCT, (short)2);
@@ -4651,13 +5513,13 @@ public String getFieldName() {
tmpMap.put(_Fields.F, new org.apache.thrift.meta_data.FieldMetaData("f", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sessionHeartbeat_result.class, metaDataMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sessionHeartbeatV2_result.class, metaDataMap);
}
- public sessionHeartbeat_result() {
+ public sessionHeartbeatV2_result() {
}
- public sessionHeartbeat_result(
+ public sessionHeartbeatV2_result(
InvalidSessionHandle e,
SafeModeException f)
{
@@ -4669,7 +5531,7 @@ public sessionHeartbeat_result(
/**
* Performs a deep copy on <i>other</i>.
*/
- public sessionHeartbeat_result(sessionHeartbeat_result other) {
+ public sessionHeartbeatV2_result(sessionHeartbeatV2_result other) {
if (other.isSetE()) {
this.e = new InvalidSessionHandle(other.e);
}
@@ -4678,8 +5540,8 @@ public sessionHeartbeat_result(sessionHeartbeat_result other) {
}
}
- public sessionHeartbeat_result deepCopy() {
- return new sessionHeartbeat_result(this);
+ public sessionHeartbeatV2_result deepCopy() {
+ return new sessionHeartbeatV2_result(this);
}
@Override
@@ -4692,7 +5554,7 @@ public InvalidSessionHandle getE() {
return this.e;
}
- public sessionHeartbeat_result setE(InvalidSessionHandle e) {
+ public sessionHeartbeatV2_result setE(InvalidSessionHandle e) {
this.e = e;
return this;
}
@@ -4716,7 +5578,7 @@ public SafeModeException getF() {
return this.f;
}
- public sessionHeartbeat_result setF(SafeModeException f) {
+ public sessionHeartbeatV2_result setF(SafeModeException f) {
this.f = f;
return this;
}
@@ -4788,12 +5650,12 @@ public boolean isSet(_Fields field) {
public boolean equals(Object that) {
if (that == null)
return false;
- if (that instanceof sessionHeartbeat_result)
- return this.equals((sessionHeartbeat_result)that);
+ if (that instanceof sessionHeartbeatV2_result)
+ return this.equals((sessionHeartbeatV2_result)that);
return false;
}
- public boolean equals(sessionHeartbeat_result that) {
+ public boolean equals(sessionHeartbeatV2_result that) {
if (that == null)
return false;
@@ -4823,13 +5685,13 @@ public int hashCode() {
return 0;
}
- public int compareTo(sessionHeartbeat_result other) {
+ public int compareTo(sessionHeartbeatV2_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
- sessionHeartbeat_result typedOther = (sessionHeartbeat_result)other;
+ sessionHeartbeatV2_result typedOther = (sessionHeartbeatV2_result)other;
lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE());
if (lastComparison != 0) {
@@ -4913,7 +5775,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("sessionHeartbeat_result(");
+ StringBuilder sb = new StringBuilder("sessionHeartbeatV2_result(");
boolean first = true;
sb.append("e:");
@@ -10499,8 +11361,6 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bit_vector = new BitSet(1);
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);
@@ -10999,8 +11859,6 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bit_vector = new BitSet(1);
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);
2  src/contrib/corona/src/gen-java/org/apache/hadoop/corona/CoronaProxyJobTrackerService.java
View
@@ -1223,8 +1223,6 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bit_vector = new BitSet(1);
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);
411 src/contrib/corona/src/gen-java/org/apache/hadoop/corona/HeartbeatArgs.java
View
@@ -0,0 +1,411 @@
+/**
+ * Autogenerated by Thrift Compiler (0.7.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ */
+package org.apache.hadoop.corona;
+
+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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HeartbeatArgs implements org.apache.thrift.TBase<HeartbeatArgs, HeartbeatArgs._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HeartbeatArgs");
+
+ private static final org.apache.thrift.protocol.TField REQUEST_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("requestId", org.apache.thrift.protocol.TType.I32, (short)1);
+ private static final org.apache.thrift.protocol.TField GRANT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("grantId", org.apache.thrift.protocol.TType.I32, (short)2);
+
+ public int requestId; // required
+ public int grantId; // 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 {
+ REQUEST_ID((short)1, "requestId"),
+ GRANT_ID((short)2, "grantId");
+
+ 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: // REQUEST_ID
+ return REQUEST_ID;
+ case 2: // GRANT_ID
+ return GRANT_ID;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ private static final int __REQUESTID_ISSET_ID = 0;
+ private static final int __GRANTID_ISSET_ID = 1;
+ private BitSet __isset_bit_vector = new BitSet(2);
+
+ 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.REQUEST_ID, new org.apache.thrift.meta_data.FieldMetaData("requestId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "ResourceRequestId")));
+ tmpMap.put(_Fields.GRANT_ID, new org.apache.thrift.meta_data.FieldMetaData("grantId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "ResourceRequestId")));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HeartbeatArgs.class, metaDataMap);
+ }
+
+ public HeartbeatArgs() {
+ }
+
+ public HeartbeatArgs(
+ int requestId,
+ int grantId)
+ {
+ this();
+ this.requestId = requestId;
+ setRequestIdIsSet(true);
+ this.grantId = grantId;
+ setGrantIdIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public HeartbeatArgs(HeartbeatArgs other) {
+ __isset_bit_vector.clear();
+ __isset_bit_vector.or(other.__isset_bit_vector);
+ this.requestId = other.requestId;
+ this.grantId = other.grantId;
+ }
+
+ public HeartbeatArgs deepCopy() {
+ return new HeartbeatArgs(this);
+ }
+
+ @Override
+ public void clear() {
+ setRequestIdIsSet(false);
+ this.requestId = 0;
+ setGrantIdIsSet(false);
+ this.grantId = 0;
+ }
+
+ public int getRequestId() {
+ return this.requestId;
+ }
+
+ public HeartbeatArgs setRequestId(int requestId) {
+ this.requestId = requestId;
+ setRequestIdIsSet(true);
+ return this;
+ }
+
+ public void unsetRequestId() {
+ __isset_bit_vector.clear(__REQUESTID_ISSET_ID);
+ }
+
+ /** Returns true if field requestId is set (has been assigned a value) and false otherwise */
+ public boolean isSetRequestId() {
+ return __isset_bit_vector.get(__REQUESTID_ISSET_ID);
+ }
+
+ public void setRequestIdIsSet(boolean value) {
+ __isset_bit_vector.set(__REQUESTID_ISSET_ID, value);
+ }
+
+ public int getGrantId() {
+ return this.grantId;
+ }
+
+ public HeartbeatArgs setGrantId(int grantId) {
+ this.grantId = grantId;
+ setGrantIdIsSet(true);
+ return this;
+ }
+
+ public void unsetGrantId() {
+ __isset_bit_vector.clear(__GRANTID_ISSET_ID);
+ }
+
+ /** Returns true if field grantId is set (has been assigned a value) and false otherwise */
+ public boolean isSetGrantId() {
+ return __isset_bit_vector.get(__GRANTID_ISSET_ID);
+ }
+
+ public void setGrantIdIsSet(boolean value) {
+ __isset_bit_vector.set(__GRANTID_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case REQUEST_ID:
+ if (value == null) {
+ unsetRequestId();
+ } else {
+ setRequestId((Integer)value);
+ }
+ break;
+
+ case GRANT_ID:
+ if (value == null) {
+ unsetGrantId();
+ } else {
+ setGrantId((Integer)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case REQUEST_ID:
+ return Integer.valueOf(getRequestId());
+
+ case GRANT_ID:
+ return Integer.valueOf(getGrantId());
+
+ }
+ 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 REQUEST_ID:
+ return isSetRequestId();
+ case GRANT_ID:
+ return isSetGrantId();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof HeartbeatArgs)
+ return this.equals((HeartbeatArgs)that);
+ return false;
+ }
+
+ public boolean equals(HeartbeatArgs that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_requestId = true;
+ boolean that_present_requestId = true;
+ if (this_present_requestId || that_present_requestId) {
+ if (!(this_present_requestId && that_present_requestId))
+ return false;
+ if (this.requestId != that.requestId)
+ return false;
+ }
+
+ boolean this_present_grantId = true;
+ boolean that_present_grantId = true;
+ if (this_present_grantId || that_present_grantId) {
+ if (!(this_present_grantId && that_present_grantId))
+ return false;
+ if (this.grantId != that.grantId)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(HeartbeatArgs other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ HeartbeatArgs typedOther = (HeartbeatArgs)other;
+
+ lastComparison = Boolean.valueOf(isSetRequestId()).compareTo(typedOther.isSetRequestId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRequestId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestId, typedOther.requestId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetGrantId()).compareTo(typedOther.isSetGrantId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetGrantId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.grantId, typedOther.grantId);
+ 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 {
+ org.apache.thrift.protocol.TField field;
+ iprot.readStructBegin();
+ while (true)
+ {
+ field = iprot.readFieldBegin();
+ if (field.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (field.id) {
+ case 1: // REQUEST_ID
+ if (field.type == org.apache.thrift.protocol.TType.I32) {
+ this.requestId = iprot.readI32();
+ setRequestIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // GRANT_ID
+ if (field.type == org.apache.thrift.protocol.TType.I32) {
+ this.grantId = iprot.readI32();
+ setGrantIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ if (!isSetRequestId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'requestId' was not found in serialized data! Struct: " + toString());
+ }
+ if (!isSetGrantId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'grantId' was not found in serialized data! Struct: " + toString());
+ }
+ validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldBegin(REQUEST_ID_FIELD_DESC);
+ oprot.writeI32(this.requestId);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(GRANT_ID_FIELD_DESC);
+ oprot.writeI32(this.grantId);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("HeartbeatArgs(");
+ boolean first = true;
+
+ sb.append("requestId:");
+ sb.append(this.requestId);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("grantId:");
+ sb.append(this.grantId);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // alas, we cannot check 'requestId' because it's a primitive and you chose the non-beans generator.
+ // alas, we cannot check 'grantId' because it's a primitive and you chose the non-beans generator.
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bit_vector = new BitSet(1);
+ 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);
+ }
+ }
+
+}
+
16 src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java
View
@@ -340,6 +340,21 @@ public void sessionHeartbeat(String handle) throws TException,
}
}
+ @Override
+ public void sessionHeartbeatV2(String handle, HeartbeatArgs jtInfo) throws TException,
+ InvalidSessionHandle, SafeModeException {
+ checkSafeMode("sessionHeartbeatV2");
+ try {
+ Session session = sessionManager.getSession(handle);
+ if (!session.checkHeartbeatInfo(jtInfo)) {
+ sessionEnd(session.getSessionId(), SessionStatus.FAILED_JOBTRACKER);
+ }
+ sessionManager.heartbeat(handle);
+ } catch (RuntimeException e) {
+ throw new TApplicationException(e.getMessage());
+ }
+ }
+
/**
* Check all the resource requests and ensure that they are legal.
*
@@ -391,6 +406,7 @@ public void requestResource(String handle, List<ResourceRequest> requestList)
throw new TApplicationException("Requesting excluded hosts");
}
sessionManager.heartbeat(handle);
+ sessionManager.getSession(handle).setResourceRequest(requestList);
List<ResourceRequestInfo> reqInfoList =
new ArrayList<ResourceRequestInfo>(requestList.size());
for (ResourceRequest request : requestList) {
8 src/contrib/corona/src/java/org/apache/hadoop/corona/CoronaConf.java
View
@@ -172,6 +172,10 @@
public static final String POOLS_CONFIG_DOCUMENT_GENERATOR_PROPERTY =
"cm.pools.config.document.generator";
+ /** The max time CM will wait for JT heartbeat to be in sync */
+ public static final String CM_HEARTBEAT_DELAY_MAX =
+ "cm.heartbeat.delay.max";
+
private Map<Integer, Map<ResourceType, Integer>>
cachedCpuToResourcePartitioning = null;
@@ -504,4 +508,8 @@ public long getConfigReloadPeriodMs() {
public Class<?> getPoolsConfigDocumentGeneratorClass() {
return getClass(POOLS_CONFIG_DOCUMENT_GENERATOR_PROPERTY, null);
}
+
+ public long getCMHeartbeatDelayMax() {
+ return getLong(CM_HEARTBEAT_DELAY_MAX, 600000);
+ }
}
118 src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java
View
@@ -72,6 +72,20 @@
private final long startTime;
/** Last time a heartbeat occurred */
private long lastHeartbeatTime;
+ /** expected heartbeat info to sync with JT, inclduing the last resource requestId
+ * from JT and the last grantId to JT */
+ private HeartbeatArgs expectedInfo;
+ /** the last time when heartbeat info from JT matches CM's
+ * or is different from its own previous one
+ */
+ private long lastSyncTime;
+ /** If the heartbeat infos between CM and JT mismatch, this is the last heartbeat
+ * from JT
+ */
+ private HeartbeatArgs lastHeartbeat;
+ /** The max time for CM to wait for JT to catch up */
+ private final long maxDelay;
+
/**
* Pool info (after possible redirection), info has the original pool info
* strings.
@@ -104,13 +118,21 @@
* @param id Should be a unique id
* @param info Information about the session
*/
- public Session(String id, SessionInfo info, ConfigManager configManager) {
+ public Session(long maxDelay, String id, SessionInfo info, ConfigManager configManager) {
+ this.maxDelay = maxDelay;
this.sessionId = id;
this.info = info;
PoolInfo tmpPoolInfo = PoolInfo.createPoolInfo(info.getPoolInfoStrings());
poolInfo = configManager.getRedirect(tmpPoolInfo);
this.startTime = ClusterManager.clock.getTime();
this.lastHeartbeatTime = startTime;
+ this.expectedInfo = new HeartbeatArgs();
+ this.expectedInfo.requestId = 0;
+ this.expectedInfo.grantId = 0;
+ this.lastSyncTime = System.currentTimeMillis();
+ this.lastHeartbeat = new HeartbeatArgs();
+ this.lastHeartbeat.requestId = 0;
+ this.lastHeartbeat.grantId = 0;
}
/**
@@ -121,7 +143,8 @@ public Session(String id, SessionInfo info, ConfigManager configManager) {
* read the JSON
* @throws IOException
*/
- public Session(CoronaSerializer coronaSerializer) throws IOException {
+ public Session(long maxDelay, CoronaSerializer coronaSerializer) throws IOException {
+ this.maxDelay = maxDelay;
// Expecting the START_OBJECT token for Session
coronaSerializer.readStartObjectToken("Session");
@@ -145,6 +168,8 @@ public Session(CoronaSerializer coronaSerializer) throws IOException {
coronaSerializer.readField("info");
this.info = coronaSerializer.readValueAs(SessionInfo.class);
+
+
coronaSerializer.readField("startTime");
this.startTime = coronaSerializer.readValueAs(Long.class);
@@ -153,6 +178,25 @@ public Session(CoronaSerializer coronaSerializer) throws IOException {
this.poolInfo = new PoolInfo(coronaSerializer);
readTypeToFirstWait(coronaSerializer);
+ try {
+ coronaSerializer.readField("expectedInfo");
+ this.expectedInfo = coronaSerializer.readValueAs(HeartbeatArgs.class);
+
+ coronaSerializer.readField("lastHeartbeat");
+ this.lastHeartbeat= coronaSerializer.readValueAs(HeartbeatArgs