Interface IWorkerManager
-
- All Known Implementing Classes:
WorkerManager
public interface IWorkerManager
Manage the parallelism calls to worker in the same distributor
-
-
Field Summary
Fields Modifier and Type Field Description static VitamLogger
LOGGER
VitamLoggerstatic java.lang.String
WORKER_DB_PATH
Path to database
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
checkStatusWorker(java.lang.String serverHost, int serverPort)
WorkerFamilyManager
findWorkerBy(java.lang.String workerFamily)
Find a worker by its familyjava.io.File
getWorkerDbFile()
default void
initialize()
Do the initialization Load worker from worker.dbdefault void
loadWorkerList(java.io.File registerWorkerFile)
To load a registered worker listvoid
marshallToDB()
Marshall to Databasevoid
registerWorker(WorkerBean workerBean)
Register a workervoid
registerWorker(java.lang.String familyId, java.lang.String workerId, WorkerBean workerInformation)
To register a worker in the processingvoid
unregisterWorker(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.IOException
Do the initialization Load worker from worker.db- Throws:
java.io.IOException
-
loadWorkerList
default void loadWorkerList(java.io.File registerWorkerFile) throws java.io.IOException
To 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.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-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.IOException
To 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.IOException
Marshall 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()
-
-