Class RecoverySchemaStore

  • All Implemented Interfaces:
    SchemaStore

    public class RecoverySchemaStore
    extends Object
    implements SchemaStore
    A schema store that contains only the maxwell database, and throws away any schema changes we encounter while trying to recover the binlog position.
    • Method Detail

      • getSchema

        public Schema getSchema()
                         throws SchemaStoreException
        Description copied from interface: SchemaStore
        Retrieve the current schema If no Stored schema is found, this method should capture and save a snapshot of the current mysql schema.
        Specified by:
        getSchema in interface SchemaStore
        Returns:
        The schema, either retrieved from storage or captured.
        Throws:
        SchemaStoreException - if we have issues gettng the schema
      • processSQL

        public List<ResolvedSchemaChange> processSQL​(String sql,
                                                     String currentDatabase,
                                                     Position position)
                                              throws SchemaStoreException,
                                                     InvalidSchemaError
        Description copied from interface: SchemaStore
        Process a DDL statement Parse the given SQL, applying the changes to the schema. Returns a list of ResolvedSchemaChange objects, representing the DDL that was applied (if any)
        Specified by:
        processSQL in interface SchemaStore
        Parameters:
        sql - The SQL of the DDL statement
        currentDatabase - The "contextual database" of the DDL statement
        position - The position of the DDL statement
        Returns:
        A list of the schema changes parsed from the SQL.
        Throws:
        SchemaStoreException - if we have trouble processing or storing the schema change
        InvalidSchemaError - if we find the schema to be in a bad state
      • getSchemaID

        public Long getSchemaID()
                         throws SchemaStoreException
        Description copied from interface: SchemaStore
        Retrieve current schema id Schema id should be an always increasing integer, not current intended for use to refernce the schema, simply as a schema generation indicator.
        Specified by:
        getSchemaID in interface SchemaStore
        Returns:
        The current schema id
        Throws:
        SchemaStoreException - if we have trouble getting the schema id