imbajin commented on code in PR #2966:
URL: https://github.com/apache/hugegraph/pull/2966#discussion_r2936755627


##########
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/API.java:
##########
@@ -241,6 +241,13 @@ public static boolean checkAndParseAction(String action) {
         }

Review Comment:
   ⚠️ 
Suggestion: 
rename 
checkPdModeEnabled 
to a 
clearer name 
and add 
null-check
   
   This method 
throws when 
PD mode 
is not 
enabled. 
Rename to 
make the 
contract explicit 
(for 
example 
ensurePdModeEnabled 
or 
requirePdModeEnabled) 
and add 
a null-check 
+ [38;5
 ;204mJavadoc. 
Suggested 
change:
   
   public static 
void 
ensurePdModeEnabled(GraphManager
 manager) {
       
E.checkArgumentNotNull(manager,
 "G[3
 
8;5;198;48;5;233mraphManager
 
must
 
not
 be 
null");
       
if 
(!manager.usePD())
 {
           
throw
 
new
 
HugeException("GraphSpac[38;5;198;4
 8;5;233me 
management
 is 
not
 
supported
 in 
stan[38;5;198;48;
 
5;233mdalone
 
mode");
       }
   }
   
   Then update 
call sites 
(GraphSpaceAPI, 
ManagerAPI) 
to call 
ensurePdModeEnabled(manager).



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