summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
bf54edf)
Add a few @NonNull annotations and eliminate two else blocks.
Change-Id: Ide21c363f349af7b24fb4835b859a224357586c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
AtomicLongFieldUpdater.newUpdater(AbstractTransactionContextFactory.class, "nextTx");
private final ConcurrentMap<String, F> knownLocal = new ConcurrentHashMap<>();
AtomicLongFieldUpdater.newUpdater(AbstractTransactionContextFactory.class, "nextTx");
private final ConcurrentMap<String, F> knownLocal = new ConcurrentHashMap<>();
- private final LocalHistoryIdentifier historyId;
- private final ActorUtils actorUtils;
+ private final @NonNull LocalHistoryIdentifier historyId;
+ private final @NonNull ActorUtils actorUtils;
// Used via TX_COUNTER_UPDATER
@SuppressWarnings("unused")
// Used via TX_COUNTER_UPDATER
@SuppressWarnings("unused")
parent.getIdentifier());
return new DirectTransactionContextWrapper(parent.getIdentifier(), actorUtils, shardName,
localContext);
parent.getIdentifier());
return new DirectTransactionContextWrapper(parent.getIdentifier(), actorUtils, shardName,
localContext);
- } else {
- LOG.debug("Tx {}: Local transaction context creation failed, using DelayedTransactionWrapper",
- parent.getIdentifier());
- final RemoteTransactionContextSupport remote = new RemoteTransactionContextSupport(
- transactionContextWrapper, parent, shardName);
- remote.setPrimaryShard(primaryShardInfo);
- return transactionContextWrapper;
+
+ LOG.debug("Tx {}: Local transaction context creation failed, using DelayedTransactionWrapper",
+ parent.getIdentifier());
+ final RemoteTransactionContextSupport remote = new RemoteTransactionContextSupport(
+ transactionContextWrapper, parent, shardName);
+ remote.setPrimaryShard(primaryShardInfo);
+ return transactionContextWrapper;
} finally {
onTransactionContextCreated(parent.getIdentifier());
}
} finally {
onTransactionContextCreated(parent.getIdentifier());
}
if (findPrimaryFuture.isCompleted()) {
final Try<PrimaryShardInfo> maybe = findPrimaryFuture.value().get();
if (maybe.isSuccess()) {
if (findPrimaryFuture.isCompleted()) {
final Try<PrimaryShardInfo> maybe = findPrimaryFuture.value().get();
if (maybe.isSuccess()) {
- return maybeCreateDirectTransactionContextWrapper(maybe.get(), parent, shardName,
- contextWrapper);
- } else {
- onFindPrimaryShardFailure(maybe.failed().get(), parent, shardName,
- contextWrapper);
+ return maybeCreateDirectTransactionContextWrapper(maybe.get(), parent, shardName, contextWrapper);
+
+ onFindPrimaryShardFailure(maybe.failed().get(), parent, shardName, contextWrapper);
} else {
findPrimaryFuture.onComplete(result -> {
if (result.isSuccess()) {
} else {
findPrimaryFuture.onComplete(result -> {
if (result.isSuccess()) {