Search in sources :

Example 1 with CustomEventListener

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;
}
Also used : ClusterNode(org.apache.ignite.cluster.ClusterNode) AffinityTopologyVersion(org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion) IgniteEx(org.apache.ignite.internal.IgniteEx) SchemaFinishDiscoveryMessage(org.apache.ignite.internal.processors.query.schema.message.SchemaFinishDiscoveryMessage) CustomEventListener(org.apache.ignite.internal.managers.discovery.CustomEventListener)

Aggregations

ClusterNode (org.apache.ignite.cluster.ClusterNode)1 IgniteEx (org.apache.ignite.internal.IgniteEx)1 CustomEventListener (org.apache.ignite.internal.managers.discovery.CustomEventListener)1 AffinityTopologyVersion (org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion)1 SchemaFinishDiscoveryMessage (org.apache.ignite.internal.processors.query.schema.message.SchemaFinishDiscoveryMessage)1