yuqi1129 commented on PR #6689:
URL: https://github.com/apache/gravitino/pull/6689#issuecomment-2736408528
> 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.
```java
Awaitility.await()
.atMost(timeoutSeconds, TimeUnit.SECONDS)
.pollInterval(TimeUnits.MilliSeconds, 1)
.until(
() -> {
fileSystem.set(provider.getFileSystem(path,
config));
return true;
}
)
```
Even though `fileSystem.set(provider.getFileSystem(path, config));` takes
0ms, the whole code will mostly consume 1ms at least to get the result. Java
Future will not have this problem.
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.
--
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]