Interface WorkerStatusRepository


  • public interface WorkerStatusRepository
    • 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 id
        status - new worker status
      • updateStatusesFor

        void updateStatusesFor​(WorkerStatus status,
                               List<WorkerId> workerIds)
        Updates the status of workers with the specified ids.
        Parameters:
        status - new workers status
        workerIds - 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 object
        schema - Schema of the Task Reactor
        Returns:
        a new repository instance