Interface IWorkerManager
- All Known Implementing Classes:
WorkerManager
public interface IWorkerManager
Manage the parallelism calls to worker in the same distributor
-
Field Summary
Modifier and TypeFieldDescriptionstatic final VitamLogger
VitamLoggerstatic final String
Path to database -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkStatusWorker
(String serverHost, int serverPort) findWorkerBy
(String workerFamily) Find a worker by its familydefault void
Do the initialization Load worker from worker.dbdefault void
loadWorkerList
(File registerWorkerFile) To load a registered worker listvoid
Marshall to Databasevoid
registerWorker
(WorkerBean workerBean) Register a workervoid
registerWorker
(String familyId, String workerId, WorkerBean workerInformation) To register a worker in the processingvoid
unregisterWorker
(String familyId, String workerId) To unregister a worker in the processing
-
Field Details
-
LOGGER
VitamLogger -
WORKER_DB_PATH
Path to database- See Also:
-
-
Method Details
-
initialize
Do the initialization Load worker from worker.db- Throws:
IOException
-
loadWorkerList
To load a registered worker list- Parameters:
registerWorkerFile
- the register worker file- Throws:
IOException
-
checkStatusWorker
-
registerWorker
void registerWorker(String familyId, String workerId, WorkerBean workerInformation) throws ProcessingBadRequestException, IOException To register a worker in the processing- Parameters:
familyId
- : family of this workerworkerId
- : ID of the workerworkerInformation
- : Worker Json representation- Throws:
ProcessingBadRequestException
- if cannot register worker to familyInvalidParseOperationException
- if worker description is not well-formedIOException
-
registerWorker
Register a worker- Parameters:
workerBean
- the worker description as a WorkerBean object- Throws:
IOException
- thrown when IOException occurs while read/save worker backup file
-
unregisterWorker
void unregisterWorker(String familyId, String workerId) throws WorkerFamilyNotFoundException, IOException To unregister a worker in the processing- Parameters:
familyId
- : family of this workerworkerId
- : ID of the worker- Throws:
WorkerFamilyNotFoundException
- : when the family is unknownIOException
- if IOException occurs
-
marshallToDB
Marshall to Database- Throws:
IOException
-
findWorkerBy
Find a worker by its family- Parameters:
workerFamily
- the worker family- Returns:
- a WorkerFamilyManager object
-
getWorkerDbFile
File getWorkerDbFile()
-