-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-2779] Cache BaseDir if HudiTableNotFound Exception thrown #4014
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
Changes from 3 commits
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 |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
|
|
||
| package org.apache.hudi.hadoop; | ||
|
|
||
| import com.google.common.annotations.VisibleForTesting; | ||
| import org.apache.hudi.common.config.SerializableConfiguration; | ||
| import org.apache.hudi.common.engine.HoodieLocalEngineContext; | ||
| import org.apache.hudi.common.fs.FSUtils; | ||
|
|
@@ -173,6 +174,13 @@ public boolean accept(Path path) { | |
| } | ||
|
|
||
| if (baseDir != null) { | ||
| // Check whether baseDir in nonHoodiePathCache | ||
| if (nonHoodiePathCache.contains(baseDir.toString())) { | ||
| if (LOG.isDebugEnabled()) { | ||
| LOG.debug("Accepting non-hoodie path from cache: " + path); | ||
| } | ||
| return true; | ||
| } | ||
| HoodieTableFileSystemView fsView = null; | ||
| try { | ||
| HoodieTableMetaClient metaClient = metaClientCache.get(baseDir.toString()); | ||
|
|
@@ -211,9 +219,10 @@ public boolean accept(Path path) { | |
| } catch (TableNotFoundException e) { | ||
| // Non-hoodie path, accept it. | ||
| if (LOG.isDebugEnabled()) { | ||
| LOG.debug(String.format("(1) Caching non-hoodie path under %s \n", folder.toString())); | ||
| LOG.debug(String.format("(1) Caching non-hoodie path under %s and %s \n", folder.toString(), baseDir.toString())); | ||
|
||
| } | ||
| nonHoodiePathCache.add(folder.toString()); | ||
| nonHoodiePathCache.add(baseDir.toString()); | ||
| return true; | ||
| } | ||
| } else { | ||
|
|
@@ -231,6 +240,12 @@ public boolean accept(Path path) { | |
| } | ||
| } | ||
|
|
||
| @VisibleForTesting | ||
|
||
| public Set<String> getNonHoodiePathCache() { | ||
| return nonHoodiePathCache; | ||
| } | ||
|
|
||
|
|
||
| @Override | ||
| public void setConf(Configuration conf) { | ||
| this.conf = new SerializableConfiguration(conf); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.