You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "adonis0147 (via GitHub)" <gi...@apache.org> on 2023/05/26 07:00:14 UTC

[GitHub] [doris] adonis0147 commented on a diff in pull request #20095: [fix](mtmv)Fix tablet not found when restart fe

adonis0147 commented on code in PR #20095:
URL: https://github.com/apache/doris/pull/20095#discussion_r1206314963


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/DatabaseIf.java:
##########
@@ -172,6 +172,19 @@ default T getTableOrMetaException(String tableName, List<TableIf.TableType> tabl
         return table;
     }
 
+    default T getTableOrMetaException(String tableName, TableIf.TableType... tableTypes)
+            throws MetaNotFoundException {
+        T table = getTableOrMetaException(tableName);
+        for (TableIf.TableType tableType : tableTypes) {
+            if (table.getType() == tableType) {
+                return table;
+            }
+        }
+        throw new MetaNotFoundException(
+                "Tye type of " + tableName + " doesn't match, expected data tables=" + tableTypes);
+
+    }
+

Review Comment:
   The definition of this method looks similar as the above one (`default T getTableOrMetaException(String tableName, List<TableIf.TableType> tableTypes)
               throws MetaNotFoundException`). We should reuse the same logic.



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org