public interface Worker extends Runnable, ProgramLifecycle<WorkerContext>
Worker
.Modifier and Type | Method and Description |
---|---|
void |
configure(WorkerConfigurer configurer)
Configure a
Worker . |
void |
destroy()
Destroy the
Worker . |
void |
initialize(WorkerContext context)
Initialize the
Worker . |
void |
stop()
Stop the
Worker . |
void configure(WorkerConfigurer configurer)
Worker
.void initialize(WorkerContext context) throws Exception
Worker
.
Note that unlike most program types, this method is not called within an implicit transaction,
but instead it can start its own transactions using Transactional.execute(TxRunnable)
.
methods.initialize
in interface ProgramLifecycle<WorkerContext>
context
- An instance of RuntimeContext
Exception
- If there is any error during initialization.void destroy()
Worker
.
Note that unlike most program types, this method is not called within an implicit transaction,
but instead it can start its own transactions using Transactional.execute(TxRunnable)
.destroy
in interface ProgramLifecycle<WorkerContext>
void stop()
Worker
. This method will be invoked whenever the worker is externally stopped by CDAP.
This method will be invoked from a different thread than the one calling the Runnable.run()
method.Copyright © 2020 Cask Data, Inc. Licensed under the Apache License, Version 2.0.