Interface WorkerStatusRepository
-
public interface WorkerStatusRepository
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
WorkerStatusRepository.ColumnNames
Column names of the worker_status table.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<WorkerId>
getAvailableWorkers()
Returns the ids of all available workers.static WorkerStatusRepository
getInstance(Session session, Identifier schema)
Returns a new instance of the default repository implementation.Optional<Instant>
getLastAvailable(WorkerId workerId)
Returns the last timestamp when given worker was in available statusWorkerStatus
getStatusFor(WorkerId workerId)
Returns the status of a worker with the specified id.void
removeStatusFor(WorkerId workerId)
Removes the status for a worker with the specified id.void
updateStatusesFor(WorkerStatus status, List<WorkerId> workerIds)
Updates the status of workers with the specified ids.void
updateStatusFor(WorkerId workerId, WorkerStatus status)
Updates the status of a worker with the specified id.
-
-
-
Method Detail
-
getAvailableWorkers
Set<WorkerId> getAvailableWorkers()
Returns the ids of all available workers.- Returns:
- set of ids of all available workers
-
getStatusFor
WorkerStatus getStatusFor(WorkerId workerId)
Returns the status of a worker with the specified id.- Parameters:
workerId
- worker id- Returns:
- status of a worker with the specified id
-
updateStatusFor
void updateStatusFor(WorkerId workerId, WorkerStatus status)
Updates the status of a worker with the specified id.- Parameters:
workerId
- worker idstatus
- new worker status
-
updateStatusesFor
void updateStatusesFor(WorkerStatus status, List<WorkerId> workerIds)
Updates the status of workers with the specified ids.- Parameters:
status
- new workers statusworkerIds
- identifiers of workers
-
removeStatusFor
void removeStatusFor(WorkerId workerId)
Removes the status for a worker with the specified id.- Parameters:
workerId
- worker id
-
getLastAvailable
Optional<Instant> getLastAvailable(WorkerId workerId)
Returns the last timestamp when given worker was in available status- Parameters:
workerId
- id of worker- Returns:
- timestamp column for the last record when a worker with given id was in AVAILABLE status
-
getInstance
static WorkerStatusRepository getInstance(Session session, Identifier schema)
Returns a new instance of the default repository implementation.Default implementation of the repository uses:
- a default implementation of
DefaultWorkerStatusRepository
.
- Parameters:
session
- Snowpark session objectschema
- Schema of the Task Reactor- Returns:
- a new repository instance
- a default implementation of
-
-