-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HUDI-7069] Optimize metaclient construction and include table config… #10048
Changes from 3 commits
c334b08
78d78cf
c168e2b
a76b1ed
934de8e
0fc15c7
4a35dfe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,9 +22,11 @@ | |
import org.apache.hudi.client.common.HoodieSparkEngineContext; | ||
import org.apache.hudi.common.config.SerializableConfiguration; | ||
import org.apache.hudi.common.config.TypedProperties; | ||
import org.apache.hudi.common.table.HoodieTableMetaClient; | ||
import org.apache.hudi.common.util.collection.Pair; | ||
import org.apache.hudi.exception.HoodieException; | ||
import org.apache.hudi.exception.TableNotFoundException; | ||
import org.apache.hudi.utilities.UtilHelpers; | ||
|
||
import org.apache.hadoop.conf.Configuration; | ||
import org.apache.hadoop.fs.FileStatus; | ||
|
@@ -166,6 +168,9 @@ public static TableServicePipeline buildTableServicePipeline(JavaSparkContext js | |
HoodieMultiTableServicesMain.Config cfg, | ||
TypedProperties props) { | ||
TableServicePipeline pipeline = new TableServicePipeline(); | ||
HoodieTableMetaClient metaClient = UtilHelpers.createMetaClient(jsc, basePath, true); | ||
// Add the table config to the write config. | ||
props.putAll(metaClient.getTableConfig().getProps()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we use table config to overwrite those configs already set in write configs by user? Not sure which one have a higher priority here. @danny0405 What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can indeed lead to a priority issue here. A simple solution is to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you refering to the per-table options? We should consider write config options with higher priority always. |
||
if (cfg.enableCompaction) { | ||
pipeline.add(CompactionTask.newBuilder() | ||
.withJsc(jsc) | ||
|
@@ -175,6 +180,7 @@ public static TableServicePipeline buildTableServicePipeline(JavaSparkContext js | |
.withCompactionStrategyName(cfg.compactionStrategyClassName) | ||
.withProps(props) | ||
.withRetry(cfg.retry) | ||
.withMetaclient(metaClient) | ||
.build()); | ||
} | ||
if (cfg.enableClustering) { | ||
|
@@ -185,6 +191,7 @@ public static TableServicePipeline buildTableServicePipeline(JavaSparkContext js | |
.withClusteringRunningMode(cfg.clusteringRunningMode) | ||
.withProps(props) | ||
.withRetry(cfg.retry) | ||
.withMetaclient(metaClient) | ||
.build()); | ||
} | ||
if (cfg.enableClean) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be caution that the timeline should be refreshed each time for compaction when metaClient is reused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This‘s right. In the existing code, the metaclient is reloaded during clustering, and a new metaclient is created during compaction. A better implementation would be to have consistent behavior for compaction as well. The metaclient should be reloaded at the point of creation.
I will make modifications here.