@NotThreadSafe public class PostgresSchema extends Object
PostgresConnector. The schema information contains
the table definitions and the Kafka Connect Schemas for each table, where the
Schema excludes any columns that have been specified in the
configuration.| Modifier and Type | Field and Description |
|---|---|
private Filters |
filters |
private static org.slf4j.Logger |
LOGGER |
protected static String |
PUBLIC_SCHEMA_NAME |
private TableSchemaBuilder |
schemaBuilder |
private Function<String,String> |
schemaNameValidator |
private String |
schemaPrefix |
private Tables |
tables |
private Map<TableId,TableSchema> |
tableSchemaByTableId |
private Map<String,Integer> |
typeInfo |
| Modifier | Constructor and Description |
|---|---|
protected |
PostgresSchema(PostgresConnectorConfig config)
Create a schema component given the supplied
Postgres connector configuration. |
| Modifier and Type | Method and Description |
|---|---|
protected int |
columnTypeNameToPgOid(String localTypeName) |
Filters |
filters()
Get the
database and table filters defined by the configuration. |
protected boolean |
isFilteredOut(TableId id) |
protected boolean |
isType(String localTypeName,
int jdbcType) |
protected static TableId |
parse(String table) |
private void |
printReplicaIdentityInfo(PostgresConnection connection,
TableId tableId) |
protected PostgresSchema |
refresh(PostgresConnection connection,
boolean printReplicaIdentityInfo)
Initializes the content for this schema by reading all the database information from the supplied connection.
|
protected void |
refresh(PostgresConnection connection,
TableId tableId)
Refreshes this schema's content for a particular table
|
private void |
refreshSchema(TableId id) |
protected void |
refreshSchemas()
Discard any currently-cached schemas and rebuild them using the filters.
|
protected TableSchema |
schemaFor(String fqn) |
protected TableSchema |
schemaFor(TableId id) |
protected Table |
tableFor(String fqn) |
Table |
tableFor(TableId id)
Get the
Schema information for the table with the given identifier, if that table exists and is
included by the filter. |
protected Stream<TableId> |
tables() |
protected String |
validateSchemaName(String name) |
protected static final String PUBLIC_SCHEMA_NAME
private static final org.slf4j.Logger LOGGER
private final Map<TableId,TableSchema> tableSchemaByTableId
private final Filters filters
private final TableSchemaBuilder schemaBuilder
private final String schemaPrefix
private final Tables tables
protected PostgresSchema(PostgresConnectorConfig config)
Postgres connector configuration.config - the connector configuration, which is presumed to be validprotected PostgresSchema refresh(PostgresConnection connection, boolean printReplicaIdentityInfo) throws SQLException
connection - a JdbcConnection instance, never nullprintReplicaIdentityInfo - whether or not to look and print out replica identity information about the tablesSQLException - if there is a problem obtaining the schema from the database serverprivate void printReplicaIdentityInfo(PostgresConnection connection, TableId tableId)
protected void refresh(PostgresConnection connection, TableId tableId) throws SQLException
connection - a JdbcConnection instance, never nulltableId - the table identifier; may not be nullSQLException - if there is a problem refreshing the schema from the database serverpublic Filters filters()
database and table filters defined by the configuration.public Table tableFor(TableId id)
Schema information for the table with the given identifier, if that table exists and is
included by the filter.id - the fully-qualified table identifier; may be nullprotected TableSchema schemaFor(TableId id)
protected boolean isFilteredOut(TableId id)
protected TableSchema schemaFor(String fqn)
protected boolean isType(String localTypeName, int jdbcType)
protected int columnTypeNameToPgOid(String localTypeName)
protected void refreshSchemas()
private void refreshSchema(TableId id)
Copyright © 2017 JBoss by Red Hat. All rights reserved.