Interface WorkerService
- All Known Implementing Classes:
PulsarWorkerService,WorkerServiceWithClassLoader
public interface WorkerService
API service provides the ability to manage functions.
-
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateFunctionsStats(org.apache.pulsar.common.util.SimpleTextOutputStream out) Generate functions stats.Functions<? extends WorkerService>Get the functions service.FunctionsV2<? extends WorkerService>Get the functions service (v2).Sinks<? extends WorkerService>getSinks()Get the sinks service.Sources<? extends WorkerService>Get the sources service.Return the worker config.Workers<? extends WorkerService>Get the worker service.voidinitAsStandalone(WorkerConfig workerConfig) Initialize the worker API service using the provided config.voidinitInBroker(ServiceConfiguration brokerConfig, WorkerConfig workerConfig, PulsarResources pulsarResources, org.apache.pulsar.common.conf.InternalConfigurationData internalConf) Initialize the worker service in broker.booleanCheck if the worker service is initialized or not.voidstart(AuthenticationService authenticationService, AuthorizationService authorizationService, ErrorNotifier errorNotifier) Start the worker API service.voidstop()Stop the worker API service.
-
Method Details
-
getWorkerConfig
WorkerConfig getWorkerConfig()Return the worker config.- Returns:
- worker config
-
initAsStandalone
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(ServiceConfiguration brokerConfig, WorkerConfig workerConfig, PulsarResources pulsarResources, org.apache.pulsar.common.conf.InternalConfigurationData internalConf) throws Exception Initialize the worker service in broker.- Parameters:
brokerConfig- broker configworkerConfig- worker configpulsarResources- configuration metadata-storeinternalConf- pulsar internal configuration data- Throws:
Exception- when failed to initialize the worker service in broker.
-
start
void start(AuthenticationService authenticationService, 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
-