@Internal public final class RowDataFieldsKinesisPartitioner extends KinesisPartitioner<org.apache.flink.table.data.RowData>
A KinesisPartitioner of RowData elements that constructs the partition key
from a list of field names.
The key is constructed by concatenating the string representations of a list of fields projected from an input element. A fixed prefix can be optionally configured in order to speed up the key construction process.
Resulting partition key values are trimmed to the maximum length allowed by Kinesis.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_DELIMITER
Default delimiter for
delimiter. |
static int |
MAX_PARTITION_KEY_LENGTH
Allowed maximum length limit of a partition key.
|
| Constructor and Description |
|---|
RowDataFieldsKinesisPartitioner(org.apache.flink.table.catalog.CatalogTable table) |
RowDataFieldsKinesisPartitioner(org.apache.flink.table.catalog.CatalogTable table,
String delimiter) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
getPartitionId(org.apache.flink.table.data.RowData element)
Return a partition id based on the input.
|
int |
hashCode() |
static boolean |
hasWellDefinedString(org.apache.flink.table.types.logical.LogicalType logicalType)
Checks whether the given
LogicalType has a well-defined string representation when
calling Object.toString() on the internal data structure. |
void |
setStaticFields(Map<String,String> staticFields)
Update the fixed partition key prefix.
|
getExplicitHashKey, initializepublic static final int MAX_PARTITION_KEY_LENGTH
public RowDataFieldsKinesisPartitioner(org.apache.flink.table.catalog.CatalogTable table)
public RowDataFieldsKinesisPartitioner(org.apache.flink.table.catalog.CatalogTable table,
String delimiter)
public String getPartitionId(org.apache.flink.table.data.RowData element)
KinesisPartitionergetPartitionId in class KinesisPartitioner<org.apache.flink.table.data.RowData>element - Element to partitionpublic void setStaticFields(Map<String,String> staticFields)
staticFields - An association of (field name, field value) pairs to be used as static
partition key prefix.public static boolean hasWellDefinedString(org.apache.flink.table.types.logical.LogicalType logicalType)
LogicalType has a well-defined string representation when
calling Object.toString() on the internal data structure. The string representation
would be similar in SQL or in a programming language.
Note: This method might not be necessary anymore, once we have implemented a utility that can convert any internal data structure to a well-defined string representation.
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.