Search in sources :

Example 1 with JobStealingFailoverSpi

use of org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi in project ignite by apache.

the class GridJobStealingSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    JobStealingCollisionSpi colSpi = new JobStealingCollisionSpi();
    // One job at a time.
    colSpi.setActiveJobsThreshold(1);
    colSpi.setWaitJobsThreshold(0);
    JobStealingFailoverSpi failSpi = new JobStealingFailoverSpi();
    // Verify defaults.
    assert failSpi.getMaximumFailoverAttempts() == JobStealingFailoverSpi.DFLT_MAX_FAILOVER_ATTEMPTS;
    cfg.setCollisionSpi(colSpi);
    cfg.setFailoverSpi(failSpi);
    return cfg;
}
Also used : JobStealingCollisionSpi(org.apache.ignite.spi.collision.jobstealing.JobStealingCollisionSpi) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) JobStealingFailoverSpi(org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi)

Example 2 with JobStealingFailoverSpi

use of org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi 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;
}
Also used : JobStealingCollisionSpi(org.apache.ignite.spi.collision.jobstealing.JobStealingCollisionSpi) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) DiscoverySpi(org.apache.ignite.spi.discovery.DiscoverySpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi) JobStealingFailoverSpi(org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 3 with JobStealingFailoverSpi

use of org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi in project ignite by apache.

the class GridMultithreadedJobStealingSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    JobStealingCollisionSpi colSpi = new JobStealingCollisionSpi();
    // One job at a time.
    colSpi.setActiveJobsThreshold(1);
    colSpi.setWaitJobsThreshold(0);
    JobStealingFailoverSpi failSpi = new JobStealingFailoverSpi();
    // Verify defaults.
    assert failSpi.getMaximumFailoverAttempts() == JobStealingFailoverSpi.DFLT_MAX_FAILOVER_ATTEMPTS;
    cfg.setCollisionSpi(colSpi);
    cfg.setFailoverSpi(failSpi);
    return cfg;
}
Also used : JobStealingCollisionSpi(org.apache.ignite.spi.collision.jobstealing.JobStealingCollisionSpi) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) JobStealingFailoverSpi(org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi)

Example 4 with JobStealingFailoverSpi

use of org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi in project ignite by apache.

the class GridJobStealingZeroActiveJobsSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    JobStealingCollisionSpi colSpi = new JobStealingCollisionSpi();
    // One job at a time.
    colSpi.setActiveJobsThreshold(igniteInstanceName.endsWith("1") ? 0 : 2);
    colSpi.setWaitJobsThreshold(0);
    JobStealingFailoverSpi failSpi = new JobStealingFailoverSpi();
    // Verify defaults.
    assert failSpi.getMaximumFailoverAttempts() == JobStealingFailoverSpi.DFLT_MAX_FAILOVER_ATTEMPTS;
    cfg.setCollisionSpi(colSpi);
    cfg.setFailoverSpi(failSpi);
    return cfg;
}
Also used : JobStealingCollisionSpi(org.apache.ignite.spi.collision.jobstealing.JobStealingCollisionSpi) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) JobStealingFailoverSpi(org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi)

Aggregations

IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)4 JobStealingCollisionSpi (org.apache.ignite.spi.collision.jobstealing.JobStealingCollisionSpi)4 JobStealingFailoverSpi (org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi)4 DiscoverySpi (org.apache.ignite.spi.discovery.DiscoverySpi)1 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)1