Package com.decs.application.services
Class SlaveManager
java.lang.Object
com.decs.application.services.SlaveManager
Slave Manager Class
This class handles the connected DECS-Slave instances.
- Version:
- 1.0
- Author:
- Bruno Guiomar
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]private ByteArrayInputStreamprivate ObjectListDatabaseprivate ObjectInputStreamprivate static final intNetwork Port for the DECS-Slave registrationVaadin data provider for the automatic updates of the dashboard slave list grid visual componentprivate RunnableRunnable for the Slave Listener service.private RunnableRunnable for the heartbeat system functioning. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds a problem files mapintvoidInitializes all connected slaves and sets up their individual environment with the required components.private voidlocateSlave(SlaveInfo slaveInfo) Locates and retrieves the remote interface of a registered slave.private voidshowNotification(com.vaadin.flow.component.UI ui, String content) Shows a notification with the specified contentvoidInitiates the inference process of all connected slavesvoidInitiates the Slave Listener service.voidStops any ongoing inference process on all connected slaves.
-
Field Details
-
PORT
private static final int PORTNetwork Port for the DECS-Slave registration- See Also:
-
byteIn
-
objIn
-
buffer
private byte[] buffer -
slaveList
-
objectListDatabase
-
slaveListenerRun
Runnable for the Slave Listener service. Processes incoming slave registering requests and creates the SlaveInfo object which represents them. -
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
Vaadin data provider for the automatic updates of the dashboard slave list grid visual component
-
-
Constructor Details
-
SlaveManager
Class Constructor- Parameters:
objectListDatabase- Class containing global relevant objects
-
-
Method Details
-
getConnectedSlaves
public int getConnectedSlaves() -
getSlaveListDataProvider
-
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
Builds a problem files map- Returns:
- list of all relevant parameter files for a specified Problem
-
showNotification
Shows a notification with the specified content- Parameters:
ui- UI object where the notification must be displayedcontent- Textual content of the notification
-