use of org.apache.ignite.events.CacheRebalancingEvent in project ignite by apache.
the class GridCachePartitionedUnloadEventsSelfTest method checkPartitionUnloadEvents.
/**
* @param evts Events.
* @param g Grid.
* @param parts Parts.
*/
private void checkPartitionUnloadEvents(Collection<Event> evts, Ignite g, Collection<GridDhtLocalPartition> parts) {
assertEquals(parts.size(), evts.size());
for (Event evt : evts) {
CacheRebalancingEvent unloadEvt = (CacheRebalancingEvent) evt;
final int part = unloadEvt.partition();
assertNotNull("Unexpected partition: " + part, F.find(parts, null, new IgnitePredicate<GridDhtLocalPartition>() {
@Override
public boolean apply(GridDhtLocalPartition e) {
return e.id() == part;
}
}));
assertEquals(g.cache(DEFAULT_CACHE_NAME).getName(), unloadEvt.cacheName());
assertEquals(g.cluster().localNode().id(), unloadEvt.node().id());
}
}
Aggregations