imbajin commented on code in PR #2911:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2911#discussion_r2601675695


##########
hugegraph-server/hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseStore.java:
##########
@@ -114,6 +114,14 @@ protected List<String> tableNames() {
                           .collect(Collectors.toList());
     }
 
+    protected List<String> truncatedTableNames() {

Review Comment:
   ‼️ **Critical: Method name doesn't follow Java naming conventions**
   
   The method name `truncatedTableNames()` is grammatically incorrect and 
misleading. It suggests tables that have already been truncated, when it 
actually returns tables that SHOULD be truncated.
   
   ```suggestion
       protected List<String> getNonMetaTableNames() {
           // Exclude meta table to preserve system metadata during graph clear
           return this.tables.entrySet().stream()
                             .filter(e -> !(HugeType.META == e.getKey()))
                             .map(e -> e.getValue().table())
                             .collect(Collectors.toList());
       }
   ```
   
   Alternative names: `getClearableTableNames()`, `getDataTableNames()`, or 
`getTableNamesExcludingMeta()`



##########
hugegraph-server/hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseStore.java:
##########
@@ -114,6 +114,14 @@ protected List<String> tableNames() {
                           .collect(Collectors.toList());
     }
 
+    protected List<String> truncatedTableNames() {
+        // Exclude meta table to preserve system metadata during graph clear
+        return this.tables.entrySet().stream()

Review Comment:
   ⚠️ **Consider defensive programming: check for null HugeType**
   
   While unlikely, if `e.getKey()` is null, this comparison would fail with 
NPE. Consider using `Objects.equals()` or put the enum constant on the left 
side.
   
   ```suggestion
                             .filter(e -> !HugeType.META.equals(e.getKey()))
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to