public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (streamInfo_ != null) { output.writeMessage(1, getStreamInfo()); } if (txnId_ != null) { output.writeMessage(2, getTxnId()); } if (lease_ != 0L) { output.writeInt64(3, lease_); } unknownFields.writeTo(output); }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (streamInfo_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getStreamInfo()); } if (txnId_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getTxnId()); } if (lease_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(3, lease_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasStreamInfo()) { hash = (37 * hash) + STREAMINFO_FIELD_NUMBER; hash = (53 * hash) + getStreamInfo().hashCode(); } if (hasTxnId()) { hash = (37 * hash) + TXNID_FIELD_NUMBER; hash = (53 * hash) + getTxnId().hashCode(); } hash = (37 * hash) + LEASE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getLease()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.pravega.controller.stream.api.grpc.v1.Controller.PingTxnRequest)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.PingTxnRequest other = (io.pravega.controller.stream.api.grpc.v1.Controller.PingTxnRequest) obj; boolean result = true; result = result && (hasStreamInfo() == other.hasStreamInfo()); if (hasStreamInfo()) { result = result && getStreamInfo() .equals(other.getStreamInfo()); } result = result && (hasTxnId() == other.hasTxnId()); if (hasTxnId()) { result = result && getTxnId() .equals(other.getTxnId()); } result = result && (getLease() == other.getLease()); result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(io.pravega.controller.stream.api.grpc.v1.Controller.PingTxnRequest other) { if (other == io.pravega.controller.stream.api.grpc.v1.Controller.PingTxnRequest.getDefaultInstance()) return this; if (other.hasStreamInfo()) { mergeStreamInfo(other.getStreamInfo()); } if (other.hasTxnId()) { mergeTxnId(other.getTxnId()); } if (other.getLease() != 0L) { setLease(other.getLease()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Override public void pingTransaction(PingTxnRequest request, StreamObserver<PingTxnStatus> responseObserver) { log.info("pingTransaction called for stream {}/{}, txnId={}", request.getStreamInfo().getScope(), request.getStreamInfo().getStream(), request.getTxnId()); authenticateExecuteAndProcessResults(() -> this.authHelper.checkAuthorization(request.getStreamInfo().getScope() + "/" + request.getStreamInfo().getStream(), AuthHandler.Permissions.READ), delegationToken -> controllerService.pingTransaction(request.getStreamInfo().getScope(), request.getStreamInfo().getStream(), request.getTxnId(), request.getLease()), responseObserver); }
@Override public void pingTransaction(PingTxnRequest request, StreamObserver<PingTxnStatus> responseObserver) { if (request.getStreamInfo().getStream().equals("stream1")) { responseObserver.onNext(PingTxnStatus.newBuilder().setStatus(PingTxnStatus.Status.OK).build()); responseObserver.onCompleted(); } else { responseObserver.onError(Status.INTERNAL.withDescription("Server error").asRuntimeException()); } }
/** * <code>.io.pravega.controller.stream.api.grpc.v1.StreamInfo streamInfo = 1;</code> */ public io.pravega.controller.stream.api.grpc.v1.Controller.StreamInfoOrBuilder getStreamInfoOrBuilder() { return getStreamInfo(); }