Class BaseBrokerStarter

  • All Implemented Interfaces:
    org.apache.pinot.spi.services.ServiceStartable
    Direct Known Subclasses:
    HelixBrokerStarter

    public abstract class BaseBrokerStarter
    extends Object
    implements org.apache.pinot.spi.services.ServiceStartable
    Base class for broker startable implementations
    • Field Detail

      • _brokerConf

        protected org.apache.pinot.spi.env.PinotConfiguration _brokerConf
      • _clusterName

        protected String _clusterName
      • _zkServers

        protected String _zkServers
      • _hostname

        protected String _hostname
      • _port

        protected int _port
      • _tlsPort

        protected int _tlsPort
      • _instanceId

        protected String _instanceId
      • _spectatorHelixManager

        protected org.apache.helix.HelixManager _spectatorHelixManager
      • _helixAdmin

        protected org.apache.helix.HelixAdmin _helixAdmin
      • _propertyStore

        protected org.apache.helix.store.zk.ZkHelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> _propertyStore
      • _helixDataAccessor

        protected org.apache.helix.HelixDataAccessor _helixDataAccessor
      • _metricsRegistry

        protected org.apache.pinot.spi.metrics.PinotMetricsRegistry _metricsRegistry
      • _brokerMetrics

        protected org.apache.pinot.common.metrics.BrokerMetrics _brokerMetrics
      • _participantHelixManager

        protected org.apache.helix.HelixManager _participantHelixManager
    • Constructor Detail

      • BaseBrokerStarter

        public BaseBrokerStarter()
    • Method Detail

      • init

        public void init​(org.apache.pinot.spi.env.PinotConfiguration brokerConf)
                  throws Exception
        Specified by:
        init in interface org.apache.pinot.spi.services.ServiceStartable
        Throws:
        Exception
      • getPort

        public int getPort()
      • addIdealStateChangeHandler

        public void addIdealStateChangeHandler​(ClusterChangeHandler idealStateChangeHandler)
        Adds an ideal state change handler to handle Helix ideal state change callbacks.

        NOTE: all change handlers will be run in a single thread, so any slow change handler can block other change handlers from running. For slow change handler, make it asynchronous.

      • addExternalViewChangeHandler

        public void addExternalViewChangeHandler​(ClusterChangeHandler externalViewChangeHandler)
        Adds an external view change handler to handle Helix external view change callbacks.

        NOTE: all change handlers will be run in a single thread, so any slow change handler can block other change handlers from running. For slow change handler, make it asynchronous.

      • addInstanceConfigChangeHandler

        public void addInstanceConfigChangeHandler​(ClusterChangeHandler instanceConfigChangeHandler)
        Adds an instance config change handler to handle Helix instance config change callbacks.

        NOTE: all change handlers will be run in a single thread, so any slow change handler can block other change handlers from running. For slow change handler, make it asynchronous.

      • addLiveInstanceChangeHandler

        public void addLiveInstanceChangeHandler​(ClusterChangeHandler liveInstanceChangeHandler)
        Adds a live instance change handler to handle Helix live instance change callbacks.

        NOTE: all change handlers will be run in a single thread, so any slow change handler can block other change handlers from running. For slow change handler, make it asynchronous.

      • getServiceRole

        public org.apache.pinot.spi.services.ServiceRole getServiceRole()
        Specified by:
        getServiceRole in interface org.apache.pinot.spi.services.ServiceStartable
      • getInstanceId

        public String getInstanceId()
        Specified by:
        getInstanceId in interface org.apache.pinot.spi.services.ServiceStartable
      • getConfig

        public org.apache.pinot.spi.env.PinotConfiguration getConfig()
        Specified by:
        getConfig in interface org.apache.pinot.spi.services.ServiceStartable
      • start

        public void start()
                   throws Exception
        Specified by:
        start in interface org.apache.pinot.spi.services.ServiceStartable
        Throws:
        Exception
      • registerExtraComponents

        protected void registerExtraComponents​(BrokerAdminApiApplication brokerAdminApplication)
        Deprecated.
        Use createBrokerAdminApp() instead. This method is called after initialization of BrokerAdminApiApplication object and before calling start to allow custom broker starters to register additional components.
        Parameters:
        brokerAdminApplication - is the application
      • stop

        public void stop()
        Specified by:
        stop in interface org.apache.pinot.spi.services.ServiceStartable
      • isStarting

        public boolean isStarting()
      • isShuttingDown

        public boolean isShuttingDown()
      • getSpectatorHelixManager

        public org.apache.helix.HelixManager getSpectatorHelixManager()
      • getMetricsRegistry

        public org.apache.pinot.spi.metrics.PinotMetricsRegistry getMetricsRegistry()
      • getBrokerMetrics

        public org.apache.pinot.common.metrics.BrokerMetrics getBrokerMetrics()