use of com.torodb.core.retrier.RetrierGiveUpException in project torodb by torodb.
the class SimpleAnalyzedOplogBatchExecutor method visit.
@Override
public OplogOperation visit(CudAnalyzedOplogBatch batch, ApplierContext arg) throws RetrierGiveUpException {
metrics.getCudBatchSize().update(batch.getOriginalBatch().size());
try (Context context = metrics.getCudBatchTimer().time()) {
try {
execute(batch, arg);
} catch (UserException | NamespaceJobExecutionException ex) {
throw new RetrierGiveUpException("Unexpected exception while replying", ex);
} catch (RollbackException ex) {
ApplierContext retryingReplingContext = new ApplierContext.Builder().setReapplying(true).setUpdatesAsUpserts(true).build();
retrier.retry(() -> {
try {
execute(batch, retryingReplingContext);
return Empty.getInstance();
} catch (UserException | NamespaceJobExecutionException ex2) {
throw new RetrierAbortException("Unexpected user exception while applying " + "the batch " + batch, ex2);
}
}, Hint.CRITICAL, Hint.TIME_SENSIBLE);
}
}
List<OplogOperation> originalBatch = batch.getOriginalBatch();
return originalBatch.get(originalBatch.size() - 1);
}
Aggregations