private void handleResponse(ResponseEvent response) { TSOProto.Response resp = response.getParam(); if (resp.hasTimestampResponse()) { if (timestampRequests.size() == 0) { LOG.debug("Received timestamp response when no requests outstanding"); return; } RequestAndTimeout e = timestampRequests.remove(); e.getRequest().success(resp.getTimestampResponse().getStartTimestamp()); if (e.getTimeout() != null) { e.getTimeout().cancel(); } } else if (resp.hasCommitResponse()) { long startTimestamp = resp.getCommitResponse().getStartTimestamp(); RequestAndTimeout e = commitRequests.remove(startTimestamp); if (e == null) { LOG.debug("Received commit response for request that doesn't exist. Start TS: {}", startTimestamp); return; } if (e.getTimeout() != null) { e.getTimeout().cancel(); } if (resp.getCommitResponse().getAborted()) { e.getRequest().error(new AbortException()); } else { e.getRequest().success(resp.getCommitResponse().getCommitTimestamp()); } } }
e.getRequest().error(new AbortException()); } else { e.getRequest().success(resp.getCommitResponse().getCommitTimestamp());
public Builder mergeFrom(org.apache.omid.proto.TSOProto.CommitResponse other) { if (other == org.apache.omid.proto.TSOProto.CommitResponse.getDefaultInstance()) return this; if (other.hasAborted()) { setAborted(other.getAborted()); } if (other.hasStartTimestamp()) { setStartTimestamp(other.getStartTimestamp()); } if (other.hasCommitTimestamp()) { setCommitTimestamp(other.getCommitTimestamp()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }