Package com.zendesk.maxwell.recovery
Class RecoverySchemaStore
- java.lang.Object
-
- com.zendesk.maxwell.recovery.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.
-
-
Constructor Summary
Constructors Constructor Description RecoverySchemaStore(ConnectionPool replicationConnectionPool, String maxwellDatabaseName, CaseSensitivity caseSensitivity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Schema
getSchema()
Retrieve the current schema If no Stored schema is found, this method should capture and save a snapshot of the current mysql schema.Long
getSchemaID()
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.List<ResolvedSchemaChange>
processSQL(String sql, String currentDatabase, Position position)
Process a DDL statement Parse the given SQL, applying the changes to the schema.
-
-
-
Constructor Detail
-
RecoverySchemaStore
public RecoverySchemaStore(ConnectionPool replicationConnectionPool, String maxwellDatabaseName, CaseSensitivity caseSensitivity)
-
-
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 interfaceSchemaStore
- 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 interfaceSchemaStore
- Parameters:
sql
- The SQL of the DDL statementcurrentDatabase
- The "contextual database" of the DDL statementposition
- 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 changeInvalidSchemaError
- 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 interfaceSchemaStore
- Returns:
- The current schema id
- Throws:
SchemaStoreException
- if we have trouble getting the schema id
-
-