Package com.zendesk.maxwell.schema
Class MysqlSchemaStore
- java.lang.Object
-
- com.zendesk.maxwell.schema.AbstractSchemaStore
-
- com.zendesk.maxwell.schema.MysqlSchemaStore
-
- All Implemented Interfaces:
SchemaStore
public class MysqlSchemaStore extends AbstractSchemaStore implements SchemaStore
-
-
Field Summary
-
Fields inherited from class com.zendesk.maxwell.schema.AbstractSchemaStore
caseSensitivity, replicationConnectionPool, schemaConnectionPool
-
-
Constructor Summary
Constructors Constructor Description MysqlSchemaStore(MaxwellContext context, Position initialPosition)
MysqlSchemaStore(ConnectionPool maxwellConnectionPool, ConnectionPool replicationConnectionPool, ConnectionPool schemaConnectionPool, Long serverID, Position initialPosition, CaseSensitivity caseSensitivity, Filter filter, boolean readOnly)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MysqlSavedSchema
captureAndSaveSchema()
void
clone(Long serverID, Position position)
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.-
Methods inherited from class com.zendesk.maxwell.schema.AbstractSchemaStore
captureSchema, resolveSQL
-
-
-
-
Constructor Detail
-
MysqlSchemaStore
public MysqlSchemaStore(ConnectionPool maxwellConnectionPool, ConnectionPool replicationConnectionPool, ConnectionPool schemaConnectionPool, Long serverID, Position initialPosition, CaseSensitivity caseSensitivity, Filter filter, boolean readOnly)
-
MysqlSchemaStore
public MysqlSchemaStore(MaxwellContext context, Position initialPosition) throws SQLException
- Throws:
SQLException
-
-
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
-
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
-
captureAndSaveSchema
public MysqlSavedSchema captureAndSaveSchema() throws SQLException
- Throws:
SQLException
-
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
-
clone
public void clone(Long serverID, Position position) throws SchemaStoreException
- Throws:
SchemaStoreException
-
-