These methods take a String.format() string, not a logging one, hence
we are not getting the information we want.
Change-Id: I46de0d64c85594e3d7b8be97951f1cf5249bca8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
3e9ac68fea1aef0c7fedec346e50882efdde8acc)
LOG.debug("About to commit {} in transaction {}",
moduleIdentifier, getTransactionIdentifier());
AutoCloseable instance = module.getInstance();
- Preconditions.checkNotNull(instance, "Instance is null:{} in transaction {}", moduleIdentifier, getTransactionIdentifier());
- } catch (final Exception e) {
+ Preconditions.checkNotNull(instance, "Instance is null:%s in transaction %s", moduleIdentifier, getTransactionIdentifier());
+ } catch (Exception e) {
LOG.error("Commit failed on {} in transaction {}", moduleIdentifier,
getTransactionIdentifier(), e);
internalAbort();
final synchronized void unregisterMBean(final ObjectName on) {
// first check that on was registered using this instance
boolean removed = registeredObjectNames.remove(on);
- Preconditions.checkState(removed, "Cannot unregister - ObjectName not found in 'registeredObjectNames': {}", on);
+ Preconditions.checkState(removed, "Cannot unregister - ObjectName not found in 'registeredObjectNames': %s", on);
try {
getMBeanServer().unregisterMBean(on);
}
final void setForwarder(final ReconnectForwarder forwarder, final long now) {
- Verify.verify(successor == null, "Successor {} already set on connection {}", successor, this);
+ Verify.verify(successor == null, "Successor %s already set on connection %s", successor, this);
successor = Preconditions.checkNotNull(forwarder);
LOG.debug("Connection {} superseded by {}, splicing queue", this, successor);
void sealOnly() {
parent.onTransactionSealed(this);
final boolean success = STATE_UPDATER.compareAndSet(this, OPEN, SEALED);
- Verify.verify(success, "Attempted to replay seal on {}", this);
+ Verify.verify(success, "Attempted to replay seal on %s", this);
}
/**
}
LOG.debug("Resolved backend information to {}", response);
- Preconditions.checkArgument(response instanceof ConnectClientSuccess, "Unhandled response {}",
+ Preconditions.checkArgument(response instanceof ConnectClientSuccess, "Unhandled response %s",
response);
final ConnectClientSuccess success = (ConnectClientSuccess) response;
future.complete(new ShardBackendInfo(success.getBackend(), nextSessionId.getAndIncrement(),
final Optional<PersistenceProtocol> maybeProtocol = request.getPersistenceProtocol();
if (maybeProtocol.isPresent()) {
- Verify.verify(callback != null, "Request {} has null callback", request);
+ Verify.verify(callback != null, "Request %s has null callback", request);
if (markSealed()) {
sealOnly();
}
public CDSShardAccess getShardAccess(@Nonnull final DOMDataTreeIdentifier subtree) {
Preconditions.checkArgument(
subtrees.stream().anyMatch(dataTreeIdentifier -> dataTreeIdentifier.contains(subtree)),
- "Subtree {} is not controlled by this producer {}", subtree, this);
+ "Subtree %s is not controlled by this producer %s", subtree, this);
final DOMDataTreePrefixTableEntry<DOMDataTreeShardRegistration<DOMDataTreeShard>> lookup =
shardTable.lookup(subtree);
- Preconditions.checkState(lookup != null, "Subtree {} is not contained in any registered shard.");
+ Preconditions.checkState(lookup != null, "Subtree %s is not contained in any registered shard.", subtree);
final DOMDataTreeIdentifier lookupId = lookup.getValue().getPrefix();
synchronized void cancelTransaction(final PingPongTransaction tx, final DOMDataReadWriteTransaction frontendTx) {
// Attempt to unlock the operation.
final boolean lockedMatch = LOCKED_UPDATER.compareAndSet(this, tx, null);
- Verify.verify(lockedMatch, "Cancelling transaction {} collided with locked transaction {}", tx, lockedTx);
+ Verify.verify(lockedMatch, "Cancelling transaction %s collided with locked transaction %s", tx, lockedTx);
// Cancel the backend transaction, so we do not end up leaking it.
final boolean backendCancelled = tx.getTransaction().cancel();
final State localState = state;
do {
- Preconditions.checkState(!CLOSED.equals(localState), "Transaction chain {} has been closed", this);
+ Preconditions.checkState(!CLOSED.equals(localState), "Transaction chain %s has been closed", this);
if (FAILED.equals(localState)) {
LOG.debug("Ignoring user close in failed state");