Class WorkerServiceWithClassLoader
- java.lang.Object
-
- org.apache.pulsar.functions.worker.service.WorkerServiceWithClassLoader
-
- All Implemented Interfaces:
WorkerService
public class WorkerServiceWithClassLoader extends java.lang.Object implements WorkerService
A worker service with its classloader.
-
-
Constructor Summary
Constructors Constructor Description WorkerServiceWithClassLoader()
-
Method Summary
All Methods Instance Methods Concrete 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
public org.apache.pulsar.functions.worker.WorkerConfig getWorkerConfig()
Description copied from interface:WorkerServiceReturn the worker config.- Specified by:
getWorkerConfigin interfaceWorkerService- Returns:
- worker config
-
initAsStandalone
public void initAsStandalone(org.apache.pulsar.functions.worker.WorkerConfig workerConfig) throws java.lang.ExceptionDescription copied from interface:WorkerServiceInitialize the worker API service using the provided config.- Specified by:
initAsStandalonein interfaceWorkerService- 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.ExceptionDescription 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:
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.ExceptionDescription 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:
java.lang.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
public Functions<? extends WorkerService> getFunctions()
Description copied from interface:WorkerServiceGet the functions service.- Specified by:
getFunctionsin interfaceWorkerService- Returns:
- the functions service.
-
getFunctionsV2
public FunctionsV2<? extends WorkerService> 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
public Sinks<? extends WorkerService> getSinks()
Description copied from interface:WorkerServiceGet the sinks service.- Specified by:
getSinksin interfaceWorkerService- Returns:
- the sinks service.
-
getSources
public Sources<? extends WorkerService> getSources()
Description copied from interface:WorkerServiceGet the sources service.- Specified by:
getSourcesin interfaceWorkerService- Returns:
- the sources service.
-
getWorkers
public Workers<? extends WorkerService> 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
-
-