ofuks commented on a change in pull request #1006:
URL: https://github.com/apache/incubator-datalab/pull/1006#discussion_r539130813



##########
File path: 
services/provisioning-service/src/main/java/com/epam/datalab/backendapi/core/response/handlers/ResourcesStatusCallbackHandler.java
##########
@@ -85,6 +87,16 @@ protected EnvStatusDTO parseOutResponse(JsonNode resultNode, 
EnvStatusDTO baseSt
         return baseStatus;
     }
 
+    private String CheckAndMapStatus(String status) {
+        if (status.toLowerCase().equals("terminated_with_errors")) {

Review comment:
       Can we use **equalsIgnoreCase** method?

##########
File path: 
services/provisioning-service/src/main/java/com/epam/datalab/backendapi/core/response/handlers/ResourcesStatusCallbackHandler.java
##########
@@ -60,6 +61,7 @@ public ResourcesStatusCallbackHandler(@JacksonInject 
RESTService selfService, @J
 
     @Override
     protected EnvStatusDTO parseOutResponse(JsonNode resultNode, EnvStatusDTO 
baseStatus) {
+        log.trace("Trying to parse: {}, with{}", resultNode, baseStatus);

Review comment:
       add space after **with**

##########
File path: 
services/provisioning-service/src/main/java/com/epam/datalab/backendapi/core/response/handlers/ResourcesStatusCallbackHandler.java
##########
@@ -85,6 +87,16 @@ protected EnvStatusDTO parseOutResponse(JsonNode resultNode, 
EnvStatusDTO baseSt
         return baseStatus;
     }
 
+    private String CheckAndMapStatus(String status) {

Review comment:
       Rename method according to the Java convention 

##########
File path: 
services/self-service/src/main/java/com/epam/datalab/backendapi/service/impl/InfrastructureInfoServiceImpl.java
##########
@@ -149,11 +149,13 @@ public InfrastructureMetaInfoDTO 
getInfrastructureMetaInfo() {
     @Override
     public void updateInfrastructureStatuses(UserInfo user, String endpoint, 
List<EnvResource> hostInstances, List<EnvResource> clusterInstances) {
         EnvResourceList envResourceList = EnvResourceList.builder()
-                        .hostList(hostInstances)
-                        .clusterList(clusterInstances)
-                        .build();
+                .hostList(hostInstances)
+                .clusterList(clusterInstances)
+                .build();
 
         EndpointDTO endpointDTO = endpointService.get(endpoint);
+        log.info("SELF-SERVICE: Send request to provisioning service:\n 
POST:{}, with EnvResources: {}", INFRASTRUCTURE_STATUS,

Review comment:
       Can we remove **SELF-SERVICE** from the log? It is already in the 
**selfservice.log** file.
   

##########
File path: 
services/provisioning-service/src/main/java/com/epam/datalab/backendapi/core/response/handlers/ResourcesStatusCallbackHandler.java
##########
@@ -85,6 +87,16 @@ protected EnvStatusDTO parseOutResponse(JsonNode resultNode, 
EnvStatusDTO baseSt
         return baseStatus;
     }
 
+    private String CheckAndMapStatus(String status) {
+        if (status.toLowerCase().equals("terminated_with_errors")) {
+            log.trace("While parsing response changed: {} -> {}", status, 
UserInstanceStatus.TERMINATED);
+            return UserInstanceStatus.TERMINATED.toString();
+        } else {
+            return status;
+        }
+

Review comment:
       Please remove the empty line




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

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