Search in sources :

Example 1 with PulsarServiceNameResolver

use of org.apache.pulsar.client.impl.PulsarServiceNameResolver in project pulsar by yahoo.

the class BrokerServiceThrottlingTest method testLookupThrottlingForClientByBroker.

/**
 * Verifies: Broker side throttling:
 *
 * <pre>
 * 1. concurrent_consumer_creation > maxConcurrentLookupRequest at broker
 * 2. few of the consumer creation must fail with TooManyLookupRequestException.
 * </pre>
 *
 * @throws Exception
 */
@Test
public void testLookupThrottlingForClientByBroker() throws Exception {
    final String topicName = "persistent://prop/ns-abc/newTopic";
    @Cleanup PulsarClient pulsarClient = PulsarClient.builder().serviceUrl(pulsar.getBrokerServiceUrl()).statsInterval(0, TimeUnit.SECONDS).ioThreads(20).connectionsPerBroker(20).build();
    int newPermits = 1;
    admin.brokers().updateDynamicConfiguration("maxConcurrentLookupRequest", Integer.toString(newPermits));
    // wait config to be updated
    for (int i = 0; i < 5; i++) {
        if (pulsar.getConfiguration().getMaxConcurrentLookupRequest() != newPermits) {
            Thread.sleep(100 + (i * 10));
        } else {
            break;
        }
    }
    PulsarServiceNameResolver resolver = new PulsarServiceNameResolver();
    resolver.updateServiceUrl(pulsar.getBrokerServiceUrl());
    ClientConfigurationData conf = new ClientConfigurationData();
    conf.setConnectionsPerBroker(20);
    EventLoopGroup eventLoop = EventLoopUtil.newEventLoopGroup(20, false, new DefaultThreadFactory("test-pool", Thread.currentThread().isDaemon()));
    ExecutorService executor = Executors.newFixedThreadPool(10);
    try (ConnectionPool pool = new ConnectionPool(conf, eventLoop)) {
        final int totalConsumers = 20;
        List<Future<?>> futures = new ArrayList<>();
        // test for partitionMetadataRequest
        for (int i = 0; i < totalConsumers; i++) {
            long reqId = 0xdeadbeef + i;
            Future<?> f = executor.submit(() -> {
                ByteBuf request = Commands.newPartitionMetadataRequest(topicName, reqId);
                pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request, reqId)).get();
                return null;
            });
            futures.add(f);
        }
        int rejects = 0;
        for (Future<?> f : futures) {
            try {
                f.get();
            } catch (ExecutionException e) {
                Throwable rootCause = e;
                while (rootCause instanceof ExecutionException) {
                    rootCause = rootCause.getCause();
                }
                if (rootCause instanceof org.apache.pulsar.client.api.PulsarClientException.TooManyRequestsException) {
                    rejects++;
                } else {
                    throw e;
                }
            }
        }
        assertTrue(rejects > 0);
        futures.clear();
        // test for lookup
        for (int i = 0; i < totalConsumers; i++) {
            long reqId = 0xdeadfeef + i;
            Future<?> f = executor.submit(() -> {
                ByteBuf request = Commands.newLookup(topicName, true, reqId);
                pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request, reqId)).get();
                return null;
            });
            futures.add(f);
        }
        rejects = 0;
        for (Future<?> f : futures) {
            try {
                f.get();
            } catch (ExecutionException e) {
                Throwable rootCause = e;
                while (rootCause instanceof ExecutionException) {
                    rootCause = rootCause.getCause();
                }
                if (rootCause instanceof org.apache.pulsar.client.api.PulsarClientException.TooManyRequestsException) {
                    rejects++;
                } else {
                    throw e;
                }
            }
        }
        assertTrue(rejects > 0);
    } finally {
        executor.shutdownNow();
        eventLoop.shutdownNow();
    }
}
Also used : ClientConfigurationData(org.apache.pulsar.client.impl.conf.ClientConfigurationData) ConnectionPool(org.apache.pulsar.client.impl.ConnectionPool) PulsarServiceNameResolver(org.apache.pulsar.client.impl.PulsarServiceNameResolver) ConnectionPool(org.apache.pulsar.client.impl.ConnectionPool) DefaultThreadFactory(io.netty.util.concurrent.DefaultThreadFactory) Assert.assertEquals(org.testng.Assert.assertEquals) Cleanup(lombok.Cleanup) Test(org.testng.annotations.Test) AfterMethod(org.testng.annotations.AfterMethod) ArrayList(java.util.ArrayList) Commands(org.apache.pulsar.common.protocol.Commands) Future(java.util.concurrent.Future) Lists(com.google.common.collect.Lists) ByteBuf(io.netty.buffer.ByteBuf) Map(java.util.Map) PulsarClient(org.apache.pulsar.client.api.PulsarClient) PulsarClientException(org.apache.pulsar.client.api.PulsarClientException) ExecutorService(java.util.concurrent.ExecutorService) Assert.assertNotEquals(org.testng.Assert.assertNotEquals) EventLoopGroup(io.netty.channel.EventLoopGroup) EventLoopUtil(org.apache.pulsar.common.util.netty.EventLoopUtil) Assert.fail(org.testng.Assert.fail) BeforeMethod(org.testng.annotations.BeforeMethod) UUID(java.util.UUID) SubscriptionType(org.apache.pulsar.client.api.SubscriptionType) Executors(java.util.concurrent.Executors) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) CountDownLatch(java.util.concurrent.CountDownLatch) Consumer(org.apache.pulsar.client.api.Consumer) List(java.util.List) TreeMap(java.util.TreeMap) ClientConfigurationData(org.apache.pulsar.client.impl.conf.ClientConfigurationData) Assert.assertTrue(org.testng.Assert.assertTrue) Collections(java.util.Collections) ArrayList(java.util.ArrayList) PulsarServiceNameResolver(org.apache.pulsar.client.impl.PulsarServiceNameResolver) ByteBuf(io.netty.buffer.ByteBuf) Cleanup(lombok.Cleanup) DefaultThreadFactory(io.netty.util.concurrent.DefaultThreadFactory) EventLoopGroup(io.netty.channel.EventLoopGroup) ExecutorService(java.util.concurrent.ExecutorService) PulsarClientException(org.apache.pulsar.client.api.PulsarClientException) Future(java.util.concurrent.Future) PulsarClient(org.apache.pulsar.client.api.PulsarClient) ExecutionException(java.util.concurrent.ExecutionException) Test(org.testng.annotations.Test)

Example 2 with PulsarServiceNameResolver

use of org.apache.pulsar.client.impl.PulsarServiceNameResolver in project pulsar by yahoo.

the class PulsarWebResource method getRedirectionUrl.

private URI getRedirectionUrl(ClusterData differentClusterData) throws MalformedURLException {
    try {
        PulsarServiceNameResolver serviceNameResolver = new PulsarServiceNameResolver();
        if (isRequestHttps() && pulsar.getConfiguration().getWebServicePortTls().isPresent() && StringUtils.isNotBlank(differentClusterData.getServiceUrlTls())) {
            serviceNameResolver.updateServiceUrl(differentClusterData.getServiceUrlTls());
        } else {
            serviceNameResolver.updateServiceUrl(differentClusterData.getServiceUrl());
        }
        URL webUrl = new URL(serviceNameResolver.resolveHostUri().toString());
        return UriBuilder.fromUri(uri.getRequestUri()).host(webUrl.getHost()).port(webUrl.getPort()).build();
    } catch (PulsarClientException.InvalidServiceURL exception) {
        throw new MalformedURLException(exception.getMessage());
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) PulsarClientException(org.apache.pulsar.client.api.PulsarClientException) PulsarServiceNameResolver(org.apache.pulsar.client.impl.PulsarServiceNameResolver) URL(java.net.URL)

Example 3 with PulsarServiceNameResolver

use of org.apache.pulsar.client.impl.PulsarServiceNameResolver in project incubator-pulsar by apache.

the class BrokerServiceThrottlingTest method testLookupThrottlingForClientByBroker.

/**
 * Verifies: Broker side throttling:
 *
 * <pre>
 * 1. concurrent_consumer_creation > maxConcurrentLookupRequest at broker
 * 2. few of the consumer creation must fail with TooManyLookupRequestException.
 * </pre>
 *
 * @throws Exception
 */
@Test
public void testLookupThrottlingForClientByBroker() throws Exception {
    final String topicName = "persistent://prop/ns-abc/newTopic";
    @Cleanup PulsarClient pulsarClient = PulsarClient.builder().serviceUrl(pulsar.getBrokerServiceUrl()).statsInterval(0, TimeUnit.SECONDS).ioThreads(20).connectionsPerBroker(20).build();
    int newPermits = 1;
    admin.brokers().updateDynamicConfiguration("maxConcurrentLookupRequest", Integer.toString(newPermits));
    // wait config to be updated
    for (int i = 0; i < 5; i++) {
        if (pulsar.getConfiguration().getMaxConcurrentLookupRequest() != newPermits) {
            Thread.sleep(100 + (i * 10));
        } else {
            break;
        }
    }
    PulsarServiceNameResolver resolver = new PulsarServiceNameResolver();
    resolver.updateServiceUrl(pulsar.getBrokerServiceUrl());
    ClientConfigurationData conf = new ClientConfigurationData();
    conf.setConnectionsPerBroker(20);
    EventLoopGroup eventLoop = EventLoopUtil.newEventLoopGroup(20, false, new DefaultThreadFactory("test-pool", Thread.currentThread().isDaemon()));
    ExecutorService executor = Executors.newFixedThreadPool(10);
    try (ConnectionPool pool = new ConnectionPool(conf, eventLoop)) {
        final int totalConsumers = 20;
        List<Future<?>> futures = new ArrayList<>();
        // test for partitionMetadataRequest
        for (int i = 0; i < totalConsumers; i++) {
            long reqId = 0xdeadbeef + i;
            Future<?> f = executor.submit(() -> {
                ByteBuf request = Commands.newPartitionMetadataRequest(topicName, reqId);
                pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request, reqId)).get();
                return null;
            });
            futures.add(f);
        }
        int rejects = 0;
        for (Future<?> f : futures) {
            try {
                f.get();
            } catch (ExecutionException e) {
                Throwable rootCause = e;
                while (rootCause instanceof ExecutionException) {
                    rootCause = rootCause.getCause();
                }
                if (rootCause instanceof org.apache.pulsar.client.api.PulsarClientException.TooManyRequestsException) {
                    rejects++;
                } else {
                    throw e;
                }
            }
        }
        assertTrue(rejects > 0);
        futures.clear();
        // test for lookup
        for (int i = 0; i < totalConsumers; i++) {
            long reqId = 0xdeadfeef + i;
            Future<?> f = executor.submit(() -> {
                ByteBuf request = Commands.newLookup(topicName, true, reqId);
                pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request, reqId)).get();
                return null;
            });
            futures.add(f);
        }
        rejects = 0;
        for (Future<?> f : futures) {
            try {
                f.get();
            } catch (ExecutionException e) {
                Throwable rootCause = e;
                while (rootCause instanceof ExecutionException) {
                    rootCause = rootCause.getCause();
                }
                if (rootCause instanceof org.apache.pulsar.client.api.PulsarClientException.TooManyRequestsException) {
                    rejects++;
                } else {
                    throw e;
                }
            }
        }
        assertTrue(rejects > 0);
    } finally {
        executor.shutdownNow();
        eventLoop.shutdownNow();
    }
}
Also used : ClientConfigurationData(org.apache.pulsar.client.impl.conf.ClientConfigurationData) ConnectionPool(org.apache.pulsar.client.impl.ConnectionPool) PulsarServiceNameResolver(org.apache.pulsar.client.impl.PulsarServiceNameResolver) ConnectionPool(org.apache.pulsar.client.impl.ConnectionPool) DefaultThreadFactory(io.netty.util.concurrent.DefaultThreadFactory) Assert.assertEquals(org.testng.Assert.assertEquals) Cleanup(lombok.Cleanup) Test(org.testng.annotations.Test) AfterMethod(org.testng.annotations.AfterMethod) ArrayList(java.util.ArrayList) Commands(org.apache.pulsar.common.protocol.Commands) Future(java.util.concurrent.Future) Lists(com.google.common.collect.Lists) ByteBuf(io.netty.buffer.ByteBuf) Map(java.util.Map) PulsarClient(org.apache.pulsar.client.api.PulsarClient) PulsarClientException(org.apache.pulsar.client.api.PulsarClientException) ExecutorService(java.util.concurrent.ExecutorService) Assert.assertNotEquals(org.testng.Assert.assertNotEquals) EventLoopGroup(io.netty.channel.EventLoopGroup) EventLoopUtil(org.apache.pulsar.common.util.netty.EventLoopUtil) Assert.fail(org.testng.Assert.fail) BeforeMethod(org.testng.annotations.BeforeMethod) UUID(java.util.UUID) SubscriptionType(org.apache.pulsar.client.api.SubscriptionType) Executors(java.util.concurrent.Executors) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) CountDownLatch(java.util.concurrent.CountDownLatch) Consumer(org.apache.pulsar.client.api.Consumer) List(java.util.List) TreeMap(java.util.TreeMap) ClientConfigurationData(org.apache.pulsar.client.impl.conf.ClientConfigurationData) Assert.assertTrue(org.testng.Assert.assertTrue) Collections(java.util.Collections) ArrayList(java.util.ArrayList) PulsarServiceNameResolver(org.apache.pulsar.client.impl.PulsarServiceNameResolver) ByteBuf(io.netty.buffer.ByteBuf) Cleanup(lombok.Cleanup) DefaultThreadFactory(io.netty.util.concurrent.DefaultThreadFactory) EventLoopGroup(io.netty.channel.EventLoopGroup) ExecutorService(java.util.concurrent.ExecutorService) PulsarClientException(org.apache.pulsar.client.api.PulsarClientException) Future(java.util.concurrent.Future) PulsarClient(org.apache.pulsar.client.api.PulsarClient) ExecutionException(java.util.concurrent.ExecutionException) Test(org.testng.annotations.Test)

Example 4 with PulsarServiceNameResolver

use of org.apache.pulsar.client.impl.PulsarServiceNameResolver in project incubator-pulsar by apache.

the class PulsarWebResource method getRedirectionUrl.

private URI getRedirectionUrl(ClusterData differentClusterData) throws MalformedURLException {
    try {
        PulsarServiceNameResolver serviceNameResolver = new PulsarServiceNameResolver();
        if (isRequestHttps() && pulsar.getConfiguration().getWebServicePortTls().isPresent() && StringUtils.isNotBlank(differentClusterData.getServiceUrlTls())) {
            serviceNameResolver.updateServiceUrl(differentClusterData.getServiceUrlTls());
        } else {
            serviceNameResolver.updateServiceUrl(differentClusterData.getServiceUrl());
        }
        URL webUrl = new URL(serviceNameResolver.resolveHostUri().toString());
        return UriBuilder.fromUri(uri.getRequestUri()).host(webUrl.getHost()).port(webUrl.getPort()).build();
    } catch (PulsarClientException.InvalidServiceURL exception) {
        throw new MalformedURLException(exception.getMessage());
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) PulsarClientException(org.apache.pulsar.client.api.PulsarClientException) PulsarServiceNameResolver(org.apache.pulsar.client.impl.PulsarServiceNameResolver) URL(java.net.URL)

Example 5 with PulsarServiceNameResolver

use of org.apache.pulsar.client.impl.PulsarServiceNameResolver in project incubator-pulsar by apache.

the class BrokerServiceTest method testLookupThrottlingForClientByClient.

/**
 * Verifies: client side throttling.
 *
 * @throws Exception
 */
@Test
public void testLookupThrottlingForClientByClient() throws Exception {
    // This test looks like it could be flakey, if the broker responds
    // quickly enough, there may never be concurrency in requests
    final String topicName = "persistent://prop/ns-abc/newTopic";
    PulsarServiceNameResolver resolver = new PulsarServiceNameResolver();
    resolver.updateServiceUrl(pulsar.getBrokerServiceUrl());
    ClientConfigurationData conf = new ClientConfigurationData();
    conf.setConcurrentLookupRequest(1);
    conf.setMaxLookupRequest(2);
    EventLoopGroup eventLoop = EventLoopUtil.newEventLoopGroup(20, false, new DefaultThreadFactory("test-pool", Thread.currentThread().isDaemon()));
    long reqId = 0xdeadbeef;
    try (ConnectionPool pool = new ConnectionPool(conf, eventLoop)) {
        // for PMR
        // 2 lookup will succeed
        long reqId1 = reqId++;
        ByteBuf request1 = Commands.newPartitionMetadataRequest(topicName, reqId1);
        CompletableFuture<?> f1 = pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request1, reqId1));
        long reqId2 = reqId++;
        ByteBuf request2 = Commands.newPartitionMetadataRequest(topicName, reqId2);
        CompletableFuture<?> f2 = pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request2, reqId2));
        f1.get();
        f2.get();
        // 3 lookup will fail
        long reqId3 = reqId++;
        ByteBuf request3 = Commands.newPartitionMetadataRequest(topicName, reqId3);
        f1 = pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request3, reqId3));
        long reqId4 = reqId++;
        ByteBuf request4 = Commands.newPartitionMetadataRequest(topicName, reqId4);
        f2 = pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request4, reqId4));
        long reqId5 = reqId++;
        ByteBuf request5 = Commands.newPartitionMetadataRequest(topicName, reqId5);
        CompletableFuture<?> f3 = pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request5, reqId5));
        try {
            f1.get();
            f2.get();
            f3.get();
            fail("At least one should fail");
        } catch (ExecutionException e) {
            Throwable rootCause = e;
            while (rootCause instanceof ExecutionException) {
                rootCause = rootCause.getCause();
            }
            if (!(rootCause instanceof org.apache.pulsar.client.api.PulsarClientException.TooManyRequestsException)) {
                throw e;
            }
        }
        // for Lookup
        // 2 lookup will succeed
        long reqId6 = reqId++;
        ByteBuf request6 = Commands.newLookup(topicName, true, reqId6);
        f1 = pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request6, reqId6));
        long reqId7 = reqId++;
        ByteBuf request7 = Commands.newLookup(topicName, true, reqId7);
        f2 = pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request7, reqId7));
        f1.get();
        f2.get();
        // 3 lookup will fail
        long reqId8 = reqId++;
        ByteBuf request8 = Commands.newLookup(topicName, true, reqId8);
        f1 = pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request8, reqId8));
        long reqId9 = reqId++;
        ByteBuf request9 = Commands.newLookup(topicName, true, reqId9);
        f2 = pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request9, reqId9));
        long reqId10 = reqId++;
        ByteBuf request10 = Commands.newLookup(topicName, true, reqId10);
        f3 = pool.getConnection(resolver.resolveHost()).thenCompose(clientCnx -> clientCnx.newLookup(request10, reqId10));
        try {
            f1.get();
            f2.get();
            f3.get();
            fail("At least one should fail");
        } catch (ExecutionException e) {
            Throwable rootCause = e;
            while (rootCause instanceof ExecutionException) {
                rootCause = rootCause.getCause();
            }
            if (!(rootCause instanceof org.apache.pulsar.client.api.PulsarClientException.TooManyRequestsException)) {
                throw e;
            }
        }
    }
}
Also used : ClientConfigurationData(org.apache.pulsar.client.impl.conf.ClientConfigurationData) ConnectionPool(org.apache.pulsar.client.impl.ConnectionPool) JsonObject(com.google.gson.JsonObject) SubscriptionStats(org.apache.pulsar.common.policies.data.SubscriptionStats) ConnectionPool(org.apache.pulsar.client.impl.ConnectionPool) DefaultThreadFactory(io.netty.util.concurrent.DefaultThreadFactory) Producer(org.apache.pulsar.client.api.Producer) TimeoutException(java.util.concurrent.TimeoutException) Cleanup(lombok.Cleanup) Test(org.testng.annotations.Test) TRANSACTION_COORDINATOR_LOG(org.apache.pulsar.common.naming.SystemTopicNames.TRANSACTION_COORDINATOR_LOG) ManagedLedgerFactoryImpl(org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryImpl) TRANSACTION_COORDINATOR_ASSIGN(org.apache.pulsar.common.naming.SystemTopicNames.TRANSACTION_COORDINATOR_ASSIGN) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ManagedLedgerConfig(org.apache.bookkeeper.mledger.ManagedLedgerConfig) Gson(com.google.gson.Gson) Map(java.util.Map) NamespaceName(org.apache.pulsar.common.naming.NamespaceName) Mockito.doReturn(org.mockito.Mockito.doReturn) Assert.assertFalse(org.testng.Assert.assertFalse) PulsarClientException(org.apache.pulsar.client.api.PulsarClientException) EventLoopUtil(org.apache.pulsar.common.util.netty.EventLoopUtil) BeforeClass(org.testng.annotations.BeforeClass) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) LocalPolicies(org.apache.pulsar.common.policies.data.LocalPolicies) Assert.assertNotNull(org.testng.Assert.assertNotNull) UUID(java.util.UUID) Sets(com.google.common.collect.Sets) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) ManagedLedgerException(org.apache.bookkeeper.mledger.ManagedLedgerException) CountDownLatch(java.util.concurrent.CountDownLatch) Consumer(org.apache.pulsar.client.api.Consumer) JsonArray(com.google.gson.JsonArray) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) PersistentTopic(org.apache.pulsar.broker.service.persistent.PersistentTopic) HttpGet(org.apache.http.client.methods.HttpGet) ClientConfigurationData(org.apache.pulsar.client.impl.conf.ClientConfigurationData) ClientBuilder(org.apache.pulsar.client.api.ClientBuilder) Optional(java.util.Optional) Mockito.any(org.mockito.Mockito.any) Awaitility(org.awaitility.Awaitility) PulsarServiceNameResolver(org.apache.pulsar.client.impl.PulsarServiceNameResolver) TopicName(org.apache.pulsar.common.naming.TopicName) Assert.assertNull(org.testng.Assert.assertNull) TopicStats(org.apache.pulsar.common.policies.data.TopicStats) Assert.assertEquals(org.testng.Assert.assertEquals) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) NamespaceService(org.apache.pulsar.broker.namespace.NamespaceService) Message(org.apache.pulsar.client.api.Message) Mockito.spy(org.mockito.Mockito.spy) ArrayList(java.util.ArrayList) Commands(org.apache.pulsar.common.protocol.Commands) HashSet(java.util.HashSet) ProducerBuilder(org.apache.pulsar.client.api.ProducerBuilder) AuthenticationTls(org.apache.pulsar.client.impl.auth.AuthenticationTls) Lists(com.google.common.collect.Lists) ByteBuf(io.netty.buffer.ByteBuf) Assert(org.testng.Assert) HttpClient(org.apache.http.client.HttpClient) BundlesData(org.apache.pulsar.common.policies.data.BundlesData) PrometheusRawMetricsProvider(org.apache.pulsar.broker.stats.prometheus.PrometheusRawMetricsProvider) PulsarClient(org.apache.pulsar.client.api.PulsarClient) NamespaceBundle(org.apache.pulsar.common.naming.NamespaceBundle) ExecutorService(java.util.concurrent.ExecutorService) ManagedLedgerImpl(org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl) AfterClass(org.testng.annotations.AfterClass) EventLoopGroup(io.netty.channel.EventLoopGroup) PulsarAdminException(org.apache.pulsar.client.admin.PulsarAdminException) Assert.fail(org.testng.Assert.fail) IOException(java.io.IOException) PersistenceException(org.apache.pulsar.broker.service.BrokerServiceException.PersistenceException) Field(java.lang.reflect.Field) PulsarService(org.apache.pulsar.broker.PulsarService) SubscriptionType(org.apache.pulsar.client.api.SubscriptionType) InputStreamReader(java.io.InputStreamReader) Schema(org.apache.pulsar.client.api.Schema) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Authentication(org.apache.pulsar.client.api.Authentication) Assert.assertTrue(org.testng.Assert.assertTrue) HttpResponse(org.apache.http.HttpResponse) BufferedReader(java.io.BufferedReader) HttpClientBuilder(org.apache.http.impl.client.HttpClientBuilder) BrokerStats(org.apache.pulsar.client.admin.BrokerStats) InputStream(java.io.InputStream) PulsarServiceNameResolver(org.apache.pulsar.client.impl.PulsarServiceNameResolver) ByteBuf(io.netty.buffer.ByteBuf) DefaultThreadFactory(io.netty.util.concurrent.DefaultThreadFactory) EventLoopGroup(io.netty.channel.EventLoopGroup) PulsarClientException(org.apache.pulsar.client.api.PulsarClientException) ExecutionException(java.util.concurrent.ExecutionException) Test(org.testng.annotations.Test)

Aggregations

PulsarClientException (org.apache.pulsar.client.api.PulsarClientException)9 PulsarServiceNameResolver (org.apache.pulsar.client.impl.PulsarServiceNameResolver)9 Lists (com.google.common.collect.Lists)6 ByteBuf (io.netty.buffer.ByteBuf)6 EventLoopGroup (io.netty.channel.EventLoopGroup)6 DefaultThreadFactory (io.netty.util.concurrent.DefaultThreadFactory)6 ArrayList (java.util.ArrayList)6 List (java.util.List)6 Map (java.util.Map)6 UUID (java.util.UUID)6 CountDownLatch (java.util.concurrent.CountDownLatch)6 ExecutionException (java.util.concurrent.ExecutionException)6 ExecutorService (java.util.concurrent.ExecutorService)6 Executors (java.util.concurrent.Executors)6 TimeUnit (java.util.concurrent.TimeUnit)6 Cleanup (lombok.Cleanup)6 Consumer (org.apache.pulsar.client.api.Consumer)6 PulsarClient (org.apache.pulsar.client.api.PulsarClient)6 SubscriptionType (org.apache.pulsar.client.api.SubscriptionType)6 ConnectionPool (org.apache.pulsar.client.impl.ConnectionPool)6