Search in sources :

Example 1 with LoadManager

use of org.apache.pulsar.broker.loadbalance.LoadManager in project incubator-pulsar by apache.

the class PulsarService method close.

/**
 * Close the current pulsar service. All resources are released.
 */
@Override
public void close() throws PulsarServerException {
    mutex.lock();
    try {
        if (state == State.Closed) {
            return;
        }
        // close the service in reverse order v.s. in which they are started
        if (this.webService != null) {
            this.webService.close();
            this.webService = null;
        }
        if (this.brokerService != null) {
            this.brokerService.close();
            this.brokerService = null;
        }
        if (this.managedLedgerClientFactory != null) {
            this.managedLedgerClientFactory.close();
            this.managedLedgerClientFactory = null;
        }
        if (bkClientFactory != null) {
            this.bkClientFactory.close();
            this.bkClientFactory = null;
        }
        if (this.leaderElectionService != null) {
            this.leaderElectionService.stop();
            this.leaderElectionService = null;
        }
        loadManagerExecutor.shutdown();
        if (globalZkCache != null) {
            globalZkCache.close();
            globalZkCache = null;
            localZooKeeperConnectionProvider.close();
            localZooKeeperConnectionProvider = null;
        }
        configurationCacheService = null;
        localZkCacheService = null;
        localZkCache = null;
        if (adminClient != null) {
            adminClient.close();
            adminClient = null;
        }
        nsservice = null;
        // guard against null executors
        if (executor != null) {
            executor.shutdown();
        }
        orderedExecutor.shutdown();
        cacheExecutor.shutdown();
        LoadManager loadManager = this.loadManager.get();
        if (loadManager != null) {
            loadManager.stop();
        }
        if (schemaRegistryService != null) {
            schemaRegistryService.close();
        }
        state = State.Closed;
    } catch (Exception e) {
        throw new PulsarServerException(e);
    } finally {
        mutex.unlock();
    }
}
Also used : LoadManager(org.apache.pulsar.broker.loadbalance.LoadManager) IOException(java.io.IOException)

Example 2 with LoadManager

use of org.apache.pulsar.broker.loadbalance.LoadManager in project incubator-pulsar by apache.

the class BrokerService method updateConfigurationAndRegisterListeners.

/**
 * Update dynamic-ServiceConfiguration with value present into zk-configuration-map and register listeners on
 * dynamic-ServiceConfiguration field to take appropriate action on change of zk-configuration-map.
 */
private void updateConfigurationAndRegisterListeners() {
    // (1) Dynamic-config value validation: add validator if updated value required strict check before considering
    // validate configured load-manager classname present into classpath
    addDynamicConfigValidator("loadManagerClassName", (className) -> {
        try {
            Class.forName(className);
        } catch (ClassNotFoundException e) {
            log.warn("Configured load-manager class {} not found {}", className, e.getMessage());
            return false;
        }
        return true;
    });
    // (2) update ServiceConfiguration value by reading zk-configuration-map
    updateDynamicServiceConfiguration();
    // (3) Listener Registration
    // add listener on "maxConcurrentLookupRequest" value change
    registerConfigurationListener("maxConcurrentLookupRequest", (maxConcurrentLookupRequest) -> lookupRequestSemaphore.set(new Semaphore((int) maxConcurrentLookupRequest, false)));
    // add listener on "maxConcurrentTopicLoadRequest" value change
    registerConfigurationListener("maxConcurrentTopicLoadRequest", (maxConcurrentTopicLoadRequest) -> topicLoadRequestSemaphore.set(new Semaphore((int) maxConcurrentTopicLoadRequest, false)));
    registerConfigurationListener("loadManagerClassName", className -> {
        try {
            final LoadManager newLoadManager = LoadManager.create(pulsar);
            log.info("Created load manager: {}", className);
            pulsar.getLoadManager().get().stop();
            newLoadManager.start();
            pulsar.getLoadManager().set(newLoadManager);
        } catch (Exception ex) {
            log.warn("Failed to change load manager due to {}", ex);
        }
    });
    // add listener to update message-dispatch-rate in msg
    registerConfigurationListener("dispatchThrottlingRatePerTopicInMsg", (dispatchRatePerTopicInMsg) -> {
        updateTopicMessageDispatchRate();
    });
    // add listener to update message-dispatch-rate in byte
    registerConfigurationListener("dispatchThrottlingRatePerTopicInByte", (dispatchRatePerTopicInByte) -> {
        updateTopicMessageDispatchRate();
    });
    // add listener to update managed-ledger config to skipNonRecoverableLedgers
    registerConfigurationListener("autoSkipNonRecoverableData", (skipNonRecoverableLedger) -> {
        updateManagedLedgerConfig();
    });
// add more listeners here
}
Also used : LoadManager(org.apache.pulsar.broker.loadbalance.LoadManager) Semaphore(java.util.concurrent.Semaphore) ServiceUnitNotReadyException(org.apache.pulsar.broker.service.BrokerServiceException.ServiceUnitNotReadyException) NamingException(org.apache.pulsar.broker.service.BrokerServiceException.NamingException) NotAllowedException(org.apache.pulsar.broker.service.BrokerServiceException.NotAllowedException) ServerMetadataException(org.apache.pulsar.broker.service.BrokerServiceException.ServerMetadataException) IOException(java.io.IOException) PulsarClientException(org.apache.pulsar.client.api.PulsarClientException) ManagedLedgerException(org.apache.bookkeeper.mledger.ManagedLedgerException) KeeperException(org.apache.zookeeper.KeeperException) PersistenceException(org.apache.pulsar.broker.service.BrokerServiceException.PersistenceException)

Example 3 with LoadManager

use of org.apache.pulsar.broker.loadbalance.LoadManager in project incubator-pulsar by apache.

the class BrokerServiceLookupTest method testMultipleBrokerLookup.

/**
 * UsecaseL Multiple Broker => Lookup Redirection test
 *
 * 1. Broker1 is a leader 2. Lookup request reaches to Broker2 which redirects to leader (Broker1) with
 * authoritative = false 3. Leader (Broker1) finds out least loaded broker as Broker2 and redirects request to
 * Broker2 with authoritative = true 4. Broker2 receives final request to own a bundle with authoritative = true and
 * client connects to Broker2
 *
 * @throws Exception
 */
@Test
public void testMultipleBrokerLookup() throws Exception {
    log.info("-- Starting {} test --", methodName);
    /**
     ** start broker-2 ***
     */
    ServiceConfiguration conf2 = new ServiceConfiguration();
    conf2.setBrokerServicePort(PortManager.nextFreePort());
    conf2.setBrokerServicePortTls(PortManager.nextFreePort());
    conf2.setAdvertisedAddress("localhost");
    conf2.setWebServicePort(PortManager.nextFreePort());
    conf2.setWebServicePortTls(PortManager.nextFreePort());
    conf2.setAdvertisedAddress("localhost");
    conf2.setClusterName(conf.getClusterName());
    conf2.setZookeeperServers("localhost:2181");
    PulsarService pulsar2 = startBroker(conf2);
    pulsar.getLoadManager().get().writeLoadReportOnZookeeper();
    pulsar2.getLoadManager().get().writeLoadReportOnZookeeper();
    LoadManager loadManager1 = spy(pulsar.getLoadManager().get());
    LoadManager loadManager2 = spy(pulsar2.getLoadManager().get());
    Field loadManagerField = NamespaceService.class.getDeclaredField("loadManager");
    loadManagerField.setAccessible(true);
    // mock: redirect request to leader [2]
    doReturn(true).when(loadManager2).isCentralized();
    loadManagerField.set(pulsar2.getNamespaceService(), new AtomicReference<>(loadManager2));
    // mock: return Broker2 as a Least-loaded broker when leader receies request [3]
    doReturn(true).when(loadManager1).isCentralized();
    SimpleResourceUnit resourceUnit = new SimpleResourceUnit(pulsar2.getWebServiceAddress(), null);
    doReturn(Optional.of(resourceUnit)).when(loadManager1).getLeastLoaded(any(ServiceUnitId.class));
    loadManagerField.set(pulsar.getNamespaceService(), new AtomicReference<>(loadManager1));
    /**
     ** started broker-2 ***
     */
    URI brokerServiceUrl = new URI("pulsar://localhost:" + conf2.getBrokerServicePort());
    PulsarClient pulsarClient2 = PulsarClient.builder().serviceUrl(brokerServiceUrl.toString()).build();
    // load namespace-bundle by calling Broker2
    Consumer<byte[]> consumer = pulsarClient2.newConsumer().topic("persistent://my-property/use/my-ns/my-topic1").subscriptionName("my-subscriber-name").subscribe();
    Producer<byte[]> producer = pulsarClient.newProducer().topic("persistent://my-property/use/my-ns/my-topic1").create();
    for (int i = 0; i < 10; i++) {
        String message = "my-message-" + i;
        producer.send(message.getBytes());
    }
    Message<byte[]> msg = null;
    Set<String> messageSet = Sets.newHashSet();
    for (int i = 0; i < 10; i++) {
        msg = consumer.receive(5, TimeUnit.SECONDS);
        String receivedMessage = new String(msg.getData());
        log.debug("Received message: [{}]", receivedMessage);
        String expectedMessage = "my-message-" + i;
        testMessageOrderAndDuplicates(messageSet, receivedMessage, expectedMessage);
    }
    // Acknowledge the consumption of all messages at once
    consumer.acknowledgeCumulative(msg);
    consumer.close();
    producer.close();
    pulsarClient2.close();
    pulsar2.close();
    loadManager1 = null;
    loadManager2 = null;
}
Also used : LoadManager(org.apache.pulsar.broker.loadbalance.LoadManager) URI(java.net.URI) Field(java.lang.reflect.Field) SimpleResourceUnit(org.apache.pulsar.broker.loadbalance.impl.SimpleResourceUnit) ServiceConfiguration(org.apache.pulsar.broker.ServiceConfiguration) PulsarService(org.apache.pulsar.broker.PulsarService) ServiceUnitId(org.apache.pulsar.common.naming.ServiceUnitId) Test(org.testng.annotations.Test)

Example 4 with LoadManager

use of org.apache.pulsar.broker.loadbalance.LoadManager in project incubator-pulsar by apache.

the class BrokerServiceLookupTest method testMultipleBrokerDifferentClusterLookup.

/**
 * Usecase: Redirection due to different cluster 1. Broker1 runs on cluster: "use" and Broker2 runs on cluster:
 * "use2" 2. Broker1 receives "use2" cluster request => Broker1 reads "/clusters" from global-zookkeeper and
 * redirects request to Broker2 whch serves "use2" 3. Broker2 receives redirect request and own namespace bundle
 *
 * @throws Exception
 */
@Test
public void testMultipleBrokerDifferentClusterLookup() throws Exception {
    log.info("-- Starting {} test --", methodName);
    /**
     ** start broker-2 ***
     */
    final String newCluster = "use2";
    final String property = "my-property2";
    ServiceConfiguration conf2 = new ServiceConfiguration();
    conf2.setAdvertisedAddress("localhost");
    conf2.setBrokerServicePort(PortManager.nextFreePort());
    conf2.setBrokerServicePortTls(PortManager.nextFreePort());
    conf2.setWebServicePort(PortManager.nextFreePort());
    conf2.setWebServicePortTls(PortManager.nextFreePort());
    conf2.setAdvertisedAddress("localhost");
    // Broker2 serves newCluster
    conf2.setClusterName(newCluster);
    conf2.setZookeeperServers("localhost:2181");
    String broker2ServiceUrl = "pulsar://localhost:" + conf2.getBrokerServicePort();
    admin.clusters().createCluster(newCluster, new ClusterData("http://127.0.0.1:" + BROKER_WEBSERVICE_PORT, null, broker2ServiceUrl, null));
    admin.properties().createProperty(property, new PropertyAdmin(Lists.newArrayList("appid1", "appid2"), Sets.newHashSet(newCluster)));
    admin.namespaces().createNamespace(property + "/" + newCluster + "/my-ns");
    PulsarService pulsar2 = startBroker(conf2);
    pulsar.getLoadManager().get().writeLoadReportOnZookeeper();
    pulsar2.getLoadManager().get().writeLoadReportOnZookeeper();
    URI brokerServiceUrl = new URI(broker2ServiceUrl);
    PulsarClient pulsarClient2 = PulsarClient.builder().serviceUrl(brokerServiceUrl.toString()).build();
    // enable authorization: so, broker can validate cluster and redirect if finds different cluster
    pulsar.getConfiguration().setAuthorizationEnabled(true);
    // restart broker with authorization enabled: it initialize AuthorizationService
    stopBroker();
    startBroker();
    LoadManager loadManager2 = spy(pulsar2.getLoadManager().get());
    Field loadManagerField = NamespaceService.class.getDeclaredField("loadManager");
    loadManagerField.setAccessible(true);
    // mock: return Broker2 as a Least-loaded broker when leader receies request
    doReturn(true).when(loadManager2).isCentralized();
    SimpleResourceUnit resourceUnit = new SimpleResourceUnit(pulsar2.getWebServiceAddress(), null);
    doReturn(Optional.of(resourceUnit)).when(loadManager2).getLeastLoaded(any(ServiceUnitId.class));
    loadManagerField.set(pulsar.getNamespaceService(), new AtomicReference<>(loadManager2));
    /**
     ** started broker-2 ***
     */
    // load namespace-bundle by calling Broker2
    Consumer<byte[]> consumer = pulsarClient.newConsumer().topic("persistent://my-property2/use2/my-ns/my-topic1").subscriptionName("my-subscriber-name").subscribe();
    Producer<byte[]> producer = pulsarClient2.newProducer().topic("persistent://my-property2/use2/my-ns/my-topic1").create();
    for (int i = 0; i < 10; i++) {
        String message = "my-message-" + i;
        producer.send(message.getBytes());
    }
    Message<byte[]> msg = null;
    Set<String> messageSet = Sets.newHashSet();
    for (int i = 0; i < 10; i++) {
        msg = consumer.receive(5, TimeUnit.SECONDS);
        String receivedMessage = new String(msg.getData());
        log.debug("Received message: [{}]", receivedMessage);
        String expectedMessage = "my-message-" + i;
        testMessageOrderAndDuplicates(messageSet, receivedMessage, expectedMessage);
    }
    // Acknowledge the consumption of all messages at once
    consumer.acknowledgeCumulative(msg);
    consumer.close();
    producer.close();
    // disable authorization
    pulsar.getConfiguration().setAuthorizationEnabled(false);
    pulsarClient2.close();
    pulsar2.close();
    loadManager2 = null;
}
Also used : LoadManager(org.apache.pulsar.broker.loadbalance.LoadManager) URI(java.net.URI) Field(java.lang.reflect.Field) ClusterData(org.apache.pulsar.common.policies.data.ClusterData) SimpleResourceUnit(org.apache.pulsar.broker.loadbalance.impl.SimpleResourceUnit) ServiceConfiguration(org.apache.pulsar.broker.ServiceConfiguration) PropertyAdmin(org.apache.pulsar.common.policies.data.PropertyAdmin) PulsarService(org.apache.pulsar.broker.PulsarService) ServiceUnitId(org.apache.pulsar.common.naming.ServiceUnitId) Test(org.testng.annotations.Test)

Example 5 with LoadManager

use of org.apache.pulsar.broker.loadbalance.LoadManager in project incubator-pulsar by apache.

the class BrokerServiceLookupTest method testSplitUnloadLookupTest.

/**
 * <pre>
 * When broker-1's load-manager splits the bundle and update local-policies, broker-2 should get watch of
 * local-policies and update bundleCache so, new lookup can be redirected properly.
 *
 * (1) Start broker-1 and broker-2
 * (2) Make sure broker-2 always assign bundle to broker1
 * (3) Broker-2 receives topic-1 request, creates local-policies and sets the watch
 * (4) Broker-1 will own topic-1
 * (5) Split the bundle for topic-1
 * (6) Broker-2 should get the watch and update bundle cache
 * (7) Make lookup request again to Broker-2 which should succeed.
 *
 * </pre>
 *
 * @throws Exception
 */
@Test(timeOut = 5000)
public void testSplitUnloadLookupTest() throws Exception {
    log.info("-- Starting {} test --", methodName);
    final String namespace = "my-property/use/my-ns";
    // (1) Start broker-1
    ServiceConfiguration conf2 = new ServiceConfiguration();
    conf2.setAdvertisedAddress("localhost");
    conf2.setBrokerServicePort(PortManager.nextFreePort());
    conf2.setBrokerServicePortTls(PortManager.nextFreePort());
    conf2.setWebServicePort(PortManager.nextFreePort());
    conf2.setWebServicePortTls(PortManager.nextFreePort());
    conf2.setAdvertisedAddress("localhost");
    conf2.setClusterName(conf.getClusterName());
    conf2.setZookeeperServers("localhost:2181");
    PulsarService pulsar2 = startBroker(conf2);
    pulsar.getLoadManager().get().writeLoadReportOnZookeeper();
    pulsar2.getLoadManager().get().writeLoadReportOnZookeeper();
    pulsar.getLoadManager().get().writeLoadReportOnZookeeper();
    pulsar2.getLoadManager().get().writeLoadReportOnZookeeper();
    LoadManager loadManager1 = spy(pulsar.getLoadManager().get());
    LoadManager loadManager2 = spy(pulsar2.getLoadManager().get());
    Field loadManagerField = NamespaceService.class.getDeclaredField("loadManager");
    loadManagerField.setAccessible(true);
    // (2) Make sure broker-2 always assign bundle to broker1
    // mock: redirect request to leader [2]
    doReturn(true).when(loadManager2).isCentralized();
    loadManagerField.set(pulsar2.getNamespaceService(), new AtomicReference<>(loadManager2));
    // mock: return Broker1 as a Least-loaded broker when leader receies request [3]
    doReturn(true).when(loadManager1).isCentralized();
    SimpleResourceUnit resourceUnit = new SimpleResourceUnit(pulsar.getWebServiceAddress(), null);
    doReturn(Optional.of(resourceUnit)).when(loadManager1).getLeastLoaded(any(ServiceUnitId.class));
    loadManagerField.set(pulsar.getNamespaceService(), new AtomicReference<>(loadManager1));
    URI broker2ServiceUrl = new URI("pulsar://localhost:" + conf2.getBrokerServicePort());
    PulsarClient pulsarClient2 = PulsarClient.builder().serviceUrl(broker2ServiceUrl.toString()).build();
    // (3) Broker-2 receives topic-1 request, creates local-policies and sets the watch
    final String topic1 = "persistent://" + namespace + "/topic1";
    Consumer<byte[]> consumer1 = pulsarClient2.newConsumer().topic(topic1).subscriptionName("my-subscriber-name").subscribe();
    Set<String> serviceUnits1 = pulsar.getNamespaceService().getOwnedServiceUnits().stream().map(nb -> nb.toString()).collect(Collectors.toSet());
    // (4) Broker-1 will own topic-1
    final String unsplitBundle = namespace + "/0x00000000_0xffffffff";
    assertTrue(serviceUnits1.contains(unsplitBundle));
    // broker-2 should have this bundle into the cache
    TopicName topicName = TopicName.get(topic1);
    NamespaceBundle bundleInBroker2 = pulsar2.getNamespaceService().getBundle(topicName);
    assertEquals(bundleInBroker2.toString(), unsplitBundle);
    // (5) Split the bundle for topic-1
    admin.namespaces().splitNamespaceBundle(namespace, "0x00000000_0xffffffff", true);
    // (6) Broker-2 should get the watch and update bundle cache
    final int retry = 5;
    for (int i = 0; i < retry; i++) {
        if (pulsar2.getNamespaceService().getBundle(topicName).equals(bundleInBroker2) && i != retry - 1) {
            Thread.sleep(200);
        } else {
            break;
        }
    }
    // (7) Make lookup request again to Broker-2 which should succeed.
    final String topic2 = "persistent://" + namespace + "/topic2";
    Consumer<byte[]> consumer2 = pulsarClient.newConsumer().topic(topic2).subscriptionName("my-subscriber-name").subscribe();
    NamespaceBundle bundleInBroker1AfterSplit = pulsar2.getNamespaceService().getBundle(TopicName.get(topic2));
    assertFalse(bundleInBroker1AfterSplit.equals(unsplitBundle));
    consumer1.close();
    consumer2.close();
    pulsarClient2.close();
    pulsar2.close();
}
Also used : HttpURLConnection(java.net.HttpURLConnection) SSLContext(javax.net.ssl.SSLContext) URL(java.net.URL) DiscoveryService(org.apache.pulsar.discovery.service.DiscoveryService) Request(org.asynchttpclient.Request) ObjectMapperFactory(org.apache.pulsar.common.util.ObjectMapperFactory) LoggerFactory(org.slf4j.LoggerFactory) TrustManager(javax.net.ssl.TrustManager) Cleanup(lombok.Cleanup) LoadManager(org.apache.pulsar.broker.loadbalance.LoadManager) Test(org.testng.annotations.Test) ClusterData(org.apache.pulsar.common.policies.data.ClusterData) PortManager(org.apache.bookkeeper.test.PortManager) AfterMethod(org.testng.annotations.AfterMethod) AuthenticationException(javax.naming.AuthenticationException) SecureRandom(java.security.SecureRandom) AsyncHttpClientConfig(org.asynchttpclient.AsyncHttpClientConfig) Map(java.util.Map) DefaultAsyncHttpClientConfig(org.asynchttpclient.DefaultAsyncHttpClientConfig) URI(java.net.URI) Mockito.doReturn(org.mockito.Mockito.doReturn) Assert.assertFalse(org.testng.Assert.assertFalse) Method(java.lang.reflect.Method) DefaultKeepAliveStrategy(org.asynchttpclient.channel.DefaultKeepAliveStrategy) HttpRequest(io.netty.handler.codec.http.HttpRequest) BeforeMethod(org.testng.annotations.BeforeMethod) Set(java.util.Set) KeyStore(java.security.KeyStore) Assert.assertNotNull(org.testng.Assert.assertNotNull) Collectors(java.util.stream.Collectors) AuthenticationDataSource(org.apache.pulsar.broker.authentication.AuthenticationDataSource) Sets(com.google.common.collect.Sets) Matchers.any(org.mockito.Matchers.any) ServiceUnitId(org.apache.pulsar.common.naming.ServiceUnitId) Certificate(java.security.cert.Certificate) PrivateKey(java.security.PrivateKey) BoundRequestBuilder(org.asynchttpclient.BoundRequestBuilder) ModularLoadManagerWrapper(org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerWrapper) ServiceConfig(org.apache.pulsar.discovery.service.server.ServiceConfig) Optional(java.util.Optional) HttpResponse(io.netty.handler.codec.http.HttpResponse) PortManager.nextFreePort(org.apache.bookkeeper.test.PortManager.nextFreePort) MoreExecutors(com.google.common.util.concurrent.MoreExecutors) TopicName(org.apache.pulsar.common.naming.TopicName) AsyncHttpClient(org.asynchttpclient.AsyncHttpClient) SecurityUtility(org.apache.pulsar.common.util.SecurityUtility) Assert.assertEquals(org.testng.Assert.assertEquals) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ModularLoadManagerImpl(org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) ResourceUnit(org.apache.pulsar.broker.loadbalance.ResourceUnit) NamespaceService(org.apache.pulsar.broker.namespace.NamespaceService) PartitionedTopicMetadata(org.apache.pulsar.common.partition.PartitionedTopicMetadata) Mockito.spy(org.mockito.Mockito.spy) AtomicReference(java.util.concurrent.atomic.AtomicReference) AuthenticationTls(org.apache.pulsar.client.impl.auth.AuthenticationTls) InsecureTrustManagerFactory(io.netty.handler.ssl.util.InsecureTrustManagerFactory) Lists(com.google.common.collect.Lists) ListenableFuture(org.asynchttpclient.ListenableFuture) URLConnection(java.net.URLConnection) SimpleResourceUnit(org.apache.pulsar.broker.loadbalance.impl.SimpleResourceUnit) NamespaceBundle(org.apache.pulsar.common.naming.NamespaceBundle) DefaultAsyncHttpClient(org.asynchttpclient.DefaultAsyncHttpClient) LeaderElectionService(org.apache.pulsar.broker.loadbalance.LeaderElectionService) HttpsURLConnection(javax.net.ssl.HttpsURLConnection) PropertyAdmin(org.apache.pulsar.common.policies.data.PropertyAdmin) Logger(org.slf4j.Logger) AuthenticationProvider(org.apache.pulsar.broker.authentication.AuthenticationProvider) ServiceConfiguration(org.apache.pulsar.broker.ServiceConfiguration) Assert.fail(org.testng.Assert.fail) KeyManagerFactory(javax.net.ssl.KeyManagerFactory) IOException(java.io.IOException) Response(org.asynchttpclient.Response) Field(java.lang.reflect.Field) PulsarService(org.apache.pulsar.broker.PulsarService) KeyManager(javax.net.ssl.KeyManager) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Assert.assertTrue(org.testng.Assert.assertTrue) AsyncCompletionHandler(org.asynchttpclient.AsyncCompletionHandler) InputStream(java.io.InputStream) NamespaceBundle(org.apache.pulsar.common.naming.NamespaceBundle) LoadManager(org.apache.pulsar.broker.loadbalance.LoadManager) URI(java.net.URI) TopicName(org.apache.pulsar.common.naming.TopicName) Field(java.lang.reflect.Field) SimpleResourceUnit(org.apache.pulsar.broker.loadbalance.impl.SimpleResourceUnit) ServiceConfiguration(org.apache.pulsar.broker.ServiceConfiguration) PulsarService(org.apache.pulsar.broker.PulsarService) ServiceUnitId(org.apache.pulsar.common.naming.ServiceUnitId) Test(org.testng.annotations.Test)

Aggregations

LoadManager (org.apache.pulsar.broker.loadbalance.LoadManager)10 Field (java.lang.reflect.Field)8 Test (org.testng.annotations.Test)8 PulsarService (org.apache.pulsar.broker.PulsarService)6 ServiceConfiguration (org.apache.pulsar.broker.ServiceConfiguration)6 URI (java.net.URI)5 SimpleResourceUnit (org.apache.pulsar.broker.loadbalance.impl.SimpleResourceUnit)5 ServiceUnitId (org.apache.pulsar.common.naming.ServiceUnitId)5 IOException (java.io.IOException)4 AtomicReference (java.util.concurrent.atomic.AtomicReference)4 ResourceUnit (org.apache.pulsar.broker.loadbalance.ResourceUnit)4 NamespaceBundle (org.apache.pulsar.common.naming.NamespaceBundle)4 InputStream (java.io.InputStream)3 HttpURLConnection (java.net.HttpURLConnection)3 URL (java.net.URL)3 URLConnection (java.net.URLConnection)3 KeyStore (java.security.KeyStore)3 PrivateKey (java.security.PrivateKey)3 SecureRandom (java.security.SecureRandom)3 Certificate (java.security.cert.Certificate)3