You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@datalab.apache.org by GitBox <gi...@apache.org> on 2020/12/09 09:11:58 UTC
[GitHub] [incubator-datalab] ofuks commented on a change in pull request #1006: [DATALAB-2180] / [DATALAB-2179] -- fixed NPE, and terminated_with_err…
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datalab.apache.org
For additional commands, e-mail: dev-help@datalab.apache.org