/** * <code>.io.pravega.controller.stream.api.grpc.v1.StreamInfo streamInfo = 1;</code> */ public Builder setStreamInfo( io.pravega.controller.stream.api.grpc.v1.Controller.StreamInfo.Builder builderForValue) { if (streamInfoBuilder_ == null) { streamInfo_ = builderForValue.build(); onChanged(); } else { streamInfoBuilder_.setMessage(builderForValue.build()); } return this; } /**
subBuilder.mergeFrom(streamInfo_); streamInfo_ = subBuilder.buildPartial();
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; }
subBuilder.mergeFrom(streamInfo_); streamInfo_ = subBuilder.buildPartial();
subBuilder.mergeFrom(streamInfo_); streamInfo_ = subBuilder.buildPartial();
subBuilder.mergeFrom(streamInfo_); streamInfo_ = subBuilder.buildPartial();
subBuilder.mergeFrom(streamInfo_); streamInfo_ = subBuilder.buildPartial();
subBuilder.mergeFrom(streamInfo_); streamInfo_ = subBuilder.buildPartial();
subBuilder.mergeFrom(streamInfo_); streamInfo_ = subBuilder.buildPartial();
subBuilder.mergeFrom(streamInfo_); streamInfo_ = subBuilder.buildPartial();
subBuilder.mergeFrom(streamInfo_); streamInfo_ = subBuilder.buildPartial();
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();
subBuilder.mergeFrom(streamInfo_); streamInfo_ = subBuilder.buildPartial();
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();
@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()); }
/** * <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; } /**
/** * <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; } /**