public static Trace single(ShallowTrace shallowTrace, String planClass, Long planId) { return new Trace(Collections.singletonMap(shallowTrace.getId(), shallowTrace), Collections.emptySet(), planClass, planId); }
private ShallowTrace findPossiblyFusedTrace(final Task<?> task) { final ShallowTrace main = task.getShallowTrace(); if (main.getName().equals("fused")) { final Trace trace = task.getTrace(); Optional<Long> child = trace.getRelationships().stream() .map(rel -> getChild(rel, main.getId())) .filter(id-> id != null) .findFirst(); if (child.isPresent()) { return trace.getTraceMap().get(child.get()); } } return main; }
public ShallowTraceBuilder(final ShallowTrace shallowTrace) { this(shallowTrace.getId()); setResultType(shallowTrace.getResultType()); setName(shallowTrace.getName()); setValue(shallowTrace.getValue()); setStartNanos(shallowTrace.getStartNanos()); setPendingNanos(shallowTrace.getPendingNanos()); setEndNanos(shallowTrace.getEndNanos()); setHidden(shallowTrace.getHidden()); setSystemHidden(shallowTrace.getSystemHidden()); Map<String, String> attributes = shallowTrace.getAttributes(); if (!attributes.isEmpty()) { _attributes = new HashMap<String, String>(); _attributes.putAll(attributes); } setTaskType(shallowTrace.getTaskType()); }
private static void writeTrace(final ShallowTrace trace, final JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeNumberField(JsonTraceCodec.TRACE_ID, trace.getId()); generator.writeStringField(JsonTraceCodec.TRACE_NAME, trace.getName()); generator.writeStringField(JsonTraceCodec.TRACE_RESULT_TYPE, trace.getResultType().toString());
public static Trace single(ShallowTrace shallowTrace, String planClass, Long planId) { return new Trace(Collections.singletonMap(shallowTrace.getId(), shallowTrace), Collections.emptySet(), planClass, planId); }
public ShallowTraceBuilder(final ShallowTrace shallowTrace) { this(shallowTrace.getId()); setResultType(shallowTrace.getResultType()); setName(shallowTrace.getName()); setValue(shallowTrace.getValue()); setStartNanos(shallowTrace.getStartNanos()); setPendingNanos(shallowTrace.getPendingNanos()); setEndNanos(shallowTrace.getEndNanos()); setHidden(shallowTrace.getHidden()); setSystemHidden(shallowTrace.getSystemHidden()); Map<String, String> attributes = shallowTrace.getAttributes(); if (!attributes.isEmpty()) { _attributes = new HashMap<String, String>(); _attributes.putAll(attributes); } setTaskType(shallowTrace.getTaskType()); }
private static void writeTrace(final ShallowTrace trace, final JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeNumberField(JsonTraceCodec.TRACE_ID, trace.getId()); generator.writeStringField(JsonTraceCodec.TRACE_NAME, trace.getName()); generator.writeStringField(JsonTraceCodec.TRACE_RESULT_TYPE, trace.getResultType().toString());