Interface WorkerService

All Known Implementing Classes:
PulsarWorkerService, WorkerServiceWithClassLoader

public interface WorkerService
API service provides the ability to manage functions.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    generateFunctionsStats(org.apache.pulsar.common.util.SimpleTextOutputStream out)
    Generate functions stats.
    Get the functions service.
    Get the functions service (v2).
    Sinks<? extends WorkerService>
    Get the sinks service.
    Get the sources service.
    org.apache.pulsar.functions.worker.WorkerConfig
    Return the worker config.
    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
    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 the worker API service.
  • Method Details

    • getWorkerConfig

      org.apache.pulsar.functions.worker.WorkerConfig getWorkerConfig()
      Return the worker config.
      Returns:
      worker config
    • initAsStandalone

      void initAsStandalone(org.apache.pulsar.functions.worker.WorkerConfig workerConfig) throws Exception
      Initialize the worker API service using the provided config.
      Parameters:
      workerConfig - the worker config
      Throws:
      Exception - when fail to initialize the worker API service.
    • initInBroker

      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 Exception
      Initialize the worker service in broker.
      Parameters:
      brokerConfig - broker config
      workerConfig - worker config
      pulsarResources - configuration metadata-store
      internalConf - pulsar internal configuration data
      Throws:
      Exception - when failed to initialize the worker service in broker.
    • start

      void start(org.apache.pulsar.broker.authentication.AuthenticationService authenticationService, org.apache.pulsar.broker.authorization.AuthorizationService authorizationService, ErrorNotifier errorNotifier) throws Exception
      Start the worker API service.
      Parameters:
      authenticationService - the authentication service.
      authorizationService - the authorization service.
      errorNotifier - error notifier.
      Throws:
      Exception - when fail to start the worker API service.
    • stop

      void stop()
      Stop the worker API service.
    • isInitialized

      boolean isInitialized()
      Check if the worker service is initialized or not.
      Returns:
      true if the worker service is initialized otherwise false.
    • getFunctions

      Functions<? extends WorkerService> getFunctions()
      Get the functions service.
      Returns:
      the functions service.
    • getFunctionsV2

      FunctionsV2<? extends WorkerService> getFunctionsV2()
      Get the functions service (v2).

      This is a legacy API service for supporting v2.

      Returns:
      the functions service (v2).
    • getSinks

      Sinks<? extends WorkerService> getSinks()
      Get the sinks service.
      Returns:
      the sinks service.
    • getSources

      Sources<? extends WorkerService> getSources()
      Get the sources service.
      Returns:
      the sources service.
    • getWorkers

      Workers<? extends WorkerService> getWorkers()
      Get the worker service.
      Returns:
      the worker service.
    • generateFunctionsStats

      void generateFunctionsStats(org.apache.pulsar.common.util.SimpleTextOutputStream out)
      Generate functions stats.
      Parameters:
      out - output stream