@Override
AbstractProxyTransaction doCreateTransactionProxy(final AbstractClientConnection<ShardBackendInfo> connection,
final TransactionIdentifier txId) {
- Preconditions.checkState(lastOpen == null, "Proxy {} is currently open", lastOpen);
+ Preconditions.checkState(lastOpen == null, "Proxy %s has %s currently open", this, lastOpen);
// onTransactionCompleted() runs concurrently
final LocalProxyTransaction localSealed = lastSealed;
lastOpen = new LocalProxyTransaction(this, txId,
(CursorAwareDataTreeModification) baseSnapshot.newModification());
+ LOG.debug("Proxy {} open transaction {}", this, lastOpen);
return lastOpen;
}
@Override
void replaySuccessfulRequests() {
for (AbstractProxyTransaction t : proxies.values()) {
+ LOG.debug("{} creating successor transaction proxy for {}", identifier, t);
final AbstractProxyTransaction newProxy = successor.createTransactionProxy(t.getIdentifier());
- LOG.debug("{} created successor transaction proxy {} for {}", identifier, newProxy, t);
+ LOG.debug("{} created successor transaction proxy {}", identifier, newProxy);
t.replaySuccessfulRequests(newProxy);
}
}
}
final AbstractProxyTransaction createTransactionProxy(final TransactionIdentifier txId) {
- final TransactionIdentifier proxyId = new TransactionIdentifier(identifier, txId.getTransactionId());
-
lock.lock();
try {
+ if (successor != null) {
+ return successor.createTransactionProxy(txId);
+ }
+
+ final TransactionIdentifier proxyId = new TransactionIdentifier(identifier, txId.getTransactionId());
final AbstractProxyTransaction ret = doCreateTransactionProxy(connection, proxyId);
proxies.put(proxyId, ret);
LOG.debug("Allocated proxy {} for transaction {}", proxyId, txId);
lock.lock();
try {
proxies.remove(tx.getIdentifier());
+ LOG.debug("Proxy {} aborting transaction {}", this, tx);
+ onTransactionAborted(tx);
} finally {
lock.unlock();
}
lock.lock();
try {
proxies.remove(tx.getIdentifier());
+ LOG.debug("Proxy {} completing transaction {}", this, tx);
+ onTransactionCompleted(tx);
} finally {
lock.unlock();
}
}
successor = createSuccessor(newConnection);
+ LOG.debug("History {} instantiated successor {}", this, successor);
return new ReconnectCohort();
}