Class PulsarWorkerService
- java.lang.Object
-
- org.apache.pulsar.functions.worker.PulsarWorkerService
-
- All Implemented Interfaces:
WorkerService
public class PulsarWorkerService extends java.lang.Object implements WorkerService
A service component contains everything to run a worker except rest server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePulsarWorkerService.PulsarClientCreator
-
Constructor Summary
Constructors Constructor Description PulsarWorkerService()PulsarWorkerService(PulsarWorkerService.PulsarClientCreator clientCreator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerateFunctionsStats(org.apache.pulsar.common.util.SimpleTextOutputStream out)Generate functions stats.voidinit(org.apache.pulsar.functions.worker.WorkerConfig workerConfig, java.net.URI dlogUri, boolean runAsStandalone)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.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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pulsar.functions.worker.WorkerService
getFunctions, getFunctionsV2, getSinks, getSources, getWorkerConfig, getWorkers, isInitialized
-
-
-
-
Constructor Detail
-
PulsarWorkerService
public PulsarWorkerService()
-
PulsarWorkerService
public PulsarWorkerService(PulsarWorkerService.PulsarClientCreator clientCreator)
-
-
Method Detail
-
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
-
init
public void init(org.apache.pulsar.functions.worker.WorkerConfig workerConfig, java.net.URI dlogUri, boolean runAsStandalone)
-
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
-
-