Interface IWorkerManager
- All Known Implementing Classes:
WorkerManager
public interface IWorkerManager
Manage the parallelism calls to worker in the same distributor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VitamLoggerVitamLoggerstatic final StringPath to database -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckStatusWorker(String serverHost, int serverPort) findWorkerBy(String workerFamily) Find a worker by its familydefault voidDo the initialization Load worker from worker.dbdefault voidloadWorkerList(File registerWorkerFile) To load a registered worker listvoidMarshall to DatabasevoidregisterWorker(WorkerBean workerBean) Register a workervoidregisterWorker(String familyId, String workerId, WorkerBean workerInformation) To register a worker in the processingvoidunregisterWorker(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()
-