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.getTimeout().cancel(); } else if (resp.hasCommitResponse()) { long startTimestamp = resp.getCommitResponse().getStartTimestamp(); RequestAndTimeout e = commitRequests.remove(startTimestamp);
public Builder mergeFrom(org.apache.omid.proto.TSOProto.Response other) { if (other == org.apache.omid.proto.TSOProto.Response.getDefaultInstance()) return this; if (other.hasTimestampResponse()) { mergeTimestampResponse(other.getTimestampResponse()); } if (other.hasCommitResponse()) { mergeCommitResponse(other.getCommitResponse()); } if (other.hasHandshakeResponse()) { mergeHandshakeResponse(other.getHandshakeResponse()); } if (other.hasFenceResponse()) { mergeFenceResponse(other.getFenceResponse()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }