Class ComputePartition<R extends org.apache.kafka.connect.connector.ConnectRecord<R>>
java.lang.Object
io.debezium.transforms.partitions.ComputePartition<R>
- Type Parameters:
R
- the subtype ofConnectRecord
on which this transformation will operate
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.kafka.common.Configurable
,org.apache.kafka.connect.transforms.Transformation<R>
public class ComputePartition<R extends org.apache.kafka.connect.connector.ConnectRecord<R>>
extends Object
implements org.apache.kafka.connect.transforms.Transformation<R>
This SMT allow to use a specific table column to calculate the destination partition.
- Author:
- Mario Fiore Vitale
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
private static final org.slf4j.Logger
static final String
static final String
static final String
static final String
static final String
private SmtManager<R>
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
void
close()
private int
computePartition
(Object fieldValue, String table) org.apache.kafka.common.config.ConfigDef
config()
void
private Optional<org.apache.kafka.connect.data.Struct>
extractPayload
(org.apache.kafka.connect.data.Struct envelope) private String
getTableName
(org.apache.kafka.connect.data.Struct envelope) private boolean
skipRecord
(String table)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
SCHEMA_FIELD_NAME
- See Also:
-
SQLSERVER_CONNECTOR
- See Also:
-
KEYSPACE_FIELD_NAME
- See Also:
-
TABLE_FIELD_NAME
- See Also:
-
COLLECTION_FIELD_NAME
- See Also:
-
CONNECTOR_FIELD_NAME
- See Also:
-
MONGODB_CONNECTOR
- See Also:
-
DB_FIELD_NAME
- See Also:
-
MYSQL_CONNECTOR
- See Also:
-
POSTGRES_CONNECTOR
- See Also:
-
ORACLE_CONNECTOR
- See Also:
-
DB2_CONNECTOR
- See Also:
-
CASSANDRA_CONNECTOR
- See Also:
-
VITESS_CONNECTOR
- See Also:
-
tableNames
-
smtManager
-
numberOfPartitionsByTable
-
fieldNameByTable
-
-
Constructor Details
-
ComputePartition
public ComputePartition()
-
-
Method Details
-
config
public org.apache.kafka.common.config.ConfigDef config() -
configure
- Specified by:
configure
in interfaceorg.apache.kafka.common.Configurable
-
checkConfigurationConsistency
private void checkConfigurationConsistency() -
apply
-
skipRecord
-
getTableName
-
computePartition
-
extractPayload
private Optional<org.apache.kafka.connect.data.Struct> extractPayload(org.apache.kafka.connect.data.Struct envelope) -
close
public void close()
-