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; }
public io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest buildPartial() { io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest result = new io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest(this); if (streamInfoBuilder_ == null) { result.streamInfo_ = streamInfo_; } else { result.streamInfo_ = streamInfoBuilder_.build(); } result.epoch_ = epoch_; onBuilt(); return result; }
break; default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
final Controller.ScaleStatusRequest scalestatusRequest = Controller.ScaleStatusRequest.newBuilder() .setStreamInfo(ModelHelper.createStreamInfo(SCOPE1, STREAM1)) .setEpoch(scaleResponse.getEpoch())
final CompletableFuture<ScaleStatusResponse> result = this.retryConfig.runAsync(() -> { RPCAsyncCallback<ScaleStatusResponse> callback = new RPCAsyncCallback<>(traceId, "checkScale"); client.checkScale(ScaleStatusRequest.newBuilder() .setStreamInfo(ModelHelper.createStreamInfo(stream.getScope(), stream.getStreamName())) .setEpoch(scaleEpoch)
@io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "checkScale", requestType = io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest.class, responseType = io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor<io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest, io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusResponse> getCheckScaleMethod() { io.grpc.MethodDescriptor<io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest, io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusResponse> getCheckScaleMethod; if ((getCheckScaleMethod = ControllerServiceGrpc.getCheckScaleMethod) == null) { synchronized (ControllerServiceGrpc.class) { if ((getCheckScaleMethod = ControllerServiceGrpc.getCheckScaleMethod) == null) { ControllerServiceGrpc.getCheckScaleMethod = getCheckScaleMethod = io.grpc.MethodDescriptor.<io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest, io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusResponse>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName( "io.pravega.controller.stream.api.grpc.v1.ControllerService", "checkScale")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusResponse.getDefaultInstance())) .setSchemaDescriptor(new ControllerServiceMethodDescriptorSupplier("checkScale")) .build(); } } } return getCheckScaleMethod; }
@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 newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest getDefaultInstanceForType() { return io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest.getDefaultInstance(); }
/** * <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(); }
public io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest build() { io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
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); }
@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()); } }
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) { 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); }