Class WorkerServiceWithClassLoader

  • All Implemented Interfaces:
    WorkerService

    public class WorkerServiceWithClassLoader
    extends java.lang.Object
    implements WorkerService
    A worker service with its classloader.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void generateFunctionsStats​(org.apache.pulsar.common.util.SimpleTextOutputStream out)
      Generate functions stats.
      Functions<? extends WorkerService> getFunctions()
      Get the functions service.
      FunctionsV2<? extends WorkerService> getFunctionsV2()
      Get the functions service (v2).
      Sinks<? extends WorkerService> getSinks()
      Get the sinks service.
      Sources<? extends WorkerService> getSources()
      Get the sources service.
      org.apache.pulsar.functions.worker.WorkerConfig getWorkerConfig()
      Return the worker config.
      Workers<? extends WorkerService> getWorkers()
      Get the worker service.
      void initAsStandalone​(org.apache.pulsar.functions.worker.WorkerConfig workerConfig)
      Initialize the worker API service using the provided config.
      void initInBroker​(org.apache.pulsar.broker.ServiceConfiguration brokerConfig, org.apache.pulsar.functions.worker.WorkerConfig workerConfig, org.apache.pulsar.broker.resources.PulsarResources pulsarResources, org.apache.pulsar.common.conf.InternalConfigurationData internalConf)
      Initialize the worker service in broker.
      boolean isInitialized()
      Check if the worker service is initialized or not.
      void start​(org.apache.pulsar.broker.authentication.AuthenticationService authenticationService, org.apache.pulsar.broker.authorization.AuthorizationService authorizationService, ErrorNotifier errorNotifier)
      Start the worker API service.
      void stop()
      Stop the worker API service.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WorkerServiceWithClassLoader

        public WorkerServiceWithClassLoader()
    • Method Detail

      • getWorkerConfig

        public org.apache.pulsar.functions.worker.WorkerConfig getWorkerConfig()
        Description copied from interface: WorkerService
        Return the worker config.
        Specified by:
        getWorkerConfig in interface WorkerService
        Returns:
        worker config
      • initAsStandalone

        public void initAsStandalone​(org.apache.pulsar.functions.worker.WorkerConfig workerConfig)
                              throws java.lang.Exception
        Description copied from interface: WorkerService
        Initialize the worker API service using the provided config.
        Specified by:
        initAsStandalone in interface WorkerService
        Parameters:
        workerConfig - the worker config
        Throws:
        java.lang.Exception - when fail to initialize the worker API service.
      • initInBroker

        public void initInBroker​(org.apache.pulsar.broker.ServiceConfiguration brokerConfig,
                                 org.apache.pulsar.functions.worker.WorkerConfig workerConfig,
                                 org.apache.pulsar.broker.resources.PulsarResources pulsarResources,
                                 org.apache.pulsar.common.conf.InternalConfigurationData internalConf)
                          throws java.lang.Exception
        Description copied from interface: WorkerService
        Initialize the worker service in broker.
        Specified by:
        initInBroker in interface WorkerService
        Parameters:
        brokerConfig - broker config
        workerConfig - worker config
        pulsarResources - configuration metadata-store
        internalConf - pulsar internal configuration data
        Throws:
        java.lang.Exception - when failed to initialize the worker service in broker.
      • start

        public void start​(org.apache.pulsar.broker.authentication.AuthenticationService authenticationService,
                          org.apache.pulsar.broker.authorization.AuthorizationService authorizationService,
                          ErrorNotifier errorNotifier)
                   throws java.lang.Exception
        Description copied from interface: WorkerService
        Start the worker API service.
        Specified by:
        start in interface WorkerService
        Parameters:
        authenticationService - the authentication service.
        authorizationService - the authorization service.
        errorNotifier - error notifier.
        Throws:
        java.lang.Exception - when fail to start the worker API service.
      • stop

        public void stop()
        Description copied from interface: WorkerService
        Stop the worker API service.
        Specified by:
        stop in interface WorkerService
      • isInitialized

        public boolean isInitialized()
        Description copied from interface: WorkerService
        Check if the worker service is initialized or not.
        Specified by:
        isInitialized in interface WorkerService
        Returns:
        true if the worker service is initialized otherwise false.
      • generateFunctionsStats

        public void generateFunctionsStats​(org.apache.pulsar.common.util.SimpleTextOutputStream out)
        Description copied from interface: WorkerService
        Generate functions stats.
        Specified by:
        generateFunctionsStats in interface WorkerService
        Parameters:
        out - output stream