Class SlaveManager

java.lang.Object
com.decs.application.services.SlaveManager

@Service public class SlaveManager extends Object
Slave Manager Class

This class handles the connected DECS-Slave instances.

Version:
1.0
Author:
Bruno Guiomar
  • Field Details

    • PORT

      private static final int PORT
      Network Port for the DECS-Slave registration
      See Also:
    • byteIn

      private ByteArrayInputStream byteIn
    • objIn

      private ObjectInputStream objIn
    • buffer

      private byte[] buffer
    • slaveList

      private volatile ArrayList<SlaveInfo> slaveList
    • objectListDatabase

      private ObjectListDatabase objectListDatabase
    • slaveListenerRun

      private Runnable slaveListenerRun
      Runnable for the Slave Listener service. Processes incoming slave registering requests and creates the SlaveInfo object which represents them.
    • slaveStatusCheckerRun

      private Runnable slaveStatusCheckerRun
      Runnable for the heartbeat system functioning. This system calls a remote method on all registered slaves and checks their response. If no response or error is received, the slave is removed from the slaves list.
    • slaveListDataProvider

      private com.vaadin.flow.data.provider.DataProvider<SlaveInfo,Void> slaveListDataProvider
      Vaadin data provider for the automatic updates of the dashboard slave list grid visual component
  • Constructor Details

    • SlaveManager

      public SlaveManager(ObjectListDatabase objectListDatabase)
      Class Constructor
      Parameters:
      objectListDatabase - Class containing global relevant objects
  • Method Details

    • getConnectedSlaves

      public int getConnectedSlaves()
    • getSlaveListDataProvider

      public com.vaadin.flow.data.provider.DataProvider<SlaveInfo,Void> getSlaveListDataProvider()
    • fetchSlaveList

      public ArrayList<SlaveInfo> fetchSlaveList()
    • startSlaveListener

      public void startSlaveListener()
      Initiates the Slave Listener service. This service is responsible for handling the DECS-Slave registration process. It also processes the heartbeat system which checks the liveliness of all connected slaves.
    • initializeSlaves

      public void initializeSlaves()
      Initializes all connected slaves and sets up their individual environment with the required components. Relevant parameter files are sent to each slave for latter evolutionary execution.
    • startInference

      public void startInference()
      Initiates the inference process of all connected slaves
    • stopInference

      public void stopInference()
      Stops any ongoing inference process on all connected slaves.

      (Not implemented yet)

    • buildProblemFileMap

      private ArrayList<JobFile> buildProblemFileMap()
      Builds a problem files map
      Returns:
      list of all relevant parameter files for a specified Problem
    • locateSlave

      private void locateSlave(SlaveInfo slaveInfo)
      Locates and retrieves the remote interface of a registered slave. After a slave is registered in the system, it is necessary to retrieve its remote interface to latter invoke methods.
      Parameters:
      slaveInfo - Object which represents the registered Slave
    • showNotification

      private void showNotification(com.vaadin.flow.component.UI ui, String content)
      Shows a notification with the specified content
      Parameters:
      ui - UI object where the notification must be displayed
      content - Textual content of the notification