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



##########
File path: 
services/self-service/src/main/java/com/epam/dlab/backendapi/dao/OdahuDAOImpl.java
##########
@@ -77,15 +80,20 @@
 
     @Override
     public OdahuFieldsDTO getFields(String name, String project, String 
endpoint) {
-        Optional<Document> one = findOne(PROJECTS_COLLECTION, 
odahuProjectEndpointCondition(name, project, endpoint),
-                fields(include(ODAHU_FIELD), excludeId()));
-        OdahuFieldsDTO odahuFields = null;
-        if (one.isPresent()) {
-            List<OdahuFieldsDTO> list = 
convertFromDocument(one.get().get(ODAHU_FIELD, ArrayList.class), new 
TypeReference<List<OdahuFieldsDTO>>() {
-            });
-            odahuFields = list.get(0);
-        }
-        return odahuFields;
+        FindIterable<Document> odahuDoc = find(PROJECTS_COLLECTION,
+                odahuProjectEndpointCondition(name, project, endpoint),
+                fields(include(ODAHU_FIELD), excludeId())); //TODO: 
Potentially, method can be improved by filtering the Documents

Review comment:
       In context of this issue such interface is not applicable. Cause 
document conversion interface requires the TypeReference object.
   Plus, the ODAHU clusters array list field is extracted from the Document:
   odahuClusters.get(ODAHU_FIELD, ArrayList.class)
   In frame of this ticket, we can leave legacy methods




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