You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2022/11/23 00:33:30 UTC

[GitHub] [submarine] cdmikechen commented on a diff in pull request #1020: SUBMARINE-1349. Fix the syntax error reported in sonarcloud and add init value for apiversion in XGboostjobList.java

cdmikechen commented on code in PR #1020:
URL: https://github.com/apache/submarine/pull/1020#discussion_r1029935069


##########
submarine-server/server-core/src/main/java/org/apache/submarine/server/manager/ModelVersionManager.java:
##########
@@ -50,14 +50,10 @@ public class ModelVersionManager {
    *
    * @return object
    */
-  public static ModelVersionManager getInstance() {
+  public static synchronized ModelVersionManager getInstance() {

Review Comment:
   We should not change the position of `synchronized`, changing it on this will cause the whole method to be locked at the time of the call.



##########
submarine-server/server-core/src/main/java/org/apache/submarine/server/manager/RegisteredModelManager.java:
##########
@@ -54,14 +54,10 @@ public class RegisteredModelManager {
    *
    * @return object
    */
-  public static RegisteredModelManager getInstance() {
+  public static synchronized RegisteredModelManager getInstance() {

Review Comment:
   Same as above



##########
submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/model/xgboostjob/XGBoostJobList.java:
##########
@@ -27,7 +27,7 @@
 
 public class XGBoostJobList implements KubernetesListObject {
   @SerializedName("apiVersion")
-  private String apiVersion;
+  private String apiVersion = XGBoostJob.CRD_XGBOOST_API_VERSION_V1;
 
   @SerializedName("kind")
   private String kind;

Review Comment:
   Does `kind` have the same problem?



-- 
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@submarine.apache.org

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