-
Notifications
You must be signed in to change notification settings - Fork 418
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
[#6562] improvement(catalogs): Optimize the code path in createFileset and optimize path #6689
base: main
Are you sure you want to change the base?
Conversation
@yuqi1129 could you please review this PR when you have time? I’d really appreciate your feedback. |
Sure |
...atalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/HadoopCatalogOperations.java
Outdated
Show resolved
Hide resolved
@yuqi1129 I’ve finished updating the code. Please take a look at the PR again when you have time. I make thread pool static and remove shutdown logic in finally block. |
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.
Some minor problems, others LGTM
...atalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/HadoopCatalogOperations.java
Show resolved
Hide resolved
@yuqi1129 I’ve finished updating the code. Please take a look at the PR again when you have time. My update is as follows
|
…Fileset and optimize path Optimize the code path in createFileset and optimize path by using future.
…Fileset and optimize path make thread pool static remove shutdown logic in finally block.
…Fileset and optimize path Set the number of core threads and queue size, and set the idle time.
6a29976
to
a54087b
Compare
...atalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/HadoopCatalogOperations.java
Outdated
Show resolved
Hide resolved
…Fileset and optimize path set queue size from 100 to 500
@yuqi1129 I’ve finished updating the code. Please take a look at the PR again when you have time. My update is as follows
|
...atalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/HadoopCatalogOperations.java
Outdated
Show resolved
Hide resolved
...atalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/HadoopCatalogOperations.java
Outdated
Show resolved
Hide resolved
...atalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/HadoopCatalogOperations.java
Show resolved
Hide resolved
…Fileset and optimize path fix some bugs in the code. 1. set min thread to Math.max(Math.min(Runtime.getRuntime().availableProcessors() * 2, 100), 4) 2. set max thread to Math.max(Runtime.getRuntime().availableProcessors() * 4, 400).
@jerqi I’ve finished updating the code. Please take a look at the PR again when you have time. My update is as follows
|
Let's wait for the CI to pass before proceeding with LGTM. |
@Abyss-lord |
@yuqi1129 This problem is probably not caused by this change. The same situation occurred before, and it can be solved by running again. |
Although things may not be as they seem, I have noticed that no similar problem has been found in other PRs. |
@Abyss-lord |
What is the benefit of this change? I think using threadpool may not benefit a lot, instead it makes the code very complex. Also, we may potentially have the classloader issue since we're using the different thread to load the FS. |
The awaitiblity library will periodically poll the result and will not return immediately when the condition is satisfied. Awaitility.await()
.atMost(timeoutSeconds, TimeUnit.SECONDS)
.pollInterval(TimeUnits.MilliSeconds, 1)
.until(
() -> {
fileSystem.set(provider.getFileSystem(path, config));
return true;
}
) Even though Actually, introducing thread pools will make things a bit complicated. If the issue mentioned above is not a big problem, we can omit this PR. |
@yuqi1129 @jerryshao Should I continue with this pr, or should we pause to discuss? |
OK, please revert the code about ![]() |
What changes were proposed in this pull request?
Optimize the code path in createFileset and optimize path by using future.
Why are the changes needed?
Fix: #6562
Does this PR introduce any user-facing change?
No
How was this patch tested?
No, this is sequence chart of the CreateFileset.
