use of org.apache.ignite.internal.processors.cache.binary.MetadataUpdateAcceptedMessage in project ignite by apache.
the class IgniteContinuousQueryMetadataUpdateTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TestTcpDiscoverySpi) cfg.getDiscoverySpi()).discoveryHook(new DiscoveryHook() {
@Override
public void beforeDiscovery(DiscoveryCustomMessage customMsg) {
if (customMsg instanceof MetadataUpdateAcceptedMessage) {
try {
U.sleep(50);
} catch (IgniteInterruptedCheckedException e) {
fail("Unexpected error:" + e);
}
}
}
});
cfg.setPeerClassLoadingEnabled(true);
return cfg;
}
use of org.apache.ignite.internal.processors.cache.binary.MetadataUpdateAcceptedMessage in project ignite by apache.
the class CacheRegisterMetadataLocallyTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setDiscoverySpi(new TcpDiscoverySpi() {
@Override
public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException {
if (msg instanceof CustomMessageWrapper) {
DiscoveryCustomMessage realMsg = ((CustomMessageWrapper) msg).delegate();
if (realMsg instanceof MetadataUpdateProposedMessage || realMsg instanceof MetadataUpdateAcceptedMessage)
customMessages.add(realMsg);
}
super.sendCustomEvent(msg);
}
});
cfg.setCommunicationSpi(new TcpCommunicationSpi() {
@Override
public void sendMessage(ClusterNode node, Message msg, IgniteInClosure<IgniteException> ackC) throws IgniteSpiException {
if (msg instanceof GridIoMessage)
communicationMessages.add(((GridIoMessage) msg).message());
super.sendMessage(node, msg, ackC);
}
@Override
public void sendMessage(ClusterNode node, Message msg) throws IgniteSpiException {
if (msg instanceof GridIoMessage)
communicationMessages.add(((GridIoMessage) msg).message());
super.sendMessage(node, msg);
}
});
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
cfg.setCacheConfiguration(cacheConfiguration(STATIC_CACHE_NAME, StaticKey.class, StaticValue.class));
return cfg;
}
Aggregations