/** {@inheritDoc} */ @Override public boolean apply(Event evt) { lostParts.add(((CacheRebalancingEvent)evt).partition()); return true; } }
@Override public boolean apply(Event evt) { assert evt.type() == EventType.EVT_CACHE_REBALANCE_PART_DATA_LOST; CacheRebalancingEvent cacheEvt = (CacheRebalancingEvent)evt; if (cacheEvt.partition() == part0 && F.eq(cacheName, cacheEvt.cacheName())) { latch.countDown(); // Auto-unsubscribe. return false; } return true; } }, EventType.EVT_CACHE_REBALANCE_PART_DATA_LOST);
CacheRebalancingEvent rebalancingEvt = (CacheRebalancingEvent) evt; int part = rebalancingEvt.partition();
/** * @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()); } } }
writer.writeInt(event0.partition()); writeNode(writer, event0.discoveryNode()); writer.writeInt(event0.discoveryEventType());
writer.writeInt(event0.partition()); writeNode(writer, event0.discoveryNode()); writer.writeInt(event0.discoveryEventType());