Java Code Examples for org.apache.ignite.configuration.IgniteConfiguration#setCollisionSpi()
The following examples show how to use
org.apache.ignite.configuration.IgniteConfiguration#setCollisionSpi() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GridMbeansMiscTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); if (collisionSpi != null) cfg.setCollisionSpi(collisionSpi); if (loadBalancingSpi != null) cfg.setLoadBalancingSpi(loadBalancingSpi); if (deploymentSpi != null) cfg.setDeploymentSpi(deploymentSpi); if (checkpointSpi != null) cfg.setCheckpointSpi(checkpointSpi); return cfg; }
Example 2
Source File: GridSessionCollisionSpiSelfTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration() throws Exception { IgniteConfiguration cfg = super.getConfiguration(); cfg.setCollisionSpi(new GridSessionCollisionSpi()); return cfg; }
Example 3
Source File: GridJobCollisionCancelSelfTest.java From ignite with Apache License 2.0 | 5 votes |
/** * @return Configuration. * @throws Exception If failed. */ @Override protected IgniteConfiguration getConfiguration() throws Exception { IgniteConfiguration cfg = super.getConfiguration(); cfg.setCollisionSpi(new GridTestCollision()); return cfg; }
Example 4
Source File: SystemViewComputeJobTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setCollisionSpi(new CancelCollisionSpi()); return cfg; }
Example 5
Source File: GridCollisionJobsContextSelfTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setCollisionSpi(new TestCollisionSpi()); return cfg; }
Example 6
Source File: IgnitionEx.java From ignite with Apache License 2.0 | 4 votes |
/** * Initialize default SPI implementations. * * @param cfg Ignite configuration. */ private void initializeDefaultSpi(IgniteConfiguration cfg) { if (cfg.getDiscoverySpi() == null) cfg.setDiscoverySpi(new TcpDiscoverySpi()); if (cfg.getDiscoverySpi() instanceof TcpDiscoverySpi) { TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi)cfg.getDiscoverySpi(); if (tcpDisco.getIpFinder() == null) tcpDisco.setIpFinder(new TcpDiscoveryMulticastIpFinder()); } if (cfg.getCommunicationSpi() == null) cfg.setCommunicationSpi(new TcpCommunicationSpi()); if (cfg.getDeploymentSpi() == null) cfg.setDeploymentSpi(new LocalDeploymentSpi()); if (cfg.getEventStorageSpi() == null) cfg.setEventStorageSpi(new NoopEventStorageSpi()); if (cfg.getCheckpointSpi() == null) cfg.setCheckpointSpi(new NoopCheckpointSpi()); if (cfg.getCollisionSpi() == null) cfg.setCollisionSpi(new NoopCollisionSpi()); if (cfg.getFailoverSpi() == null) cfg.setFailoverSpi(new AlwaysFailoverSpi()); if (cfg.getLoadBalancingSpi() == null) cfg.setLoadBalancingSpi(new RoundRobinLoadBalancingSpi()); else { Collection<LoadBalancingSpi> spis = new ArrayList<>(); boolean dfltLoadBalancingSpi = false; for (LoadBalancingSpi spi : cfg.getLoadBalancingSpi()) { spis.add(spi); if (!dfltLoadBalancingSpi && spi instanceof RoundRobinLoadBalancingSpi) dfltLoadBalancingSpi = true; } // Add default load balancing SPI for internal tasks. if (!dfltLoadBalancingSpi) spis.add(new RoundRobinLoadBalancingSpi()); cfg.setLoadBalancingSpi(spis.toArray(new LoadBalancingSpi[spis.size()])); } if (cfg.getIndexingSpi() == null) cfg.setIndexingSpi(new NoopIndexingSpi()); if (cfg.getEncryptionSpi() == null) cfg.setEncryptionSpi(new NoopEncryptionSpi()); if (F.isEmpty(cfg.getMetricExporterSpi())) cfg.setMetricExporterSpi(new NoopMetricExporterSpi()); if (F.isEmpty(cfg.getSystemViewExporterSpi())) { if (IgniteComponentType.INDEXING.inClassPath()) { try { cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi(), U.newInstance(SYSTEM_VIEW_SQL_SPI)); } catch (IgniteCheckedException e) { throw new IgniteException(e); } } else cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi()); } }
Example 7
Source File: IgniteCacheLockPartitionOnAffinityRunWithCollisionSpiTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CollisionSpi colSpi = new AlwaysCancelCollisionSpi(); cfg.setCollisionSpi(colSpi); return cfg; }
Example 8
Source File: TcpCommunicationSpiSkipMessageSendTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); if (!igniteInstanceName.contains("client")) { FifoQueueCollisionSpi collisionSpi = new FifoQueueCollisionSpi(); collisionSpi.setParallelJobsNumber(1); cfg.setCollisionSpi(collisionSpi); } cfg.setFailureDetectionTimeout(FAILURE_DETECTION_TIMEOUT); cfg.setSegmentationPolicy(SegmentationPolicy.NOOP); TcpCommunicationSpi commSpi = new CustomCommunicationSpi(); cfg.setCommunicationSpi(commSpi); TcpDiscoverySpi discoSpi = new CustomDiscoverySpi(); discoSpi.setIpFinder(LOCAL_IP_FINDER); discoSpi.setJoinTimeout(JOIN_TIMEOUT); cfg.setDiscoverySpi(discoSpi); return cfg; }
Example 9
Source File: GridTaskJobRejectSelfTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); FifoQueueCollisionSpi collision = new FifoQueueCollisionSpi(); collision.setParallelJobsNumber(1); cfg.setCollisionSpi(collision); cfg.setIncludeEventTypes(EventType.EVTS_ALL); return cfg; }