private boolean updateTopologyVersionIfGreater(AffinityTopologyVersion updated,DiscoCache discoCache){
  while (true) {
    Snapshot cur=topSnap.get();
    if (updated.compareTo(cur.topVer) >= 0) {
      if (topSnap.compareAndSet(cur,new Snapshot(updated,discoCache)))       return true;
    }
 else     return false;
  }
}

private boolean updateTopologyVersionIfGreater ( AffinityTopologyVersion updated , DiscoCache discoCache ) { while ( true ) { Snapshot cur = topSnap . get ( ) ; if ( updated . compareTo ( cur . topVer ) >= 0 ) { if ( topSnap . compareAndSet ( cur , new Snapshot ( updated , discoCache ) ) ) return true ; } else return false ; } }
updates topology version if current version is smaller than updated .
