@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.StreamInfo)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.StreamInfo other = (io.pravega.controller.stream.api.grpc.v1.Controller.StreamInfo) obj; boolean result = true; result = result && getScope() .equals(other.getScope()); result = result && getStream() .equals(other.getStream()); result = result && unknownFields.equals(other.unknownFields); return result; }
@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.ScaleRequest)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.ScaleRequest other = (io.pravega.controller.stream.api.grpc.v1.Controller.ScaleRequest) obj; boolean result = true; result = result && (hasStreamInfo() == other.hasStreamInfo()); if (hasStreamInfo()) { result = result && getStreamInfo() .equals(other.getStreamInfo()); } result = result && getSealedSegmentsList() .equals(other.getSealedSegmentsList()); result = result && getNewKeyRangesList() .equals(other.getNewKeyRangesList()); result = result && (getScaleTimestamp() == other.getScaleTimestamp()); result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(io.pravega.controller.stream.api.grpc.v1.Controller.StreamInfo other) { if (other == io.pravega.controller.stream.api.grpc.v1.Controller.StreamInfo.getDefaultInstance()) return this; if (!other.getScope().isEmpty()) { scope_ = other.scope_; onChanged(); } if (!other.getStream().isEmpty()) { stream_ = other.stream_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
List<Long> segmentIds) throws ExecutionException, InterruptedException { Controller.StreamCutRange.Builder rangeBuilder = Controller.StreamCutRange.newBuilder().setStreamInfo( Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); Controller.StreamCutRange streamCutRange; streamCutRange = rangeBuilder.putAllFrom(streamCut01).putAllTo(Collections.emptyMap()).build(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(streamCut023).putAllTo(Collections.emptyMap()).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(streamCut423).putAllTo(Collections.emptyMap()).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(streamCut56).putAllTo(Collections.emptyMap()).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(streamCut41).putAllTo(Collections.emptyMap()).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(streamCut06).putAllTo(Collections.emptyMap()).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get();
List<Long> segmentIds) throws InterruptedException, java.util.concurrent.ExecutionException { Controller.StreamCutRange.Builder rangeBuilder = Controller.StreamCutRange.newBuilder().setStreamInfo( Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); Controller.StreamCutRange streamCutRange; streamCutRange = rangeBuilder.putAllFrom(Collections.emptyMap()).putAllTo(streamCut01).build(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(Collections.emptyMap()).putAllTo(streamCut023).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(Collections.emptyMap()).putAllTo(streamCut423).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(Collections.emptyMap()).putAllTo(streamCut56).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(Collections.emptyMap()).putAllTo(streamCut41).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(Collections.emptyMap()).putAllTo(streamCut06).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get();
List<Long> segmentIds) throws ExecutionException, InterruptedException { Controller.StreamCutRange.Builder rangeBuilder = Controller.StreamCutRange.newBuilder().setStreamInfo( Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); Controller.StreamCutRange streamCutRange; streamCutRange = rangeBuilder.putAllFrom(streamCut01).putAllTo(streamCut023).build(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(streamCut01).putAllTo(streamCut423).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(streamCut01).putAllTo(streamCut06).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(streamCut41).putAllTo(streamCut56).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get(); Controller.StreamInfo.newBuilder().setScope(SCOPE).setStream(STREAM).build()); streamCutRange = rangeBuilder.putAllFrom(streamCut01).putAllTo(streamCut06).build(); segments = consumer.getSegmentsBetweenStreamCuts(streamCutRange).get();
StreamInfo streamInfo = StreamInfo.newBuilder() .setScope(SCOPE1) .setStream(STREAM1)
@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.StreamConfig)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.StreamConfig other = (io.pravega.controller.stream.api.grpc.v1.Controller.StreamConfig) obj; boolean result = true; result = result && (hasStreamInfo() == other.hasStreamInfo()); if (hasStreamInfo()) { result = result && getStreamInfo() .equals(other.getStreamInfo()); } result = result && (hasScalingPolicy() == other.hasScalingPolicy()); if (hasScalingPolicy()) { result = result && getScalingPolicy() .equals(other.getScalingPolicy()); } result = result && (hasRetentionPolicy() == other.hasRetentionPolicy()); if (hasRetentionPolicy()) { result = result && getRetentionPolicy() .equals(other.getRetentionPolicy()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@Test public void truncateStreamTests() { CreateScopeStatus createScopeStatus; CreateStreamStatus createStreamStatus; final StreamConfiguration configuration1 = StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(4)).build(); // Create a test scope. ResultObserver<CreateScopeStatus> result1 = new ResultObserver<>(); this.controllerService.createScope(ModelHelper.createScopeInfo(SCOPE1), result1); createScopeStatus = result1.get(); assertEquals("Create Scope", CreateScopeStatus.Status.SUCCESS, createScopeStatus.getStatus()); // Create a test stream. ResultObserver<CreateStreamStatus> result2 = new ResultObserver<>(); this.controllerService.createStream(ModelHelper.decode(SCOPE1, STREAM1, configuration1), result2); createStreamStatus = result2.get(); assertEquals("Create stream", CreateStreamStatus.Status.SUCCESS, createStreamStatus.getStatus()); //Truncate the stream ResultObserver<UpdateStreamStatus> result3 = new ResultObserver<>(); this.controllerService.truncateStream(Controller.StreamCut.newBuilder() .setStreamInfo(StreamInfo.newBuilder() .setScope(SCOPE1) .setStream(STREAM1) .build()) .putCut(0, 0).putCut(1, 0).putCut(2, 0).putCut(3, 0).build(), result3); UpdateStreamStatus truncateStreamStatus = result3.get(); assertEquals(UpdateStreamStatus.Status.SUCCESS, truncateStreamStatus.getStatus()); }
@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; }
@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.TxnRequest)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.TxnRequest other = (io.pravega.controller.stream.api.grpc.v1.Controller.TxnRequest) 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 && unknownFields.equals(other.unknownFields); return result; }
@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.StreamCutRange)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.StreamCutRange other = (io.pravega.controller.stream.api.grpc.v1.Controller.StreamCutRange) obj; boolean result = true; result = result && (hasStreamInfo() == other.hasStreamInfo()); if (hasStreamInfo()) { result = result && getStreamInfo() .equals(other.getStreamInfo()); } result = result && internalGetFrom().equals( other.internalGetFrom()); result = result && internalGetTo().equals( other.internalGetTo()); result = result && unknownFields.equals(other.unknownFields); return result; }
@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.CreateTxnRequest)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.CreateTxnRequest other = (io.pravega.controller.stream.api.grpc.v1.Controller.CreateTxnRequest) obj; boolean result = true; result = result && (hasStreamInfo() == other.hasStreamInfo()); if (hasStreamInfo()) { result = result && getStreamInfo() .equals(other.getStreamInfo()); } result = result && (getLease() == other.getLease()); result = result && (getScaleGracePeriod() == other.getScaleGracePeriod()); result = result && unknownFields.equals(other.unknownFields); return result; }
@Override public void getSegments(GetSegmentsRequest request, StreamObserver<SegmentsAtTime> responseObserver) { log.debug("getSegments called for stream " + request.getStreamInfo().getScope() + "/" + request.getStreamInfo().getStream()); authenticateExecuteAndProcessResults(() -> this.authHelper.checkAuthorizationAndCreateToken(request.getStreamInfo().getScope() + "/" + request.getStreamInfo().getStream(), AuthHandler.Permissions.READ_UPDATE), delegationToken -> controllerService.getSegmentsAtHead(request.getStreamInfo().getScope(), request.getStreamInfo().getStream()) .thenApply(segments -> { SegmentsAtTime.Builder builder = SegmentsAtTime.newBuilder() .setDelegationToken(delegationToken); for (Entry<SegmentId, Long> entry : segments.entrySet()) { builder.addSegments(SegmentLocation.newBuilder() .setSegmentId(entry.getKey()) .setOffset(entry.getValue()) .build()); } return builder.build(); }), responseObserver); }
@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.StreamCut)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.StreamCut other = (io.pravega.controller.stream.api.grpc.v1.Controller.StreamCut) obj; boolean result = true; result = result && (hasStreamInfo() == other.hasStreamInfo()); if (hasStreamInfo()) { result = result && getStreamInfo() .equals(other.getStreamInfo()); } result = result && internalGetCut().equals( other.internalGetCut()); result = result && unknownFields.equals(other.unknownFields); return result; }
@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.GetSegmentsRequest)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.GetSegmentsRequest other = (io.pravega.controller.stream.api.grpc.v1.Controller.GetSegmentsRequest) obj; boolean result = true; result = result && (hasStreamInfo() == other.hasStreamInfo()); if (hasStreamInfo()) { result = result && getStreamInfo() .equals(other.getStreamInfo()); } result = result && (getTimestamp() == other.getTimestamp()); result = result && unknownFields.equals(other.unknownFields); return result; }
@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; }
@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.SegmentId)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.SegmentId other = (io.pravega.controller.stream.api.grpc.v1.Controller.SegmentId) obj; boolean result = true; result = result && (hasStreamInfo() == other.hasStreamInfo()); if (hasStreamInfo()) { result = result && getStreamInfo() .equals(other.getStreamInfo()); } result = result && (getSegmentId() == other.getSegmentId()); result = result && unknownFields.equals(other.unknownFields); return result; }
/** * <code>.io.pravega.controller.stream.api.grpc.v1.StreamInfo streamInfo = 1;</code> */ public Builder mergeStreamInfo(io.pravega.controller.stream.api.grpc.v1.Controller.StreamInfo value) { if (streamInfoBuilder_ == null) { if (streamInfo_ != null) { streamInfo_ = io.pravega.controller.stream.api.grpc.v1.Controller.StreamInfo.newBuilder(streamInfo_).mergeFrom(value).buildPartial(); } else { streamInfo_ = value; } onChanged(); } else { streamInfoBuilder_.mergeFrom(value); } return this; } /**
/** * <code>.io.pravega.controller.stream.api.grpc.v1.StreamInfo streamInfo = 1;</code> */ public Builder mergeStreamInfo(io.pravega.controller.stream.api.grpc.v1.Controller.StreamInfo value) { if (streamInfoBuilder_ == null) { if (streamInfo_ != null) { streamInfo_ = io.pravega.controller.stream.api.grpc.v1.Controller.StreamInfo.newBuilder(streamInfo_).mergeFrom(value).buildPartial(); } else { streamInfo_ = value; } onChanged(); } else { streamInfoBuilder_.mergeFrom(value); } return this; } /**