@Override public FlowletId getParent() { return new FlowletId(namespace, application, flow, flowlet); }
private FlowletId deserializeFlowletId(JsonObject id) { FlowId flow = deserializeFlowId(id.getAsJsonObject("flow")); String flowletId = id.get("id").getAsString(); return new FlowletId(flow.getParent(), flow.getProgram(), flowletId); }
private FlowletId deserializeFlowletId(JsonObject id) { FlowId flow = deserializeFlowId(id); String flowletId = id.get("flowlet").getAsString(); return new FlowletId(flow.getParent(), flow.getProgram(), flowletId); }
/** * returns flowlet related metrics * @param namespace * @param appName * @param flowName * @param flowletName * @return {@link co.cask.cdap.api.metrics.RuntimeMetrics} */ public RuntimeMetrics getFlowletMetrics(String namespace, String appName, String flowName, String flowletName) { FlowletId flowletId = new FlowletId(namespace, appName, flowName, flowletName); return getMetrics(MetricsTags.flowlet(flowletId), Constants.Metrics.Name.Flow.FLOWLET_INPUT, Constants.Metrics.Name.Flow.FLOWLET_PROCESSED, Constants.Metrics.Name.Flow.FLOWLET_EXCEPTIONS); }
@Override public FlowletId toEntityId() { return new FlowletId(flow.getNamespaceId(), flow.getApplicationId(), flow.getId(), id); }
public FlowletId flowlet(String flowlet) { if (type != ProgramType.FLOW) { throw new IllegalArgumentException("Expected program type for flowlet to be " + ProgramType.FLOW); } return new FlowletId(new ApplicationId(getNamespace(), getApplication(), getVersion()), program, flowlet); }
@SuppressWarnings("unused") public static FlowletId fromIdParts(Iterable<String> idString) { Iterator<String> iterator = idString.iterator(); return new FlowletId( new ApplicationId(next(iterator, "namespace"), next(iterator, "application"), next(iterator, "version")), next(iterator, "flow"), nextAndEnd(iterator, "flowlet")); }