public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (streamInfo_ != null) { output.writeMessage(1, getStreamInfo()); } if (epoch_ != 0) { output.writeInt32(2, epoch_); } 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 (epoch_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(2, epoch_); } 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(); } hash = (37 * hash) + EPOCH_FIELD_NUMBER; hash = (53 * hash) + getEpoch(); 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.ScaleStatusRequest)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest other = (io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest) obj; boolean result = true; result = result && (hasStreamInfo() == other.hasStreamInfo()); if (hasStreamInfo()) { result = result && getStreamInfo() .equals(other.getStreamInfo()); } result = result && (getEpoch() == other.getEpoch()); result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest other) { if (other == io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest.getDefaultInstance()) return this; if (other.hasStreamInfo()) { mergeStreamInfo(other.getStreamInfo()); } if (other.getEpoch() != 0) { setEpoch(other.getEpoch()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Override public void checkScale(ScaleStatusRequest request, StreamObserver<ScaleStatusResponse> responseObserver) { if (request.getStreamInfo().getStream().equals("stream1")) { responseObserver.onNext(ScaleStatusResponse.newBuilder() .setStatus(ScaleStatusResponse.ScaleStatus.SUCCESS).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(); }
@Override public void checkScale(ScaleStatusRequest request, StreamObserver<ScaleStatusResponse> responseObserver) { log.debug("check scale status called for stream {}/{}.", request.getStreamInfo().getScope(), request.getStreamInfo().getStream()); authenticateExecuteAndProcessResults(() -> this.authHelper.checkAuthorization(request.getStreamInfo().getScope() + "/" + request.getStreamInfo().getStream(), AuthHandler.Permissions.READ_UPDATE), delegationToken -> controllerService.checkScale(request.getStreamInfo().getScope(), request.getStreamInfo().getStream(), request.getEpoch()), responseObserver); }