Class WorkerServiceWithClassLoader
java.lang.Object
org.apache.pulsar.functions.worker.service.WorkerServiceWithClassLoader
- All Implemented Interfaces:
WorkerService
A worker service with its classloader.
-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
WorkerServiceWithClassLoader
public WorkerServiceWithClassLoader()
-
-
Method Details
-
getWorkerConfig
Description copied from interface:WorkerServiceReturn the worker config.- Specified by:
getWorkerConfigin interfaceWorkerService- Returns:
- worker config
-
initAsStandalone
Description copied from interface:WorkerServiceInitialize the worker API service using the provided config.- Specified by:
initAsStandalonein interfaceWorkerService- Parameters:
workerConfig- the worker config- Throws:
Exception- when fail to initialize the worker API service.
-
initInBroker
public void initInBroker(ServiceConfiguration brokerConfig, WorkerConfig workerConfig, PulsarResources pulsarResources, org.apache.pulsar.common.conf.InternalConfigurationData internalConf) throws Exception Description copied from interface:WorkerServiceInitialize the worker service in broker.- Specified by:
initInBrokerin interfaceWorkerService- 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
public void start(AuthenticationService authenticationService, AuthorizationService authorizationService, ErrorNotifier errorNotifier) throws Exception Description copied from interface:WorkerServiceStart the worker API service.- Specified by:
startin interfaceWorkerService- Parameters:
authenticationService- the authentication service.authorizationService- the authorization service.errorNotifier- error notifier.- Throws:
Exception- when fail to start the worker API service.
-
stop
public void stop()Description copied from interface:WorkerServiceStop the worker API service.- Specified by:
stopin interfaceWorkerService
-
isInitialized
public boolean isInitialized()Description copied from interface:WorkerServiceCheck if the worker service is initialized or not.- Specified by:
isInitializedin interfaceWorkerService- Returns:
- true if the worker service is initialized otherwise false.
-
getFunctions
Description copied from interface:WorkerServiceGet the functions service.- Specified by:
getFunctionsin interfaceWorkerService- Returns:
- the functions service.
-
getFunctionsV2
Description copied from interface:WorkerServiceGet the functions service (v2).This is a legacy API service for supporting v2.
- Specified by:
getFunctionsV2in interfaceWorkerService- Returns:
- the functions service (v2).
-
getSinks
Description copied from interface:WorkerServiceGet the sinks service.- Specified by:
getSinksin interfaceWorkerService- Returns:
- the sinks service.
-
getSources
Description copied from interface:WorkerServiceGet the sources service.- Specified by:
getSourcesin interfaceWorkerService- Returns:
- the sources service.
-
getWorkers
Description copied from interface:WorkerServiceGet the worker service.- Specified by:
getWorkersin interfaceWorkerService- Returns:
- the worker service.
-
generateFunctionsStats
public void generateFunctionsStats(org.apache.pulsar.common.util.SimpleTextOutputStream out) Description copied from interface:WorkerServiceGenerate functions stats.- Specified by:
generateFunctionsStatsin interfaceWorkerService- Parameters:
out- output stream
-