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.
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
COMMENT
已过时。
|
static String |
DATA_TYPE
已过时。
|
static String |
EXPR
已过时。
|
static String |
METADATA
已过时。
|
static String |
NAME
已过时。
|
static String |
PARTITION_KEYS
已过时。
|
static String |
PRIMARY_KEY_COLUMNS
已过时。
|
static String |
PRIMARY_KEY_NAME
已过时。
|
static String |
TYPE
已过时。
|
static String |
VIRTUAL
已过时。
|
static String |
WATERMARK
已过时。
|
static String |
WATERMARK_ROWTIME
已过时。
|
static String |
WATERMARK_STRATEGY
已过时。
|
static String |
WATERMARK_STRATEGY_DATA_TYPE
已过时。
|
static String |
WATERMARK_STRATEGY_EXPR
已过时。
|
| 构造器和说明 |
|---|
DescriptorProperties()
已过时。
|
DescriptorProperties(boolean normalizeKeys)
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
Map<String,String> |
asMap()
已过时。
Returns the properties as a map copy.
|
Map<String,String> |
asPrefixedMap(String prefix)
已过时。
Returns the properties as a map copy with a prefix key.
|
boolean |
containsKey(String key)
已过时。
Returns if the given key is contained.
|
boolean |
equals(Object o)
已过时。
|
<E> List<E> |
getArray(String key,
java.util.function.Function<String,E> keyMapper)
已过时。
Returns all array elements under a given existing key.
|
BigDecimal |
getBigDecimal(String key)
已过时。
Returns a big decimal value under the given existing key.
|
boolean |
getBoolean(String key)
已过时。
Returns a boolean value under the given existing key.
|
byte |
getByte(String key)
已过时。
Returns a byte value under the given existing key.
|
Character |
getCharacter(String key)
已过时。
Returns a character value under the given existing key.
|
<T> Class<T> |
getClass(String key,
Class<T> superClass)
已过时。
Returns a class value under the given existing key.
|
DataType |
getDataType(String key)
已过时。
Returns the DataType under the given existing key.
|
double |
getDouble(String key)
已过时。
Returns a double value under the given existing key.
|
java.time.Duration |
getDuration(String key)
已过时。
Returns a java
Duration under the given existing key. |
List<Map<String,String>> |
getFixedIndexedProperties(String key,
List<String> subKeys)
已过时。
Returns the property keys of fixed indexed properties.
|
float |
getFloat(String key)
已过时。
Returns a float value under the given given existing key.
|
Map<String,String> |
getIndexedProperty(String key,
String subKey)
已过时。
Returns all properties under a given key that contains an index in between.
|
int |
getInt(String key)
已过时。
Returns an integer value under the given existing key.
|
long |
getLong(String key)
已过时。
Returns a long value under the given existing key.
|
org.apache.flink.configuration.MemorySize |
getMemorySize(String key)
已过时。
Returns a Flink
MemorySize under the given existing key. |
<E> Optional<List<E>> |
getOptionalArray(String key,
java.util.function.Function<String,E> keyMapper)
已过时。
Returns all array elements under a given key if it exists.
|
Optional<BigDecimal> |
getOptionalBigDecimal(String key)
已过时。
Returns a big decimal value under the given key if it exists.
|
Optional<Boolean> |
getOptionalBoolean(String key)
已过时。
Returns a boolean value under the given key if it exists.
|
Optional<Byte> |
getOptionalByte(String key)
已过时。
Returns a byte value under the given key if it exists.
|
Optional<Character> |
getOptionalCharacter(String key)
已过时。
Returns a character value under the given key if it exists.
|
<T> Optional<Class<T>> |
getOptionalClass(String key,
Class<T> superClass)
已过时。
Returns a class value under the given key if it exists.
|
Optional<DataType> |
getOptionalDataType(String key)
已过时。
Returns the DataType under the given key if it exists.
|
Optional<Double> |
getOptionalDouble(String key)
已过时。
Returns a double value under the given key if it exists.
|
Optional<java.time.Duration> |
getOptionalDuration(String key)
已过时。
Returns a Java
Duration under the given key if it exists. |
Optional<Float> |
getOptionalFloat(String key)
已过时。
Returns a float value under the given key if it exists.
|
Optional<Integer> |
getOptionalInt(String key)
已过时。
Returns an integer value under the given key if it exists.
|
Optional<Long> |
getOptionalLong(String key)
已过时。
Returns a long value under the given key if it exists.
|
Optional<org.apache.flink.configuration.MemorySize> |
getOptionalMemorySize(String key)
已过时。
Returns a Flink
MemorySize under the given key if it exists. |
Optional<Short> |
getOptionalShort(String key)
已过时。
Returns a short value under the given key if it exists.
|
Optional<String> |
getOptionalString(String key)
已过时。
Returns a string value under the given key if it exists.
|
Optional<TableSchema> |
getOptionalTableSchema(String key)
已过时。
Returns a table schema under the given key if it exists.
|
Optional<org.apache.flink.api.common.typeinfo.TypeInformation<?>> |
getOptionalType(String key)
已过时。
Returns the type information under the given key if it exists.
|
List<String> |
getPartitionKeys()
已过时。
Returns partition keys.
|
Map<String,String> |
getPropertiesWithPrefix(String prefix)
已过时。
Returns a map of properties whose key starts with the given prefix, and the prefix is removed
upon return.
|
short |
getShort(String key)
已过时。
Returns a short value under the given existing key.
|
String |
getString(String key)
已过时。
Returns a string value under the given existing key.
|
TableSchema |
getTableSchema(String key)
已过时。
Returns a table schema under the given existing key.
|
org.apache.flink.api.common.typeinfo.TypeInformation<?> |
getType(String key)
已过时。
Returns the type information under the given existing key.
|
List<Map<String,String>> |
getVariableIndexedProperties(String key,
List<String> requiredSubKeys)
已过时。
Returns the property keys of variable indexed properties.
|
int |
hashCode()
已过时。
|
boolean |
hasPrefix(String prefix)
已过时。
Returns if a given prefix exists in the properties.
|
boolean |
isValue(String key,
String value)
已过时。
Returns if a value under key is exactly equal to the given value.
|
static java.util.function.Consumer<String> |
noValidation()
已过时。
Returns an empty validation logic.
|
void |
putBoolean(String key,
boolean b)
已过时。
Adds a boolean under the given key.
|
void |
putCharacter(String key,
char c)
已过时。
Adds a character under the given key.
|
void |
putClass(String key,
Class<?> clazz)
已过时。
Adds a class under the given key.
|
void |
putIndexedFixedProperties(String key,
List<String> subKeys,
List<List<String>> subKeyValues)
已过时。
Adds an indexed sequence of properties (with sub-properties) under a common key.
|
void |
putIndexedOptionalProperties(String key,
List<String> subKeys,
List<List<String>> subKeyValues)
已过时。
Adds an indexed sequence of properties (with sub-properties) under a common key.
|
void |
putIndexedVariableProperties(String key,
List<Map<String,String>> subKeyValues)
已过时。
Adds an indexed mapping of properties under a common key.
|
void |
putInt(String key,
int i)
已过时。
Adds an integer under the given key.
|
void |
putLong(String key,
long l)
已过时。
Adds a long under the given key.
|
void |
putMemorySize(String key,
org.apache.flink.configuration.MemorySize size)
已过时。
Adds a Flink
MemorySize under the given key. |
void |
putPartitionKeys(List<String> keys)
已过时。
Adds table partition keys.
|
void |
putProperties(DescriptorProperties otherProperties)
已过时。
Adds a set of descriptor properties.
|
void |
putProperties(Map<String,String> properties)
已过时。
Adds a set of properties.
|
void |
putPropertiesWithPrefix(String prefix,
Map<String,String> prop)
已过时。
Adds a properties map by appending the given prefix to element keys with a dot.
|
void |
putString(String key,
String str)
已过时。
Adds a string under the given key.
|
void |
putTableSchema(String key,
TableSchema schema)
已过时。
Adds a table schema under the given key.
|
String |
toString()
已过时。
|
static String |
toString(Map<String,String> propertyMap)
已过时。
|
static String |
toString(String str)
已过时。
|
static String |
toString(String key,
String value)
已过时。
|
void |
validateArray(String key,
java.util.function.Consumer<String> elementValidation,
int minLength)
已过时。
Validates an array of values.
|
void |
validateArray(String key,
java.util.function.Consumer<String> elementValidation,
int minLength,
int maxLength)
已过时。
Validates an array of values.
|
void |
validateBigDecimal(String key,
boolean isOptional)
已过时。
Validates a big decimal property.
|
void |
validateBigDecimal(String key,
boolean isOptional,
BigDecimal min,
BigDecimal max)
已过时。
Validates a big decimal property.
|
void |
validateBoolean(String key,
boolean isOptional)
已过时。
Validates that a boolean value is present under the given key.
|
void |
validateByte(String key,
boolean isOptional)
已过时。
Validates a byte property.
|
void |
validateByte(String key,
boolean isOptional,
byte min)
已过时。
Validates a byte property.
|
void |
validateByte(String key,
boolean isOptional,
byte min,
byte max)
已过时。
Validates a byte property.
|
void |
validateDataType(String key,
String fallbackKey,
boolean isOptional)
已过时。
Validates a data type property.
|
void |
validateDouble(String key,
boolean isOptional)
已过时。
Validates a double property.
|
void |
validateDouble(String key,
boolean isOptional,
double min)
已过时。
Validates a double property.
|
void |
validateDouble(String key,
boolean isOptional,
double min,
double max)
已过时。
Validates a double property.
|
void |
validateDuration(String key,
boolean isOptional,
int precision)
已过时。
Validates a Java
Duration. |
void |
validateDuration(String key,
boolean isOptional,
int precision,
long min)
已过时。
Validates a Java
Duration. |
void |
validateDuration(String key,
boolean isOptional,
int precision,
long min,
long max)
已过时。
Validates a Java
Duration. |
void |
validateEnum(String key,
boolean isOptional,
Map<String,java.util.function.Consumer<String>> enumValidation)
已过时。
Validates an enum property with a set of validation logic for each enum value.
|
void |
validateEnumValues(String key,
boolean isOptional,
List<String> values)
已过时。
Validates an enum property with a set of enum values.
|
void |
validateExclusion(String key)
已过时。
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)
已过时。
Validation for fixed indexed properties.
|
void |
validateFloat(String key,
boolean isOptional)
已过时。
Validates a float property.
|
void |
validateFloat(String key,
boolean isOptional,
float min)
已过时。
Validates a float property.
|
void |
validateFloat(String key,
boolean isOptional,
float min,
float max)
已过时。
Validates a float property.
|
void |
validateInt(String key,
boolean isOptional)
已过时。
Validates an integer property.
|
void |
validateInt(String key,
boolean isOptional,
int min)
已过时。
Validates an integer property.
|
void |
validateInt(String key,
boolean isOptional,
int min,
int max)
已过时。
Validates an integer property.
|
void |
validateLong(String key,
boolean isOptional)
已过时。
Validates an long property.
|
void |
validateLong(String key,
boolean isOptional,
long min)
已过时。
Validates an long property.
|
void |
validateLong(String key,
boolean isOptional,
long min,
long max)
已过时。
Validates an long property.
|
void |
validateMemorySize(String key,
boolean isOptional,
int precision)
已过时。
Validates a Flink
MemorySize. |
void |
validateMemorySize(String key,
boolean isOptional,
int precision,
long min)
已过时。
Validates a Flink
MemorySize. |
void |
validateMemorySize(String key,
boolean isOptional,
int precision,
long min,
long max)
已过时。
Validates a Flink
MemorySize. |
void |
validatePrefixExclusion(String prefix)
已过时。
Validates that the given prefix is not included in these properties.
|
void |
validateShort(String key,
boolean isOptional)
已过时。
Validates a short property.
|
void |
validateShort(String key,
boolean isOptional,
short min)
已过时。
Validates a short property.
|
void |
validateShort(String key,
boolean isOptional,
short min,
short max)
已过时。
Validates a short property.
|
void |
validateString(String key,
boolean isOptional)
已过时。
Validates a string property.
|
void |
validateString(String key,
boolean isOptional,
int minLen)
已过时。
Validates a string property.
|
void |
validateString(String key,
boolean isOptional,
int minLen,
int maxLen)
已过时。
Validates a string property.
|
void |
validateTableSchema(String key,
boolean isOptional)
已过时。
Validates a table schema property.
|
void |
validateType(String key,
boolean isOptional,
boolean requireRow)
已过时。
Validates a type property.
|
void |
validateValue(String key,
String value,
boolean isOptional)
已过时。
Validates that a certain value is present under the given key.
|
DescriptorProperties |
withoutKeys(List<String> keys)
已过时。
Returns a new properties instance with the given keys removed.
|
public static final String WATERMARK_STRATEGY_DATA_TYPE
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 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 putMemorySize(String key, org.apache.flink.configuration.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<org.apache.flink.api.common.typeinfo.TypeInformation<?>> getOptionalType(String key)
public org.apache.flink.api.common.typeinfo.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<org.apache.flink.configuration.MemorySize> getOptionalMemorySize(String key)
MemorySize under the given key if it exists.public org.apache.flink.configuration.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–2022 The Apache Software Foundation. All rights reserved.