Interface WorkerService
-
- All Known Implementing Classes:
PulsarWorkerService,WorkerServiceWithClassLoader
public interface WorkerServiceAPI service provides the ability to manage functions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidgenerateFunctionsStats(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.WorkerConfiggetWorkerConfig()Return the worker config.Workers<? extends WorkerService>getWorkers()Get the worker service.voidinitAsStandalone(org.apache.pulsar.functions.worker.WorkerConfig workerConfig)Initialize the worker API service using the provided config.voidinitInBroker(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.booleanisInitialized()Check if the worker service is initialized or not.voidstart(org.apache.pulsar.broker.authentication.AuthenticationService authenticationService, org.apache.pulsar.broker.authorization.AuthorizationService authorizationService, ErrorNotifier errorNotifier)Start the worker API service.voidstop()Stop the worker API service.
-
-
-
Method Detail
-
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 java.lang.ExceptionInitialize the worker API service using the provided config.- Parameters:
workerConfig- the worker config- Throws:
java.lang.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 java.lang.ExceptionInitialize the worker service in broker.- Parameters:
brokerConfig- broker configworkerConfig- worker configpulsarResources- configuration metadata-storeinternalConf- pulsar internal configuration data- Throws:
java.lang.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 java.lang.ExceptionStart the worker API service.- 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
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
-
-