Class SetWorkersNumberHandler


  • public class SetWorkersNumberHandler
    extends Object
    Handler for the Task Reactor worker number update.
    • Constructor Detail

      • SetWorkersNumberHandler

        public SetWorkersNumberHandler()
    • Method Detail

      • setWorkersNumber

        public static String setWorkersNumber​(Session session,
                                              int workersNumber,
                                              String instanceSchema)
        Default handler method for the TASK_REACTOR.SET_WORKERS_NUMBER procedure.

        Sets the desired number of workers in the for a Task Reactor instance. Statuses of each worker can be queried from the WORKER_REGISTRY table in the Task Reactor schema.

        Note: This procedure only manages the values in the WORKER_REGISTRY table. It does not create, nor delete, worker tables, streams or tasks. This is a job of a dispatcher procedure. In the next run the dispatcher will create requested workers and remove workers marked for deletion, updating their status in the WORKER_REGISTRY table.

        Parameters:
        session - Snowpark session object
        workersNumber - desired number of workers, greater or equal to 0
        instanceSchema - task reactor instance name
        Returns:
        message about how many workers were scheduled for adding or deletion