Class Scheduler


  • public class Scheduler
    extends Object
    Utility class that allows messages to be queued and processed in the background. Messages are accumulated in a queue, and processed whenever possible by a thread pool Internally, there is a queue for each table and a thread pool to process messages in each queue. When a new queue is created, a task is submitted to the thread pool to do a unit of work. If there are still items in the queue after the unit of work, the task will submit a continuation task to repeat this process. If there are errors in processing the queue, the we will skip that item and continue with the rest of the queue.
    Author:
    wwong
    • Constructor Detail

      • Scheduler

        public Scheduler​(int threadPoolCount,
                         SnowflakeConf snowflakeConf)
        Constructor for the scheduler
        Parameters:
        threadPoolCount - Number of worker threads to use
        snowflakeConf - The configuration for Snowflake Hive metastore listener
    • Method Detail

      • enqueueMessage

        public void enqueueMessage​(Command message)
        Enqueues a message to be collected and batched
        Parameters:
        message - the message