Search in sources :

Example 6 with ControllerFailureException

use of io.pravega.client.control.impl.ControllerFailureException in project pravega by pravega.

the class LocalControllerTest method testUpdateReaderGroup.

@Test(timeout = 10000)
public void testUpdateReaderGroup() throws ExecutionException, InterruptedException {
    final Segment seg0 = new Segment("scope", "stream1", 0L);
    final Segment seg1 = new Segment("scope", "stream1", 1L);
    ImmutableMap<Segment, Long> startStreamCut = ImmutableMap.of(seg0, 10L, seg1, 10L);
    Map<Stream, StreamCut> startSC = ImmutableMap.of(Stream.of("scope", "stream1"), new StreamCutImpl(Stream.of("scope", "stream1"), startStreamCut));
    ImmutableMap<Segment, Long> endStreamCut = ImmutableMap.of(seg0, 200L, seg1, 300L);
    Map<Stream, StreamCut> endSC = ImmutableMap.of(Stream.of("scope", "stream1"), new StreamCutImpl(Stream.of("scope", "stream1"), endStreamCut));
    ReaderGroupConfig rgConfig = ReaderGroupConfig.builder().automaticCheckpointIntervalMillis(30000L).groupRefreshTimeMillis(20000L).maxOutstandingCheckpointRequest(2).retentionType(ReaderGroupConfig.StreamDataRetention.AUTOMATIC_RELEASE_AT_LAST_CHECKPOINT).startingStreamCuts(startSC).endingStreamCuts(endSC).build();
    ReaderGroupConfig config = ReaderGroupConfig.cloneConfig(rgConfig, UUID.randomUUID(), 0L);
    when(this.mockControllerService.updateReaderGroup(anyString(), anyString(), any(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.UpdateReaderGroupResponse.newBuilder().setStatus(Controller.UpdateReaderGroupResponse.Status.SUCCESS).setGeneration(1L).build()));
    Assert.assertNotNull(this.testController.updateReaderGroup("scope", "subscriber", config).join());
    when(this.mockControllerService.updateReaderGroup(anyString(), anyString(), any(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.UpdateReaderGroupResponse.newBuilder().setStatus(Controller.UpdateReaderGroupResponse.Status.FAILURE).build()));
    assertThrows("Expected ControllerFailureException", () -> this.testController.updateReaderGroup("scope", "subscriber", config).join(), ex -> ex instanceof ControllerFailureException);
    when(this.mockControllerService.updateReaderGroup(anyString(), anyString(), any(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.UpdateReaderGroupResponse.newBuilder().setStatus(Controller.UpdateReaderGroupResponse.Status.INVALID_CONFIG).build()));
    assertThrows("Expected ReaderGroupConfigRejectedException", () -> this.testController.updateReaderGroup("scope", "subscriber", config).join(), ex -> ex instanceof ReaderGroupConfigRejectedException);
    when(this.mockControllerService.updateReaderGroup(anyString(), anyString(), any(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.UpdateReaderGroupResponse.newBuilder().setStatus(Controller.UpdateReaderGroupResponse.Status.RG_NOT_FOUND).build()));
    assertThrows("Expected IllegalArgumentException", () -> this.testController.updateReaderGroup("scope", "subscriber", config).join(), ex -> ex instanceof IllegalArgumentException);
    when(this.mockControllerService.updateReaderGroup(anyString(), anyString(), any(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.UpdateReaderGroupResponse.newBuilder().setStatusValue(-1).build()));
    assertThrows("Expected ControllerFailureException", () -> this.testController.updateReaderGroup("scope", "subscriber", config).join(), ex -> ex instanceof ControllerFailureException);
}
Also used : ReaderGroupConfig(io.pravega.client.stream.ReaderGroupConfig) StreamCut(io.pravega.client.stream.StreamCut) StreamCutImpl(io.pravega.client.stream.impl.StreamCutImpl) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) ControllerFailureException(io.pravega.client.control.impl.ControllerFailureException) ReaderGroupConfigRejectedException(io.pravega.client.control.impl.ReaderGroupConfigRejectedException) Stream(io.pravega.client.stream.Stream) Segment(io.pravega.client.segment.impl.Segment) Test(org.junit.Test)

Example 7 with ControllerFailureException

use of io.pravega.client.control.impl.ControllerFailureException in project pravega by pravega.

the class LocalControllerTest method testGetKeyValueTableConfiguration.

@Test(timeout = 10000)
public void testGetKeyValueTableConfiguration() {
    KeyValueTableConfiguration config = KeyValueTableConfiguration.builder().partitionCount(2).primaryKeyLength(4).secondaryKeyLength(4).build();
    when(this.mockControllerService.getKeyValueTableConfiguration(any(), any(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.KeyValueTableConfigResponse.newBuilder().setStatus(Controller.KeyValueTableConfigResponse.Status.SUCCESS).setConfig(ModelHelper.decode("scope", "kvtable1", config)).build()));
    KeyValueTableConfiguration responseConfig = this.testController.getKeyValueTableConfiguration("scope", "kvtable1").join();
    assertEquals(config.getPartitionCount(), responseConfig.getPartitionCount());
    assertEquals(config.getPrimaryKeyLength(), responseConfig.getPrimaryKeyLength());
    assertEquals(config.getSecondaryKeyLength(), responseConfig.getSecondaryKeyLength());
    when(this.mockControllerService.getKeyValueTableConfiguration(any(), any(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.KeyValueTableConfigResponse.newBuilder().setStatus(Controller.KeyValueTableConfigResponse.Status.FAILURE).build()));
    assertThrows("Expected ControllerFailureException", () -> this.testController.getKeyValueTableConfiguration("scope", "kvtable2").join(), ex -> ex instanceof ControllerFailureException);
    when(this.mockControllerService.getKeyValueTableConfiguration(any(), any(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.KeyValueTableConfigResponse.newBuilder().setStatus(Controller.KeyValueTableConfigResponse.Status.TABLE_NOT_FOUND).build()));
    assertThrows("Expected IllegalArgumentException", () -> this.testController.getKeyValueTableConfiguration("scope", "kvtable3").join(), ex -> ex instanceof IllegalArgumentException);
    when(this.mockControllerService.getKeyValueTableConfiguration(any(), any(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.KeyValueTableConfigResponse.newBuilder().setStatusValue(-1).build()));
    assertThrows("Expected ControllerFailureException", () -> this.testController.getKeyValueTableConfiguration("scope", "kvtable4").join(), ex -> ex instanceof ControllerFailureException);
}
Also used : KeyValueTableConfiguration(io.pravega.client.tables.KeyValueTableConfiguration) ControllerFailureException(io.pravega.client.control.impl.ControllerFailureException) Test(org.junit.Test)

Example 8 with ControllerFailureException

use of io.pravega.client.control.impl.ControllerFailureException in project pravega by pravega.

the class LocalControllerTest method testScaleStream.

@Test(timeout = 10000)
public void testScaleStream() throws ExecutionException, InterruptedException {
    when(this.mockControllerService.checkScale(anyString(), anyString(), anyInt(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.ScaleStatusResponse.newBuilder().setStatus(Controller.ScaleStatusResponse.ScaleStatus.SUCCESS).build()));
    when(this.mockControllerService.scale(any(), any(), any(), any(), anyLong(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.ScaleResponse.newBuilder().setStatus(Controller.ScaleResponse.ScaleStreamStatus.STARTED).build()));
    Assert.assertTrue(this.testController.scaleStream(new StreamImpl("scope", "stream"), new ArrayList<>(), new HashMap<>(), executorService()).getFuture().join());
    when(this.mockControllerService.scale(any(), any(), any(), any(), anyLong(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.ScaleResponse.newBuilder().setStatus(Controller.ScaleResponse.ScaleStreamStatus.PRECONDITION_FAILED).build()));
    Assert.assertFalse(this.testController.scaleStream(new StreamImpl("scope", "stream"), new ArrayList<>(), new HashMap<>(), executorService()).getFuture().join());
    when(this.mockControllerService.scale(any(), any(), any(), any(), anyLong(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.ScaleResponse.newBuilder().setStatus(Controller.ScaleResponse.ScaleStreamStatus.FAILURE).build()));
    assertThrows("Expected ControllerFailureException", () -> this.testController.startScale(new StreamImpl("scope", "stream"), new ArrayList<>(), new HashMap<>()).join(), ex -> ex instanceof ControllerFailureException);
    when(this.mockControllerService.scale(any(), any(), any(), any(), anyLong(), anyLong())).thenReturn(CompletableFuture.completedFuture(Controller.ScaleResponse.newBuilder().setStatusValue(-1).build()));
    assertThrows("Expected ControllerFailureException", () -> this.testController.startScale(new StreamImpl("scope", "stream"), new ArrayList<>(), new HashMap<>()).join(), ex -> ex instanceof ControllerFailureException);
}
Also used : HashMap(java.util.HashMap) StreamImpl(io.pravega.client.stream.impl.StreamImpl) ArrayList(java.util.ArrayList) ControllerFailureException(io.pravega.client.control.impl.ControllerFailureException) Test(org.junit.Test)

Example 9 with ControllerFailureException

use of io.pravega.client.control.impl.ControllerFailureException in project pravega by pravega.

the class SegmentSelector method refreshSegmentEventWritersUponSealed.

/**
 * Refresh segment writers corresponding to the successors of the sealed segment and return inflight event list of the sealed segment.
 * The segment writer for sealed segment is not removed.
 * @param sealedSegment The sealed segment.
 * @param segmentSealedCallback Sealed segment callback.
 * @return List of pending events.
 */
public List<PendingEvent> refreshSegmentEventWritersUponSealed(Segment sealedSegment, Consumer<Segment> segmentSealedCallback) {
    StreamSegmentsWithPredecessors successors = Futures.getAndHandleExceptions(controller.getSuccessors(sealedSegment), t -> {
        log.error("Error while fetching successors for segment: {}", sealedSegment, t);
        // Remove all writers and fail all pending writes
        Exception e = (t instanceof RetriesExhaustedException) ? new ControllerFailureException(t) : new NoSuchSegmentException(sealedSegment.toString(), t);
        removeAllWriters().forEach(event -> event.getAckFuture().completeExceptionally(e));
        return null;
    });
    if (successors == null) {
        return Collections.emptyList();
    } else if (successors.getSegmentToPredecessor().isEmpty()) {
        log.warn("Stream {} is sealed since no successor segments found for segment {} ", sealedSegment.getStream(), sealedSegment);
        Exception e = new IllegalStateException("Writes cannot proceed since the stream is sealed");
        removeAllWriters().forEach(pendingEvent -> pendingEvent.getAckFuture().completeExceptionally(e));
        sealed.set(true);
        return Collections.emptyList();
    } else {
        return updateSegmentsUponSealed(successors, sealedSegment, segmentSealedCallback);
    }
}
Also used : Segment(io.pravega.client.segment.impl.Segment) RequiredArgsConstructor(lombok.RequiredArgsConstructor) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) Random(java.util.Random) SegmentSealedException(io.pravega.client.segment.impl.SegmentSealedException) ArrayList(java.util.ArrayList) Stream(io.pravega.client.stream.Stream) Map(java.util.Map) ControllerFailureException(io.pravega.client.control.impl.ControllerFailureException) SegmentOutputStream(io.pravega.client.segment.impl.SegmentOutputStream) EventWriterConfig(io.pravega.client.stream.EventWriterConfig) Synchronized(lombok.Synchronized) Iterator(java.util.Iterator) NoSuchSegmentException(io.pravega.client.segment.impl.NoSuchSegmentException) GuardedBy(javax.annotation.concurrent.GuardedBy) RetriesExhaustedException(io.pravega.common.util.RetriesExhaustedException) DelegationTokenProvider(io.pravega.client.security.auth.DelegationTokenProvider) SegmentOutputStreamFactory(io.pravega.client.segment.impl.SegmentOutputStreamFactory) Consumer(java.util.function.Consumer) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) Entry(java.util.Map.Entry) Preconditions(com.google.common.base.Preconditions) RandomFactory(io.pravega.common.hash.RandomFactory) Collections(java.util.Collections) Controller(io.pravega.client.control.impl.Controller) Futures(io.pravega.common.concurrent.Futures) RetriesExhaustedException(io.pravega.common.util.RetriesExhaustedException) ControllerFailureException(io.pravega.client.control.impl.ControllerFailureException) SegmentSealedException(io.pravega.client.segment.impl.SegmentSealedException) ControllerFailureException(io.pravega.client.control.impl.ControllerFailureException) NoSuchSegmentException(io.pravega.client.segment.impl.NoSuchSegmentException) RetriesExhaustedException(io.pravega.common.util.RetriesExhaustedException) NoSuchSegmentException(io.pravega.client.segment.impl.NoSuchSegmentException)

Example 10 with ControllerFailureException

use of io.pravega.client.control.impl.ControllerFailureException in project pravega by pravega.

the class StreamManagerImplTest method testForceDeleteScopeWithReaderGroups.

@Test
public void testForceDeleteScopeWithReaderGroups() throws ConnectionFailedException, DeleteScopeFailedException {
    // 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));
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            WireCommands.DeleteSegment request = (WireCommands.DeleteSegment) invocation.getArgument(0);
            connectionFactory.getProcessor(location).process(new WireCommands.SegmentDeleted(request.getRequestId(), request.getSegment()));
            return null;
        }
    }).when(connection).send(Mockito.any(WireCommands.DeleteSegment.class));
    connectionFactory.provideConnection(location, connection);
    MockController mockController = spy(new MockController(location.getEndpoint(), location.getPort(), connectionFactory, true));
    ConnectionPoolImpl pool = new ConnectionPoolImpl(ClientConfig.builder().maxConnectionsPerSegmentStore(1).build(), connectionFactory);
    @Cleanup final StreamManager streamManager = new StreamManagerImpl(mockController, pool);
    String scope = "scope";
    String stream1 = "stream1";
    String stream2 = "stream2";
    String readerGroup1 = "readerGroup1";
    String readerGroup2 = "readerGroup2";
    ReaderGroupConfig config1 = ReaderGroupConfig.builder().stream(NameUtils.getScopedStreamName(scope, stream1)).build();
    ReaderGroupConfig config2 = ReaderGroupConfig.builder().stream(NameUtils.getScopedStreamName(scope, stream2)).build();
    streamManager.createScope(scope);
    streamManager.createStream(scope, stream1, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(3)).build());
    streamManager.createStream(scope, stream2, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(3)).build());
    Set<Stream> streams = Sets.newHashSet(streamManager.listStreams(scope));
    assertEquals(2, streams.size());
    assertTrue(streams.stream().anyMatch(x -> x.getStreamName().equals(stream1)));
    assertTrue(streams.stream().anyMatch(x -> x.getStreamName().equals(stream2)));
    mockController.createReaderGroup(scope, readerGroup1, config1);
    mockController.createReaderGroup(scope, readerGroup2, config2);
    // mock controller client to throw exceptions when attempting to get config for reader-group.
    doAnswer(x -> Futures.failedFuture(new ControllerFailureException("Unable to access reader-group config"))).when(mockController).getReaderGroupConfig(scope, readerGroup1);
    doAnswer(x -> new AsyncIterator<Stream>() {

        final Iterator<Stream> iterator = new ArrayList<Stream>(Arrays.asList(new StreamImpl(scope, stream1), new StreamImpl(scope, stream2), new StreamImpl(scope, NameUtils.getStreamForReaderGroup(readerGroup1)), new StreamImpl(scope, NameUtils.getStreamForReaderGroup(readerGroup2)))).iterator();

        @Override
        public CompletableFuture<Stream> getNext() {
            Stream next;
            if (!iterator.hasNext()) {
                next = null;
            } else {
                next = iterator.next();
            }
            return CompletableFuture.completedFuture(next);
        }
    }).when(mockController).listStreams(scope);
    AssertExtensions.assertThrows("Should have thrown exception", () -> streamManager.deleteScope(scope, true), e -> Exceptions.unwrap(e) instanceof DeleteScopeFailedException);
    // reset mock controller
    reset(mockController);
    streamManager.createStream(scope, stream1, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(3)).build());
    streamManager.createStream(scope, stream2, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(3)).build());
    streams = Sets.newHashSet(streamManager.listStreams(scope));
    assertEquals(2, streams.size());
    assertTrue(streams.stream().anyMatch(x -> x.getStreamName().equals(stream1)));
    assertTrue(streams.stream().anyMatch(x -> x.getStreamName().equals(stream2)));
    mockController.createReaderGroup(scope, readerGroup1, config1);
    mockController.createReaderGroup(scope, readerGroup2, config2);
    // mock controller client to throw exceptions when attempting to delete the reader-group.
    doAnswer(x -> Futures.failedFuture(new ControllerFailureException("Unable to delete reader-group"))).when(mockController).deleteReaderGroup(scope, readerGroup1, config1.getReaderGroupId());
    doAnswer(x -> new AsyncIterator<Stream>() {

        final Iterator<Stream> iterator = new ArrayList<Stream>(Arrays.asList(new StreamImpl(scope, stream1), new StreamImpl(scope, stream2), new StreamImpl(scope, NameUtils.getStreamForReaderGroup(readerGroup1)), new StreamImpl(scope, NameUtils.getStreamForReaderGroup(readerGroup2)))).iterator();

        @Override
        public CompletableFuture<Stream> getNext() {
            Stream next;
            if (!iterator.hasNext()) {
                next = null;
            } else {
                next = iterator.next();
            }
            return CompletableFuture.completedFuture(next);
        }
    }).when(mockController).listStreams(scope);
    AssertExtensions.assertThrows("Should have thrown exception", () -> streamManager.deleteScope(scope, true), e -> Exceptions.unwrap(e) instanceof DeleteScopeFailedException);
    // reset mock controller
    reset(mockController);
    streamManager.createStream(scope, stream1, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(3)).build());
    streamManager.createStream(scope, stream2, StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(3)).build());
    streams = Sets.newHashSet(streamManager.listStreams(scope));
    assertEquals(2, streams.size());
    assertTrue(streams.stream().anyMatch(x -> x.getStreamName().equals(stream1)));
    assertTrue(streams.stream().anyMatch(x -> x.getStreamName().equals(stream2)));
    mockController.createReaderGroup(scope, readerGroup1, config1);
    mockController.createReaderGroup(scope, readerGroup2, config2);
    // mock controller client to throw ReaderGroupNotFoundException when attempting to get the config of reader-group.
    doAnswer(x -> Futures.failedFuture(new ReaderGroupNotFoundException("Reader-group does not exist"))).when(mockController).getReaderGroupConfig(scope, readerGroup1);
    doAnswer(x -> new AsyncIterator<Stream>() {

        final Iterator<Stream> iterator = new ArrayList<Stream>(Arrays.asList(new StreamImpl(scope, stream1), new StreamImpl(scope, stream2), new StreamImpl(scope, NameUtils.getStreamForReaderGroup(readerGroup1)), new StreamImpl(scope, NameUtils.getStreamForReaderGroup(readerGroup2)))).iterator();

        @Override
        public CompletableFuture<Stream> getNext() {
            Stream next;
            if (!iterator.hasNext()) {
                next = null;
            } else {
                next = iterator.next();
            }
            return CompletableFuture.completedFuture(next);
        }
    }).when(mockController).listStreams(scope);
    assertTrue(streamManager.deleteScope(scope, true));
}
Also used : Arrays(java.util.Arrays) AssertExtensions(io.pravega.test.common.AssertExtensions) Cleanup(lombok.Cleanup) DeleteScopeFailedException(io.pravega.client.stream.DeleteScopeFailedException) StreamConfiguration(io.pravega.client.stream.StreamConfiguration) KeyValueTableConfiguration(io.pravega.client.tables.KeyValueTableConfiguration) ReaderGroupNotFoundException(io.pravega.client.stream.ReaderGroupNotFoundException) StreamSegments(io.pravega.client.stream.impl.StreamSegments) MockController(io.pravega.client.stream.mock.MockController) ClientConnection(io.pravega.client.connection.impl.ClientConnection) KeyValueTableInfo(io.pravega.client.admin.KeyValueTableInfo) Stream(io.pravega.client.stream.Stream) After(org.junit.After) Mockito.doAnswer(org.mockito.Mockito.doAnswer) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) URI(java.net.URI) Mockito.doReturn(org.mockito.Mockito.doReturn) ReaderGroupConfig(io.pravega.client.stream.ReaderGroupConfig) Set(java.util.Set) StreamInfo(io.pravega.client.admin.StreamInfo) Sets(com.google.common.collect.Sets) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) Assert.assertFalse(org.junit.Assert.assertFalse) TestUtils(io.pravega.test.common.TestUtils) Controller(io.pravega.client.control.impl.Controller) Futures(io.pravega.common.concurrent.Futures) Mockito.mock(org.mockito.Mockito.mock) StreamImpl(io.pravega.client.stream.impl.StreamImpl) ConnectionFailedException(io.pravega.shared.protocol.netty.ConnectionFailedException) StreamManager(io.pravega.client.admin.StreamManager) Exceptions(io.pravega.common.Exceptions) CompletableFuture(java.util.concurrent.CompletableFuture) ConnectionPoolImpl(io.pravega.client.connection.impl.ConnectionPoolImpl) Mockito.spy(org.mockito.Mockito.spy) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Answer(org.mockito.stubbing.Answer) KeyValueTableManager(io.pravega.client.admin.KeyValueTableManager) InvocationOnMock(org.mockito.invocation.InvocationOnMock) Lists(com.google.common.collect.Lists) ControllerFailureException(io.pravega.client.control.impl.ControllerFailureException) Before(org.junit.Before) NameUtils(io.pravega.shared.NameUtils) Iterator(java.util.Iterator) Assert.assertNotNull(org.junit.Assert.assertNotNull) MockConnectionFactoryImpl(io.pravega.client.stream.mock.MockConnectionFactoryImpl) Assert.assertTrue(org.junit.Assert.assertTrue) AsyncIterator(io.pravega.common.util.AsyncIterator) Test(org.junit.Test) WireCommands(io.pravega.shared.protocol.netty.WireCommands) Mockito(org.mockito.Mockito) TreeMap(java.util.TreeMap) InvalidStreamException(io.pravega.client.stream.InvalidStreamException) Assert(org.junit.Assert) Collections(java.util.Collections) Mockito.reset(org.mockito.Mockito.reset) ScalingPolicy(io.pravega.client.stream.ScalingPolicy) Assert.assertEquals(org.junit.Assert.assertEquals) ClientConfig(io.pravega.client.ClientConfig) ConnectionPoolImpl(io.pravega.client.connection.impl.ConnectionPoolImpl) Cleanup(lombok.Cleanup) ReaderGroupNotFoundException(io.pravega.client.stream.ReaderGroupNotFoundException) CompletableFuture(java.util.concurrent.CompletableFuture) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) ClientConnection(io.pravega.client.connection.impl.ClientConnection) Stream(io.pravega.client.stream.Stream) DeleteScopeFailedException(io.pravega.client.stream.DeleteScopeFailedException) WireCommands(io.pravega.shared.protocol.netty.WireCommands) ReaderGroupConfig(io.pravega.client.stream.ReaderGroupConfig) InvocationOnMock(org.mockito.invocation.InvocationOnMock) StreamManager(io.pravega.client.admin.StreamManager) StreamImpl(io.pravega.client.stream.impl.StreamImpl) ControllerFailureException(io.pravega.client.control.impl.ControllerFailureException) MockController(io.pravega.client.stream.mock.MockController) Test(org.junit.Test)

Aggregations

ControllerFailureException (io.pravega.client.control.impl.ControllerFailureException)15 Test (org.junit.Test)12 Stream (io.pravega.client.stream.Stream)9 Controller (io.pravega.client.control.impl.Controller)6 ReaderGroupConfig (io.pravega.client.stream.ReaderGroupConfig)6 StreamImpl (io.pravega.client.stream.impl.StreamImpl)6 Futures (io.pravega.common.concurrent.Futures)6 ArrayList (java.util.ArrayList)6 Iterator (java.util.Iterator)6 CompletableFuture (java.util.concurrent.CompletableFuture)6 KeyValueTableInfo (io.pravega.client.admin.KeyValueTableInfo)5 Segment (io.pravega.client.segment.impl.Segment)5 InvalidStreamException (io.pravega.client.stream.InvalidStreamException)5 StreamCut (io.pravega.client.stream.StreamCut)5 StreamCutImpl (io.pravega.client.stream.impl.StreamCutImpl)5 Exceptions (io.pravega.common.Exceptions)5 AsyncIterator (io.pravega.common.util.AsyncIterator)5 ClientConfig (io.pravega.client.ClientConfig)4 StreamInfo (io.pravega.client.admin.StreamInfo)4 StreamManager (io.pravega.client.admin.StreamManager)4