[HUDI 1308] Harden RFC-15 Implementation based on production testing (#2441)
Addresses leaks, perf degradation observed during testing. These were regressions from the original rfc-15 PoC implementation. * Pass a single instance of HoodieTableMetadata everywhere * Fix tests and add config for enabling metrics - Removed special casing of assumeDatePartitioning inside FSUtils#getAllPartitionPaths() - Consequently, IOException is never thrown and many files had to be adjusted - More diligent handling of open file handles in metadata table - Added config for controlling reuse of connections - Added config for turning off fallback to listing, so we can see tests fail - Changed all ipf listing code to cache/amortize the open/close for better performance - Timelineserver also reuses connections, for better performance - Without timelineserver, when metadata table is opened from executors, reuse is not allowed - HoodieMetadataConfig passed into HoodieTableMetadata#create as argument. - Fix TestHoodieBackedTableMetadata#testSync
This commit is contained in:
@@ -146,7 +146,8 @@ public class MetadataCommand implements CommandMarker {
|
||||
@CliCommand(value = "metadata stats", help = "Print stats about the metadata")
|
||||
public String stats() throws IOException {
|
||||
HoodieCLI.getTableMetaClient();
|
||||
HoodieBackedTableMetadata metadata = new HoodieBackedTableMetadata(HoodieCLI.conf, HoodieCLI.basePath, "/tmp", true, false, false);
|
||||
HoodieMetadataConfig config = HoodieMetadataConfig.newBuilder().enable(true).build();
|
||||
HoodieBackedTableMetadata metadata = new HoodieBackedTableMetadata(HoodieCLI.conf, config, HoodieCLI.basePath, "/tmp");
|
||||
Map<String, String> stats = metadata.stats();
|
||||
|
||||
StringBuffer out = new StringBuffer("\n");
|
||||
@@ -162,8 +163,9 @@ public class MetadataCommand implements CommandMarker {
|
||||
public String listPartitions() throws IOException {
|
||||
HoodieCLI.getTableMetaClient();
|
||||
initJavaSparkContext();
|
||||
HoodieBackedTableMetadata metadata = new HoodieBackedTableMetadata(new HoodieSparkEngineContext(jsc),
|
||||
HoodieCLI.basePath, "/tmp", true, false, false, false);
|
||||
HoodieMetadataConfig config = HoodieMetadataConfig.newBuilder().enable(true).build();
|
||||
HoodieBackedTableMetadata metadata = new HoodieBackedTableMetadata(new HoodieSparkEngineContext(jsc), config,
|
||||
HoodieCLI.basePath, "/tmp");
|
||||
|
||||
StringBuffer out = new StringBuffer("\n");
|
||||
if (!metadata.enabled()) {
|
||||
@@ -194,7 +196,8 @@ public class MetadataCommand implements CommandMarker {
|
||||
@CliOption(key = {"partition"}, help = "Name of the partition to list files", mandatory = true)
|
||||
final String partition) throws IOException {
|
||||
HoodieCLI.getTableMetaClient();
|
||||
HoodieBackedTableMetadata metaReader = new HoodieBackedTableMetadata(HoodieCLI.conf, HoodieCLI.basePath, "/tmp", true, false, false);
|
||||
HoodieMetadataConfig config = HoodieMetadataConfig.newBuilder().enable(true).build();
|
||||
HoodieBackedTableMetadata metaReader = new HoodieBackedTableMetadata(HoodieCLI.conf, config, HoodieCLI.basePath, "/tmp");
|
||||
|
||||
StringBuffer out = new StringBuffer("\n");
|
||||
if (!metaReader.enabled()) {
|
||||
|
||||
Reference in New Issue
Block a user