You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/12/15 08:13:00 UTC

[GitHub] [ignite-3] vldpyatkov commented on a change in pull request #496: IGNITE-15718 do not wait table creation by name in TableManager#table(String)

vldpyatkov commented on a change in pull request #496:
URL: https://github.com/apache/ignite-3/pull/496#discussion_r769360051



##########
File path: modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
##########
@@ -1114,52 +1114,14 @@ public TableImpl table(IgniteUuid id) throws NodeStoppingException {
      * @param checkConfiguration True when the method checks a configuration before tries to get a table, false otherwise.
      * @return A table or {@code null} if table does not exist.
      */
-    private CompletableFuture<Table> tableAsync(String name, boolean checkConfiguration) {
+    private CompletableFuture<? extends Table> tableAsync(String name, boolean checkConfiguration) {
         if (checkConfiguration && !isTableConfigured(name)) {
             return CompletableFuture.completedFuture(null);
         }
 
-        Table tbl = tables.get(name);
+        ExtendedTableView view = (ExtendedTableView) ConfigurationUtil.directValue(tablesCfg.tables()).get(name);

Review comment:
       Please move this to another method, which return ID or null if table dos not found.

##########
File path: modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
##########
@@ -1114,52 +1114,14 @@ public TableImpl table(IgniteUuid id) throws NodeStoppingException {
      * @param checkConfiguration True when the method checks a configuration before tries to get a table, false otherwise.
      * @return A table or {@code null} if table does not exist.
      */
-    private CompletableFuture<Table> tableAsync(String name, boolean checkConfiguration) {
+    private CompletableFuture<? extends Table> tableAsync(String name, boolean checkConfiguration) {

Review comment:
       Better to use here TableImpl.
   The parametrization looks ugly and not clear.

##########
File path: modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
##########
@@ -1114,52 +1114,14 @@ public TableImpl table(IgniteUuid id) throws NodeStoppingException {
      * @param checkConfiguration True when the method checks a configuration before tries to get a table, false otherwise.
      * @return A table or {@code null} if table does not exist.
      */
-    private CompletableFuture<Table> tableAsync(String name, boolean checkConfiguration) {
+    private CompletableFuture<? extends Table> tableAsync(String name, boolean checkConfiguration) {
         if (checkConfiguration && !isTableConfigured(name)) {

Review comment:
       This condition does not need here anymore, because we make the same check in `tableAsyncInternal(IgniteUUID)`.
   The flag `checkConfiguration` should move to `tableAsyncInternal(IgniteUUID)` and pass false from the method, we find a table by name, that mean we already check that the table exist.




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org