Search in sources :

Example 1 with DelayedDeliveryTrackerFactory

use of org.apache.pulsar.broker.delayed.DelayedDeliveryTrackerFactory in project pulsar by apache.

the class BrokerService method closeAsync.

public CompletableFuture<Void> closeAsync() {
    try {
        log.info("Shutting down Pulsar Broker service");
        // unloads all namespaces gracefully without disrupting mutually
        unloadNamespaceBundlesGracefully();
        // close replication clients
        replicationClients.forEach((cluster, client) -> {
            try {
                client.shutdown();
            } catch (Exception e) {
                log.warn("Error shutting down repl client for cluster {}", cluster, e);
            }
        });
        // close replication admins
        clusterAdmins.forEach((cluster, admin) -> {
            try {
                admin.close();
            } catch (Exception e) {
                log.warn("Error shutting down repl admin for cluster {}", cluster, e);
            }
        });
        // close entry filters
        if (entryFilters != null) {
            entryFilters.forEach((name, filter) -> {
                try {
                    filter.close();
                } catch (Exception e) {
                    log.warn("Error shutting down entry filter {}", name, e);
                }
            });
        }
        CompletableFuture<CompletableFuture<Void>> cancellableDownstreamFutureReference = new CompletableFuture<>();
        log.info("Event loops shutting down gracefully...");
        List<CompletableFuture<?>> shutdownEventLoops = new ArrayList<>();
        shutdownEventLoops.add(shutdownEventLoopGracefully(acceptorGroup));
        shutdownEventLoops.add(shutdownEventLoopGracefully(workerGroup));
        for (EventLoopGroup group : protocolHandlersWorkerGroups) {
            shutdownEventLoops.add(shutdownEventLoopGracefully(group));
        }
        CompletableFuture<Void> shutdownFuture = CompletableFuture.allOf(shutdownEventLoops.toArray(new CompletableFuture[0])).handle((v, t) -> {
            if (t != null) {
                log.warn("Error shutting down event loops gracefully", t);
            } else {
                log.info("Event loops shutdown completed.");
            }
            return null;
        }).thenCompose(__ -> {
            log.info("Continuing to second phase in shutdown.");
            List<CompletableFuture<Void>> asyncCloseFutures = new ArrayList<>();
            listenChannels.forEach(ch -> {
                if (ch.isOpen()) {
                    asyncCloseFutures.add(closeChannel(ch));
                }
            });
            if (interceptor != null) {
                interceptor.close();
                interceptor = null;
            }
            try {
                authenticationService.close();
            } catch (IOException e) {
                log.warn("Error in closing authenticationService", e);
            }
            pulsarStats.close();
            try {
                delayedDeliveryTrackerFactory.close();
            } catch (IOException e) {
                log.warn("Error in closing delayedDeliveryTrackerFactory", e);
            }
            asyncCloseFutures.add(GracefulExecutorServicesShutdown.initiate().timeout(Duration.ofMillis((long) (GRACEFUL_SHUTDOWN_TIMEOUT_RATIO_OF_TOTAL_TIMEOUT * pulsar.getConfiguration().getBrokerShutdownTimeoutMs()))).shutdown(statsUpdater, inactivityMonitor, messageExpiryMonitor, compactionMonitor, consumedLedgersMonitor, backlogQuotaChecker, topicOrderedExecutor, topicPublishRateLimiterMonitor, brokerPublishRateLimiterMonitor, deduplicationSnapshotMonitor).handle());
            CompletableFuture<Void> combined = FutureUtil.waitForAllAndSupportCancel(asyncCloseFutures);
            cancellableDownstreamFutureReference.complete(combined);
            combined.handle((v, t) -> {
                if (t == null) {
                    log.info("Broker service completely shut down");
                } else {
                    if (t instanceof CancellationException) {
                        log.warn("Broker service didn't complete gracefully. " + "Terminating Broker service.");
                    } else {
                        log.warn("Broker service shut down completed with exception", t);
                    }
                }
                return null;
            });
            return combined;
        });
        FutureUtil.whenCancelledOrTimedOut(shutdownFuture, () -> cancellableDownstreamFutureReference.thenAccept(future -> future.cancel(false)));
        return shutdownFuture;
    } catch (Exception e) {
        return FutureUtil.failedFuture(e);
    }
}
Also used : ServiceUnitNotReadyException(org.apache.pulsar.broker.service.BrokerServiceException.ServiceUnitNotReadyException) Arrays(java.util.Arrays) NamingException(org.apache.pulsar.broker.service.BrokerServiceException.NamingException) NotAllowedException(org.apache.pulsar.broker.service.BrokerServiceException.NotAllowedException) LedgerOffloader(org.apache.bookkeeper.mledger.LedgerOffloader) BundlesQuotas(org.apache.pulsar.broker.cache.BundlesQuotas) LoadManager(org.apache.pulsar.broker.loadbalance.LoadManager) StringUtils(org.apache.commons.lang3.StringUtils) SystemTopic(org.apache.pulsar.broker.service.persistent.SystemTopic) FieldContext(org.apache.pulsar.common.configuration.FieldContext) Duration(java.time.Duration) Map(java.util.Map) BrokerInterceptor(org.apache.pulsar.broker.intercept.BrokerInterceptor) PersistentOfflineTopicStats(org.apache.pulsar.common.policies.data.PersistentOfflineTopicStats) SocketChannel(io.netty.channel.socket.SocketChannel) ReadWriteLock(java.util.concurrent.locks.ReadWriteLock) LocalPoliciesResources(org.apache.pulsar.broker.resources.LocalPoliciesResources) MetadataStoreException(org.apache.pulsar.metadata.api.MetadataStoreException) CancellationException(java.util.concurrent.CancellationException) NettyFutureUtil(org.apache.pulsar.common.util.netty.NettyFutureUtil) PersistencePolicies(org.apache.pulsar.common.policies.data.PersistencePolicies) Set(java.util.Set) Futures(org.apache.bookkeeper.mledger.util.Futures) DelayedDeliveryTrackerLoader(org.apache.pulsar.broker.delayed.DelayedDeliveryTrackerLoader) PublishRate(org.apache.pulsar.common.policies.data.PublishRate) Executors(java.util.concurrent.Executors) ConcurrentOpenHashSet(org.apache.pulsar.common.util.collections.ConcurrentOpenHashSet) StringUtils.isNotBlank(org.apache.commons.lang3.StringUtils.isNotBlank) ConcurrentOpenHashMap(org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap) ClientBuilderImpl(org.apache.pulsar.client.impl.ClientBuilderImpl) ChannelFutures(org.apache.pulsar.common.util.netty.ChannelFutures) PartitionedTopicResources(org.apache.pulsar.broker.resources.NamespaceResources.PartitionedTopicResources) DispatchRateLimiter(org.apache.pulsar.broker.service.persistent.DispatchRateLimiter) ChannelOption(io.netty.channel.ChannelOption) ManagedLedgerFactory(org.apache.bookkeeper.mledger.ManagedLedgerFactory) AuthenticationService(org.apache.pulsar.broker.authentication.AuthenticationService) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) PulsarAdmin(org.apache.pulsar.client.admin.PulsarAdmin) PartitionedTopicMetadata(org.apache.pulsar.common.partition.PartitionedTopicMetadata) DelayedDeliveryTrackerFactory(org.apache.pulsar.broker.delayed.DelayedDeliveryTrackerFactory) RestException(org.apache.pulsar.common.util.RestException) ArrayList(java.util.ArrayList) TopicType(org.apache.pulsar.common.policies.data.TopicType) PulsarAdminBuilder(org.apache.pulsar.client.admin.PulsarAdminBuilder) PulsarService.isTransactionSystemTopic(org.apache.pulsar.broker.PulsarService.isTransactionSystemTopic) Lists(com.google.common.collect.Lists) AccessLevel(lombok.AccessLevel) BrokerEntryMetadataUtils(org.apache.pulsar.common.intercept.BrokerEntryMetadataUtils) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) PulsarClient(org.apache.pulsar.client.api.PulsarClient) NamespaceBundle(org.apache.pulsar.common.naming.NamespaceBundle) PersistentDispatcherMultipleConsumers(org.apache.pulsar.broker.service.persistent.PersistentDispatcherMultipleConsumers) ManagedLedgerNotFoundException(org.apache.bookkeeper.mledger.ManagedLedgerException.ManagedLedgerNotFoundException) Summary(org.apache.pulsar.broker.stats.prometheus.metrics.Summary) SslContext(io.netty.handler.ssl.SslContext) AutoSubscriptionCreationOverride(org.apache.pulsar.common.policies.data.AutoSubscriptionCreationOverride) IOException(java.io.IOException) Field(java.lang.reflect.Field) PulsarService(org.apache.pulsar.broker.PulsarService) EventsTopicNames.checkTopicIsEventsNames(org.apache.pulsar.common.events.EventsTopicNames.checkTopicIsEventsNames) Channel(io.netty.channel.Channel) ExecutionException(java.util.concurrent.ExecutionException) SystemTopicClient(org.apache.pulsar.broker.systopic.SystemTopicClient) OpenLedgerCallback(org.apache.bookkeeper.mledger.AsyncCallbacks.OpenLedgerCallback) Compactor(org.apache.pulsar.compaction.Compactor) PulsarServerException(org.apache.pulsar.broker.PulsarServerException) CollectionUtils.isEmpty(org.apache.commons.collections.CollectionUtils.isEmpty) AuthorizationService(org.apache.pulsar.broker.authorization.AuthorizationService) Metrics(org.apache.pulsar.common.stats.Metrics) DefaultThreadFactory(io.netty.util.concurrent.DefaultThreadFactory) ScheduledFuture(java.util.concurrent.ScheduledFuture) SocketAddress(java.net.SocketAddress) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) ClusterData(org.apache.pulsar.common.policies.data.ClusterData) EntryFilterWithClassLoader(org.apache.pulsar.broker.service.plugin.EntryFilterWithClassLoader) TopicStatsImpl(org.apache.pulsar.common.policies.data.stats.TopicStatsImpl) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) Notification(org.apache.pulsar.metadata.api.Notification) ManagedLedger(org.apache.bookkeeper.mledger.ManagedLedger) ManagedLedgerConfig(org.apache.bookkeeper.mledger.ManagedLedgerConfig) NamespaceName(org.apache.pulsar.common.naming.NamespaceName) TransactionMetadataStoreService(org.apache.pulsar.broker.TransactionMetadataStoreService) EntryFilterProvider(org.apache.pulsar.broker.service.plugin.EntryFilterProvider) EventLoopUtil(org.apache.pulsar.common.util.netty.EventLoopUtil) ChannelInitializer(io.netty.channel.ChannelInitializer) OrderedScheduler(org.apache.bookkeeper.common.util.OrderedScheduler) ImmutableMap(com.google.common.collect.ImmutableMap) Predicate(java.util.function.Predicate) OffloadPoliciesImpl(org.apache.pulsar.common.policies.data.OffloadPoliciesImpl) BindAddressValidator(org.apache.pulsar.broker.validator.BindAddressValidator) InetSocketAddress(java.net.InetSocketAddress) ObserverGauge(org.apache.pulsar.broker.stats.prometheus.metrics.ObserverGauge) PulsarByteBufAllocator(org.apache.pulsar.common.allocator.PulsarByteBufAllocator) ManagedLedgerException(org.apache.bookkeeper.mledger.ManagedLedgerException) Queues(com.google.common.collect.Queues) List(java.util.List) PersistentTopic(org.apache.pulsar.broker.service.persistent.PersistentTopic) ManagedLedgerPayloadProcessor(org.apache.pulsar.common.intercept.ManagedLedgerPayloadProcessor) FutureUtil(org.apache.pulsar.common.util.FutureUtil) Response(javax.ws.rs.core.Response) ClientConfigurationData(org.apache.pulsar.client.impl.conf.ClientConfigurationData) AppendIndexMetadataInterceptor(org.apache.pulsar.common.intercept.AppendIndexMetadataInterceptor) ClientBuilder(org.apache.pulsar.client.api.ClientBuilder) Optional(java.util.Optional) NamespaceResources(org.apache.pulsar.broker.resources.NamespaceResources) NamespaceBundleStats(org.apache.pulsar.policies.data.loadbalancer.NamespaceBundleStats) IsolatedBookieEnsemblePlacementPolicy(org.apache.pulsar.bookie.rackawareness.IsolatedBookieEnsemblePlacementPolicy) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) LongAdder(java.util.concurrent.atomic.LongAdder) Setter(lombok.Setter) TransactionMetadataStore(org.apache.pulsar.transaction.coordinator.TransactionMetadataStore) DeleteLedgerCallback(org.apache.bookkeeper.mledger.AsyncCallbacks.DeleteLedgerCallback) TopicName(org.apache.pulsar.common.naming.TopicName) Getter(lombok.Getter) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) BacklogQuota(org.apache.pulsar.common.policies.data.BacklogQuota) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) RateLimiter(org.apache.pulsar.common.util.RateLimiter) AtomicReference(java.util.concurrent.atomic.AtomicReference) HashSet(java.util.HashSet) SafeRun.safeRun(org.apache.bookkeeper.mledger.util.SafeRun.safeRun) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) ByteBuf(io.netty.buffer.ByteBuf) AutoTopicCreationOverride(org.apache.pulsar.common.policies.data.AutoTopicCreationOverride) BindAddress(org.apache.pulsar.common.configuration.BindAddress) ManagedLedgerInterceptorImpl(org.apache.pulsar.broker.intercept.ManagedLedgerInterceptorImpl) AdaptiveRecvByteBufAllocator(io.netty.channel.AdaptiveRecvByteBufAllocator) TopicDomain(org.apache.pulsar.common.naming.TopicDomain) ClusterReplicationMetrics(org.apache.pulsar.broker.stats.ClusterReplicationMetrics) FieldParser(org.apache.pulsar.common.util.FieldParser) RetentionPolicies(org.apache.pulsar.common.policies.data.RetentionPolicies) EventLoopGroup(io.netty.channel.EventLoopGroup) Logger(org.slf4j.Logger) Semaphore(java.util.concurrent.Semaphore) ServiceConfiguration(org.apache.pulsar.broker.ServiceConfiguration) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) PersistenceException(org.apache.pulsar.broker.service.BrokerServiceException.PersistenceException) TopicPolicies(org.apache.pulsar.common.policies.data.TopicPolicies) SchemaVersion(org.apache.pulsar.common.protocol.schema.SchemaVersion) Maps(com.google.common.collect.Maps) OrderedExecutor(org.apache.bookkeeper.common.util.OrderedExecutor) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Policies(org.apache.pulsar.common.policies.data.Policies) BrokerEntryMetadataInterceptor(org.apache.pulsar.common.intercept.BrokerEntryMetadataInterceptor) Closeable(java.io.Closeable) NonPersistentTopic(org.apache.pulsar.broker.service.nonpersistent.NonPersistentTopic) NotificationType(org.apache.pulsar.metadata.api.NotificationType) ServerBootstrap(io.netty.bootstrap.ServerBootstrap) VisibleForTesting(com.google.common.annotations.VisibleForTesting) AllArgsConstructor(lombok.AllArgsConstructor) Collections(java.util.Collections) CompletableFuture(java.util.concurrent.CompletableFuture) EventLoopGroup(io.netty.channel.EventLoopGroup) CancellationException(java.util.concurrent.CancellationException) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ServiceUnitNotReadyException(org.apache.pulsar.broker.service.BrokerServiceException.ServiceUnitNotReadyException) NamingException(org.apache.pulsar.broker.service.BrokerServiceException.NamingException) NotAllowedException(org.apache.pulsar.broker.service.BrokerServiceException.NotAllowedException) MetadataStoreException(org.apache.pulsar.metadata.api.MetadataStoreException) CancellationException(java.util.concurrent.CancellationException) RestException(org.apache.pulsar.common.util.RestException) ManagedLedgerNotFoundException(org.apache.bookkeeper.mledger.ManagedLedgerException.ManagedLedgerNotFoundException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) PulsarServerException(org.apache.pulsar.broker.PulsarServerException) TimeoutException(java.util.concurrent.TimeoutException) ManagedLedgerException(org.apache.bookkeeper.mledger.ManagedLedgerException) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) PersistenceException(org.apache.pulsar.broker.service.BrokerServiceException.PersistenceException)

Example 2 with DelayedDeliveryTrackerFactory

use of org.apache.pulsar.broker.delayed.DelayedDeliveryTrackerFactory in project pulsar by yahoo.

the class BrokerService method closeAsync.

public CompletableFuture<Void> closeAsync() {
    try {
        log.info("Shutting down Pulsar Broker service");
        // unloads all namespaces gracefully without disrupting mutually
        unloadNamespaceBundlesGracefully();
        // close replication clients
        replicationClients.forEach((cluster, client) -> {
            try {
                client.shutdown();
            } catch (Exception e) {
                log.warn("Error shutting down repl client for cluster {}", cluster, e);
            }
        });
        // close replication admins
        clusterAdmins.forEach((cluster, admin) -> {
            try {
                admin.close();
            } catch (Exception e) {
                log.warn("Error shutting down repl admin for cluster {}", cluster, e);
            }
        });
        // close entry filters
        if (entryFilters != null) {
            entryFilters.forEach((name, filter) -> {
                try {
                    filter.close();
                } catch (Exception e) {
                    log.warn("Error shutting down entry filter {}", name, e);
                }
            });
        }
        CompletableFuture<CompletableFuture<Void>> cancellableDownstreamFutureReference = new CompletableFuture<>();
        log.info("Event loops shutting down gracefully...");
        List<CompletableFuture<?>> shutdownEventLoops = new ArrayList<>();
        shutdownEventLoops.add(shutdownEventLoopGracefully(acceptorGroup));
        shutdownEventLoops.add(shutdownEventLoopGracefully(workerGroup));
        for (EventLoopGroup group : protocolHandlersWorkerGroups) {
            shutdownEventLoops.add(shutdownEventLoopGracefully(group));
        }
        CompletableFuture<Void> shutdownFuture = CompletableFuture.allOf(shutdownEventLoops.toArray(new CompletableFuture[0])).handle((v, t) -> {
            if (t != null) {
                log.warn("Error shutting down event loops gracefully", t);
            } else {
                log.info("Event loops shutdown completed.");
            }
            return null;
        }).thenCompose(__ -> {
            log.info("Continuing to second phase in shutdown.");
            List<CompletableFuture<Void>> asyncCloseFutures = new ArrayList<>();
            listenChannels.forEach(ch -> {
                if (ch.isOpen()) {
                    asyncCloseFutures.add(closeChannel(ch));
                }
            });
            if (interceptor != null) {
                interceptor.close();
                interceptor = null;
            }
            try {
                authenticationService.close();
            } catch (IOException e) {
                log.warn("Error in closing authenticationService", e);
            }
            pulsarStats.close();
            try {
                delayedDeliveryTrackerFactory.close();
            } catch (IOException e) {
                log.warn("Error in closing delayedDeliveryTrackerFactory", e);
            }
            asyncCloseFutures.add(GracefulExecutorServicesShutdown.initiate().timeout(Duration.ofMillis((long) (GRACEFUL_SHUTDOWN_TIMEOUT_RATIO_OF_TOTAL_TIMEOUT * pulsar.getConfiguration().getBrokerShutdownTimeoutMs()))).shutdown(statsUpdater, inactivityMonitor, messageExpiryMonitor, compactionMonitor, consumedLedgersMonitor, backlogQuotaChecker, topicOrderedExecutor, topicPublishRateLimiterMonitor.scheduler, brokerPublishRateLimiterMonitor.scheduler, deduplicationSnapshotMonitor).handle());
            CompletableFuture<Void> combined = FutureUtil.waitForAllAndSupportCancel(asyncCloseFutures);
            cancellableDownstreamFutureReference.complete(combined);
            combined.handle((v, t) -> {
                if (t == null) {
                    log.info("Broker service completely shut down");
                } else {
                    if (t instanceof CancellationException) {
                        log.warn("Broker service didn't complete gracefully. " + "Terminating Broker service.");
                    } else {
                        log.warn("Broker service shut down completed with exception", t);
                    }
                }
                return null;
            });
            return combined;
        });
        FutureUtil.whenCancelledOrTimedOut(shutdownFuture, () -> cancellableDownstreamFutureReference.thenAccept(future -> future.cancel(false)));
        return shutdownFuture;
    } catch (Exception e) {
        return FutureUtil.failedFuture(e);
    }
}
Also used : ServiceUnitNotReadyException(org.apache.pulsar.broker.service.BrokerServiceException.ServiceUnitNotReadyException) Arrays(java.util.Arrays) NamingException(org.apache.pulsar.broker.service.BrokerServiceException.NamingException) NotAllowedException(org.apache.pulsar.broker.service.BrokerServiceException.NotAllowedException) LedgerOffloader(org.apache.bookkeeper.mledger.LedgerOffloader) BundlesQuotas(org.apache.pulsar.broker.cache.BundlesQuotas) LoadManager(org.apache.pulsar.broker.loadbalance.LoadManager) StringUtils(org.apache.commons.lang3.StringUtils) SystemTopic(org.apache.pulsar.broker.service.persistent.SystemTopic) FieldContext(org.apache.pulsar.common.configuration.FieldContext) Duration(java.time.Duration) Map(java.util.Map) BrokerInterceptor(org.apache.pulsar.broker.intercept.BrokerInterceptor) PersistentOfflineTopicStats(org.apache.pulsar.common.policies.data.PersistentOfflineTopicStats) SocketChannel(io.netty.channel.socket.SocketChannel) ReadWriteLock(java.util.concurrent.locks.ReadWriteLock) LocalPoliciesResources(org.apache.pulsar.broker.resources.LocalPoliciesResources) MetadataStoreException(org.apache.pulsar.metadata.api.MetadataStoreException) CancellationException(java.util.concurrent.CancellationException) NettyFutureUtil(org.apache.pulsar.common.util.netty.NettyFutureUtil) PersistencePolicies(org.apache.pulsar.common.policies.data.PersistencePolicies) Set(java.util.Set) Futures(org.apache.bookkeeper.mledger.util.Futures) DelayedDeliveryTrackerLoader(org.apache.pulsar.broker.delayed.DelayedDeliveryTrackerLoader) PublishRate(org.apache.pulsar.common.policies.data.PublishRate) Executors(java.util.concurrent.Executors) ConcurrentOpenHashSet(org.apache.pulsar.common.util.collections.ConcurrentOpenHashSet) StringUtils.isNotBlank(org.apache.commons.lang3.StringUtils.isNotBlank) ConcurrentOpenHashMap(org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap) SizeUnit(org.apache.pulsar.client.api.SizeUnit) ClientBuilderImpl(org.apache.pulsar.client.impl.ClientBuilderImpl) ChannelFutures(org.apache.pulsar.common.util.netty.ChannelFutures) PartitionedTopicResources(org.apache.pulsar.broker.resources.NamespaceResources.PartitionedTopicResources) DispatchRateLimiter(org.apache.pulsar.broker.service.persistent.DispatchRateLimiter) ChannelOption(io.netty.channel.ChannelOption) ManagedLedgerFactory(org.apache.bookkeeper.mledger.ManagedLedgerFactory) AuthenticationService(org.apache.pulsar.broker.authentication.AuthenticationService) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) NamespaceService(org.apache.pulsar.broker.namespace.NamespaceService) PulsarAdmin(org.apache.pulsar.client.admin.PulsarAdmin) PartitionedTopicMetadata(org.apache.pulsar.common.partition.PartitionedTopicMetadata) DelayedDeliveryTrackerFactory(org.apache.pulsar.broker.delayed.DelayedDeliveryTrackerFactory) RestException(org.apache.pulsar.common.util.RestException) ArrayList(java.util.ArrayList) TopicType(org.apache.pulsar.common.policies.data.TopicType) PulsarAdminBuilder(org.apache.pulsar.client.admin.PulsarAdminBuilder) Lists(com.google.common.collect.Lists) AccessLevel(lombok.AccessLevel) BrokerEntryMetadataUtils(org.apache.pulsar.common.intercept.BrokerEntryMetadataUtils) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) PulsarClient(org.apache.pulsar.client.api.PulsarClient) NamespaceBundle(org.apache.pulsar.common.naming.NamespaceBundle) PersistentDispatcherMultipleConsumers(org.apache.pulsar.broker.service.persistent.PersistentDispatcherMultipleConsumers) NullLedgerOffloader(org.apache.bookkeeper.mledger.impl.NullLedgerOffloader) ManagedLedgerNotFoundException(org.apache.bookkeeper.mledger.ManagedLedgerException.ManagedLedgerNotFoundException) Summary(org.apache.pulsar.broker.stats.prometheus.metrics.Summary) SslContext(io.netty.handler.ssl.SslContext) AutoSubscriptionCreationOverride(org.apache.pulsar.common.policies.data.AutoSubscriptionCreationOverride) IOException(java.io.IOException) Field(java.lang.reflect.Field) PulsarService(org.apache.pulsar.broker.PulsarService) Channel(io.netty.channel.Channel) ExecutionException(java.util.concurrent.ExecutionException) OpenLedgerCallback(org.apache.bookkeeper.mledger.AsyncCallbacks.OpenLedgerCallback) Compactor(org.apache.pulsar.compaction.Compactor) PulsarServerException(org.apache.pulsar.broker.PulsarServerException) CollectionUtils.isEmpty(org.apache.commons.collections.CollectionUtils.isEmpty) AuthorizationService(org.apache.pulsar.broker.authorization.AuthorizationService) Metrics(org.apache.pulsar.common.stats.Metrics) DefaultThreadFactory(io.netty.util.concurrent.DefaultThreadFactory) ScheduledFuture(java.util.concurrent.ScheduledFuture) SocketAddress(java.net.SocketAddress) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) ClusterData(org.apache.pulsar.common.policies.data.ClusterData) SystemTopicNames(org.apache.pulsar.common.naming.SystemTopicNames) EntryFilterWithClassLoader(org.apache.pulsar.broker.service.plugin.EntryFilterWithClassLoader) TopicStatsImpl(org.apache.pulsar.common.policies.data.stats.TopicStatsImpl) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) Notification(org.apache.pulsar.metadata.api.Notification) ManagedLedger(org.apache.bookkeeper.mledger.ManagedLedger) ManagedLedgerConfig(org.apache.bookkeeper.mledger.ManagedLedgerConfig) NamespaceName(org.apache.pulsar.common.naming.NamespaceName) TransactionMetadataStoreService(org.apache.pulsar.broker.TransactionMetadataStoreService) EntryFilterProvider(org.apache.pulsar.broker.service.plugin.EntryFilterProvider) EventLoopUtil(org.apache.pulsar.common.util.netty.EventLoopUtil) ChannelInitializer(io.netty.channel.ChannelInitializer) OrderedScheduler(org.apache.bookkeeper.common.util.OrderedScheduler) ImmutableMap(com.google.common.collect.ImmutableMap) Predicate(java.util.function.Predicate) OffloadPoliciesImpl(org.apache.pulsar.common.policies.data.OffloadPoliciesImpl) LocalPolicies(org.apache.pulsar.common.policies.data.LocalPolicies) BindAddressValidator(org.apache.pulsar.broker.validator.BindAddressValidator) InetSocketAddress(java.net.InetSocketAddress) ObserverGauge(org.apache.pulsar.broker.stats.prometheus.metrics.ObserverGauge) PulsarByteBufAllocator(org.apache.pulsar.common.allocator.PulsarByteBufAllocator) ManagedLedgerException(org.apache.bookkeeper.mledger.ManagedLedgerException) Queues(com.google.common.collect.Queues) List(java.util.List) PersistentTopic(org.apache.pulsar.broker.service.persistent.PersistentTopic) ManagedLedgerPayloadProcessor(org.apache.pulsar.common.intercept.ManagedLedgerPayloadProcessor) FutureUtil(org.apache.pulsar.common.util.FutureUtil) Response(javax.ws.rs.core.Response) ClientConfigurationData(org.apache.pulsar.client.impl.conf.ClientConfigurationData) AppendIndexMetadataInterceptor(org.apache.pulsar.common.intercept.AppendIndexMetadataInterceptor) ClientBuilder(org.apache.pulsar.client.api.ClientBuilder) Optional(java.util.Optional) NamespaceResources(org.apache.pulsar.broker.resources.NamespaceResources) NamespaceBundleStats(org.apache.pulsar.policies.data.loadbalancer.NamespaceBundleStats) IsolatedBookieEnsemblePlacementPolicy(org.apache.pulsar.bookie.rackawareness.IsolatedBookieEnsemblePlacementPolicy) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) LongAdder(java.util.concurrent.atomic.LongAdder) Setter(lombok.Setter) TransactionMetadataStore(org.apache.pulsar.transaction.coordinator.TransactionMetadataStore) DeleteLedgerCallback(org.apache.bookkeeper.mledger.AsyncCallbacks.DeleteLedgerCallback) TopicName(org.apache.pulsar.common.naming.TopicName) Getter(lombok.Getter) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) BacklogQuota(org.apache.pulsar.common.policies.data.BacklogQuota) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) RateLimiter(org.apache.pulsar.common.util.RateLimiter) AtomicReference(java.util.concurrent.atomic.AtomicReference) HashSet(java.util.HashSet) SafeRun.safeRun(org.apache.bookkeeper.mledger.util.SafeRun.safeRun) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) ByteBuf(io.netty.buffer.ByteBuf) AutoTopicCreationOverride(org.apache.pulsar.common.policies.data.AutoTopicCreationOverride) BindAddress(org.apache.pulsar.common.configuration.BindAddress) ManagedLedgerInterceptorImpl(org.apache.pulsar.broker.intercept.ManagedLedgerInterceptorImpl) AdaptiveRecvByteBufAllocator(io.netty.channel.AdaptiveRecvByteBufAllocator) TopicDomain(org.apache.pulsar.common.naming.TopicDomain) ClusterReplicationMetrics(org.apache.pulsar.broker.stats.ClusterReplicationMetrics) FieldParser(org.apache.pulsar.common.util.FieldParser) RetentionPolicies(org.apache.pulsar.common.policies.data.RetentionPolicies) EventLoopGroup(io.netty.channel.EventLoopGroup) Logger(org.slf4j.Logger) Semaphore(java.util.concurrent.Semaphore) ServiceConfiguration(org.apache.pulsar.broker.ServiceConfiguration) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) PersistenceException(org.apache.pulsar.broker.service.BrokerServiceException.PersistenceException) TopicPolicies(org.apache.pulsar.common.policies.data.TopicPolicies) Maps(com.google.common.collect.Maps) OrderedExecutor(org.apache.bookkeeper.common.util.OrderedExecutor) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Policies(org.apache.pulsar.common.policies.data.Policies) BrokerEntryMetadataInterceptor(org.apache.pulsar.common.intercept.BrokerEntryMetadataInterceptor) Closeable(java.io.Closeable) NonPersistentTopic(org.apache.pulsar.broker.service.nonpersistent.NonPersistentTopic) NotificationType(org.apache.pulsar.metadata.api.NotificationType) ServerBootstrap(io.netty.bootstrap.ServerBootstrap) SystemTopicNames.isTransactionInternalName(org.apache.pulsar.common.naming.SystemTopicNames.isTransactionInternalName) VisibleForTesting(com.google.common.annotations.VisibleForTesting) AllArgsConstructor(lombok.AllArgsConstructor) Collections(java.util.Collections) CompletableFuture(java.util.concurrent.CompletableFuture) EventLoopGroup(io.netty.channel.EventLoopGroup) CancellationException(java.util.concurrent.CancellationException) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ServiceUnitNotReadyException(org.apache.pulsar.broker.service.BrokerServiceException.ServiceUnitNotReadyException) NamingException(org.apache.pulsar.broker.service.BrokerServiceException.NamingException) NotAllowedException(org.apache.pulsar.broker.service.BrokerServiceException.NotAllowedException) MetadataStoreException(org.apache.pulsar.metadata.api.MetadataStoreException) CancellationException(java.util.concurrent.CancellationException) RestException(org.apache.pulsar.common.util.RestException) ManagedLedgerNotFoundException(org.apache.bookkeeper.mledger.ManagedLedgerException.ManagedLedgerNotFoundException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) PulsarServerException(org.apache.pulsar.broker.PulsarServerException) TimeoutException(java.util.concurrent.TimeoutException) ManagedLedgerException(org.apache.bookkeeper.mledger.ManagedLedgerException) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) PersistenceException(org.apache.pulsar.broker.service.BrokerServiceException.PersistenceException)

Example 3 with DelayedDeliveryTrackerFactory

use of org.apache.pulsar.broker.delayed.DelayedDeliveryTrackerFactory in project incubator-pulsar by apache.

the class BrokerService method closeAsync.

public CompletableFuture<Void> closeAsync() {
    try {
        log.info("Shutting down Pulsar Broker service");
        // unloads all namespaces gracefully without disrupting mutually
        unloadNamespaceBundlesGracefully();
        // close replication clients
        replicationClients.forEach((cluster, client) -> {
            try {
                client.shutdown();
            } catch (Exception e) {
                log.warn("Error shutting down repl client for cluster {}", cluster, e);
            }
        });
        // close replication admins
        clusterAdmins.forEach((cluster, admin) -> {
            try {
                admin.close();
            } catch (Exception e) {
                log.warn("Error shutting down repl admin for cluster {}", cluster, e);
            }
        });
        // close entry filters
        if (entryFilters != null) {
            entryFilters.forEach((name, filter) -> {
                try {
                    filter.close();
                } catch (Exception e) {
                    log.warn("Error shutting down entry filter {}", name, e);
                }
            });
        }
        CompletableFuture<CompletableFuture<Void>> cancellableDownstreamFutureReference = new CompletableFuture<>();
        log.info("Event loops shutting down gracefully...");
        List<CompletableFuture<?>> shutdownEventLoops = new ArrayList<>();
        shutdownEventLoops.add(shutdownEventLoopGracefully(acceptorGroup));
        shutdownEventLoops.add(shutdownEventLoopGracefully(workerGroup));
        for (EventLoopGroup group : protocolHandlersWorkerGroups) {
            shutdownEventLoops.add(shutdownEventLoopGracefully(group));
        }
        CompletableFuture<Void> shutdownFuture = CompletableFuture.allOf(shutdownEventLoops.toArray(new CompletableFuture[0])).handle((v, t) -> {
            if (t != null) {
                log.warn("Error shutting down event loops gracefully", t);
            } else {
                log.info("Event loops shutdown completed.");
            }
            return null;
        }).thenCompose(__ -> {
            log.info("Continuing to second phase in shutdown.");
            List<CompletableFuture<Void>> asyncCloseFutures = new ArrayList<>();
            listenChannels.forEach(ch -> {
                if (ch.isOpen()) {
                    asyncCloseFutures.add(closeChannel(ch));
                }
            });
            if (interceptor != null) {
                interceptor.close();
                interceptor = null;
            }
            try {
                authenticationService.close();
            } catch (IOException e) {
                log.warn("Error in closing authenticationService", e);
            }
            pulsarStats.close();
            try {
                delayedDeliveryTrackerFactory.close();
            } catch (IOException e) {
                log.warn("Error in closing delayedDeliveryTrackerFactory", e);
            }
            asyncCloseFutures.add(GracefulExecutorServicesShutdown.initiate().timeout(Duration.ofMillis((long) (GRACEFUL_SHUTDOWN_TIMEOUT_RATIO_OF_TOTAL_TIMEOUT * pulsar.getConfiguration().getBrokerShutdownTimeoutMs()))).shutdown(statsUpdater, inactivityMonitor, messageExpiryMonitor, compactionMonitor, consumedLedgersMonitor, backlogQuotaChecker, topicOrderedExecutor, topicPublishRateLimiterMonitor.scheduler, brokerPublishRateLimiterMonitor.scheduler, deduplicationSnapshotMonitor).handle());
            CompletableFuture<Void> combined = FutureUtil.waitForAllAndSupportCancel(asyncCloseFutures);
            cancellableDownstreamFutureReference.complete(combined);
            combined.handle((v, t) -> {
                if (t == null) {
                    log.info("Broker service completely shut down");
                } else {
                    if (t instanceof CancellationException) {
                        log.warn("Broker service didn't complete gracefully. " + "Terminating Broker service.");
                    } else {
                        log.warn("Broker service shut down completed with exception", t);
                    }
                }
                return null;
            });
            return combined;
        });
        FutureUtil.whenCancelledOrTimedOut(shutdownFuture, () -> cancellableDownstreamFutureReference.thenAccept(future -> future.cancel(false)));
        return shutdownFuture;
    } catch (Exception e) {
        return FutureUtil.failedFuture(e);
    }
}
Also used : ServiceUnitNotReadyException(org.apache.pulsar.broker.service.BrokerServiceException.ServiceUnitNotReadyException) Arrays(java.util.Arrays) NamingException(org.apache.pulsar.broker.service.BrokerServiceException.NamingException) NotAllowedException(org.apache.pulsar.broker.service.BrokerServiceException.NotAllowedException) LedgerOffloader(org.apache.bookkeeper.mledger.LedgerOffloader) BundlesQuotas(org.apache.pulsar.broker.cache.BundlesQuotas) LoadManager(org.apache.pulsar.broker.loadbalance.LoadManager) StringUtils(org.apache.commons.lang3.StringUtils) SystemTopic(org.apache.pulsar.broker.service.persistent.SystemTopic) FieldContext(org.apache.pulsar.common.configuration.FieldContext) Duration(java.time.Duration) Map(java.util.Map) BrokerInterceptor(org.apache.pulsar.broker.intercept.BrokerInterceptor) PersistentOfflineTopicStats(org.apache.pulsar.common.policies.data.PersistentOfflineTopicStats) SocketChannel(io.netty.channel.socket.SocketChannel) ReadWriteLock(java.util.concurrent.locks.ReadWriteLock) LocalPoliciesResources(org.apache.pulsar.broker.resources.LocalPoliciesResources) MetadataStoreException(org.apache.pulsar.metadata.api.MetadataStoreException) CancellationException(java.util.concurrent.CancellationException) NettyFutureUtil(org.apache.pulsar.common.util.netty.NettyFutureUtil) PersistencePolicies(org.apache.pulsar.common.policies.data.PersistencePolicies) Set(java.util.Set) Futures(org.apache.bookkeeper.mledger.util.Futures) DelayedDeliveryTrackerLoader(org.apache.pulsar.broker.delayed.DelayedDeliveryTrackerLoader) PublishRate(org.apache.pulsar.common.policies.data.PublishRate) Executors(java.util.concurrent.Executors) ConcurrentOpenHashSet(org.apache.pulsar.common.util.collections.ConcurrentOpenHashSet) StringUtils.isNotBlank(org.apache.commons.lang3.StringUtils.isNotBlank) ConcurrentOpenHashMap(org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap) SizeUnit(org.apache.pulsar.client.api.SizeUnit) ClientBuilderImpl(org.apache.pulsar.client.impl.ClientBuilderImpl) ChannelFutures(org.apache.pulsar.common.util.netty.ChannelFutures) PartitionedTopicResources(org.apache.pulsar.broker.resources.NamespaceResources.PartitionedTopicResources) DispatchRateLimiter(org.apache.pulsar.broker.service.persistent.DispatchRateLimiter) ChannelOption(io.netty.channel.ChannelOption) ManagedLedgerFactory(org.apache.bookkeeper.mledger.ManagedLedgerFactory) AuthenticationService(org.apache.pulsar.broker.authentication.AuthenticationService) ReentrantReadWriteLock(java.util.concurrent.locks.ReentrantReadWriteLock) NamespaceService(org.apache.pulsar.broker.namespace.NamespaceService) PulsarAdmin(org.apache.pulsar.client.admin.PulsarAdmin) PartitionedTopicMetadata(org.apache.pulsar.common.partition.PartitionedTopicMetadata) DelayedDeliveryTrackerFactory(org.apache.pulsar.broker.delayed.DelayedDeliveryTrackerFactory) RestException(org.apache.pulsar.common.util.RestException) ArrayList(java.util.ArrayList) TopicType(org.apache.pulsar.common.policies.data.TopicType) PulsarAdminBuilder(org.apache.pulsar.client.admin.PulsarAdminBuilder) Lists(com.google.common.collect.Lists) AccessLevel(lombok.AccessLevel) BrokerEntryMetadataUtils(org.apache.pulsar.common.intercept.BrokerEntryMetadataUtils) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) PropertiesUtils(org.apache.pulsar.client.internal.PropertiesUtils) PulsarClient(org.apache.pulsar.client.api.PulsarClient) NamespaceBundle(org.apache.pulsar.common.naming.NamespaceBundle) PersistentDispatcherMultipleConsumers(org.apache.pulsar.broker.service.persistent.PersistentDispatcherMultipleConsumers) NullLedgerOffloader(org.apache.bookkeeper.mledger.impl.NullLedgerOffloader) ManagedLedgerNotFoundException(org.apache.bookkeeper.mledger.ManagedLedgerException.ManagedLedgerNotFoundException) Summary(org.apache.pulsar.broker.stats.prometheus.metrics.Summary) SslContext(io.netty.handler.ssl.SslContext) AutoSubscriptionCreationOverride(org.apache.pulsar.common.policies.data.AutoSubscriptionCreationOverride) IOException(java.io.IOException) Field(java.lang.reflect.Field) PulsarService(org.apache.pulsar.broker.PulsarService) Channel(io.netty.channel.Channel) ExecutionException(java.util.concurrent.ExecutionException) OpenLedgerCallback(org.apache.bookkeeper.mledger.AsyncCallbacks.OpenLedgerCallback) Compactor(org.apache.pulsar.compaction.Compactor) PulsarServerException(org.apache.pulsar.broker.PulsarServerException) CollectionUtils.isEmpty(org.apache.commons.collections.CollectionUtils.isEmpty) AuthorizationService(org.apache.pulsar.broker.authorization.AuthorizationService) Metrics(org.apache.pulsar.common.stats.Metrics) DefaultThreadFactory(io.netty.util.concurrent.DefaultThreadFactory) ScheduledFuture(java.util.concurrent.ScheduledFuture) SocketAddress(java.net.SocketAddress) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) ClusterData(org.apache.pulsar.common.policies.data.ClusterData) SystemTopicNames(org.apache.pulsar.common.naming.SystemTopicNames) EntryFilterWithClassLoader(org.apache.pulsar.broker.service.plugin.EntryFilterWithClassLoader) TopicStatsImpl(org.apache.pulsar.common.policies.data.stats.TopicStatsImpl) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) Notification(org.apache.pulsar.metadata.api.Notification) ManagedLedger(org.apache.bookkeeper.mledger.ManagedLedger) ManagedLedgerConfig(org.apache.bookkeeper.mledger.ManagedLedgerConfig) NamespaceName(org.apache.pulsar.common.naming.NamespaceName) TransactionMetadataStoreService(org.apache.pulsar.broker.TransactionMetadataStoreService) EntryFilterProvider(org.apache.pulsar.broker.service.plugin.EntryFilterProvider) EventLoopUtil(org.apache.pulsar.common.util.netty.EventLoopUtil) ChannelInitializer(io.netty.channel.ChannelInitializer) OrderedScheduler(org.apache.bookkeeper.common.util.OrderedScheduler) ImmutableMap(com.google.common.collect.ImmutableMap) Predicate(java.util.function.Predicate) OffloadPoliciesImpl(org.apache.pulsar.common.policies.data.OffloadPoliciesImpl) LocalPolicies(org.apache.pulsar.common.policies.data.LocalPolicies) BindAddressValidator(org.apache.pulsar.broker.validator.BindAddressValidator) InetSocketAddress(java.net.InetSocketAddress) ObserverGauge(org.apache.pulsar.broker.stats.prometheus.metrics.ObserverGauge) PulsarByteBufAllocator(org.apache.pulsar.common.allocator.PulsarByteBufAllocator) ManagedLedgerException(org.apache.bookkeeper.mledger.ManagedLedgerException) Queues(com.google.common.collect.Queues) List(java.util.List) PersistentTopic(org.apache.pulsar.broker.service.persistent.PersistentTopic) ManagedLedgerPayloadProcessor(org.apache.pulsar.common.intercept.ManagedLedgerPayloadProcessor) FutureUtil(org.apache.pulsar.common.util.FutureUtil) Response(javax.ws.rs.core.Response) ClientConfigurationData(org.apache.pulsar.client.impl.conf.ClientConfigurationData) AppendIndexMetadataInterceptor(org.apache.pulsar.common.intercept.AppendIndexMetadataInterceptor) ClientBuilder(org.apache.pulsar.client.api.ClientBuilder) Optional(java.util.Optional) NamespaceResources(org.apache.pulsar.broker.resources.NamespaceResources) NamespaceBundleStats(org.apache.pulsar.policies.data.loadbalancer.NamespaceBundleStats) IsolatedBookieEnsemblePlacementPolicy(org.apache.pulsar.bookie.rackawareness.IsolatedBookieEnsemblePlacementPolicy) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) LongAdder(java.util.concurrent.atomic.LongAdder) Setter(lombok.Setter) TransactionMetadataStore(org.apache.pulsar.transaction.coordinator.TransactionMetadataStore) DeleteLedgerCallback(org.apache.bookkeeper.mledger.AsyncCallbacks.DeleteLedgerCallback) TopicName(org.apache.pulsar.common.naming.TopicName) Getter(lombok.Getter) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) BacklogQuota(org.apache.pulsar.common.policies.data.BacklogQuota) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) RateLimiter(org.apache.pulsar.common.util.RateLimiter) AtomicReference(java.util.concurrent.atomic.AtomicReference) HashSet(java.util.HashSet) SafeRun.safeRun(org.apache.bookkeeper.mledger.util.SafeRun.safeRun) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) ByteBuf(io.netty.buffer.ByteBuf) AutoTopicCreationOverride(org.apache.pulsar.common.policies.data.AutoTopicCreationOverride) BindAddress(org.apache.pulsar.common.configuration.BindAddress) ManagedLedgerInterceptorImpl(org.apache.pulsar.broker.intercept.ManagedLedgerInterceptorImpl) AdaptiveRecvByteBufAllocator(io.netty.channel.AdaptiveRecvByteBufAllocator) TopicDomain(org.apache.pulsar.common.naming.TopicDomain) ClusterReplicationMetrics(org.apache.pulsar.broker.stats.ClusterReplicationMetrics) FieldParser(org.apache.pulsar.common.util.FieldParser) RetentionPolicies(org.apache.pulsar.common.policies.data.RetentionPolicies) EventLoopGroup(io.netty.channel.EventLoopGroup) Logger(org.slf4j.Logger) Semaphore(java.util.concurrent.Semaphore) ServiceConfiguration(org.apache.pulsar.broker.ServiceConfiguration) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) PersistenceException(org.apache.pulsar.broker.service.BrokerServiceException.PersistenceException) TopicPolicies(org.apache.pulsar.common.policies.data.TopicPolicies) Maps(com.google.common.collect.Maps) OrderedExecutor(org.apache.bookkeeper.common.util.OrderedExecutor) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Policies(org.apache.pulsar.common.policies.data.Policies) BrokerEntryMetadataInterceptor(org.apache.pulsar.common.intercept.BrokerEntryMetadataInterceptor) Closeable(java.io.Closeable) NonPersistentTopic(org.apache.pulsar.broker.service.nonpersistent.NonPersistentTopic) NotificationType(org.apache.pulsar.metadata.api.NotificationType) ServerBootstrap(io.netty.bootstrap.ServerBootstrap) SystemTopicNames.isTransactionInternalName(org.apache.pulsar.common.naming.SystemTopicNames.isTransactionInternalName) VisibleForTesting(com.google.common.annotations.VisibleForTesting) AllArgsConstructor(lombok.AllArgsConstructor) Collections(java.util.Collections) CompletableFuture(java.util.concurrent.CompletableFuture) EventLoopGroup(io.netty.channel.EventLoopGroup) CancellationException(java.util.concurrent.CancellationException) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ServiceUnitNotReadyException(org.apache.pulsar.broker.service.BrokerServiceException.ServiceUnitNotReadyException) NamingException(org.apache.pulsar.broker.service.BrokerServiceException.NamingException) NotAllowedException(org.apache.pulsar.broker.service.BrokerServiceException.NotAllowedException) MetadataStoreException(org.apache.pulsar.metadata.api.MetadataStoreException) CancellationException(java.util.concurrent.CancellationException) RestException(org.apache.pulsar.common.util.RestException) ManagedLedgerNotFoundException(org.apache.bookkeeper.mledger.ManagedLedgerException.ManagedLedgerNotFoundException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) PulsarServerException(org.apache.pulsar.broker.PulsarServerException) TimeoutException(java.util.concurrent.TimeoutException) ManagedLedgerException(org.apache.bookkeeper.mledger.ManagedLedgerException) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) PersistenceException(org.apache.pulsar.broker.service.BrokerServiceException.PersistenceException)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)3 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)3 Preconditions.checkNotNull (com.google.common.base.Preconditions.checkNotNull)3 ImmutableMap (com.google.common.collect.ImmutableMap)3 Lists (com.google.common.collect.Lists)3 Maps (com.google.common.collect.Maps)3 Queues (com.google.common.collect.Queues)3 ServerBootstrap (io.netty.bootstrap.ServerBootstrap)3 ByteBuf (io.netty.buffer.ByteBuf)3 AdaptiveRecvByteBufAllocator (io.netty.channel.AdaptiveRecvByteBufAllocator)3 Channel (io.netty.channel.Channel)3 ChannelInitializer (io.netty.channel.ChannelInitializer)3 ChannelOption (io.netty.channel.ChannelOption)3 EventLoopGroup (io.netty.channel.EventLoopGroup)3 SocketChannel (io.netty.channel.socket.SocketChannel)3 SslContext (io.netty.handler.ssl.SslContext)3 DefaultThreadFactory (io.netty.util.concurrent.DefaultThreadFactory)3 Closeable (java.io.Closeable)3 IOException (java.io.IOException)3 Field (java.lang.reflect.Field)3