Search in sources :

Example 26 with ConnectionPool

use of io.pravega.client.connection.impl.ConnectionPool in project pravega by pravega.

the class SegmentMetadataClientTest method testExceptionOnSend.

@Test(timeout = 10000)
public void testExceptionOnSend() throws ConnectionFailedException {
    Segment segment = new Segment("scope", "testRetry", 4);
    PravegaNodeUri endpoint = new PravegaNodeUri("localhost", 0);
    @Cleanup("shutdown") InlineExecutor executor = new InlineExecutor();
    @Cleanup ConnectionPool cf = Mockito.mock(ConnectionPool.class);
    Mockito.when(cf.getInternalExecutor()).thenReturn(executor);
    @Cleanup MockController controller = new MockController(endpoint.getEndpoint(), endpoint.getPort(), cf, true);
    ClientConnection connection1 = mock(ClientConnection.class);
    ClientConnection connection2 = mock(ClientConnection.class);
    AtomicReference<ReplyProcessor> processor = new AtomicReference<>();
    Mockito.doAnswer(invocation -> {
        final CompletableFuture<ClientConnection> future = invocation.getArgument(3);
        future.completeExceptionally(new ConnectionFailedException(new RuntimeException("Mock error")));
        return null;
    }).doAnswer(invocation -> {
        final CompletableFuture<ClientConnection> future = invocation.getArgument(3);
        future.complete(connection1);
        return null;
    }).doAnswer(invocation -> {
        final CompletableFuture<ClientConnection> future = invocation.getArgument(3);
        processor.set(invocation.getArgument(2));
        future.complete(connection2);
        return null;
    }).when(cf).getClientConnection(Mockito.any(Flow.class), Mockito.eq(endpoint), Mockito.any(ReplyProcessor.class), Mockito.<CompletableFuture<ClientConnection>>any());
    final List<Long> requestIds = new ArrayList<>();
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            WireCommands.GetStreamSegmentInfo request = invocation.getArgument(0);
            requestIds.add(request.getRequestId());
            if (requestIds.size() == 1) {
                throw new ConnectionFailedException();
            } else {
                processor.get().process(new StreamSegmentInfo(request.getRequestId(), segment.getScopedName(), true, false, false, 0, 123, 121));
            }
            return null;
        }
    }).when(connection1).send(any(WireCommands.GetStreamSegmentInfo.class));
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            WireCommands.GetStreamSegmentInfo request = invocation.getArgument(0);
            requestIds.add(request.getRequestId());
            processor.get().process(new StreamSegmentInfo(request.getRequestId(), segment.getScopedName(), true, false, false, 0, 123, 121));
            return null;
        }
    }).when(connection2).send(any(WireCommands.GetStreamSegmentInfo.class));
    @Cleanup SegmentMetadataClientImpl client = new SegmentMetadataClientImpl(segment, controller, cf, "");
    InOrder order = Mockito.inOrder(connection1, connection2, cf);
    long length = client.fetchCurrentSegmentLength().join();
    order.verify(cf, Mockito.times(2)).getClientConnection(Mockito.any(Flow.class), Mockito.eq(endpoint), Mockito.any(), Mockito.<CompletableFuture<ClientConnection>>any());
    order.verify(connection1).send(Mockito.eq(new WireCommands.GetStreamSegmentInfo(requestIds.get(0), segment.getScopedName(), "")));
    order.verify(connection1).close();
    order.verify(cf).getClientConnection(Mockito.any(Flow.class), Mockito.eq(endpoint), Mockito.any(), Mockito.<CompletableFuture<ClientConnection>>any());
    order.verify(connection2).send(Mockito.eq(new WireCommands.GetStreamSegmentInfo(requestIds.get(1), segment.getScopedName(), "")));
    order.verifyNoMoreInteractions();
    assertEquals(123, length);
}
Also used : ConnectionPool(io.pravega.client.connection.impl.ConnectionPool) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) AssertExtensions(io.pravega.test.common.AssertExtensions) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) ConnectionFailedException(io.pravega.shared.protocol.netty.ConnectionFailedException) SegmentIsTruncated(io.pravega.shared.protocol.netty.WireCommands.SegmentIsTruncated) Cleanup(lombok.Cleanup) CompletableFuture(java.util.concurrent.CompletableFuture) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) Answer(org.mockito.stubbing.Answer) MockController(io.pravega.client.stream.mock.MockController) InvocationOnMock(org.mockito.invocation.InvocationOnMock) ClientConnection(io.pravega.client.connection.impl.ClientConnection) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) Flow(io.pravega.client.connection.impl.Flow) StreamSegmentInfo(io.pravega.shared.protocol.netty.WireCommands.StreamSegmentInfo) InOrder(org.mockito.InOrder) ConnectionPool(io.pravega.client.connection.impl.ConnectionPool) MockConnectionFactoryImpl(io.pravega.client.stream.mock.MockConnectionFactoryImpl) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) WireCommands(io.pravega.shared.protocol.netty.WireCommands) SegmentAttributeUpdated(io.pravega.shared.protocol.netty.WireCommands.SegmentAttributeUpdated) AtomicLong(java.util.concurrent.atomic.AtomicLong) Mockito(org.mockito.Mockito) List(java.util.List) InvalidTokenException(io.pravega.auth.InvalidTokenException) SegmentTruncated(io.pravega.shared.protocol.netty.WireCommands.SegmentTruncated) InlineExecutor(io.pravega.test.common.InlineExecutor) ReplyProcessor(io.pravega.shared.protocol.netty.ReplyProcessor) Assert.assertEquals(org.junit.Assert.assertEquals) Mockito.mock(org.mockito.Mockito.mock) StreamSegmentInfo(io.pravega.shared.protocol.netty.WireCommands.StreamSegmentInfo) ArrayList(java.util.ArrayList) Cleanup(lombok.Cleanup) CompletableFuture(java.util.concurrent.CompletableFuture) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) InlineExecutor(io.pravega.test.common.InlineExecutor) ClientConnection(io.pravega.client.connection.impl.ClientConnection) InOrder(org.mockito.InOrder) AtomicReference(java.util.concurrent.atomic.AtomicReference) Flow(io.pravega.client.connection.impl.Flow) InvocationOnMock(org.mockito.invocation.InvocationOnMock) AtomicLong(java.util.concurrent.atomic.AtomicLong) MockController(io.pravega.client.stream.mock.MockController) ConnectionFailedException(io.pravega.shared.protocol.netty.ConnectionFailedException) ReplyProcessor(io.pravega.shared.protocol.netty.ReplyProcessor) Test(org.junit.Test)

Example 27 with ConnectionPool

use of io.pravega.client.connection.impl.ConnectionPool in project pravega by pravega.

the class EventProcessorHealthContributorTest method setup.

@SneakyThrows
@Before
public void setup() {
    Host host = mock(Host.class);
    LocalController localController = mock(LocalController.class);
    CheckpointStore checkpointStore = mock(CheckpointStore.class);
    StreamMetadataStore streamStore = mock(StreamMetadataStore.class);
    BucketStore bucketStore = mock(BucketStore.class);
    ConnectionPool connectionPool = mock(ConnectionPool.class);
    StreamMetadataTasks streamMetadataTasks = mock(StreamMetadataTasks.class);
    StreamTransactionMetadataTasks streamTransactionMetadataTasks = mock(StreamTransactionMetadataTasks.class);
    ScheduledExecutorService executor = mock(ScheduledExecutorService.class);
    KVTableMetadataStore kvtMetadataStore = mock(KVTableMetadataStore.class);
    TableMetadataTasks kvtMetadataTasks = mock(TableMetadataTasks.class);
    EventProcessorSystem system = mock(EventProcessorSystemImpl.class);
    ControllerEventProcessorConfig config = ControllerEventProcessorConfigImpl.withDefault();
    EventProcessorGroup<ControllerEvent> processor = getProcessor();
    EventProcessorGroup<ControllerEvent> mockProcessor = spy(processor);
    doThrow(new CheckpointStoreException("host not found")).when(mockProcessor).notifyProcessFailure("host3");
    when(system.createEventProcessorGroup(any(), any(), any())).thenReturn(mockProcessor);
    eventProcessors = spy(new ControllerEventProcessors(host.getHostId(), config, localController, checkpointStore, streamStore, bucketStore, connectionPool, streamMetadataTasks, streamTransactionMetadataTasks, kvtMetadataStore, kvtMetadataTasks, system, executorService()));
    doReturn(true).when(eventProcessors).isReady();
    contributor = new EventProcessorHealthContributor("eventprocessors", eventProcessors);
    builder = Health.builder().name("eventprocessors");
}
Also used : ConnectionPool(io.pravega.client.connection.impl.ConnectionPool) ControllerEventProcessorConfig(io.pravega.controller.server.eventProcessor.ControllerEventProcessorConfig) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) KVTableMetadataStore(io.pravega.controller.store.kvtable.KVTableMetadataStore) EventProcessorSystem(io.pravega.controller.eventProcessor.EventProcessorSystem) Host(io.pravega.common.cluster.Host) CheckpointStore(io.pravega.controller.store.checkpoint.CheckpointStore) StreamMetadataStore(io.pravega.controller.store.stream.StreamMetadataStore) ControllerEvent(io.pravega.shared.controller.event.ControllerEvent) LocalController(io.pravega.controller.server.eventProcessor.LocalController) ControllerEventProcessors(io.pravega.controller.server.eventProcessor.ControllerEventProcessors) StreamTransactionMetadataTasks(io.pravega.controller.task.Stream.StreamTransactionMetadataTasks) CheckpointStoreException(io.pravega.controller.store.checkpoint.CheckpointStoreException) TableMetadataTasks(io.pravega.controller.task.KeyValueTable.TableMetadataTasks) BucketStore(io.pravega.controller.store.stream.BucketStore) StreamMetadataTasks(io.pravega.controller.task.Stream.StreamMetadataTasks) Before(org.junit.Before) SneakyThrows(lombok.SneakyThrows)

Example 28 with ConnectionPool

use of io.pravega.client.connection.impl.ConnectionPool in project pravega by pravega.

the class ScopeTest method testForceDeleteScope.

@Test
public void testForceDeleteScope() throws Exception {
    final String scope = "test";
    final String streamName1 = "test1";
    final String streamName2 = "test2";
    final String streamName3 = "test3";
    final String kvtName1 = "kvt1";
    final String kvtName2 = "kvt2";
    final String groupName1 = "rg1";
    final String groupName2 = "rg2";
    StreamConfiguration config = StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(1)).build();
    @Cleanup Controller controller = controllerWrapper.getController();
    ClientConfig clientConfig = ClientConfig.builder().controllerURI(URI.create("tcp://localhost:" + controllerPort)).build();
    @Cleanup ConnectionPool cp = new ConnectionPoolImpl(clientConfig, new SocketConnectionFactoryImpl(clientConfig));
    @Cleanup ConnectionFactory connectionFactory = new SocketConnectionFactoryImpl(clientConfig);
    controllerWrapper.getControllerService().createScope(scope, 0L).get();
    controller.createStream(scope, streamName1, config).get();
    controller.createStream(scope, streamName2, config).get();
    controller.createStream(scope, streamName3, config).get();
    @Cleanup StreamManager streamManager = new StreamManagerImpl(controller, cp);
    @Cleanup KeyValueTableManager keyValueTableManager = new KeyValueTableManagerImpl(clientConfig);
    @Cleanup ReaderGroupManager readerGroupManager = new ReaderGroupManagerImpl(scope, clientConfig, connectionFactory);
    KeyValueTableConfiguration kvtConfig = KeyValueTableConfiguration.builder().partitionCount(2).primaryKeyLength(4).secondaryKeyLength(4).build();
    keyValueTableManager.createKeyValueTable(scope, kvtName1, kvtConfig);
    keyValueTableManager.createKeyValueTable(scope, kvtName2, kvtConfig);
    readerGroupManager.createReaderGroup(groupName1, ReaderGroupConfig.builder().stream(getScopedStreamName(scope, streamName1)).build());
    readerGroupManager.createReaderGroup(groupName2, ReaderGroupConfig.builder().stream(getScopedStreamName(scope, streamName2)).build());
    assertTrue(streamManager.deleteScope(scope, true));
}
Also used : ConnectionPool(io.pravega.client.connection.impl.ConnectionPool) KeyValueTableManager(io.pravega.client.admin.KeyValueTableManager) ReaderGroupManager(io.pravega.client.admin.ReaderGroupManager) KeyValueTableConfiguration(io.pravega.client.tables.KeyValueTableConfiguration) ConnectionPoolImpl(io.pravega.client.connection.impl.ConnectionPoolImpl) StreamManagerImpl(io.pravega.client.admin.impl.StreamManagerImpl) Controller(io.pravega.client.control.impl.Controller) SocketConnectionFactoryImpl(io.pravega.client.connection.impl.SocketConnectionFactoryImpl) Cleanup(lombok.Cleanup) ConnectionFactory(io.pravega.client.connection.impl.ConnectionFactory) KeyValueTableManagerImpl(io.pravega.client.admin.impl.KeyValueTableManagerImpl) StreamManager(io.pravega.client.admin.StreamManager) StreamConfiguration(io.pravega.client.stream.StreamConfiguration) ClientConfig(io.pravega.client.ClientConfig) ReaderGroupManagerImpl(io.pravega.client.admin.impl.ReaderGroupManagerImpl) Test(org.junit.Test)

Example 29 with ConnectionPool

use of io.pravega.client.connection.impl.ConnectionPool in project pravega by pravega.

the class ScopeTest method testDeleteScopeRecursive.

@Test
public void testDeleteScopeRecursive() throws Exception {
    final String scope = "testDeleteScope";
    final String testFalseScope = "falseScope";
    final String streamName1 = "test1";
    final String streamName2 = "test2";
    final String streamName3 = "test3";
    final String streamName4 = "test4";
    final String kvtName1 = "kvt1";
    final String kvtName2 = "kvt2";
    final String kvtName3 = "kvt3";
    final String groupName1 = "rg1";
    final String groupName2 = "rg2";
    final String groupName3 = "rg3";
    StreamConfiguration config = StreamConfiguration.builder().scalingPolicy(ScalingPolicy.fixed(1)).build();
    @Cleanup Controller controller = controllerWrapper.getController();
    ClientConfig clientConfig = ClientConfig.builder().controllerURI(URI.create("tcp://localhost:" + controllerPort)).build();
    @Cleanup ConnectionPool cp = new ConnectionPoolImpl(clientConfig, new SocketConnectionFactoryImpl(clientConfig));
    @Cleanup ConnectionFactory connectionFactory = new SocketConnectionFactoryImpl(clientConfig);
    // Create scope
    controllerWrapper.getControllerService().createScope(scope, 0L).get();
    assertTrue(controller.checkScopeExists(scope).get());
    // Create streams
    assertTrue(controller.createStream(scope, streamName1, config).get());
    assertTrue(controller.createStream(scope, streamName2, config).get());
    assertTrue(controller.createStream(scope, streamName3, config).get());
    @Cleanup StreamManager streamManager = new StreamManagerImpl(controller, cp);
    @Cleanup KeyValueTableManager keyValueTableManager = new KeyValueTableManagerImpl(clientConfig);
    @Cleanup ReaderGroupManager readerGroupManager = new ReaderGroupManagerImpl(scope, clientConfig, connectionFactory);
    // 1. Call deleteScopeRecursive() without creating a scope
    assertTrue(streamManager.deleteScopeRecursive(testFalseScope));
    // Create KVT under the scope
    KeyValueTableConfiguration kvtConfig = KeyValueTableConfiguration.builder().partitionCount(2).primaryKeyLength(4).secondaryKeyLength(4).build();
    assertTrue(keyValueTableManager.createKeyValueTable(scope, kvtName1, kvtConfig));
    assertTrue(keyValueTableManager.createKeyValueTable(scope, kvtName2, kvtConfig));
    // Create RG under the same scope
    assertTrue(readerGroupManager.createReaderGroup(groupName1, ReaderGroupConfig.builder().stream(getScopedStreamName(scope, streamName1)).build()));
    assertTrue(readerGroupManager.createReaderGroup(groupName2, ReaderGroupConfig.builder().stream(getScopedStreamName(scope, streamName2)).build()));
    // Call deleteScopeRecursive to delete the scope recursively
    assertTrue(streamManager.deleteScopeRecursive(scope));
    // Validate that the scope is deleted
    assertFalse(controller.checkScopeExists(scope).get());
    // Validate create operation of Stream/RG/KVT should throw error
    AssertExtensions.assertThrows("Failed to create Reader Group as Scope does not exits", () -> readerGroupManager.createReaderGroup(groupName3, ReaderGroupConfig.builder().stream(getScopedStreamName(scope, streamName2)).build()), e -> e instanceof IllegalArgumentException);
    AssertExtensions.assertThrows("Scope does not exist", () -> controller.createStream(scope, streamName4, config).get(), e -> e instanceof IllegalArgumentException);
    AssertExtensions.assertThrows("Scope does not exist", () -> keyValueTableManager.createKeyValueTable(scope, kvtName3, kvtConfig), e -> e instanceof IllegalArgumentException);
}
Also used : ConnectionPool(io.pravega.client.connection.impl.ConnectionPool) KeyValueTableManager(io.pravega.client.admin.KeyValueTableManager) ReaderGroupManager(io.pravega.client.admin.ReaderGroupManager) KeyValueTableConfiguration(io.pravega.client.tables.KeyValueTableConfiguration) ConnectionPoolImpl(io.pravega.client.connection.impl.ConnectionPoolImpl) StreamManagerImpl(io.pravega.client.admin.impl.StreamManagerImpl) Controller(io.pravega.client.control.impl.Controller) SocketConnectionFactoryImpl(io.pravega.client.connection.impl.SocketConnectionFactoryImpl) Cleanup(lombok.Cleanup) ConnectionFactory(io.pravega.client.connection.impl.ConnectionFactory) KeyValueTableManagerImpl(io.pravega.client.admin.impl.KeyValueTableManagerImpl) StreamManager(io.pravega.client.admin.StreamManager) StreamConfiguration(io.pravega.client.stream.StreamConfiguration) ClientConfig(io.pravega.client.ClientConfig) ReaderGroupManagerImpl(io.pravega.client.admin.impl.ReaderGroupManagerImpl) Test(org.junit.Test)

Example 30 with ConnectionPool

use of io.pravega.client.connection.impl.ConnectionPool in project pravega by pravega.

the class ScopeTest method testListStreams.

@Test(timeout = 30000)
public void testListStreams() throws Exception {
    final String scope = "test";
    final String streamName1 = "test1";
    final String streamName2 = "test2";
    final String streamName3 = "test3";
    final Map<String, Integer> foundCount = new HashMap<>();
    foundCount.put(streamName1, 0);
    foundCount.put(streamName2, 0);
    foundCount.put(streamName3, 0);
    foundCount.put(NameUtils.getMarkStreamForStream(streamName1), 0);
    foundCount.put(NameUtils.getMarkStreamForStream(streamName2), 0);
    foundCount.put(NameUtils.getMarkStreamForStream(streamName3), 0);
    StreamConfiguration config = StreamConfiguration.builder().scalingPolicy(ScalingPolicy.byEventRate(10, 2, 1)).build();
    @Cleanup Controller controller = controllerWrapper.getController();
    ClientConfig clientConfig = ClientConfig.builder().controllerURI(URI.create("tcp://localhost")).build();
    @Cleanup ConnectionPool cp = new ConnectionPoolImpl(clientConfig, new SocketConnectionFactoryImpl(clientConfig));
    controllerWrapper.getControllerService().createScope(scope, 0L).get();
    controller.createStream(scope, streamName1, config).get();
    controller.createStream(scope, streamName2, config).get();
    controller.createStream(scope, streamName3, config).get();
    @Cleanup StreamManager manager = new StreamManagerImpl(controller, cp);
    Iterator<Stream> iterator = manager.listStreams(scope);
    assertTrue(iterator.hasNext());
    Stream next = iterator.next();
    foundCount.computeIfPresent(next.getStreamName(), (x, y) -> ++y);
    assertTrue(iterator.hasNext());
    next = iterator.next();
    foundCount.computeIfPresent(next.getStreamName(), (x, y) -> ++y);
    assertTrue(iterator.hasNext());
    next = iterator.next();
    foundCount.computeIfPresent(next.getStreamName(), (x, y) -> ++y);
    assertTrue(iterator.hasNext());
    next = iterator.next();
    foundCount.computeIfPresent(next.getStreamName(), (x, y) -> ++y);
    assertTrue(iterator.hasNext());
    next = iterator.next();
    foundCount.computeIfPresent(next.getStreamName(), (x, y) -> ++y);
    assertTrue(iterator.hasNext());
    next = iterator.next();
    foundCount.computeIfPresent(next.getStreamName(), (x, y) -> ++y);
    assertFalse(iterator.hasNext());
    assertTrue(foundCount.entrySet().stream().allMatch(x -> x.getValue() == 1));
    AsyncIterator<Stream> asyncIterator = controller.listStreams(scope);
    next = asyncIterator.getNext().join();
    foundCount.computeIfPresent(next.getStreamName(), (x, y) -> ++y);
    next = asyncIterator.getNext().join();
    foundCount.computeIfPresent(next.getStreamName(), (x, y) -> ++y);
    next = asyncIterator.getNext().join();
    foundCount.computeIfPresent(next.getStreamName(), (x, y) -> ++y);
    next = asyncIterator.getNext().join();
    foundCount.computeIfPresent(next.getStreamName(), (x, y) -> ++y);
    next = asyncIterator.getNext().join();
    foundCount.computeIfPresent(next.getStreamName(), (x, y) -> ++y);
    next = asyncIterator.getNext().join();
    foundCount.computeIfPresent(next.getStreamName(), (x, y) -> ++y);
    next = asyncIterator.getNext().join();
    assertNull(next);
    assertTrue(foundCount.entrySet().stream().allMatch(x -> x.getValue() == 2));
}
Also used : ConnectionPool(io.pravega.client.connection.impl.ConnectionPool) Arrays(java.util.Arrays) TableStore(io.pravega.segmentstore.contracts.tables.TableStore) AssertExtensions(io.pravega.test.common.AssertExtensions) ReaderGroupManagerImpl(io.pravega.client.admin.impl.ReaderGroupManagerImpl) Cleanup(lombok.Cleanup) StreamConfiguration(io.pravega.client.stream.StreamConfiguration) KeyValueTableConfiguration(io.pravega.client.tables.KeyValueTableConfiguration) ServiceBuilderConfig(io.pravega.segmentstore.server.store.ServiceBuilderConfig) Collections.singletonList(java.util.Collections.singletonList) ServiceBuilder(io.pravega.segmentstore.server.store.ServiceBuilder) ReaderGroupManager(io.pravega.client.admin.ReaderGroupManager) Stream(io.pravega.client.stream.Stream) After(org.junit.After) Map(java.util.Map) Status(io.grpc.Status) URI(java.net.URI) PravegaConnectionListener(io.pravega.segmentstore.server.host.handler.PravegaConnectionListener) ReaderGroupConfig(io.pravega.client.stream.ReaderGroupConfig) StreamSegmentStore(io.pravega.segmentstore.contracts.StreamSegmentStore) Collections.emptyList(java.util.Collections.emptyList) Set(java.util.Set) List(java.util.List) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) StreamManagerImpl(io.pravega.client.admin.impl.StreamManagerImpl) KeyValueTableManagerImpl(io.pravega.client.admin.impl.KeyValueTableManagerImpl) Assert.assertFalse(org.junit.Assert.assertFalse) TestUtils(io.pravega.test.common.TestUtils) ControllerWrapper(io.pravega.test.integration.demo.ControllerWrapper) Controller(io.pravega.client.control.impl.Controller) ConnectionFactory(io.pravega.client.connection.impl.ConnectionFactory) StreamManager(io.pravega.client.admin.StreamManager) HashMap(java.util.HashMap) ConnectionPoolImpl(io.pravega.client.connection.impl.ConnectionPoolImpl) KeyValueTableManager(io.pravega.client.admin.KeyValueTableManager) TestingServerStarter(io.pravega.test.common.TestingServerStarter) TestingServer(org.apache.curator.test.TestingServer) SocketConnectionFactoryImpl(io.pravega.client.connection.impl.SocketConnectionFactoryImpl) Before(org.junit.Before) NameUtils(io.pravega.shared.NameUtils) Iterator(java.util.Iterator) ConnectionPool(io.pravega.client.connection.impl.ConnectionPool) Assert.assertTrue(org.junit.Assert.assertTrue) AsyncIterator(io.pravega.common.util.AsyncIterator) Test(org.junit.Test) StatusRuntimeException(io.grpc.StatusRuntimeException) Assert.assertNull(org.junit.Assert.assertNull) NameUtils.getScopedStreamName(io.pravega.shared.NameUtils.getScopedStreamName) ScalingPolicy(io.pravega.client.stream.ScalingPolicy) Assert.assertEquals(org.junit.Assert.assertEquals) ClientConfig(io.pravega.client.ClientConfig) HashMap(java.util.HashMap) ConnectionPoolImpl(io.pravega.client.connection.impl.ConnectionPoolImpl) StreamManagerImpl(io.pravega.client.admin.impl.StreamManagerImpl) Controller(io.pravega.client.control.impl.Controller) SocketConnectionFactoryImpl(io.pravega.client.connection.impl.SocketConnectionFactoryImpl) Cleanup(lombok.Cleanup) StreamManager(io.pravega.client.admin.StreamManager) StreamConfiguration(io.pravega.client.stream.StreamConfiguration) Stream(io.pravega.client.stream.Stream) ClientConfig(io.pravega.client.ClientConfig) Test(org.junit.Test)

Aggregations

ConnectionPool (io.pravega.client.connection.impl.ConnectionPool)41 Cleanup (lombok.Cleanup)22 ConnectionPoolImpl (io.pravega.client.connection.impl.ConnectionPoolImpl)19 SocketConnectionFactoryImpl (io.pravega.client.connection.impl.SocketConnectionFactoryImpl)19 ClientConfig (io.pravega.client.ClientConfig)17 CompletableFuture (java.util.concurrent.CompletableFuture)17 Test (org.junit.Test)16 UUID (java.util.UUID)14 StreamManager (io.pravega.client.admin.StreamManager)13 StreamManagerImpl (io.pravega.client.admin.impl.StreamManagerImpl)13 List (java.util.List)13 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)12 VisibleForTesting (com.google.common.annotations.VisibleForTesting)11 ScalingPolicy (io.pravega.client.stream.ScalingPolicy)11 PravegaNodeUri (io.pravega.shared.protocol.netty.PravegaNodeUri)11 ConnectionFactory (io.pravega.client.connection.impl.ConnectionFactory)10 Exceptions (io.pravega.common.Exceptions)10 HostControllerStore (io.pravega.controller.store.host.HostControllerStore)10 ConnectionFailedException (io.pravega.shared.protocol.netty.ConnectionFailedException)10 WireCommands (io.pravega.shared.protocol.netty.WireCommands)10