Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
BUG-7594: Rework sal-remoterpc-connector messages
[controller.git]
/
opendaylight
/
md-sal
/
sal-remoterpc-connector
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
remote
/
rpc
/
registry
/
gossip
/
LocalBucket.java
diff --git
a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/LocalBucket.java
b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/LocalBucket.java
index b2c5e0c833f969caa58635944a9f530dac617e71..e5a2a5488313a33f8ba0ee53f28dd65cca0e7f0a 100644
(file)
--- a/
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/LocalBucket.java
+++ b/
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/LocalBucket.java
@@
-23,7
+23,7
@@
final class LocalBucket<T extends BucketData<T>> {
*
* We are keeping a boxed version here, as we stick it into a map anyway.
*/
*
* We are keeping a boxed version here, as we stick it into a map anyway.
*/
- private
L
ong version;
+ private
l
ong version;
private T data;
// We bump versions only if we took a snapshot since last data update
private T data;
// We bump versions only if we took a snapshot since last data update
@@
-39,7
+39,7
@@
final class LocalBucket<T extends BucketData<T>> {
return data;
}
return data;
}
-
L
ong getVersion() {
+
l
ong getVersion() {
return version;
}
return version;
}
@@
-50,15
+50,11
@@
final class LocalBucket<T extends BucketData<T>> {
boolean setData(final T data) {
this.data = Preconditions.checkNotNull(data);
boolean setData(final T data) {
this.data = Preconditions.checkNotNull(data);
- if (bumpVersion) {
- final long next = version.longValue() + 1;
- if ((next & 0xffff_ffffL) == 0) {
- return true;
- }
-
- version = next;
- bumpVersion = false;
+ if (!bumpVersion) {
+ return false;
}
}
- return false;
+
+ bumpVersion = false;
+ return (++version & 0xffff_ffffL) == 0;
}
}
}
}