boneanxs commented on a change in pull request #4791:
URL: https://github.com/apache/hudi/pull/4791#discussion_r805292689
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/config/TypedProperties.java
##########
@@ -44,27 +43,22 @@ public TypedProperties(Properties defaults) {
}
private void checkKey(String property) {
- if (!keyExists(property)) {
+ if (!containsKey(property)) {
throw new IllegalArgumentException("Property " + property + " not
found");
Review comment:
The `TypedProperties` could be a hotspot method if we use
`CustomKeyGenerator` to do the bulk insert, because it will create
`SimpleKeyGenerator` and `ComplexKeyGenerator` when `getPartitionPath` and
`getRecordKey`(these two methods will called for every rows in the dataset),
creating these generators will call its' parent constructor method,
```java
protected BaseKeyGenerator(TypedProperties config) {
super(config);
this.encodePartitionPath =
config.getBoolean(KeyGeneratorOptions.URL_ENCODE_PARTITIONING.key(),
Boolean.parseBoolean(KeyGeneratorOptions.URL_ENCODE_PARTITIONING.defaultValue()));
this.hiveStylePartitioning =
config.getBoolean(KeyGeneratorOptions.HIVE_STYLE_PARTITIONING_ENABLE.key(),
Boolean.parseBoolean(KeyGeneratorOptions.HIVE_STYLE_PARTITIONING_ENABLE.defaultValue()));
this.consistentLogicalTimestampEnabled =
config.getBoolean(KeyGeneratorOptions.KEYGENERATOR_CONSISTENT_LOGICAL_TIMESTAMP_ENABLED.key(),
Boolean.parseBoolean(KeyGeneratorOptions.KEYGENERATOR_CONSISTENT_LOGICAL_TIMESTAMP_ENABLED.defaultValue()));
}
```
As `TypedProperties.getBolean` will call `keyExists`, which copy all items
to do the check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]