*/
abstract class AbstractFrontendHistory implements Identifiable<LocalHistoryIdentifier> {
private static final Logger LOG = LoggerFactory.getLogger(AbstractFrontendHistory.class);
- private static final OutOfOrderRequestException UNSEQUENCED_START = new OutOfOrderRequestException(0);
private final Map<TransactionIdentifier, FrontendTransaction> transactions = new HashMap<>();
private final RangeSet<UnsignedLong> purgedTransactions;
// The transaction does not exist and we are about to create it, check sequence number
if (request.getSequence() != 0) {
LOG.debug("{}: no transaction state present, unexpected request {}", persistenceId(), request);
- throw UNSEQUENCED_START;
+ throw new OutOfOrderRequestException(0);
}
tx = createTransaction(request, id);
throws RequestException {
if (request instanceof CommitLocalTransactionRequest) {
LOG.debug("{}: allocating new ready transaction {}", persistenceId(), id);
+ tree.getStats().incrementReadWriteTransactionCount();
return createReadyTransaction(id, ((CommitLocalTransactionRequest) request).getModification());
}
if (request instanceof AbstractReadTransactionRequest) {
if (((AbstractReadTransactionRequest<?>) request).isSnapshotOnly()) {
- LOG.debug("{}: allocatint new open snapshot {}", persistenceId(), id);
+ LOG.debug("{}: allocating new open snapshot {}", persistenceId(), id);
+ tree.getStats().incrementReadOnlyTransactionCount();
return createOpenSnapshot(id);
}
}
LOG.debug("{}: allocating new open transaction {}", persistenceId(), id);
+ tree.getStats().incrementReadWriteTransactionCount();
return createOpenTransaction(id);
}