import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Consumer;
-import javax.annotation.concurrent.GuardedBy;
-import javax.annotation.concurrent.ThreadSafe;
+import org.checkerframework.checker.lock.qual.GuardedBy;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.controller.cluster.access.ABIVersion;
* shard is assigned a single cookie and this mapping is stored in a bidirectional map. Information about corresponding
* shard leader is resolved via {@link ActorUtils}. The product of resolution is {@link ShardBackendInfo}.
*
+ * <p>
+ * This class is thread-safe.
+ *
* @author Robert Varga
*/
-@ThreadSafe
abstract class AbstractShardBackendResolver extends BackendInfoResolver<ShardBackendInfo> {
static final class ShardState {
private final CompletionStage<ShardBackendInfo> stage;
private synchronized void onStageResolved(final ShardBackendInfo info, final Throwable failure) {
if (failure == null) {
- this.result = requireNonNull(info);
+ result = requireNonNull(info);
} else {
LOG.warn("Failed to resolve shard", failure);
}
// FIXME: we really need just ActorContext.findPrimaryShardAsync()
AbstractShardBackendResolver(final ClientIdentifier clientId, final ActorUtils actorUtils) {
this.actorUtils = requireNonNull(actorUtils);
- this.connectFunction = ExplicitAsk.toScala(t -> new ConnectClientRequest(clientId, t, ABIVersion.BORON,
+ connectFunction = ExplicitAsk.toScala(t -> new ConnectClientRequest(clientId, t, ABIVersion.POTASSIUM,
ABIVersion.current()));
}
return () -> staleBackendInfoCallbacks.remove(callback);
}
- protected void notifyStaleBackendInfoCallbacks(Long cookie) {
+ protected void notifyStaleBackendInfoCallbacks(final Long cookie) {
staleBackendInfoCallbacks.forEach(callback -> callback.accept(cookie));
}