Search in sources :

Example 1 with StreamSegments

use of io.pravega.client.stream.impl.StreamSegments in project pravega by pravega.

the class StreamManagerImplTest method testSealedStream.

@Test(timeout = 10000)
public void testSealedStream() throws ConnectionFailedException {
    final String streamName = "stream";
    final Stream stream = new StreamImpl(defaultScope, streamName);
    // Setup Mocks
    ClientConnection connection = mock(ClientConnection.class);
    PravegaNodeUri location = new PravegaNodeUri("localhost", 0);
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            WireCommands.CreateSegment request = (WireCommands.CreateSegment) invocation.getArgument(0);
            connectionFactory.getProcessor(location).process(new WireCommands.SegmentCreated(request.getRequestId(), request.getSegment()));
            return null;
        }
    }).when(connection).send(Mockito.any(WireCommands.CreateSegment.class));
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            WireCommands.GetStreamSegmentInfo request = (WireCommands.GetStreamSegmentInfo) invocation.getArgument(0);
            connectionFactory.getProcessor(location).process(new WireCommands.StreamSegmentInfo(request.getRequestId(), request.getSegmentName(), true, false, false, 0, 0, 0));
            return null;
        }
    }).when(connection).send(Mockito.any(WireCommands.GetStreamSegmentInfo.class));
    connectionFactory.provideConnection(location, connection);
    MockController mockController = spy(new MockController(location.getEndpoint(), location.getPort(), connectionFactory, true));
    doReturn(CompletableFuture.completedFuture(true)).when(mockController).sealStream(defaultScope, streamName);
    StreamSegments empty = new StreamSegments(new TreeMap<>());
    doReturn(CompletableFuture.completedFuture(empty)).when(mockController).getCurrentSegments(defaultScope, streamName);
    ConnectionPoolImpl pool = new ConnectionPoolImpl(ClientConfig.builder().maxConnectionsPerSegmentStore(1).build(), connectionFactory);
    // Create a StreamManager
    @Cleanup final StreamManager streamManager = new StreamManagerImpl(mockController, pool);
    // Create a scope and stream and seal it.
    streamManager.createScope(defaultScope);
    streamManager.createStream(defaultScope, streamName, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(3)).build());
    streamManager.sealStream(defaultScope, streamName);
    // Fetch StreamInfo
    StreamInfo info = streamManager.getStreamInfo(defaultScope, streamName);
    // validate results.
    assertEquals(defaultScope, info.getScope());
    assertEquals(streamName, info.getStreamName());
    assertNotNull(info.getTailStreamCut());
    assertEquals(stream, info.getTailStreamCut().asImpl().getStream());
    assertEquals(0, info.getTailStreamCut().asImpl().getPositions().size());
    assertNotNull(info.getHeadStreamCut());
    assertEquals(stream, info.getHeadStreamCut().asImpl().getStream());
    assertEquals(3, info.getHeadStreamCut().asImpl().getPositions().size());
    assertTrue(info.isSealed());
}
Also used : ConnectionPoolImpl(io.pravega.client.connection.impl.ConnectionPoolImpl) Cleanup(lombok.Cleanup) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) StreamImpl(io.pravega.client.stream.impl.StreamImpl) InvocationOnMock(org.mockito.invocation.InvocationOnMock) StreamManager(io.pravega.client.admin.StreamManager) StreamInfo(io.pravega.client.admin.StreamInfo) MockController(io.pravega.client.stream.mock.MockController) Stream(io.pravega.client.stream.Stream) ClientConnection(io.pravega.client.connection.impl.ClientConnection) WireCommands(io.pravega.shared.protocol.netty.WireCommands) StreamSegments(io.pravega.client.stream.impl.StreamSegments) Test(org.junit.Test)

Example 2 with StreamSegments

use of io.pravega.client.stream.impl.StreamSegments in project pravega by pravega.

the class ControllerImplTest method testScale.

@Test
public void testScale() throws Exception {
    CompletableFuture<Boolean> scaleStream;
    StreamImpl stream = new StreamImpl("scope1", "stream1");
    scaleStream = controllerClient.scaleStream(stream, new ArrayList<>(), new HashMap<>(), executor).getFuture();
    assertTrue(scaleStream.get());
    CompletableFuture<StreamSegments> segments = controllerClient.getCurrentSegments("scope1", "stream1");
    assertEquals(2, segments.get().getSegments().size());
    assertEquals(new Segment("scope1", "stream1", 6), segments.get().getSegmentForKey(0.25));
    assertEquals(new Segment("scope1", "stream1", 7), segments.get().getSegmentForKey(0.75));
    scaleStream = controllerClient.scaleStream(new StreamImpl("scope1", "stream2"), new ArrayList<>(), new HashMap<>(), executor).getFuture();
    AssertExtensions.assertFutureThrows("Should throw Exception", scaleStream, throwable -> true);
    scaleStream = controllerClient.scaleStream(new StreamImpl("UNKNOWN", "stream2"), new ArrayList<>(), new HashMap<>(), executor).getFuture();
    AssertExtensions.assertFutureThrows("Should throw Exception", scaleStream, throwable -> true);
    scaleStream = controllerClient.scaleStream(new StreamImpl("scope1", "UNKNOWN"), new ArrayList<>(), new HashMap<>(), executor).getFuture();
    AssertExtensions.assertFutureThrows("Should throw Exception", scaleStream, throwable -> true);
}
Also used : StreamImpl(io.pravega.client.stream.impl.StreamImpl) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) StreamSegments(io.pravega.client.stream.impl.StreamSegments) Segment(io.pravega.client.segment.impl.Segment) Test(org.junit.Test)

Example 3 with StreamSegments

use of io.pravega.client.stream.impl.StreamSegments in project pravega by pravega.

the class ControllerImplTest method testGetCurrentSegments.

@Test
public void testGetCurrentSegments() throws Exception {
    CompletableFuture<StreamSegments> streamSegments;
    streamSegments = controllerClient.getCurrentSegments("scope1", "stream1");
    assertTrue(streamSegments.get().getSegments().size() == 2);
    assertEquals(new Segment("scope1", "stream1", 6), streamSegments.get().getSegmentForKey(0.2));
    assertEquals(new Segment("scope1", "stream1", 7), streamSegments.get().getSegmentForKey(0.6));
    streamSegments = controllerClient.getCurrentSegments("scope1", "stream2");
    AssertExtensions.assertFutureThrows("Should throw Exception", streamSegments, throwable -> true);
    streamSegments = controllerClient.getCurrentSegments("scope1", "sealedStream");
    assertTrue(streamSegments.get().getNumberOfSegments() == 0);
}
Also used : StreamSegments(io.pravega.client.stream.impl.StreamSegments) Segment(io.pravega.client.segment.impl.Segment) Test(org.junit.Test)

Example 4 with StreamSegments

use of io.pravega.client.stream.impl.StreamSegments in project pravega by pravega.

the class ControllerImplTest method testParallelGetCurrentSegments.

@Test
public void testParallelGetCurrentSegments() throws Exception {
    final ExecutorService executorService = ExecutorServiceHelpers.newScheduledThreadPool(10, "testParallelGetCurrentSegments");
    Semaphore createCount = new Semaphore(-19);
    AtomicBoolean success = new AtomicBoolean(true);
    for (int i = 0; i < 10; i++) {
        executorService.submit(() -> {
            for (int j = 0; j < 2; j++) {
                try {
                    CompletableFuture<StreamSegments> streamSegments;
                    streamSegments = controllerClient.getCurrentSegments("scope1", "streamparallel");
                    assertTrue(streamSegments.get().getSegments().size() == 2);
                    assertEquals(new Segment("scope1", "streamparallel", 0), streamSegments.get().getSegmentForKey(0.2));
                    assertEquals(new Segment("scope1", "streamparallel", 1), streamSegments.get().getSegmentForKey(0.6));
                    createCount.release();
                } catch (Exception e) {
                    log.error("Exception when getting segments: {}", e);
                    // Don't wait for other threads to complete.
                    success.set(false);
                    createCount.release(20);
                }
            }
        });
    }
    createCount.acquire();
    ExecutorServiceHelpers.shutdown(executorService);
    assertTrue(success.get());
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ExecutorService(java.util.concurrent.ExecutorService) Semaphore(java.util.concurrent.Semaphore) StreamSegments(io.pravega.client.stream.impl.StreamSegments) Segment(io.pravega.client.segment.impl.Segment) NoSuchScopeException(io.pravega.client.stream.NoSuchScopeException) PingFailedException(io.pravega.client.stream.PingFailedException) IOException(java.io.IOException) StatusRuntimeException(io.grpc.StatusRuntimeException) ExecutionException(java.util.concurrent.ExecutionException) TxnFailedException(io.pravega.client.stream.TxnFailedException) RetriesExhaustedException(io.pravega.common.util.RetriesExhaustedException) InvalidStreamException(io.pravega.client.stream.InvalidStreamException) Test(org.junit.Test)

Example 5 with StreamSegments

use of io.pravega.client.stream.impl.StreamSegments in project pravega by pravega.

the class ControllerImplTest method testDeadline.

@Test
public void testDeadline() {
    @Cleanup final ControllerImpl controller = new ControllerImpl(ControllerImplConfig.builder().clientConfig(ClientConfig.builder().controllerURI(URI.create((testSecure ? "tls://" : "tcp://") + "localhost:" + serverPort)).credentials(new DefaultCredentials("1111_aaaa", "admin")).trustStore(SecurityConfigDefaults.TLS_CA_CERT_PATH).build()).timeoutMillis(200).retryAttempts(1).build(), executor);
    Predicate<Throwable> deadlinePredicate = e -> {
        Throwable unwrapped = Exceptions.unwrap(e);
        if (unwrapped instanceof RetriesExhaustedException) {
            unwrapped = Exceptions.unwrap(unwrapped.getCause());
        }
        StatusRuntimeException exception = (StatusRuntimeException) unwrapped;
        Status.Code code = exception.getStatus().getCode();
        return code.equals(Status.Code.DEADLINE_EXCEEDED);
    };
    String deadline = "deadline";
    // region scope
    CompletableFuture<Boolean> scopeFuture = controller.createScope(deadline);
    AssertExtensions.assertFutureThrows("", scopeFuture, deadlinePredicate);
    CompletableFuture<Boolean> deleteScopeFuture = controller.deleteScope(deadline);
    AssertExtensions.assertFutureThrows("", deleteScopeFuture, deadlinePredicate);
    CompletableFuture<Void> listFuture = controller.listStreams(deadline).collectRemaining(x -> true);
    AssertExtensions.assertFutureThrows("", listFuture, deadlinePredicate);
    CompletableFuture<Void> listWithTagFuture = controller.listStreamsForTag(deadline, "tx").collectRemaining(x -> true);
    AssertExtensions.assertFutureThrows("", listWithTagFuture, deadlinePredicate);
    CompletableFuture<StreamConfiguration> getStreamCfgFuture = controller.getStreamConfiguration(deadline, deadline);
    AssertExtensions.assertFutureThrows("", getStreamCfgFuture, deadlinePredicate);
    // endregion
    CompletableFuture<String> tokenFuture = controller.getOrRefreshDelegationTokenFor(deadline, deadline, AccessOperation.ANY);
    AssertExtensions.assertFutureThrows("", tokenFuture, deadlinePredicate);
    // region stream
    CompletableFuture<Boolean> createStreamFuture = controller.createStream(deadline, deadline, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(1)).build());
    AssertExtensions.assertFutureThrows("", createStreamFuture, deadlinePredicate);
    Stream stream = Stream.of(deadline, deadline);
    CompletableFuture<PravegaNodeUri> getEndpointFuture = controller.getEndpointForSegment(NameUtils.getQualifiedStreamSegmentName(deadline, deadline, 0L));
    AssertExtensions.assertFutureThrows("", getEndpointFuture, deadlinePredicate);
    CompletableFuture<StreamSegments> getSegmentFuture = controller.getCurrentSegments(deadline, deadline);
    AssertExtensions.assertFutureThrows("", getSegmentFuture, deadlinePredicate);
    CompletableFuture<Map<Segment, Long>> getSegmentsAtTimeFuture = controller.getSegmentsAtTime(stream, 0L);
    AssertExtensions.assertFutureThrows("", getSegmentsAtTimeFuture, deadlinePredicate);
    CompletableFuture<StreamSegments> currentSegmentsFuture = controller.getCurrentSegments(deadline, deadline);
    AssertExtensions.assertFutureThrows("", currentSegmentsFuture, deadlinePredicate);
    Segment segment = new Segment(deadline, deadline, 0L);
    CompletableFuture<Boolean> isSegmentOpenFuture = controller.isSegmentOpen(segment);
    AssertExtensions.assertFutureThrows("", isSegmentOpenFuture, deadlinePredicate);
    CompletableFuture<StreamSegmentsWithPredecessors> successorFuture = controller.getSuccessors(segment);
    AssertExtensions.assertFutureThrows("", successorFuture, deadlinePredicate);
    StreamCut streamCut = new StreamCutImpl(stream, Collections.emptyMap());
    CompletableFuture<StreamSegmentSuccessors> streamCutFuture = controller.getSegments(streamCut, streamCut);
    AssertExtensions.assertFutureThrows("", streamCutFuture, deadlinePredicate);
    CompletableFuture<StreamSegmentSuccessors> streamcutSuccessorsFuture = controller.getSuccessors(streamCut);
    AssertExtensions.assertFutureThrows("", streamcutSuccessorsFuture, deadlinePredicate);
    CompletableFuture<Boolean> updateFuture = controller.updateStream(deadline, deadline, StreamConfiguration.builder().build());
    AssertExtensions.assertFutureThrows("", updateFuture, deadlinePredicate);
    CompletableFuture<Boolean> scaleFuture = controller.scaleStream(stream, Collections.emptyList(), Collections.emptyMap(), executor).getFuture();
    AssertExtensions.assertFutureThrows("", scaleFuture, deadlinePredicate);
    CompletableFuture<Boolean> scaleStatusFuture = controller.checkScaleStatus(stream, 0);
    AssertExtensions.assertFutureThrows("", scaleStatusFuture, deadlinePredicate);
    CompletableFuture<Boolean> truncateFuture = controller.truncateStream(deadline, deadline, new StreamCutImpl(Stream.of(deadline, deadline), Collections.emptyMap()));
    AssertExtensions.assertFutureThrows("", truncateFuture, deadlinePredicate);
    CompletableFuture<Boolean> sealFuture = controller.sealStream(deadline, deadline);
    AssertExtensions.assertFutureThrows("", sealFuture, deadlinePredicate);
    CompletableFuture<Boolean> deleteFuture = controller.deleteStream(deadline, deadline);
    AssertExtensions.assertFutureThrows("", deleteFuture, deadlinePredicate);
    // endregion
    // region transaction
    CompletableFuture<TxnSegments> createtxnFuture = controller.createTransaction(stream, 100L);
    AssertExtensions.assertFutureThrows("", createtxnFuture, deadlinePredicate);
    CompletableFuture<Transaction.PingStatus> pingTxnFuture = controller.pingTransaction(stream, UUID.randomUUID(), 100L);
    AssertExtensions.assertFutureThrows("", pingTxnFuture, deadlinePredicate);
    CompletableFuture<Void> abortFuture = controller.abortTransaction(stream, UUID.randomUUID());
    AssertExtensions.assertFutureThrows("", abortFuture, deadlinePredicate);
    CompletableFuture<Void> commitFuture = controller.commitTransaction(stream, "", 0L, UUID.randomUUID());
    AssertExtensions.assertFutureThrows("", commitFuture, deadlinePredicate);
    CompletableFuture<Transaction.Status> txnStatusFuture = controller.checkTransactionStatus(stream, UUID.randomUUID());
    AssertExtensions.assertFutureThrows("", txnStatusFuture, deadlinePredicate);
    // endregion
    // region writer mark
    CompletableFuture<Void> writerPosFuture = controller.noteTimestampFromWriter("deadline", stream, 0L, mock(WriterPosition.class));
    AssertExtensions.assertFutureThrows("", writerPosFuture, deadlinePredicate);
    CompletableFuture<Void> removeWriterFuture = controller.removeWriter("deadline", stream);
    AssertExtensions.assertFutureThrows("", removeWriterFuture, deadlinePredicate);
    // endregion
    // verify that a stub level deadline is not set and that the stub can still make successful calls for which we
    // have mocked successful responses.
    controller.createScope("scope1").join();
}
Also used : StreamCut(io.pravega.client.stream.StreamCut) StreamConfig(io.pravega.controller.stream.api.grpc.v1.Controller.StreamConfig) Cleanup(lombok.Cleanup) StreamConfiguration(io.pravega.client.stream.StreamConfiguration) PingTxnRequest(io.pravega.controller.stream.api.grpc.v1.Controller.PingTxnRequest) SegmentRanges(io.pravega.controller.stream.api.grpc.v1.Controller.SegmentRanges) Mockito.doThrow(org.mockito.Mockito.doThrow) StreamSegments(io.pravega.client.stream.impl.StreamSegments) NoSuchScopeException(io.pravega.client.stream.NoSuchScopeException) Pair(org.apache.commons.lang3.tuple.Pair) AccessOperation(io.pravega.shared.security.auth.AccessOperation) Map(java.util.Map) KeyValueTableInfo(io.pravega.controller.stream.api.grpc.v1.Controller.KeyValueTableInfo) SubscriberStreamCut(io.pravega.controller.stream.api.grpc.v1.Controller.SubscriberStreamCut) Status(io.grpc.Status) Mockito.doReturn(org.mockito.Mockito.doReturn) ReaderGroupConfig(io.pravega.client.stream.ReaderGroupConfig) DeleteScopeStatus(io.pravega.controller.stream.api.grpc.v1.Controller.DeleteScopeStatus) ReaderGroupInfo(io.pravega.controller.stream.api.grpc.v1.Controller.ReaderGroupInfo) TxnId(io.pravega.controller.stream.api.grpc.v1.Controller.TxnId) Slf4j(lombok.extern.slf4j.Slf4j) Assert.assertFalse(org.junit.Assert.assertFalse) TestUtils(io.pravega.test.common.TestUtils) Mockito.mock(org.mockito.Mockito.mock) KeyValueTableSegments(io.pravega.client.tables.impl.KeyValueTableSegments) SegmentId(io.pravega.controller.stream.api.grpc.v1.Controller.SegmentId) ControllerServiceImplBase(io.pravega.controller.stream.api.grpc.v1.ControllerServiceGrpc.ControllerServiceImplBase) CreateReaderGroupResponse(io.pravega.controller.stream.api.grpc.v1.Controller.CreateReaderGroupResponse) KeyValueTableConfig(io.pravega.controller.stream.api.grpc.v1.Controller.KeyValueTableConfig) GrpcSslContexts(io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts) Exceptions(io.pravega.common.Exceptions) ModelHelper.decode(io.pravega.client.control.impl.ModelHelper.decode) ScopeInfo(io.pravega.controller.stream.api.grpc.v1.Controller.ScopeInfo) Mockito.spy(org.mockito.Mockito.spy) UpdateSubscriberStatus(io.pravega.controller.stream.api.grpc.v1.Controller.UpdateSubscriberStatus) PingFailedException(io.pravega.client.stream.PingFailedException) ArrayList(java.util.ArrayList) Strings(com.google.common.base.Strings) NodeUri(io.pravega.controller.stream.api.grpc.v1.Controller.NodeUri) ReaderGroupConfiguration(io.pravega.controller.stream.api.grpc.v1.Controller.ReaderGroupConfiguration) StreamInfo(io.pravega.controller.stream.api.grpc.v1.Controller.StreamInfo) DefaultCredentials(io.pravega.shared.security.auth.DefaultCredentials) Timeout(org.junit.rules.Timeout) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) StreamSegmentsWithPredecessors(io.pravega.client.stream.impl.StreamSegmentsWithPredecessors) Server(io.grpc.Server) Before(org.junit.Before) NettyServerBuilder(io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder) SegmentLocation(io.pravega.controller.stream.api.grpc.v1.Controller.SegmentsAtTime.SegmentLocation) lombok.val(lombok.val) Assert.assertTrue(org.junit.Assert.assertTrue) AsyncIterator(io.pravega.common.util.AsyncIterator) Test(org.junit.Test) IOException(java.io.IOException) Mockito.times(org.mockito.Mockito.times) WriterPosition(io.pravega.client.stream.impl.WriterPosition) File(java.io.File) StatusRuntimeException(io.grpc.StatusRuntimeException) ExecutionException(java.util.concurrent.ExecutionException) DeleteReaderGroupStatus(io.pravega.controller.stream.api.grpc.v1.Controller.DeleteReaderGroupStatus) SegmentsAtTime(io.pravega.controller.stream.api.grpc.v1.Controller.SegmentsAtTime) TxnFailedException(io.pravega.client.stream.TxnFailedException) CreateKeyValueTableStatus(io.pravega.controller.stream.api.grpc.v1.Controller.CreateKeyValueTableStatus) ScalingPolicy(io.pravega.client.stream.ScalingPolicy) Assert.assertEquals(org.junit.Assert.assertEquals) ManagedChannel(io.grpc.ManagedChannel) AssertExtensions(io.pravega.test.common.AssertExtensions) KeyValueTableConfiguration(io.pravega.client.tables.KeyValueTableConfiguration) GetSegmentsRequest(io.pravega.controller.stream.api.grpc.v1.Controller.GetSegmentsRequest) StreamObserver(io.grpc.stub.StreamObserver) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Stream(io.pravega.client.stream.Stream) After(org.junit.After) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) SubscribersResponse(io.pravega.controller.stream.api.grpc.v1.Controller.SubscribersResponse) Controller(io.pravega.controller.stream.api.grpc.v1.Controller) URI(java.net.URI) Transaction(io.pravega.client.stream.Transaction) TxnSegments(io.pravega.client.stream.impl.TxnSegments) CreateStreamStatus(io.pravega.controller.stream.api.grpc.v1.Controller.CreateStreamStatus) ImmutableMap(com.google.common.collect.ImmutableMap) Predicate(java.util.function.Predicate) AssertExtensions.assertThrows(io.pravega.test.common.AssertExtensions.assertThrows) UUID(java.util.UUID) RetriesExhaustedException(io.pravega.common.util.RetriesExhaustedException) SegmentWithRange(io.pravega.client.stream.impl.SegmentWithRange) List(java.util.List) Entry(java.util.Map.Entry) GetEpochSegmentsRequest(io.pravega.controller.stream.api.grpc.v1.Controller.GetEpochSegmentsRequest) PingTxnStatus(io.pravega.controller.stream.api.grpc.v1.Controller.PingTxnStatus) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Segment(io.pravega.client.segment.impl.Segment) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) CreateScopeStatus(io.pravega.controller.stream.api.grpc.v1.Controller.CreateScopeStatus) StreamImpl(io.pravega.client.stream.impl.StreamImpl) ScaleStatusRequest(io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusRequest) KeyValueTableConfigResponse(io.pravega.controller.stream.api.grpc.v1.Controller.KeyValueTableConfigResponse) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ScaleStatusResponse(io.pravega.controller.stream.api.grpc.v1.Controller.ScaleStatusResponse) TxnState(io.pravega.controller.stream.api.grpc.v1.Controller.TxnState) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) AtomicReference(java.util.concurrent.atomic.AtomicReference) SuccessorResponse(io.pravega.controller.stream.api.grpc.v1.Controller.SuccessorResponse) ScaleRequest(io.pravega.controller.stream.api.grpc.v1.Controller.ScaleRequest) DeleteKVTableStatus(io.pravega.controller.stream.api.grpc.v1.Controller.DeleteKVTableStatus) CreateTxnRequest(io.pravega.controller.stream.api.grpc.v1.Controller.CreateTxnRequest) StreamCutImpl(io.pravega.client.stream.impl.StreamCutImpl) DeleteStreamStatus(io.pravega.controller.stream.api.grpc.v1.Controller.DeleteStreamStatus) NettyChannelBuilder(io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder) LinkedList(java.util.LinkedList) ExecutorService(java.util.concurrent.ExecutorService) ScaleResponse(io.pravega.controller.stream.api.grpc.v1.Controller.ScaleResponse) UpdateReaderGroupResponse(io.pravega.controller.stream.api.grpc.v1.Controller.UpdateReaderGroupResponse) NameUtils(io.pravega.shared.NameUtils) Semaphore(java.util.concurrent.Semaphore) Assert.assertNotNull(org.junit.Assert.assertNotNull) Mockito.verify(org.mockito.Mockito.verify) StreamSegmentSuccessors(io.pravega.client.stream.impl.StreamSegmentSuccessors) TimeUnit(java.util.concurrent.TimeUnit) SecurityConfigDefaults(io.pravega.test.common.SecurityConfigDefaults) Rule(org.junit.Rule) UpdateStreamStatus(io.pravega.controller.stream.api.grpc.v1.Controller.UpdateStreamStatus) InvalidStreamException(io.pravega.client.stream.InvalidStreamException) ExecutorServiceHelpers(io.pravega.common.concurrent.ExecutorServiceHelpers) TxnRequest(io.pravega.controller.stream.api.grpc.v1.Controller.TxnRequest) ReaderGroupConfigResponse(io.pravega.controller.stream.api.grpc.v1.Controller.ReaderGroupConfigResponse) SegmentValidityResponse(io.pravega.controller.stream.api.grpc.v1.Controller.SegmentValidityResponse) Collections(java.util.Collections) ClientConfig(io.pravega.client.ClientConfig) StreamCutImpl(io.pravega.client.stream.impl.StreamCutImpl) StreamSegmentSuccessors(io.pravega.client.stream.impl.StreamSegmentSuccessors) WriterPosition(io.pravega.client.stream.impl.WriterPosition) Cleanup(lombok.Cleanup) Segment(io.pravega.client.segment.impl.Segment) DefaultCredentials(io.pravega.shared.security.auth.DefaultCredentials) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) StatusRuntimeException(io.grpc.StatusRuntimeException) StreamConfiguration(io.pravega.client.stream.StreamConfiguration) Stream(io.pravega.client.stream.Stream) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Status(io.grpc.Status) DeleteScopeStatus(io.pravega.controller.stream.api.grpc.v1.Controller.DeleteScopeStatus) UpdateSubscriberStatus(io.pravega.controller.stream.api.grpc.v1.Controller.UpdateSubscriberStatus) DeleteReaderGroupStatus(io.pravega.controller.stream.api.grpc.v1.Controller.DeleteReaderGroupStatus) CreateKeyValueTableStatus(io.pravega.controller.stream.api.grpc.v1.Controller.CreateKeyValueTableStatus) CreateStreamStatus(io.pravega.controller.stream.api.grpc.v1.Controller.CreateStreamStatus) PingTxnStatus(io.pravega.controller.stream.api.grpc.v1.Controller.PingTxnStatus) CreateScopeStatus(io.pravega.controller.stream.api.grpc.v1.Controller.CreateScopeStatus) DeleteKVTableStatus(io.pravega.controller.stream.api.grpc.v1.Controller.DeleteKVTableStatus) DeleteStreamStatus(io.pravega.controller.stream.api.grpc.v1.Controller.DeleteStreamStatus) UpdateStreamStatus(io.pravega.controller.stream.api.grpc.v1.Controller.UpdateStreamStatus) StreamCut(io.pravega.client.stream.StreamCut) SubscriberStreamCut(io.pravega.controller.stream.api.grpc.v1.Controller.SubscriberStreamCut) TxnSegments(io.pravega.client.stream.impl.TxnSegments) StreamSegmentsWithPredecessors(io.pravega.client.stream.impl.StreamSegmentsWithPredecessors) RetriesExhaustedException(io.pravega.common.util.RetriesExhaustedException) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) HashMap(java.util.HashMap) StreamSegments(io.pravega.client.stream.impl.StreamSegments) Test(org.junit.Test)

Aggregations

StreamSegments (io.pravega.client.stream.impl.StreamSegments)23 Segment (io.pravega.client.segment.impl.Segment)12 Test (org.junit.Test)11 StreamImpl (io.pravega.client.stream.impl.StreamImpl)6 PravegaNodeUri (io.pravega.shared.protocol.netty.PravegaNodeUri)6 TreeMap (java.util.TreeMap)6 Cleanup (lombok.Cleanup)6 SegmentWithRange (io.pravega.client.stream.impl.SegmentWithRange)5 TxnSegments (io.pravega.client.stream.impl.TxnSegments)4 MockController (io.pravega.client.stream.mock.MockController)4 ArrayList (java.util.ArrayList)4 CompletableFuture (java.util.concurrent.CompletableFuture)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 StatusRuntimeException (io.grpc.StatusRuntimeException)3 Controller (io.pravega.client.control.impl.Controller)3 InvalidStreamException (io.pravega.client.stream.InvalidStreamException)3 Stream (io.pravega.client.stream.Stream)3 StreamConfiguration (io.pravega.client.stream.StreamConfiguration)3 ClientFactoryImpl (io.pravega.client.stream.impl.ClientFactoryImpl)3 SegmentRange (io.pravega.controller.stream.api.grpc.v1.Controller.SegmentRange)3