use of org.apache.ignite.internal.managers.discovery.CustomEventListener in project ignite by apache.
the class DynamicColumnsAbstractConcurrentSelfTest method ignitionStart.
/**
* Spoof blocking indexing class and start new node.
* @param cfg Node configuration.
* @param latch Latch to await for ultimate completion of DDL operations.
* @return New node.
*/
private static IgniteEx ignitionStart(IgniteConfiguration cfg, final CountDownLatch latch) {
// Have to do this for each starting node - see GridQueryProcessor ctor, it nulls
// idxCls static field on each call.
GridQueryProcessor.idxCls = BlockingIndexing.class;
IgniteEx node = (IgniteEx) Ignition.start(cfg);
if (latch != null)
node.context().discovery().setCustomEventListener(SchemaFinishDiscoveryMessage.class, new CustomEventListener<SchemaFinishDiscoveryMessage>() {
@Override
public void onCustomEvent(AffinityTopologyVersion topVer, ClusterNode snd, SchemaFinishDiscoveryMessage msg) {
latch.countDown();
}
});
return node;
}
Aggregations