X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Futils%2FPrimaryShardInfoFutureCache.java;h=b3291aad2552bbe23bd9390e6768f6ff8287c306;hp=3d4476a972e6ee8491da4143c6fb6174bdc2d366;hb=1d5ca4009be6c61d7b61989799037ad8f1ab7a75;hpb=8232a626b43fdd2f5799da0fbcfb0f02d3c8f4fb diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/PrimaryShardInfoFutureCache.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/PrimaryShardInfoFutureCache.java index 3d4476a972..b3291aad25 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/PrimaryShardInfoFutureCache.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/PrimaryShardInfoFutureCache.java @@ -10,8 +10,8 @@ package org.opendaylight.controller.cluster.datastore.utils; import akka.dispatch.Futures; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.controller.cluster.datastore.messages.PrimaryShardInfo; import scala.concurrent.Future; @@ -23,16 +23,15 @@ import scala.concurrent.Future; public class PrimaryShardInfoFutureCache { private final Cache> primaryShardInfoCache = CacheBuilder.newBuilder().build(); - @Nullable - public Future getIfPresent(@Nonnull String shardName) { + public @Nullable Future getIfPresent(@NonNull String shardName) { return primaryShardInfoCache.getIfPresent(shardName); } - public void putSuccessful(@Nonnull String shardName, @Nonnull PrimaryShardInfo info) { + public void putSuccessful(@NonNull String shardName, @NonNull PrimaryShardInfo info) { primaryShardInfoCache.put(shardName, Futures.successful(info)); } - public void remove(@Nonnull String shardName) { + public void remove(@NonNull String shardName) { primaryShardInfoCache.invalidate(shardName); } }