if (groupManager == null) {
return cacheTopology;
}
ConsistentHash currentCH = cacheTopology.getCurrentCH();
currentCH = new GroupingConsistentHash(currentCH, groupManager);
ConsistentHash pendingCH = cacheTopology.getPendingCH();
if (pendingCH != null) {
pendingCH = new GroupingConsistentHash(pendingCH, groupManager);
}
ConsistentHash unionCH = cacheTopology.getUnionCH();
if (unionCH != null) {
unionCH = new GroupingConsistentHash(unionCH, groupManager);
}
return new CacheTopology(cacheTopology.getTopologyId(), cacheTopology.getRebalanceId(), currentCH, pendingCH, unionCH);
}