use of org.openkilda.wfm.error.PipelineException in project open-kilda by telstra.
the class ControllerToSpeakerProxyBolt method pullKafkaKey.
private String pullKafkaKey() {
String result;
Tuple tuple = getCurrentTuple();
try {
result = pullValue(tuple, KafkaRecordTranslator.FIELD_ID_KEY, String.class);
} catch (PipelineException e) {
log.error("Unable to read kafka-key from tuple {}: {}", formatTuplePayload(tuple), e);
return null;
}
return result;
}
use of org.openkilda.wfm.error.PipelineException in project open-kilda by telstra.
the class FailReporter method report.
private void report(Tuple input, String flowId, FlowObserver flowObserver, State state) throws PipelineException {
String logMessage = String.format("{FLOW-PING} Flow %s become %s", flowId, state);
if (state != State.OPERATIONAL) {
String cookies = flowObserver.getFlowTreadsInState(state).stream().map(cookie -> String.format("0x%016x", cookie)).collect(Collectors.joining(", "));
if (!cookies.isEmpty()) {
logMessage += String.format("(%s)", cookies);
}
}
log.info(logMessage);
Values output = new Values(new PingReport(flowId, state), pullContext(input));
getOutput().emit(input, output);
}
use of org.openkilda.wfm.error.PipelineException in project open-kilda by telstra.
the class FlowFetcher method init.
@Override
@PersistenceContextRequired(requiresNew = true)
public void init() {
super.init();
flowRepository = persistenceManager.getRepositoryFactory().createFlowRepository();
yFlowRepository = persistenceManager.getRepositoryFactory().createYFlowRepository();
flowResourcesManager = new FlowResourcesManager(persistenceManager, flowResourcesConfig);
try {
refreshHeap(null, false);
} catch (PipelineException e) {
log.error("Failed to init periodic ping cache");
}
}
use of org.openkilda.wfm.error.PipelineException in project open-kilda by telstra.
the class FlowFetcher method refreshHeap.
private void refreshHeap(Tuple input, boolean emitCacheExpiry) throws PipelineException {
log.debug("Handle periodic ping request");
Set<FlowWithTransitEncapsulation> flowsWithTransitEncapsulation = flowRepository.findWithPeriodicPingsEnabled().stream().peek(flowRepository::detach).map(this::getFlowWithTransitEncapsulation).flatMap(o -> o.isPresent() ? Stream.of(o.get()) : Stream.empty()).collect(Collectors.toSet());
if (emitCacheExpiry) {
final CommandContext commandContext = pullContext(input);
emitCacheExpire(input, commandContext, flowsWithTransitEncapsulation);
}
flowsSet = flowsWithTransitEncapsulation;
lastPeriodicPingCacheRefresh = System.currentTimeMillis();
}
use of org.openkilda.wfm.error.PipelineException in project open-kilda by telstra.
the class AbstractBolt method setupCommandContext.
protected CommandContext setupCommandContext() {
Tuple input = getCurrentTuple();
CommandContext context;
try {
context = pullContext(input);
} catch (PipelineException e) {
context = new CommandContext().fork("trace-fail");
log.warn("The command context is missing in input tuple received by {} on stream {}:{}, execution context" + " can't be traced. Create new command context for possible tracking of following" + " processing [{}].", getClass().getName(), input.getSourceComponent(), input.getSourceStreamId(), formatTuplePayload(input), e);
}
return context;
}
Aggregations