Class K8SWorkerControlImpl

java.lang.Object
com.illumon.iris.db.tables.remotequery.process.K8SWorkerControlImpl
All Implemented Interfaces:
WorkerControl

public class K8SWorkerControlImpl extends Object implements 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/
  • Field Details

  • 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: WorkerControl
      Construct 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:
      createWorker in interface WorkerControl
      Parameters:
      workerKind - WorkerKind for this worker
      workerId - A string representing the id for this worker, may not be unique
      processInfoId - A unique string representing the worker process
      protocols - The protocols implemented by this worker
      userName - The username of the requester
      request - The RemoteProcessingRequest specifying the processing characteristics
      clientClassDirectory - The directory for client classes
      log - The logger to use for logging
      processEventLogLogger - The process event logger
      dispatcherHostName - The dispatcher hostname
      dispatcherDiscoveryName - The dispatcher discovery name
      irisGroupProvider - The group provider to allow for getting a user's groups
      eventConsumer - A method to be called to propagate any status events upon worker creation
      workerTerminationCallback - A method to be called when a worker terminates
      Returns:
      A Worker data object with attributes and settings of the Worker process
    • cleanupWorkers

      public void cleanupWorkers()
      Description copied from interface: WorkerControl
      Cleanup any Workers that that were not properly cleaned up from Dispatcher restarts. This method should be called when WorkerControl is created.
      Specified by:
      cleanupWorkers in interface WorkerControl