DynamicTableFactory
is based on ConfigOption
and catalogs use CatalogPropertiesUtil
.@Deprecated @Internal public class DescriptorProperties extends Object
Note to implementers: Please try to reuse key names as much as possible. Key-names should be hierarchical and lower case. Use "-" instead of dots or camel case. E.g., connector.schema.start-from = from-earliest. Try not to use the higher level in a key-name. E.g., instead of connector.kafka.kafka-version use connector.kafka.version.
Properties with key normalization enabled contain only lower-case keys.
Modifier and Type | Field and Description |
---|---|
static String |
COMMENT
Deprecated.
|
static String |
DATA_TYPE
Deprecated.
|
static String |
EXPR
Deprecated.
|
static String |
METADATA
Deprecated.
|
static String |
NAME
Deprecated.
|
static String |
PARTITION_KEYS
Deprecated.
|
static String |
PRIMARY_KEY_COLUMNS
Deprecated.
|
static String |
PRIMARY_KEY_NAME
Deprecated.
|
static String |
TYPE
Deprecated.
|
static String |
VIRTUAL
Deprecated.
|
static String |
WATERMARK
Deprecated.
|
static String |
WATERMARK_ROWTIME
Deprecated.
|
static String |
WATERMARK_STRATEGY
Deprecated.
|
static String |
WATERMARK_STRATEGY_DATA_TYPE
Deprecated.
|
static String |
WATERMARK_STRATEGY_EXPR
Deprecated.
|
Constructor and Description |
---|
DescriptorProperties()
Deprecated.
|
DescriptorProperties(boolean normalizeKeys)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
asMap()
Deprecated.
Returns the properties as a map copy.
|
Map<String,String> |
asPrefixedMap(String prefix)
Deprecated.
Returns the properties as a map copy with a prefix key.
|
boolean |
containsKey(String key)
Deprecated.
Returns if the given key is contained.
|
boolean |
equals(Object o)
Deprecated.
|
<E> List<E> |
getArray(String key,
java.util.function.Function<String,E> keyMapper)
Deprecated.
Returns all array elements under a given existing key.
|
BigDecimal |
getBigDecimal(String key)
Deprecated.
Returns a big decimal value under the given existing key.
|
boolean |
getBoolean(String key)
Deprecated.
Returns a boolean value under the given existing key.
|
byte |
getByte(String key)
Deprecated.
Returns a byte value under the given existing key.
|
Character |
getCharacter(String key)
Deprecated.
Returns a character value under the given existing key.
|
<T> Class<T> |
getClass(String key,
Class<T> superClass)
Deprecated.
Returns a class value under the given existing key.
|
DataType |
getDataType(String key)
Deprecated.
Returns the DataType under the given existing key.
|
double |
getDouble(String key)
Deprecated.
Returns a double value under the given existing key.
|
java.time.Duration |
getDuration(String key)
Deprecated.
Returns a java
Duration under the given existing key. |
List<Map<String,String>> |
getFixedIndexedProperties(String key,
List<String> subKeys)
Deprecated.
Returns the property keys of fixed indexed properties.
|
float |
getFloat(String key)
Deprecated.
Returns a float value under the given given existing key.
|
Map<String,String> |
getIndexedProperty(String key,
String subKey)
Deprecated.
Returns all properties under a given key that contains an index in between.
|
int |
getInt(String key)
Deprecated.
Returns an integer value under the given existing key.
|
long |
getLong(String key)
Deprecated.
Returns a long value under the given existing key.
|
MemorySize |
getMemorySize(String key)
Deprecated.
Returns a Flink
MemorySize under the given existing key. |
<E> Optional<List<E>> |
getOptionalArray(String key,
java.util.function.Function<String,E> keyMapper)
Deprecated.
Returns all array elements under a given key if it exists.
|
Optional<BigDecimal> |
getOptionalBigDecimal(String key)
Deprecated.
Returns a big decimal value under the given key if it exists.
|
Optional<Boolean> |
getOptionalBoolean(String key)
Deprecated.
Returns a boolean value under the given key if it exists.
|
Optional<Byte> |
getOptionalByte(String key)
Deprecated.
Returns a byte value under the given key if it exists.
|
Optional<Character> |
getOptionalCharacter(String key)
Deprecated.
Returns a character value under the given key if it exists.
|
<T> Optional<Class<T>> |
getOptionalClass(String key,
Class<T> superClass)
Deprecated.
Returns a class value under the given key if it exists.
|
Optional<DataType> |
getOptionalDataType(String key)
Deprecated.
Returns the DataType under the given key if it exists.
|
Optional<Double> |
getOptionalDouble(String key)
Deprecated.
Returns a double value under the given key if it exists.
|
Optional<java.time.Duration> |
getOptionalDuration(String key)
Deprecated.
Returns a Java
Duration under the given key if it exists. |
Optional<Float> |
getOptionalFloat(String key)
Deprecated.
Returns a float value under the given key if it exists.
|
Optional<Integer> |
getOptionalInt(String key)
Deprecated.
Returns an integer value under the given key if it exists.
|
Optional<Long> |
getOptionalLong(String key)
Deprecated.
Returns a long value under the given key if it exists.
|
Optional<MemorySize> |
getOptionalMemorySize(String key)
Deprecated.
Returns a Flink
MemorySize under the given key if it exists. |
Optional<Short> |
getOptionalShort(String key)
Deprecated.
Returns a short value under the given key if it exists.
|
Optional<String> |
getOptionalString(String key)
Deprecated.
Returns a string value under the given key if it exists.
|
Optional<TableSchema> |
getOptionalTableSchema(String key)
Deprecated.
Returns a table schema under the given key if it exists.
|
Optional<TypeInformation<?>> |
getOptionalType(String key)
Deprecated.
Returns the type information under the given key if it exists.
|
List<String> |
getPartitionKeys()
Deprecated.
Returns partition keys.
|
Map<String,String> |
getPropertiesWithPrefix(String prefix)
Deprecated.
Returns a map of properties whose key starts with the given prefix, and the prefix is removed
upon return.
|
short |
getShort(String key)
Deprecated.
Returns a short value under the given existing key.
|
String |
getString(String key)
Deprecated.
Returns a string value under the given existing key.
|
TableSchema |
getTableSchema(String key)
Deprecated.
Returns a table schema under the given existing key.
|
TypeInformation<?> |
getType(String key)
Deprecated.
Returns the type information under the given existing key.
|
List<Map<String,String>> |
getVariableIndexedProperties(String key,
List<String> requiredSubKeys)
Deprecated.
Returns the property keys of variable indexed properties.
|
int |
hashCode()
Deprecated.
|
boolean |
hasPrefix(String prefix)
Deprecated.
Returns if a given prefix exists in the properties.
|
boolean |
isValue(String key,
String value)
Deprecated.
Returns if a value under key is exactly equal to the given value.
|
static java.util.function.Consumer<String> |
noValidation()
Deprecated.
Returns an empty validation logic.
|
void |
putBoolean(String key,
boolean b)
Deprecated.
Adds a boolean under the given key.
|
void |
putCharacter(String key,
char c)
Deprecated.
Adds a character under the given key.
|
void |
putClass(String key,
Class<?> clazz)
Deprecated.
Adds a class under the given key.
|
void |
putIndexedFixedProperties(String key,
List<String> subKeys,
List<List<String>> subKeyValues)
Deprecated.
Adds an indexed sequence of properties (with sub-properties) under a common key.
|
void |
putIndexedOptionalProperties(String key,
List<String> subKeys,
List<List<String>> subKeyValues)
Deprecated.
Adds an indexed sequence of properties (with sub-properties) under a common key.
|
void |
putIndexedVariableProperties(String key,
List<Map<String,String>> subKeyValues)
Deprecated.
Adds an indexed mapping of properties under a common key.
|
void |
putInt(String key,
int i)
Deprecated.
Adds an integer under the given key.
|
void |
putLong(String key,
long l)
Deprecated.
Adds a long under the given key.
|
void |
putMemorySize(String key,
MemorySize size)
Deprecated.
Adds a Flink
MemorySize under the given key. |
void |
putPartitionKeys(List<String> keys)
Deprecated.
Adds table partition keys.
|
void |
putProperties(DescriptorProperties otherProperties)
Deprecated.
Adds a set of descriptor properties.
|
void |
putProperties(Map<String,String> properties)
Deprecated.
Adds a set of properties.
|
void |
putPropertiesWithPrefix(String prefix,
Map<String,String> prop)
Deprecated.
Adds a properties map by appending the given prefix to element keys with a dot.
|
void |
putString(String key,
String str)
Deprecated.
Adds a string under the given key.
|
void |
putTableSchema(String key,
TableSchema schema)
Deprecated.
Adds a table schema under the given key.
|
String |
toString()
Deprecated.
|
static String |
toString(Map<String,String> propertyMap)
Deprecated.
|
static String |
toString(String str)
Deprecated.
|
static String |
toString(String key,
String value)
Deprecated.
|
void |
validateArray(String key,
java.util.function.Consumer<String> elementValidation,
int minLength)
Deprecated.
Validates an array of values.
|
void |
validateArray(String key,
java.util.function.Consumer<String> elementValidation,
int minLength,
int maxLength)
Deprecated.
Validates an array of values.
|
void |
validateBigDecimal(String key,
boolean isOptional)
Deprecated.
Validates a big decimal property.
|
void |
validateBigDecimal(String key,
boolean isOptional,
BigDecimal min,
BigDecimal max)
Deprecated.
Validates a big decimal property.
|
void |
validateBoolean(String key,
boolean isOptional)
Deprecated.
Validates that a boolean value is present under the given key.
|
void |
validateByte(String key,
boolean isOptional)
Deprecated.
Validates a byte property.
|
void |
validateByte(String key,
boolean isOptional,
byte min)
Deprecated.
Validates a byte property.
|
void |
validateByte(String key,
boolean isOptional,
byte min,
byte max)
Deprecated.
Validates a byte property.
|
void |
validateDataType(String key,
String fallbackKey,
boolean isOptional)
Deprecated.
Validates a data type property.
|
void |
validateDouble(String key,
boolean isOptional)
Deprecated.
Validates a double property.
|
void |
validateDouble(String key,
boolean isOptional,
double min)
Deprecated.
Validates a double property.
|
void |
validateDouble(String key,
boolean isOptional,
double min,
double max)
Deprecated.
Validates a double property.
|
void |
validateDuration(String key,
boolean isOptional,
int precision)
Deprecated.
Validates a Java
Duration . |
void |
validateDuration(String key,
boolean isOptional,
int precision,
long min)
Deprecated.
Validates a Java
Duration . |
void |
validateDuration(String key,
boolean isOptional,
int precision,
long min,
long max)
Deprecated.
Validates a Java
Duration . |
void |
validateEnum(String key,
boolean isOptional,
Map<String,java.util.function.Consumer<String>> enumValidation)
Deprecated.
Validates an enum property with a set of validation logic for each enum value.
|
void |
validateEnumValues(String key,
boolean isOptional,
List<String> values)
Deprecated.
Validates an enum property with a set of enum values.
|
void |
validateExclusion(String key)
Deprecated.
Validates that the given key is not included in these properties.
|
void |
validateFixedIndexedProperties(String key,
boolean allowEmpty,
Map<String,java.util.function.Consumer<String>> subKeyValidation)
Deprecated.
Validation for fixed indexed properties.
|
void |
validateFloat(String key,
boolean isOptional)
Deprecated.
Validates a float property.
|
void |
validateFloat(String key,
boolean isOptional,
float min)
Deprecated.
Validates a float property.
|
void |
validateFloat(String key,
boolean isOptional,
float min,
float max)
Deprecated.
Validates a float property.
|
void |
validateInt(String key,
boolean isOptional)
Deprecated.
Validates an integer property.
|
void |
validateInt(String key,
boolean isOptional,
int min)
Deprecated.
Validates an integer property.
|
void |
validateInt(String key,
boolean isOptional,
int min,
int max)
Deprecated.
Validates an integer property.
|
void |
validateLong(String key,
boolean isOptional)
Deprecated.
Validates an long property.
|
void |
validateLong(String key,
boolean isOptional,
long min)
Deprecated.
Validates an long property.
|
void |
validateLong(String key,
boolean isOptional,
long min,
long max)
Deprecated.
Validates an long property.
|
void |
validateMemorySize(String key,
boolean isOptional,
int precision)
Deprecated.
Validates a Flink
MemorySize . |
void |
validateMemorySize(String key,
boolean isOptional,
int precision,
long min)
Deprecated.
Validates a Flink
MemorySize . |
void |
validateMemorySize(String key,
boolean isOptional,
int precision,
long min,
long max)
Deprecated.
Validates a Flink
MemorySize . |
void |
validatePrefixExclusion(String prefix)
Deprecated.
Validates that the given prefix is not included in these properties.
|
void |
validateShort(String key,
boolean isOptional)
Deprecated.
Validates a short property.
|
void |
validateShort(String key,
boolean isOptional,
short min)
Deprecated.
Validates a short property.
|
void |
validateShort(String key,
boolean isOptional,
short min,
short max)
Deprecated.
Validates a short property.
|
void |
validateString(String key,
boolean isOptional)
Deprecated.
Validates a string property.
|
void |
validateString(String key,
boolean isOptional,
int minLen)
Deprecated.
Validates a string property.
|
void |
validateString(String key,
boolean isOptional,
int minLen,
int maxLen)
Deprecated.
Validates a string property.
|
void |
validateTableSchema(String key,
boolean isOptional)
Deprecated.
Validates a table schema property.
|
void |
validateType(String key,
boolean isOptional,
boolean requireRow)
Deprecated.
Validates a type property.
|
void |
validateValue(String key,
String value,
boolean isOptional)
Deprecated.
Validates that a certain value is present under the given key.
|
DescriptorProperties |
withoutKeys(List<String> keys)
Deprecated.
Returns a new properties instance with the given keys removed.
|
public static final String NAME
public static final String TYPE
public static final String DATA_TYPE
public static final String EXPR
public static final String METADATA
public static final String VIRTUAL
public static final String PARTITION_KEYS
public static final String WATERMARK
public static final String WATERMARK_ROWTIME
public static final String WATERMARK_STRATEGY
public static final String WATERMARK_STRATEGY_EXPR
public static final String WATERMARK_STRATEGY_DATA_TYPE
public static final String PRIMARY_KEY_NAME
public static final String PRIMARY_KEY_COLUMNS
public static final String COMMENT
public DescriptorProperties(boolean normalizeKeys)
public DescriptorProperties()
public void putProperties(Map<String,String> properties)
public void putProperties(DescriptorProperties otherProperties)
public void putPropertiesWithPrefix(String prefix, Map<String,String> prop)
For example: for prefix "flink" and a map of a single property with key "k" and value "v". The added property will be as key "flink.k" and value "v".
public void putClass(String key, Class<?> clazz)
public void putString(String key, String str)
public void putBoolean(String key, boolean b)
public void putLong(String key, long l)
public void putInt(String key, int i)
public void putCharacter(String key, char c)
public void putTableSchema(String key, TableSchema schema)
public void putPartitionKeys(List<String> keys)
public void putMemorySize(String key, MemorySize size)
MemorySize
under the given key.public void putIndexedFixedProperties(String key, List<String> subKeys, List<List<String>> subKeyValues)
For example:
schema.fields.0.type = INT, schema.fields.0.name = test schema.fields.1.type = LONG, schema.fields.1.name = test2
The arity of each subKeyValues must match the arity of propertyKeys.
public void putIndexedOptionalProperties(String key, List<String> subKeys, List<List<String>> subKeyValues)
putIndexedFixedProperties(java.lang.String, java.util.List<java.lang.String>, java.util.List<java.util.List<java.lang.String>>)
, this method supports the properties value to be
null, which would be ignore. The sub-properties should at least have one non-null value.
For example:
schema.fields.0.type = INT, schema.fields.0.name = test schema.fields.1.type = LONG, schema.fields.1.name = test2 schema.fields.2.type = LONG, schema.fields.2.name = test3, schema.fields.2.expr = test2 + 1
The arity of each subKeyValues must match the arity of propertyKeys.
public void putIndexedVariableProperties(String key, List<Map<String,String>> subKeyValues)
For example:
schema.fields.0.type = INT, schema.fields.0.name = test schema.fields.1.name = test2
The arity of the subKeyValues can differ.
public Optional<String> getOptionalString(String key)
public String getString(String key)
public Optional<Character> getOptionalCharacter(String key)
public Character getCharacter(String key)
public <T> Optional<Class<T>> getOptionalClass(String key, Class<T> superClass)
public <T> Class<T> getClass(String key, Class<T> superClass)
public Optional<BigDecimal> getOptionalBigDecimal(String key)
public BigDecimal getBigDecimal(String key)
public Optional<Boolean> getOptionalBoolean(String key)
public boolean getBoolean(String key)
public Optional<Byte> getOptionalByte(String key)
public byte getByte(String key)
public Optional<Double> getOptionalDouble(String key)
public double getDouble(String key)
public Optional<Float> getOptionalFloat(String key)
public float getFloat(String key)
public Optional<Integer> getOptionalInt(String key)
public int getInt(String key)
public Optional<Long> getOptionalLong(String key)
public long getLong(String key)
public Optional<Short> getOptionalShort(String key)
public short getShort(String key)
public Optional<TypeInformation<?>> getOptionalType(String key)
public TypeInformation<?> getType(String key)
public Optional<DataType> getOptionalDataType(String key)
public DataType getDataType(String key)
public Optional<TableSchema> getOptionalTableSchema(String key)
public TableSchema getTableSchema(String key)
public Optional<MemorySize> getOptionalMemorySize(String key)
MemorySize
under the given key if it exists.public MemorySize getMemorySize(String key)
MemorySize
under the given existing key.public Optional<java.time.Duration> getOptionalDuration(String key)
Duration
under the given key if it exists.public java.time.Duration getDuration(String key)
Duration
under the given existing key.public List<Map<String,String>> getFixedIndexedProperties(String key, List<String> subKeys)
For example:
schema.fields.0.type = INT, schema.fields.0.name = test schema.fields.1.type = LONG, schema.fields.1.name = test2
getFixedIndexedProperties("schema.fields", List("type", "name")) leads to:
0: Map("type" -> "schema.fields.0.type", "name" -> "schema.fields.0.name") 1: Map("type" -> "schema.fields.1.type", "name" -> "schema.fields.1.name")
public List<Map<String,String>> getVariableIndexedProperties(String key, List<String> requiredSubKeys)
For example:
schema.fields.0.type = INT, schema.fields.0.name = test schema.fields.1.type = LONG
getFixedIndexedProperties("schema.fields", List("type")) leads to:
0: Map("type" -> "schema.fields.0.type", "name" -> "schema.fields.0.name") 1: Map("type" -> "schema.fields.1.type")
public Map<String,String> getIndexedProperty(String key, String subKey)
E.g. rowtime.0.name -> returns all rowtime.#.name properties
public <E> Optional<List<E>> getOptionalArray(String key, java.util.function.Function<String,E> keyMapper)
For example:
primary-key.0 = field1 primary-key.1 = field2
leads to: List(field1, field2)
or:
primary-key = field1
leads to: List(field1)
The key mapper gets the key of the current value e.g. "primary-key.1".
public <E> List<E> getArray(String key, java.util.function.Function<String,E> keyMapper)
public boolean isValue(String key, String value)
public Map<String,String> getPropertiesWithPrefix(String prefix)
For example, for prefix "flink" and a map of a single property with key "flink.k" and value "v", this method will return it as key "k" and value "v" by identifying and removing the prefix "flink".
public void validateString(String key, boolean isOptional)
public void validateString(String key, boolean isOptional, int minLen)
public void validateString(String key, boolean isOptional, int minLen, int maxLen)
public void validateInt(String key, boolean isOptional)
public void validateInt(String key, boolean isOptional, int min)
public void validateInt(String key, boolean isOptional, int min, int max)
public void validateLong(String key, boolean isOptional)
public void validateLong(String key, boolean isOptional, long min)
public void validateLong(String key, boolean isOptional, long min, long max)
public void validateValue(String key, String value, boolean isOptional)
public void validateBoolean(String key, boolean isOptional)
public void validateDouble(String key, boolean isOptional)
public void validateDouble(String key, boolean isOptional, double min)
public void validateDouble(String key, boolean isOptional, double min, double max)
public void validateBigDecimal(String key, boolean isOptional)
public void validateBigDecimal(String key, boolean isOptional, BigDecimal min, BigDecimal max)
public void validateByte(String key, boolean isOptional)
public void validateByte(String key, boolean isOptional, byte min)
public void validateByte(String key, boolean isOptional, byte min, byte max)
public void validateFloat(String key, boolean isOptional)
public void validateFloat(String key, boolean isOptional, float min)
public void validateFloat(String key, boolean isOptional, float min, float max)
public void validateShort(String key, boolean isOptional)
public void validateShort(String key, boolean isOptional, short min)
public void validateShort(String key, boolean isOptional, short min, short max)
public void validateFixedIndexedProperties(String key, boolean allowEmpty, Map<String,java.util.function.Consumer<String>> subKeyValidation)
For example:
schema.fields.0.data-type = INT, schema.fields.0.name = test schema.fields.1.data-type = BIGINT, schema.fields.1.name = test2
The subKeyValidation map must define e.g. "data-type" and "name" and a validation logic for the given full key.
public void validateTableSchema(String key, boolean isOptional)
public void validateMemorySize(String key, boolean isOptional, int precision)
MemorySize
.
The precision defines the allowed minimum unit in bytes (e.g. 1024 would only allow KB).
public void validateMemorySize(String key, boolean isOptional, int precision, long min)
MemorySize
. The boundaries are inclusive and in bytes.
The precision defines the allowed minimum unit in bytes (e.g. 1024 would only allow KB).
public void validateMemorySize(String key, boolean isOptional, int precision, long min, long max)
MemorySize
. The boundaries are inclusive and in bytes.
The precision defines the allowed minimum unit in bytes (e.g. 1024 would only allow KB).
public void validateDuration(String key, boolean isOptional, int precision)
Duration
.
The precision defines the allowed minimum unit in milliseconds (e.g. 1000 would only allow seconds).
public void validateDuration(String key, boolean isOptional, int precision, long min)
Duration
. The boundaries are inclusive and in milliseconds.
The precision defines the allowed minimum unit in milliseconds (e.g. 1000 would only allow seconds).
public void validateDuration(String key, boolean isOptional, int precision, long min, long max)
Duration
. The boundaries are inclusive and in milliseconds.
The precision defines the allowed minimum unit in milliseconds (e.g. 1000 would only allow seconds).
public void validateEnum(String key, boolean isOptional, Map<String,java.util.function.Consumer<String>> enumValidation)
public void validateEnumValues(String key, boolean isOptional, List<String> values)
public void validateType(String key, boolean isOptional, boolean requireRow)
public void validateDataType(String key, String fallbackKey, boolean isOptional)
public void validateArray(String key, java.util.function.Consumer<String> elementValidation, int minLength)
For example:
primary-key.0 = field1 primary-key.1 = field2
leads to: List(field1, field2)
or:
primary-key = field1
The validation consumer gets the key of the current value e.g. "primary-key.1".
public void validateArray(String key, java.util.function.Consumer<String> elementValidation, int minLength, int maxLength)
For example:
primary-key.0 = field1 primary-key.1 = field2
leads to: List(field1, field2)
or:
primary-key = field1
The validation consumer gets the key of the current value e.g. "primary-key.1".
public void validatePrefixExclusion(String prefix)
public void validateExclusion(String key)
public boolean containsKey(String key)
public boolean hasPrefix(String prefix)
public Map<String,String> asPrefixedMap(String prefix)
public DescriptorProperties withoutKeys(List<String> keys)
public static java.util.function.Consumer<String> noValidation()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.