类 SchedulerManager

  • 所有已实现的接口:
    java.lang.AutoCloseable

    public class SchedulerManager
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • 字段详细资料

      • HEARTBEAT_TENANT

        public static final java.lang.String HEARTBEAT_TENANT
        另请参阅:
        常量字段值
      • HEARTBEAT_NAMESPACE

        public static final java.lang.String HEARTBEAT_NAMESPACE
        另请参阅:
        常量字段值
    • 构造器详细资料

      • SchedulerManager

        public SchedulerManager​(org.apache.pulsar.functions.worker.WorkerConfig workerConfig,
                                org.apache.pulsar.client.api.PulsarClient pulsarClient,
                                org.apache.pulsar.client.admin.PulsarAdmin admin,
                                WorkerStatsManager workerStatsManager,
                                ErrorNotifier errorNotifier)
    • 方法详细资料

      • acquireExclusiveWrite

        public org.apache.pulsar.client.api.Producer<byte[]> acquireExclusiveWrite​(java.util.function.Supplier<java.lang.Boolean> isLeader)
                                                                            throws WorkerUtils.NotLeaderAnymore
        Acquires a exclusive producer. This method cannot return null. It can only return a valid exclusive producer or throw NotLeaderAnymore exception.
        参数:
        isLeader - if the worker is still the leader
        返回:
        A valid exclusive producer
        抛出:
        WorkerUtils.NotLeaderAnymore - if the worker is no longer the leader.
      • initialize

        public void initialize​(org.apache.pulsar.client.api.Producer<byte[]> exclusiveProducer)
      • schedule

        public java.util.concurrent.Future<?> schedule()
      • rebalanceIfNotInprogress

        public java.util.concurrent.Future<?> rebalanceIfNotInprogress()
      • drainIfNotInProgress

        public java.util.concurrent.Future<?> drainIfNotInProgress​(java.lang.String workerId)
      • getDrainStatus

        public org.apache.pulsar.client.admin.LongRunningProcessStatus getDrainStatus​(java.lang.String workerId)
      • updateWorkerDrainMap

        protected int updateWorkerDrainMap()
      • close

        public void close()
        指定者:
        close 在接口中 java.lang.AutoCloseable