LiJie20190102 opened a new pull request, #13104: URL: https://github.com/apache/gravitino/pull/13104
### What changes were proposed in this pull request? - Move `loadMetalake` from the `GravitinoClient` constructor to lazy initialization in `getMetalake()` using double-checked locking (volatile + synchronized). - Store only the metalake name in the constructor; the metalake handle is loaded on first use. - Remove `@throws NoSuchMetalakeException` from the constructor and `build()` Javadoc; update `Command.buildClient()` Javadoc to reflect the deferred exception timing. - Add `testNoSuchMetalakeOnFirstOperation` to verify that `NoSuchMetalakeException` surfaces on the first operation, not at `build()`. ### Why are the changes needed? `GravitinoClient`'s constructor performs a remote `loadMetalake` call that runs with whatever credentials the `AuthDataProvider` resolves at construction time. For a shared client whose provider resolves the caller per request (the standalone Lance REST service after #12984), this causes the permission requirement to land non-deterministically on the first caller, failed construction to retry on every request, and metalake-load errors to surface instead of the operation the caller requested. Fix: #12985 ### Does this PR introduce _any_ user-facing change? Yes. `NoSuchMetalakeException` is now thrown on the first operation (e.g. `listCatalogs()`) instead of at `build()` time. No API or configuration changes. ### How was this patch tested? - `./gradlew :clients:client-java:spotlessCheck :clients:cli:spotlessCheck :clients:client-java:compileTestJava :clients:cli:compileJava` - Ran `TestGravitinoMetalake` (21 tests) and `TestGravitinoClientBuilder` (3 tests). -- 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]
