/** * <code>optional .CommitResponse commitResponse = 2;</code> */ public Builder mergeCommitResponse(org.apache.omid.proto.TSOProto.CommitResponse value) { if (commitResponseBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && commitResponse_ != org.apache.omid.proto.TSOProto.CommitResponse.getDefaultInstance()) { commitResponse_ = org.apache.omid.proto.TSOProto.CommitResponse.newBuilder(commitResponse_).mergeFrom(value).buildPartial(); } else { commitResponse_ = value; } onChanged(); } else { commitResponseBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /**
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()); } } }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBool(1, aborted_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeInt64(2, startTimestamp_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeInt64(3, commitTimestamp_); } getUnknownFields().writeTo(output); }
long startTimestamp = resp.getCommitResponse().getStartTimestamp(); RequestAndTimeout e = commitRequests.remove(startTimestamp); if (e == null) { e.getTimeout().cancel(); if (resp.getCommitResponse().getAborted()) { e.getRequest().error(new AbortException()); } else { e.getRequest().success(resp.getCommitResponse().getCommitTimestamp());
public Builder clear() { super.clear(); if (timestampResponseBuilder_ == null) { timestampResponse_ = org.apache.omid.proto.TSOProto.TimestampResponse.getDefaultInstance(); } else { timestampResponseBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); if (commitResponseBuilder_ == null) { commitResponse_ = org.apache.omid.proto.TSOProto.CommitResponse.getDefaultInstance(); } else { commitResponseBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); if (handshakeResponseBuilder_ == null) { handshakeResponse_ = org.apache.omid.proto.TSOProto.HandshakeResponse.getDefaultInstance(); } else { handshakeResponseBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); if (fenceResponseBuilder_ == null) { fenceResponse_ = org.apache.omid.proto.TSOProto.FenceResponse.getDefaultInstance(); } else { fenceResponseBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); return this; }
public org.apache.omid.proto.TSOProto.CommitResponse buildPartial() { org.apache.omid.proto.TSOProto.CommitResponse result = new org.apache.omid.proto.TSOProto.CommitResponse(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.aborted_ = aborted_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.startTimestamp_ = startTimestamp_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.commitTimestamp_ = commitTimestamp_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.omid.proto.TSOProto.CommitResponse prototype) {
public Builder toBuilder() { return newBuilder(this); }
public org.apache.omid.proto.TSOProto.CommitResponse getDefaultInstanceForType() { return org.apache.omid.proto.TSOProto.CommitResponse.getDefaultInstance(); }
/** * <code>optional .CommitResponse commitResponse = 2;</code> */ public Builder clearCommitResponse() { if (commitResponseBuilder_ == null) { commitResponse_ = org.apache.omid.proto.TSOProto.CommitResponse.getDefaultInstance(); onChanged(); } else { commitResponseBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); return this; } /**
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; }
public static Builder newBuilder(org.apache.omid.proto.TSOProto.CommitResponse prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
@Override public void sendAbortResponse(long startTimestamp, Channel c, MonitoringContext monCtx) { TSOProto.Response.Builder builder = TSOProto.Response.newBuilder(); TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder(); commitBuilder.setAborted(true); commitBuilder.setStartTimestamp(startTimestamp); builder.setCommitResponse(commitBuilder.build()); c.write(builder.build()); abortMeter.mark(); monCtx.timerStop("reply.processor.abort.latency"); }
@Override public void sendAbortResponse(long startTimestamp, Channel c) { TSOProto.Response.Builder builder = TSOProto.Response.newBuilder(); TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder(); commitBuilder.setAborted(true); commitBuilder.setStartTimestamp(startTimestamp); builder.setCommitResponse(commitBuilder.build()); c.write(builder.build()); }
@Override public void sendCommitResponse(long startTimestamp, long commitTimestamp, Channel c) { TSOProto.Response.Builder builder = TSOProto.Response.newBuilder(); TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder(); commitBuilder.setAborted(false) .setStartTimestamp(startTimestamp) .setCommitTimestamp(commitTimestamp); builder.setCommitResponse(commitBuilder.build()); c.write(builder.build()); }
@Override public void sendAbortResponse(long startTimestamp, Channel c) { TSOProto.Response.Builder builder = TSOProto.Response.newBuilder(); TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder(); commitBuilder.setAborted(true); commitBuilder.setStartTimestamp(startTimestamp); builder.setCommitResponse(commitBuilder.build()); c.write(builder.build()); abortMeter.mark(); }
@Override public void sendCommitResponse(long startTimestamp, long commitTimestamp, Channel c) { TSOProto.Response.Builder builder = TSOProto.Response.newBuilder(); TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder(); commitBuilder.setAborted(false) .setStartTimestamp(startTimestamp) .setCommitTimestamp(commitTimestamp); builder.setCommitResponse(commitBuilder.build()); c.write(builder.build()); commitMeter.mark(); }
private void initFields() { timestampResponse_ = org.apache.omid.proto.TSOProto.TimestampResponse.getDefaultInstance(); commitResponse_ = org.apache.omid.proto.TSOProto.CommitResponse.getDefaultInstance(); handshakeResponse_ = org.apache.omid.proto.TSOProto.HandshakeResponse.getDefaultInstance(); fenceResponse_ = org.apache.omid.proto.TSOProto.FenceResponse.getDefaultInstance(); } private byte memoizedIsInitialized = -1;
@Override public void sendCommitResponse(long startTimestamp, long commitTimestamp, Channel c, MonitoringContext monCtx) { TSOProto.Response.Builder builder = TSOProto.Response.newBuilder(); TSOProto.CommitResponse.Builder commitBuilder = TSOProto.CommitResponse.newBuilder(); commitBuilder.setAborted(false) .setStartTimestamp(startTimestamp) .setCommitTimestamp(commitTimestamp); builder.setCommitResponse(commitBuilder.build()); c.write(builder.build()); commitMeter.mark(); monCtx.timerStop("reply.processor.commit.latency"); }