use of org.apache.ignite.internal.events.DiscoveryCustomEvent in project ignite by apache.
the class CacheBlockOnReadAbstractTest method destroyCachePredicate.
/**
* Checks that given discovery event is from "Destroy cache" operation.
*
* @param discoEvt Discovery event.
*/
private static boolean destroyCachePredicate(DiscoveryEvent discoEvt) {
if (discoEvt instanceof DiscoveryCustomEvent) {
DiscoveryCustomEvent discoCustomEvt = (DiscoveryCustomEvent) discoEvt;
DiscoveryCustomMessage customMsg = discoCustomEvt.customMessage();
if (customMsg instanceof DynamicCacheChangeBatch) {
DynamicCacheChangeBatch cacheChangeBatch = (DynamicCacheChangeBatch) customMsg;
ExchangeActions exchangeActions = U.field(cacheChangeBatch, "exchangeActions");
Collection<CacheActionData> stopRequests = exchangeActions.cacheStopRequests();
return !stopRequests.isEmpty();
}
}
return false;
}
Aggregations