Skip to content

Commit

Permalink
ignite-5852 : Fixed affinity calculation for local cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilantukh committed Oct 18, 2017
1 parent 15efc43 commit 6efac46
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ public void onReconnected() {
* @return Affinity assignments.
*/
@SuppressWarnings("IfMayBeConditional")
public List<List<ClusterNode>> calculate(AffinityTopologyVersion topVer, DiscoveryEvent discoEvt,
DiscoCache discoCache) {
public List<List<ClusterNode>> calculate(AffinityTopologyVersion topVer, @Nullable DiscoveryEvent discoEvt,
@Nullable DiscoCache discoCache) {
if (log.isDebugEnabled())
log.debug("Calculating affinity [topVer=" + topVer + ", locNodeId=" + ctx.localNodeId() +
", discoEvt=" + discoEvt + ']');
Expand All @@ -286,9 +286,14 @@ public List<List<ClusterNode>> calculate(AffinityTopologyVersion topVer, Discove
else
sorted = Collections.singletonList(ctx.discovery().localNode());

boolean hasBaseline = discoCache.state().baselineTopology() != null;
boolean changedBaseline = !hasBaseline ? baselineTopology != null :
!discoCache.state().baselineTopology().equals(baselineTopology);
boolean hasBaseline = false;
boolean changedBaseline = false;

if (discoCache != null) {
hasBaseline = discoCache.state().baselineTopology() != null;
changedBaseline = !hasBaseline ? baselineTopology != null :
!discoCache.state().baselineTopology().equals(baselineTopology);
}

List<List<ClusterNode>> assignment;

Expand Down

0 comments on commit 6efac46

Please sign in to comment.