@Finder("latestFlowStatus") public List<FlowStatus> getLatestFlowStatus(@Context PagingContext context, @QueryParam("flowId") FlowId flowId) { LOG.info("getLatestFlowStatus called with flowGroup " + flowId.getFlowGroup() + " flowName " + flowId.getFlowName()); gobblin.service.monitoring.FlowStatus latestFlowStatus = _flowStatusGenerator.getLatestFlowStatus(flowId.getFlowName(), flowId.getFlowGroup()); if (latestFlowStatus != null) { return Collections.singletonList(convertFlowStatus(latestFlowStatus)); } // will return 404 status code return null; }
.setExecutionEndTime(queriedJobStatus.getEndTime()) .setProcessedCount(queriedJobStatus.getProcessedCount())) .setExecutionStatus(timingEventToStatus(queriedJobStatus.getEventName())) .setMessage(queriedJobStatus.getMessage()) .setJobState(new JobState().setLowWatermark(queriedJobStatus.getLowWatermark()). flowExecutionStatus = updatedFlowExecutionStatus(jobStatus.getExecutionStatus(), flowExecutionStatus);
/** * Retrieve the FlowStatus with the given key * @param key flow status id key containing group name and flow name * @return {@link FlowStatus} with flow status for the latest execution of the flow */ @Override public FlowStatus get(ComplexResourceKey<FlowStatusId, EmptyRecord> key) { String flowGroup = key.getKey().getFlowGroup(); String flowName = key.getKey().getFlowName(); long flowExecutionId = key.getKey().getFlowExecutionId(); LOG.info("Get called with flowGroup " + flowGroup + " flowName " + flowName + " flowExecutionId " + flowExecutionId); gobblin.service.monitoring.FlowStatus flowStatus = _flowStatusGenerator.getFlowStatus(flowName, flowGroup, flowExecutionId); // this returns null to raise a 404 error if flowStatus is null return convertFlowStatus(flowStatus); }