Interface IWorkerManager
-
- All Known Implementing Classes:
WorkerManager
public interface IWorkerManagerManage the parallelism calls to worker in the same distributor
-
-
Field Summary
Fields Modifier and Type Field Description static VitamLoggerLOGGERVitamLoggerstatic java.lang.StringWORKER_DB_PATHPath to database
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancheckStatusWorker(java.lang.String serverHost, int serverPort)WorkerFamilyManagerfindWorkerBy(java.lang.String workerFamily)Find a worker by its familyjava.io.FilegetWorkerDbFile()default voidinitialize()Do the initialization Load worker from worker.dbdefault voidloadWorkerList(java.io.File registerWorkerFile)To load a registered worker listvoidmarshallToDB()Marshall to DatabasevoidregisterWorker(WorkerBean workerBean)Register a workervoidregisterWorker(java.lang.String familyId, java.lang.String workerId, WorkerBean workerInformation)To register a worker in the processingvoidunregisterWorker(java.lang.String familyId, java.lang.String workerId)To unregister a worker in the processing
-
-
-
Field Detail
-
LOGGER
static final VitamLogger LOGGER
VitamLogger
-
WORKER_DB_PATH
static final java.lang.String WORKER_DB_PATH
Path to database- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
default void initialize() throws java.io.IOExceptionDo the initialization Load worker from worker.db- Throws:
java.io.IOException
-
loadWorkerList
default void loadWorkerList(java.io.File registerWorkerFile) throws java.io.IOExceptionTo load a registered worker list- Parameters:
registerWorkerFile- the register worker file- Throws:
java.io.IOException
-
checkStatusWorker
boolean checkStatusWorker(java.lang.String serverHost, int serverPort)
-
registerWorker
void registerWorker(java.lang.String familyId, java.lang.String workerId, WorkerBean workerInformation) throws ProcessingBadRequestException, java.io.IOExceptionTo 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-formedjava.io.IOException
-
registerWorker
void registerWorker(WorkerBean workerBean) throws java.io.IOException
Register a worker- Parameters:
workerBean- the worker description as a WorkerBean object- Throws:
java.io.IOException- thrown when IOException occurs while read/save worker backup file
-
unregisterWorker
void unregisterWorker(java.lang.String familyId, java.lang.String workerId) throws WorkerFamilyNotFoundException, java.io.IOExceptionTo unregister a worker in the processing- Parameters:
familyId- : family of this workerworkerId- : ID of the worker- Throws:
WorkerFamilyNotFoundException- : when the family is unknownjava.io.IOException- if IOException occurs
-
marshallToDB
void marshallToDB() throws java.io.IOExceptionMarshall to Database- Throws:
java.io.IOException
-
findWorkerBy
WorkerFamilyManager findWorkerBy(java.lang.String workerFamily)
Find a worker by its family- Parameters:
workerFamily- the worker family- Returns:
- a WorkerFamilyManager object
-
getWorkerDbFile
java.io.File getWorkerDbFile()
-
-