use of org.opendaylight.controller.cluster.access.commands.UnknownHistoryException in project controller by opendaylight.
the class LeaderFrontendState method handleTransactionRequest.
@Nullable
TransactionSuccess<?> handleTransactionRequest(final TransactionRequest<?> request, final RequestEnvelope envelope, final long now) throws RequestException {
checkRequestSequence(envelope);
try {
final LocalHistoryIdentifier lhId = request.getTarget().getHistoryId();
final AbstractFrontendHistory history;
if (lhId.getHistoryId() != 0) {
history = localHistories.get(lhId);
if (history == null) {
if (purgedHistories.contains(lhId.getHistoryId())) {
LOG.warn("{}: rejecting request {} to purged history", persistenceId, request);
throw new DeadHistoryException(purgedHistories.toImmutable());
}
LOG.warn("{}: rejecting unknown history request {}", persistenceId, request);
throw new UnknownHistoryException(lastSeenHistory);
}
} else {
history = standaloneHistory;
}
return history.handleTransactionRequest(request, envelope, now);
} finally {
expectNextRequest();
}
}
Aggregations