@Test public void testNoReuse_requiredBreadcrumb() { HopInfo hopA = forwardedHop("A"); HopInfo hopB = forwardedHop("B"); HopInfo hopALoop = loopHop("A"); HopInfo hopC = forwardedHop("C"); DagTraceRecorder recorder = new DagTraceRecorder(TEST_FLOW); assertTrue(recorder.tryRecordPartialTrace(ImmutableList.of(hopA, hopB, hopALoop))); assertFalse(recorder.tryRecordPartialTrace(ImmutableList.of(hopC, hopB))); }
@Override public boolean tryRecordPartialTrace(List<HopInfo> hops) { checkState(_builtTraceDag == null, "Cannot add traces after the Dag has been built"); HopInfo rootHop = hops.get(0); if (_rootBuilder != null && _rootBuilder._hopInfo != rootHop) { buildRoot(); } if (_rootBuilder == null) { _rootBuilder = new NodeBuilder(ImmutableList.of(), rootHop, new NodeKey(_flow, rootHop.getHop())); } return _rootBuilder.tryRecordPartialTrace(hops.subList(1, hops.size())); }
DagTraceRecorder implements TraceRecorder { @Override public boolean tryRecordPartialTrace(List<HopInfo> hops) { checkState(_builtTraceDag == null, "Cannot add traces after the Dag has been built"); HopInfo rootHop = hops.get(0); if (_rootBuilder != null && _rootBuilder._hopInfo != rootHop) { buildRoot(); } if (_rootBuilder == null) { _rootBuilder = new NodeBuilder(ImmutableList.of(), rootHop, new NodeKey(_flow, rootHop.getHop())); } return _rootBuilder.tryRecordPartialTrace(hops.subList(1, hops.size())); } }
DagTraceRecorder implements TraceRecorder { @Override public boolean tryRecordPartialTrace(List<HopInfo> hops) { checkState(_builtTraceDag == null, "Cannot add traces after the Dag has been built"); HopInfo rootHop = hops.get(0); if (_rootBuilder != null && _rootBuilder._hopInfo != rootHop) { buildRoot(); } if (_rootBuilder == null) { _rootBuilder = new NodeBuilder(ImmutableList.of(), rootHop, new NodeKey(_flow, rootHop.getHop())); } return _rootBuilder.tryRecordPartialTrace(hops.subList(1, hops.size())); } DagTraceRecorder(@Nonnull Flow flow); }
DagTraceRecorder implements TraceRecorder { @Override public boolean tryRecordPartialTrace(List<HopInfo> hops) { checkState(_builtTraceDag == null, "Cannot add traces after the Dag has been built"); HopInfo rootHop = hops.get(0); if (_rootBuilder != null && _rootBuilder._hopInfo != rootHop) { buildRoot(); } if (_rootBuilder == null) { _rootBuilder = new NodeBuilder(ImmutableList.of(), rootHop, new NodeKey(_flow, rootHop.getHop())); } return _rootBuilder.tryRecordPartialTrace(hops.subList(1, hops.size())); } DagTraceRecorder(@Nonnull Flow flow); @Override boolean tryRecordPartialTrace(List<HopInfo> hops); @Override void recordTrace(List<HopInfo> hops); TraceDag build(); }
DagTraceRecorder implements TraceRecorder { @Override public boolean tryRecordPartialTrace(List<HopInfo> hops) { checkState(_builtTraceDag == null, "Cannot add traces after the Dag has been built"); HopInfo rootHop = hops.get(0); if (_rootBuilder != null && _rootBuilder._hopInfo != rootHop) { buildRoot(); } if (_rootBuilder == null) { _rootBuilder = new NodeBuilder(ImmutableList.of(), rootHop, new NodeKey(_flow, rootHop.getHop())); } return _rootBuilder.tryRecordPartialTrace(hops.subList(1, hops.size())); } DagTraceRecorder(@Nonnull Flow flow); @Override boolean tryRecordPartialTrace(List<HopInfo> hops); @Override void recordTrace(List<HopInfo> hops); TraceDag build();  }