xushiyan commented on code in PR #10099:
URL: https://github.com/apache/hudi/pull/10099#discussion_r1401411887
##########
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HiveSyncTool.java:
##########
@@ -103,15 +103,29 @@ public class HiveSyncTool extends HoodieSyncTool
implements AutoCloseable {
public HiveSyncTool(Properties props, Configuration hadoopConf) {
super(props, hadoopConf);
- String metastoreUris = props.getProperty(METASTORE_URIS.key());
- // Give precedence to HiveConf.ConfVars.METASTOREURIS if it is set.
- // Else if user has provided HiveSyncConfigHolder.METASTORE_URIS, then set
that in hadoop conf.
- if (isNullOrEmpty(hadoopConf.get(HiveConf.ConfVars.METASTOREURIS.varname))
&& nonEmpty(metastoreUris)) {
- LOG.info(String.format("Setting %s = %s",
HiveConf.ConfVars.METASTOREURIS.varname, metastoreUris));
- hadoopConf.set(HiveConf.ConfVars.METASTOREURIS.varname, metastoreUris);
+ String configuredMetastoreUris = props.getProperty(METASTORE_URIS.key());
+ String existingHadoopConfMetastoreUris =
hadoopConf.get(HiveConf.ConfVars.METASTOREURIS.varname);
Review Comment:
so wrote a small snippet to check how much memory it could cost.
```java
Configuration originalConf = hadoopConf();
long freeMem0 = Runtime.getRuntime().freeMemory();
IntStream.range(0, 1000).forEach(i -> {
originalConf.set("typical.hadoop.configuration.key" + i,
"https://www.example.com:8080/path?query=value#fragment" + i);
});
System.out.println("no conf entries: " + originalConf.size());
List<Configuration> l = new ArrayList<>();
IntStream.range(0, 100).forEach(i -> {
l.add(new Configuration(originalConf));
});
long freeMem1 = Runtime.getRuntime().freeMemory();
System.out.println("after copy, used mem (MB): " + (freeMem0 - freeMem1)
/ (1024.0 * 1024.0));
```
each hadoop conf has 2k+ properties and making 100 copies cost 30mb
```
no conf entries: 2162
after copy, used mem (MB): 29.616012573242188
```
this is even extreme case with this number of confs and metasync tasks. so i
don't think memory will be an issue.
--
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]