Java Code Examples for org.apache.ignite.configuration.IgniteConfiguration#setIncludeEventTypes()
The following examples show how to use
org.apache.ignite.configuration.IgniteConfiguration#setIncludeEventTypes() .
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: IgniteCacheQueryNodeRestartSelfTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration c = super.getConfiguration(igniteInstanceName); c.setConsistentId(igniteInstanceName); CacheConfiguration<?, ?> cc = defaultCacheConfiguration(); cc.setCacheMode(PARTITIONED); cc.setBackups(1); cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); cc.setAtomicityMode(TRANSACTIONAL); cc.setRebalanceMode(SYNC); cc.setAffinity(new RendezvousAffinityFunction(false, 15)); cc.setIndexedTypes( Integer.class, Integer.class ); c.setCacheConfiguration(cc); c.setIncludeEventTypes(EventType.EVTS_ALL); return c; }
Example 2
Source File: IgniteCacheBinaryObjectsScanSelfTest.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.setIncludeEventTypes(getIncludeEventTypes()); cfg.setMarshaller(null); cfg.setPeerClassLoadingEnabled(false); if ("client".equals(igniteInstanceName)) cfg.setClassLoader(ldr); return cfg; }
Example 3
Source File: IgniteCacheAbstractQuerySelfTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration c = super.getConfiguration(igniteInstanceName); ((TcpDiscoverySpi)c.getDiscoverySpi()).setForceServerMode(true); if (igniteInstanceName.startsWith("client")) c.setDataStorageConfiguration(new DataStorageConfiguration()); c.setIncludeEventTypes(EventType.EVTS_ALL); return c; }
Example 4
Source File: HadoopSecondaryFileSystemConfigurationTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); discoSpi.setIpFinder(IP_FINDER); cfg.setDiscoverySpi(discoSpi); cfg.setFileSystemConfiguration(fsConfiguration(igniteInstanceName)); cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED); cfg.setCommunicationSpi(communicationSpi()); return cfg; }
Example 5
Source File: AbstractReadRepairTest.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.setIncludeEventTypes(EventType.EVTS_ALL); return cfg; }
Example 6
Source File: WalCompactionAfterRestartTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String name) throws Exception { IgniteConfiguration cfg = super.getConfiguration(name); cfg.setDataStorageConfiguration(new DataStorageConfiguration() .setDefaultDataRegionConfiguration(new DataRegionConfiguration() .setPersistenceEnabled(true) .setMaxSize(200L * 1024 * 1024)) .setWalMode(WALMode.LOG_ONLY) .setWalSegmentSize(512 * 1024) .setWalCompactionEnabled(true) .setMaxWalArchiveSize(2 * 512 * 1024) ); CacheConfiguration ccfg = new CacheConfiguration(); ccfg.setName(DEFAULT_CACHE_NAME); ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); ccfg.setAffinity(new RendezvousAffinityFunction(false, 16)); ccfg.setBackups(0); cfg.setCacheConfiguration(ccfg); cfg.setConsistentId(name); cfg.setIncludeEventTypes(EVT_WAL_SEGMENT_COMPACTED); return cfg; }
Example 7
Source File: GridEventStorageRuntimeConfigurationSelfTest.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.setIncludeEventTypes(inclEvtTypes); return cfg; }
Example 8
Source File: CacheGroupsMetricsRebalanceTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration cfg1 = new CacheConfiguration() .setName(CACHE1) .setGroupName(GROUP) .setCacheMode(CacheMode.PARTITIONED) .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) .setRebalanceMode(CacheRebalanceMode.ASYNC) .setRebalanceBatchSize(100) .setStatisticsEnabled(true); CacheConfiguration cfg2 = new CacheConfiguration(cfg1) .setName(CACHE2); CacheConfiguration cfg3 = new CacheConfiguration() .setName(CACHE3) .setCacheMode(CacheMode.PARTITIONED) .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) .setRebalanceMode(CacheRebalanceMode.ASYNC) .setRebalanceBatchSize(100) .setStatisticsEnabled(true) .setRebalanceDelay(REBALANCE_DELAY); CacheConfiguration cfg4 = new CacheConfiguration() .setAffinity(new RendezvousAffinityFunction()) .setRebalanceMode(CacheRebalanceMode.ASYNC) .setName(CACHE4) .setCacheMode(CacheMode.REPLICATED) .setGroupName(GROUP2); CacheConfiguration cfg5 = new CacheConfiguration(cfg4) .setName(CACHE5); cfg.setCacheConfiguration(cfg1, cfg2, cfg3, cfg4, cfg5); cfg.setIncludeEventTypes(EventType.EVTS_ALL); cfg.setCommunicationSpi(new TestRecordingCommunicationSpi()); return cfg; }
Example 9
Source File: GridCachePartitionedUnloadEventsSelfTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration<?, ?> ccfg = cacheConfiguration(); CacheConfiguration<?, ?> ccfgEvtsDisabled = new CacheConfiguration<>(ccfg); ccfgEvtsDisabled.setName(DEFAULT_CACHE_NAME_EVTS_DISABLED); ccfgEvtsDisabled.setEventsDisabled(true); cfg.setCacheConfiguration(ccfg, ccfgEvtsDisabled); cfg.setIncludeEventTypes(EventType.EVTS_ALL); return cfg; }
Example 10
Source File: CacheGroupMetricsTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration cCfg1 = new CacheConfiguration() .setName("cache1") .setGroupName("group1") .setCacheMode(CacheMode.PARTITIONED) .setBackups(3) .setAffinity(new RoundRobinVariableSizeAffinityFunction()) .setAtomicityMode(atomicityMode()); CacheConfiguration cCfg2 = new CacheConfiguration() .setName("cache2") .setGroupName("group2") .setCacheMode(CacheMode.REPLICATED) .setAtomicityMode(atomicityMode()); CacheConfiguration cCfg3 = new CacheConfiguration() .setName("cache3") .setGroupName("group2") .setCacheMode(CacheMode.REPLICATED) .setAtomicityMode(atomicityMode()); CacheConfiguration cCfg4 = new CacheConfiguration() .setName("cache4") .setCacheMode(CacheMode.PARTITIONED) .setAtomicityMode(atomicityMode()); cfg.setCacheConfiguration(cCfg1, cCfg2, cCfg3, cCfg4); cfg.setGridLogger(testLog); if (pds) { cfg.setDataStorageConfiguration(new DataStorageConfiguration() .setDefaultDataRegionConfiguration(new DataRegionConfiguration() .setPersistenceEnabled(true) .setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_INITIAL_SIZE) .setMetricsEnabled(true) ).setMetricsEnabled(true) ); } cfg.setIncludeEventTypes(EventType.EVTS_ALL); return cfg; }
Example 11
Source File: IgniteCacheClientNodePartitionsExchangeTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true); CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); cfg.setCacheConfiguration(ccfg); cfg.setCommunicationSpi(new TestCommunicationSpi()); cfg.setIncludeEventTypes(EventType.EVT_CACHE_REBALANCE_STARTED, EventType.EVT_CACHE_REBALANCE_STOPPED); return cfg; }
Example 12
Source File: IgniteCachePutRetryAbstractSelfTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setIncludeEventTypes(); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); AtomicConfiguration acfg = new AtomicConfiguration(); acfg.setBackups(1); cfg.setAtomicConfiguration(acfg); cfg.setIncludeEventTypes(new int[0]); return cfg; }
Example 13
Source File: HadoopIgfs20FileSystemAbstractSelfTest.java From ignite with Apache License 2.0 | 4 votes |
/** * Starts the nodes for this test. * * @throws Exception If failed. */ private void startNodes() throws Exception { if (mode != PRIMARY) { // Start secondary IGFS. FileSystemConfiguration igfsCfg = new FileSystemConfiguration(); igfsCfg.setName("igfs_secondary"); igfsCfg.setIpcEndpointConfiguration(secondaryIpcEndpointConfiguration()); igfsCfg.setManagementPort(-1); igfsCfg.setBlockSize(512 * 1024); igfsCfg.setPrefetchBlocks(1); CacheConfiguration dataCacheCfg = defaultCacheConfiguration(); dataCacheCfg.setName("partitioned"); dataCacheCfg.setCacheMode(PARTITIONED); dataCacheCfg.setNearConfiguration(null); dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(GRP_SIZE)); dataCacheCfg.setBackups(0); dataCacheCfg.setAtomicityMode(TRANSACTIONAL); CacheConfiguration metaCacheCfg = defaultCacheConfiguration(); metaCacheCfg.setName("replicated"); metaCacheCfg.setCacheMode(REPLICATED); metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); metaCacheCfg.setAtomicityMode(TRANSACTIONAL); igfsCfg.setDataCacheConfiguration(dataCacheCfg); igfsCfg.setMetaCacheConfiguration(metaCacheCfg); IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setIgniteInstanceName("grid_secondary"); TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true)); cfg.setDiscoverySpi(discoSpi); cfg.setCacheConfiguration(metaCacheCfg, dataCacheCfg); cfg.setFileSystemConfiguration(igfsCfg); cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED); cfg.setLocalHost(U.getLocalHost().getHostAddress()); cfg.setCommunicationSpi(communicationSpi()); G.start(cfg); } startGrids(4); awaitPartitionMapExchange(); }
Example 14
Source File: GridCacheBasicApiAbstractTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); TcpDiscoverySpi disco = new TcpDiscoverySpi(); disco.setIpFinder(new TcpDiscoveryVmIpFinder(true)); cfg.setDiscoverySpi(disco); cfg.setIncludeEventTypes(EventType.EVTS_ALL); return cfg; }
Example 15
Source File: GridEventConsumeSelfTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setConsistentId(igniteInstanceName); cfg.setIncludeEventTypes(EventType.EVTS_ALL); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); if (include) cfg.setUserAttributes(F.asMap("include", true)); return cfg; }
Example 16
Source File: IgniteDataStreamerPerformanceTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setIncludeProperties(); cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED); cfg.setConnectorConfiguration(null); cfg.setPeerClassLoadingEnabled(true); if (useCache) { CacheConfiguration cc = defaultCacheConfiguration(); cc.setCacheMode(PARTITIONED); cc.setNearConfiguration(null); cc.setWriteSynchronizationMode(FULL_SYNC); cc.setBackups(1); cfg.setCacheSanityCheckEnabled(false); cfg.setCacheConfiguration(cc); } else cfg.setCacheConfiguration(); return cfg; }
Example 17
Source File: TaskEventSubjectIdSelfTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setConnectorConfiguration(new ConnectorConfiguration()); cfg.setIncludeEventTypes(EventType.EVTS_ALL); return cfg; }
Example 18
Source File: IgniteHadoopFileSystemIpcCacheSelfTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); FileSystemConfiguration igfsCfg = new FileSystemConfiguration(); igfsCfg.setName("igfs"); igfsCfg.setManagementPort(FileSystemConfiguration.DFLT_MGMT_PORT + cnt); igfsCfg.setDataCacheConfiguration(dataCacheConfiguration()); igfsCfg.setMetaCacheConfiguration(metaCacheConfiguration()); IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration(); endpointCfg.setType(IgfsIpcEndpointType.SHMEM); endpointCfg.setPort(IpcSharedMemoryServerEndpoint.DFLT_IPC_PORT + cnt); igfsCfg.setIpcEndpointConfiguration(endpointCfg); igfsCfg.setBlockSize(512 * 1024); // Together with group blocks mapper will yield 64M per node groups. cfg.setFileSystemConfiguration(igfsCfg); cfg.setCacheConfiguration(dataCacheConfiguration()); cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED); TcpCommunicationSpi commSpi = new TcpCommunicationSpi(); commSpi.setSharedMemoryPort(-1); cfg.setCommunicationSpi(commSpi); cnt++; return cfg; }
Example 19
Source File: AgentClusterDemo.java From ignite with Apache License 2.0 | 2 votes |
/** * Configure node. * * @param basePort Base port. * @param gridIdx Ignite instance name index. * @param client If {@code true} then start client node. * @return IgniteConfiguration */ private static IgniteConfiguration igniteConfiguration(int basePort, int gridIdx, boolean client) throws IgniteCheckedException { IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setGridLogger(new Slf4jLogger()); cfg.setIgniteInstanceName((client ? CLN_NODE_NAME : SRV_NODE_NAME) + gridIdx); cfg.setLocalHost("127.0.0.1"); cfg.setEventStorageSpi(new MemoryEventStorageSpi()); cfg.setConsistentId(cfg.getIgniteInstanceName()); File workDir = new File(U.workDirectory(null, null), "demo-work"); cfg.setWorkDirectory(workDir.getAbsolutePath()); int[] evts = new int[EVTS_DISCOVERY.length + VISOR_TASK_EVTS.length]; System.arraycopy(EVTS_DISCOVERY, 0, evts, 0, EVTS_DISCOVERY.length); System.arraycopy(VISOR_TASK_EVTS, 0, evts, EVTS_DISCOVERY.length, VISOR_TASK_EVTS.length); cfg.setIncludeEventTypes(evts); cfg.getConnectorConfiguration().setPort(basePort); System.setProperty(IGNITE_JETTY_PORT, String.valueOf(basePort + 10)); TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(); int discoPort = basePort + 20; ipFinder.setAddresses(Collections.singletonList("127.0.0.1:" + discoPort + ".." + (discoPort + NODE_CNT - 1))); // Configure discovery SPI. TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); discoSpi.setLocalPort(discoPort); discoSpi.setIpFinder(ipFinder); cfg.setDiscoverySpi(discoSpi); TcpCommunicationSpi commSpi = new TcpCommunicationSpi(); commSpi.setSharedMemoryPort(-1); commSpi.setMessageQueueLimit(10); int commPort = basePort + 30; commSpi.setLocalPort(commPort); cfg.setCommunicationSpi(commSpi); cfg.setGridLogger(new Slf4jLogger(log)); cfg.setMetricsLogFrequency(0); DataRegionConfiguration dataRegCfg = new DataRegionConfiguration(); dataRegCfg.setName("demo"); dataRegCfg.setMetricsEnabled(true); dataRegCfg.setMaxSize(DFLT_DATA_REGION_INITIAL_SIZE); dataRegCfg.setPersistenceEnabled(true); DataStorageConfiguration dataStorageCfg = new DataStorageConfiguration(); dataStorageCfg.setMetricsEnabled(true); dataStorageCfg.setStoragePath(PdsConsistentIdProcessor.DB_DEFAULT_FOLDER); dataStorageCfg.setDefaultDataRegionConfiguration(dataRegCfg); dataStorageCfg.setSystemRegionMaxSize(DFLT_DATA_REGION_INITIAL_SIZE); dataStorageCfg.setWalMode(LOG_ONLY); dataStorageCfg.setWalSegments(WAL_SEGMENTS); dataStorageCfg.setWalSegmentSize(WAL_SEGMENT_SZ); cfg.setDataStorageConfiguration(dataStorageCfg); cfg.setClientMode(client); return cfg; }
Example 20
Source File: IpcSharedMemoryNodeStartup.java From ignite with Apache License 2.0 | 2 votes |
/** * @param args Args. * @throws Exception If failed. */ public static void main(String[] args) throws Exception { IgniteConfiguration cfg = new IgniteConfiguration(); FileSystemConfiguration igfsCfg = new FileSystemConfiguration(); TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true)); cfg.setDiscoverySpi(discoSpi); IgfsIpcEndpointConfiguration endpointCfg = new IgfsIpcEndpointConfiguration(); endpointCfg.setType(IgfsIpcEndpointType.SHMEM); endpointCfg.setPort(10500); igfsCfg.setIpcEndpointConfiguration(endpointCfg); igfsCfg.setName("igfs"); CacheConfiguration metaCacheCfg = new CacheConfiguration(); metaCacheCfg.setName("partitioned"); metaCacheCfg.setCacheMode(PARTITIONED); metaCacheCfg.setNearConfiguration(null); metaCacheCfg.setWriteSynchronizationMode(FULL_SYNC); metaCacheCfg.setEvictionPolicy(null); metaCacheCfg.setBackups(0); CacheConfiguration dataCacheCfg = new CacheConfiguration(); dataCacheCfg.setName("partitioned"); dataCacheCfg.setCacheMode(PARTITIONED); dataCacheCfg.setNearConfiguration(null); dataCacheCfg.setWriteSynchronizationMode(FULL_SYNC); dataCacheCfg.setEvictionPolicy(null); dataCacheCfg.setBackups(0); igfsCfg.setMetaCacheConfiguration(metaCacheCfg); igfsCfg.setDataCacheConfiguration(dataCacheCfg); cfg.setFileSystemConfiguration(igfsCfg); cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED); try (Ignite ignored = G.start(cfg)) { X.println("Press any key to stop grid..."); System.in.read(); } }