Class K8SWorkerControlImpl
java.lang.Object
com.illumon.iris.db.tables.remotequery.process.K8SWorkerControlImpl
- All Implemented Interfaces:
WorkerControl
DockerServiceWorkerControlImpl is an implementation of the
WorkerControl interface that
creates Workers on Kubernetes.
This class uses the Fabric8 Java client library for kubernetes.
https://fabric8.io/-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCleanup any Workers that that were not properly cleaned up from Dispatcher restarts.createWorker(WorkerKind workerKind, String workerId, String processInfoId, List<WorkerProtocol> protocols, String userName, RemoteProcessingRequest request, File clientClassDirectory, com.fishlib.io.logger.Logger log, ProcessEventLogFormat2Logger processEventLogLogger, String dispatcherHostName, String dispatcherDiscoveryName, IrisGroupProvider irisGroupProvider, @NotNull Consumer<String> eventConsumer, @NotNull Consumer<Worker> workerTerminationCallback) Construct a Worker with the specified request parameters needed to start the worker.
-
Field Details
-
VALIDATOR_CLASS_PREFIX
- See Also:
-
-
Constructor Details
-
K8SWorkerControlImpl
public K8SWorkerControlImpl(com.fishlib.io.logger.Logger log) Constructor- Parameters:
log- The Logger to use for logging
-
-
Method Details
-
createWorker
public Worker createWorker(WorkerKind workerKind, String workerId, String processInfoId, List<WorkerProtocol> protocols, String userName, RemoteProcessingRequest request, File clientClassDirectory, com.fishlib.io.logger.Logger log, ProcessEventLogFormat2Logger processEventLogLogger, String dispatcherHostName, String dispatcherDiscoveryName, IrisGroupProvider irisGroupProvider, @NotNull @NotNull Consumer<String> eventConsumer, @NotNull @NotNull Consumer<Worker> workerTerminationCallback) Description copied from interface:WorkerControlConstruct a Worker with the specified request parameters needed to start the worker. Note: This create method should set up a data object only and not attempt to start or launch the Worker. Use the WorkerControl#startWorkerMethod() to start or launch the Workers- Specified by:
createWorkerin interfaceWorkerControl- Parameters:
workerKind- WorkerKind for this workerworkerId- A string representing the id for this worker, may not be uniqueprocessInfoId- A unique string representing the worker processprotocols- The protocols implemented by this workeruserName- The username of the requesterrequest- TheRemoteProcessingRequestspecifying the processing characteristicsclientClassDirectory- The directory for client classeslog- The logger to use for loggingprocessEventLogLogger- The process event loggerdispatcherHostName- The dispatcher hostnamedispatcherDiscoveryName- The dispatcher discovery nameirisGroupProvider- The group provider to allow for getting a user's groupseventConsumer- A method to be called to propagate any status events upon worker creationworkerTerminationCallback- A method to be called when a worker terminates- Returns:
- A
Workerdata object with attributes and settings of the Worker process
-
cleanupWorkers
public void cleanupWorkers()Description copied from interface:WorkerControlCleanup any Workers that that were not properly cleaned up from Dispatcher restarts. This method should be called when WorkerControl is created.- Specified by:
cleanupWorkersin interfaceWorkerControl
-