use of com.sequenceiq.common.api.diagnostics.DiagnosticsCollection in project cloudbreak by hortonworks.
the class FlowLogsToListDiagnosticsCollectionResponseConverter method convert.
public ListDiagnosticsCollectionResponse convert(List<FlowLog> flowLogs) {
ListDiagnosticsCollectionResponse response = new ListDiagnosticsCollectionResponse();
if (!flowLogs.isEmpty()) {
List<DiagnosticsCollection> collections = flowLogs.stream().map(flowLog -> {
DiagnosticsCollection collection = new DiagnosticsCollection();
collection.setFlowId(flowLog.getFlowId());
collection.setCreated(flowLog.getCreated());
collection.setProperties(flowPayloadToDiagnosticDetailsConverter.convert(flowLog.getPayload()));
collection.setStatus(calculateStatus(flowLog));
collection.setCurrentFlowStatus(flowLog.getCurrentState());
collection.setProgressPercentage(calculateProgressPercentage(flowLog));
return collection;
}).collect(Collectors.toList());
response.setCollections(collections);
}
return response;
}
use of com.sequenceiq.common.api.diagnostics.DiagnosticsCollection in project cloudbreak by hortonworks.
the class FlowLogsToListDiagnosticsCollectionResponseConverter method convert.
public ListDiagnosticsCollectionResponse convert(List<FlowLog> flowLogs) {
ListDiagnosticsCollectionResponse response = new ListDiagnosticsCollectionResponse();
if (!flowLogs.isEmpty()) {
List<DiagnosticsCollection> collections = flowLogs.stream().map(flowLog -> {
DiagnosticsCollection collection = new DiagnosticsCollection();
collection.setFlowId(flowLog.getFlowId());
collection.setCreated(flowLog.getCreated());
collection.setProperties(flowPayloadToDiagnosticDetailsConverter.convert(flowLog.getPayload()));
collection.setStatus(calculateStatus(flowLog));
collection.setCurrentFlowStatus(flowLog.getCurrentState());
collection.setProgressPercentage(calculateProgressPercentage(flowLog));
return collection;
}).collect(Collectors.toList());
response.setCollections(collections);
}
return response;
}
Aggregations