use of org.apache.ignite.spi.discovery.DiscoverySpi in project ignite by apache.
the class GridifySingleSplitLoadTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration() throws Exception {
IgniteConfiguration cfg = super.getConfiguration();
/* Uncomment following code if you start it manually. */
CommunicationSpi commSpi = new TcpCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
DiscoverySpi discoSpi = new TcpDiscoverySpi();
cfg.setDiscoverySpi(discoSpi);
/*
*/
@SuppressWarnings("TypeMayBeWeakened") Log4JLogger log = (Log4JLogger) cfg.getGridLogger();
log.getLogger("org.apache.ignite").setLevel(Level.INFO);
return cfg;
}
use of org.apache.ignite.spi.discovery.DiscoverySpi in project ignite by apache.
the class TcpDiscoveryIpFinderAdapter method discoveryClientMode.
/**
* @return {@code True} if TCP discovery works in client mode.
*/
protected boolean discoveryClientMode() {
boolean clientMode;
Ignite ignite0 = ignite;
if (ignite0 != null) {
// Can be null if used in tests without starting Ignite.
DiscoverySpi discoSpi = ignite0.configuration().getDiscoverySpi();
if (!(discoSpi instanceof TcpDiscoverySpi))
throw new IgniteSpiException("TcpDiscoveryIpFinder should be used with TcpDiscoverySpi: " + discoSpi);
clientMode = ignite0.configuration().isClientMode() && !((TcpDiscoverySpi) discoSpi).isForceServerMode();
} else
clientMode = false;
return clientMode;
}
use of org.apache.ignite.spi.discovery.DiscoverySpi in project ignite by apache.
the class TcpDiscoverySnapshotHistoryTest method testHistorySupported.
/**
* @throws Exception If any error occurs.
*/
public void testHistorySupported() throws Exception {
try {
final Ignite g = startGrid();
DiscoverySpi spi = g.configuration().getDiscoverySpi();
DiscoverySpiHistorySupport ann = U.getAnnotation(spi.getClass(), DiscoverySpiHistorySupport.class);
assertNotNull("Spi does not have annotation for history support", ann);
assertTrue("History support is disabled for current spi", ann.value());
} finally {
stopGrid();
}
}
use of org.apache.ignite.spi.discovery.DiscoverySpi in project ignite by apache.
the class GridStealingLoadTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
JobStealingCollisionSpi colSpi = new JobStealingCollisionSpi();
assert colSpi.getActiveJobsThreshold() == JobStealingCollisionSpi.DFLT_ACTIVE_JOBS_THRESHOLD;
assert colSpi.getWaitJobsThreshold() == JobStealingCollisionSpi.DFLT_WAIT_JOBS_THRESHOLD;
// One job at a time.
colSpi.setActiveJobsThreshold(5);
colSpi.setWaitJobsThreshold(0);
colSpi.setMessageExpireTime(5000);
JobStealingFailoverSpi failSpi = new JobStealingFailoverSpi();
// Verify defaults.
assert failSpi.getMaximumFailoverAttempts() == JobStealingFailoverSpi.DFLT_MAX_FAILOVER_ATTEMPTS;
DiscoverySpi discoSpi = new TcpDiscoverySpi();
cfg.setDiscoverySpi(discoSpi);
cfg.setCollisionSpi(colSpi);
cfg.setFailoverSpi(failSpi);
return cfg;
}
use of org.apache.ignite.spi.discovery.DiscoverySpi in project ignite by apache.
the class GridCancelledJobsMetricsSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration() throws Exception {
IgniteConfiguration cfg = super.getConfiguration();
cfg.setCollisionSpi(colSpi);
DiscoverySpi discoSpi = cfg.getDiscoverySpi();
assert discoSpi instanceof TcpDiscoverySpi;
cfg.setMetricsUpdateFrequency(500);
return cfg;
}
Aggregations