public class PulsarService extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
PulsarService.State |
| Constructor and Description |
|---|
PulsarService(ServiceConfiguration config) |
PulsarService(ServiceConfiguration config,
Optional<WorkerService> functionWorkerService,
Consumer<Integer> processTerminator) |
public PulsarService(ServiceConfiguration config)
public PulsarService(ServiceConfiguration config, Optional<WorkerService> functionWorkerService, Consumer<Integer> processTerminator)
public void close()
throws PulsarServerException
close in interface AutoCloseablePulsarServerExceptionpublic ServiceConfiguration getConfiguration()
public Optional<WorkerConfig> getWorkerConfig()
public void start()
throws PulsarServerException
PulsarServerExceptionprotected void startLeaderElectionService()
protected void acquireSLANamespace()
public void waitUntilClosed()
throws InterruptedException
InterruptedExceptionprotected void startZkCacheService()
throws PulsarServerException
PulsarServerExceptionprotected void startNamespaceService()
throws PulsarServerException
PulsarServerExceptionpublic Supplier<NamespaceService> getNamespaceServiceProvider() throws PulsarServerException
PulsarServerExceptionprotected void startLoadManagementService()
throws PulsarServerException
PulsarServerExceptionpublic void loadNamespaceTopics(NamespaceBundle bundle)
bundle - NamespaceBundle to identify the service unitExceptionpublic String getStatusFilePath()
public ZooKeeper getZkClient()
public String getMetadataServiceUri()
public org.apache.pulsar.common.conf.InternalConfigurationData getInternalConfigurationData()
public ConfigurationCacheService getConfigurationCache()
public PulsarService.State getState()
public LeaderElectionService getLeaderElectionService()
LeaderElectionService instance associated with the current
PulsarService instance.LeaderElectionService instance.public NamespaceService getNamespaceService()
public WorkerService getWorkerService()
public BrokerService getBrokerService()
BrokerService instance associated with the current
PulsarService instance.BrokerService instance.public BookKeeper getBookKeeperClient()
public ManagedLedgerFactory getManagedLedgerFactory()
public ManagedLedgerClientFactory getManagedLedgerClientFactory()
public LedgerOffloader getManagedLedgerOffloader(org.apache.pulsar.common.naming.NamespaceName namespaceName, org.apache.pulsar.common.policies.data.OffloadPolicies offloadPolicies)
LedgerOffloader from local map cache, create new LedgerOffloader if not in cache or
the OffloadPolicies changed, return the LedgerOffloader directly if exist in cache
and the OffloadPolicies not changed.namespaceName - NamespaceNameoffloadPolicies - the OffloadPoliciespublic LedgerOffloader createManagedLedgerOffloader(org.apache.pulsar.common.policies.data.OffloadPolicies offloadPolicies) throws PulsarServerException
PulsarServerExceptionpublic ZooKeeperCache getLocalZkCache()
public ZooKeeperCache getGlobalZkCache()
public ScheduledExecutorService getExecutor()
public ScheduledExecutorService getCacheExecutor()
public ScheduledExecutorService getLoadManagerExecutor()
public org.apache.bookkeeper.common.util.OrderedExecutor getOrderedExecutor()
public LocalZooKeeperCacheService getLocalZkCacheService()
public ZooKeeperClientFactory getZooKeeperClientFactory()
public BookKeeperClientFactory newBookKeeperClientFactory()
public BookKeeperClientFactory getBookKeeperClientFactory()
protected ScheduledExecutorService getCompactorExecutor()
public Compactor newCompactor() throws PulsarServerException
PulsarServerExceptionpublic Compactor getCompactor() throws PulsarServerException
PulsarServerExceptionprotected org.apache.bookkeeper.common.util.OrderedScheduler getOffloaderScheduler(org.apache.pulsar.common.policies.data.OffloadPolicies offloadPolicies)
public org.apache.pulsar.client.api.PulsarClient getClient()
throws PulsarServerException
PulsarServerExceptionpublic PulsarAdmin getAdminClient() throws PulsarServerException
PulsarServerExceptionpublic MetricsGenerator getMetricsGenerator()
public TransactionMetadataStoreService getTransactionMetadataStoreService()
public TransactionBufferProvider getTransactionBufferProvider()
public org.apache.pulsar.client.api.transaction.TransactionBufferClient getTransactionBufferClient()
public ZooKeeperSessionWatcher.ShutdownService getShutdownService()
public static String advertisedAddress(ServiceConfiguration config)
public String brokerUrlTls(ServiceConfiguration config)
public String webAddress(ServiceConfiguration config)
public String webAddressTls(ServiceConfiguration config)
public String getSafeWebServiceAddress()
public String getSafeBrokerServiceUrl()
public static String bookieMetadataServiceUri(ServiceConfiguration config)
config - broker configurationpublic TopicPoliciesService getTopicPoliciesService()
public void addPrometheusRawMetricsProvider(PrometheusRawMetricsProvider metricsProvider)
public CompletableFuture<Set<String>> getAvailableBookiesAsync()
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.