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/10/15 18:04:39 UTC

[GitHub] [incubator-datalab] ppapou commented on a change in pull request #926: [DLAB-1650] Creating ODAHU cluster in same project

ppapou commented on a change in pull request #926:
URL: https://github.com/apache/incubator-datalab/pull/926#discussion_r505737990



##########
File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/OdahuServiceImpl.java
##########
@@ -91,7 +91,9 @@ public OdahuServiceImpl(ProjectService projectService, EndpointService endpointS
     @BudgetLimited
     @Override
     public void create(@Project String project, OdahuCreateDTO odahuCreateDTO, UserInfo user) {
-        Optional<OdahuDTO> odahuDTO = odahuDAO.getByProjectEndpoint(odahuCreateDTO.getProject(), odahuCreateDTO.getEndpoint());
+        Optional<OdahuDTO> odahuDTO = odahuDAO
+                .getByProjectEndpoint(odahuCreateDTO.getProject(), odahuCreateDTO.getEndpoint())
+                .filter(p -> p.getStatus().equals(UserInstanceStatus.FAILED));

Review comment:
       the Optional filter behavior. If a value is present, and the value matches the given predicate, return an Optional describing the value, otherwise return an empty Optional.
   




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