Class BootstrapController

  • All Implemented Interfaces:
    StoppableTask

    public class BootstrapController
    extends RunLoopProcess
    Watches maxwell.bootstrap, starts and stops bootstrap tasks
    • Constructor Detail

      • BootstrapController

        public BootstrapController​(ConnectionPool maxwellConnectionPool,
                                   AbstractProducer producer,
                                   SynchronousBootstrapper bootstrapper,
                                   String clientID,
                                   boolean syncMode,
                                   Long currentSchemaID)
        Instantiate a controller
        Parameters:
        maxwellConnectionPool - maxwell connection pool
        producer - where to write rows
        bootstrapper - the "actor" that actually does work
        clientID - current client ID
        syncMode - whether to stop replication while we bootstrap
        currentSchemaID - initial value for schema_id
    • Method Detail

      • setCurrentSchemaID

        public void setCurrentSchemaID​(Long schemaID)
        setup a value for outputting as "schema_id". Note that this is laughably unreliable, as there's totally no way of syncing the bootstrap's work with the replicators'. But one of my great talents as an engineer has been ignoring stuff that's sublty wrong but functionally useful.
        Parameters:
        schemaID - the totally disconnected from reality schema_id
      • shouldSkip

        public boolean shouldSkip​(RowMap row)
                           throws IOException
        If a bootstrap is active for a table, buffer the row for later. At the end of a bootstrap we will output the buffered rows. This allows us to output a consistant snapshot of table, first doing the SELECT * and then outputting deltas.
        Parameters:
        row - a row to possibly buffer
        Returns:
        whether the row was buffered
        Throws:
        IOException - if there was a problem buffering the row