当前位置: 首页>>代码示例>>Java>>正文


Java IgniteConfiguration.setIncludeEventTypes方法代码示例

本文整理汇总了Java中org.apache.ignite.configuration.IgniteConfiguration.setIncludeEventTypes方法的典型用法代码示例。如果您正苦于以下问题:Java IgniteConfiguration.setIncludeEventTypes方法的具体用法?Java IgniteConfiguration.setIncludeEventTypes怎么用?Java IgniteConfiguration.setIncludeEventTypes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ignite.configuration.IgniteConfiguration的用法示例。


在下文中一共展示了IgniteConfiguration.setIncludeEventTypes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@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(igfsConfiguration(igniteInstanceName));
    cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
    cfg.setLocalHost("127.0.0.1");
    cfg.setCommunicationSpi(communicationSpi());

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:17,代码来源:HadoopIgfs20FileSystemAbstractSelfTest.java

示例2: copyDefaultsFromSource

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * @param cfg Config.
 * @param srcCfg Source config.
 */
private static void copyDefaultsFromSource(IgniteConfiguration cfg, IgniteConfiguration srcCfg) {
    cfg.setIgniteInstanceName(srcCfg.getIgniteInstanceName());
    cfg.setGridLogger(srcCfg.getGridLogger());
    cfg.setNodeId(srcCfg.getNodeId());
    cfg.setIgniteHome(srcCfg.getIgniteHome());
    cfg.setMBeanServer(srcCfg.getMBeanServer());
    cfg.setMetricsLogFrequency(srcCfg.getMetricsLogFrequency());
    cfg.setConnectorConfiguration(srcCfg.getConnectorConfiguration());
    cfg.setCommunicationSpi(srcCfg.getCommunicationSpi());
    cfg.setNetworkTimeout(srcCfg.getNetworkTimeout());
    cfg.setDiscoverySpi(srcCfg.getDiscoverySpi());
    cfg.setCheckpointSpi(srcCfg.getCheckpointSpi());
    cfg.setIncludeEventTypes(srcCfg.getIncludeEventTypes());

    // Specials.
    ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true);
    cfg.getTransactionConfiguration().setTxSerializableEnabled(true);
}
 
开发者ID:apache,项目名称:ignite,代码行数:24,代码来源:ConfigVariationsFactory.java

示例3: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);

    ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true);

    int[] evtTypes = cfg.getIncludeEventTypes();

    if (evtTypes == null || evtTypes.length == 0)
        cfg.setIncludeEventTypes(EventType.EVT_CACHE_OBJECT_READ);
    else {
        for (int evtType : evtTypes) {
            if (evtType == EventType.EVT_CACHE_OBJECT_READ)
                return cfg;
        }

        int[] updatedEvtTypes = Arrays.copyOf(evtTypes, evtTypes.length + 1);

        updatedEvtTypes[updatedEvtTypes.length - 1] = EventType.EVT_CACHE_OBJECT_READ;
    }

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:26,代码来源:GridCacheAbstractFullApiSelfTest.java

示例4: buildComponent

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
protected IgniteComponent buildComponent() {
    IgniteConfiguration config = new IgniteConfiguration();
    config.setGridName(UUID.randomUUID().toString());
    config.setIncludeEventTypes(EventType.EVT_JOB_FINISHED, EventType.EVT_JOB_RESULTED);
    config.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(LOCAL_IP_FINDER));
    
    return IgniteComponent.fromConfiguration(config);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:9,代码来源:AbstractIgniteTest.java

示例5: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setIncludeEventTypes();

    cfg.setMarshaller(null);

    ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);

    RendezvousAffinityFunction aff = new RendezvousAffinityFunction();
    aff.setPartitions(3000);

    CacheConfiguration<Object, Object> parentCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
    parentCfg.setAffinity(aff);
    parentCfg.setAtomicityMode(TRANSACTIONAL);
    parentCfg.setCacheMode(PARTITIONED);
    parentCfg.setBackups(2);
    parentCfg.setWriteSynchronizationMode(FULL_SYNC);

    cfg.setCacheConfiguration(
        getTraderCfg(parentCfg),
        getDepositCfg(parentCfg),
        getDepositHistoryCfg(parentCfg)
    );

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:29,代码来源:IgniteCacheQueriesLoadTest1.java

示例6: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("deprecation")
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setIncludeEventTypes(inclEvtTypes);

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:10,代码来源:GridEventStorageRuntimeConfigurationSelfTest.java

示例7: buildComponent

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
@Override
protected IgniteComponent buildComponent() {
    IgniteConfiguration config = new IgniteConfiguration();
    config.setIncludeEventTypes(EventType.EVTS_ALL_MINUS_METRIC_UPDATE);
    return IgniteComponent.fromConfiguration(config);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:7,代码来源:IgniteEventsTest.java

示例8: startNodes

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * 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();
}
 
开发者ID:apache,项目名称:ignite,代码行数:59,代码来源:HadoopIgfs20FileSystemAbstractSelfTest.java

示例9: startSecondary

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * Starts secondary IGFS
 */
private void startSecondary() {
    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();

    igfsCfg.setName("igfs_secondary");
    igfsCfg.setIpcEndpointConfiguration(SECONDARY_ENDPOINT_CFG);
    igfsCfg.setBlockSize(512 * 1024);
    igfsCfg.setPrefetchBlocks(1);

    CacheConfiguration dataCacheCfg = defaultCacheConfiguration();

    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.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.setFileSystemConfiguration(igfsCfg);
    cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);

    cfg.setCommunicationSpi(communicationSpi());

    G.start(cfg);
}
 
开发者ID:apache,项目名称:ignite,代码行数:46,代码来源:HadoopSecondaryFileSystemConfigurationTest.java

示例10: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration() throws Exception {
    IgniteConfiguration c = super.getConfiguration();

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(ipFinder);

    c.setDiscoverySpi(disco);

    CacheConfiguration cc = defaultCacheConfiguration();

    cc.setCacheMode(cacheMode());
    cc.setAtomicityMode(atomicityMode());
    cc.setEvictionPolicy(new FifoEvictionPolicy());
    cc.setOnheapCacheEnabled(true);

    c.setCacheConfiguration(cc);

    c.setIncludeEventTypes(EVT_CACHE_ENTRY_EVICTED, EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);

    return c;
}
 
开发者ID:apache,项目名称:ignite,代码行数:24,代码来源:GridCacheEvictionEventAbstractTest.java

示例11: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@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.setIncludeEventTypes(getIncludeEventTypes());

    cfg.setMarshaller(null);
    cfg.setPeerClassLoadingEnabled(false);

    if ("client".equals(igniteInstanceName)) {
        cfg.setClientMode(true);

        cfg.setClassLoader(ldr);
    }

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:23,代码来源:IgniteCacheBinaryObjectsScanSelfTest.java

示例12: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    TcpDiscoverySpi spi = new TcpDiscoverySpi();

    spi.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(spi);

    int[] evts = {EVT_NODE_JOINED, EVT_NODE_FAILED, EVT_NODE_LEFT};

    cfg.setIncludeEventTypes(evts);

    Map<IgnitePredicate<? extends Event>, int[]> lsnrs = new HashMap<>();

    lsnrs.put(new TestEventListener(), evts);

    cfg.setLocalEventListeners(lsnrs);

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:23,代码来源:TcpDiscoveryRestartTest.java

示例13: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);

    if (client) {
        cfg.setClientMode(true);

        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true);
    }

    cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE_NAME, testAttribute));

    CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

    cacheCfg.setCacheMode(CacheMode.REPLICATED);

    cacheCfg.setName(STATIC_CACHE_NAME);

    cfg.setCacheConfiguration(cacheCfg);

    cfg.setIncludeEventTypes(EventType.EVT_CACHE_STARTED, EventType.EVT_CACHE_STOPPED, EventType.EVT_CACHE_NODES_LEFT);

    if (daemon)
        cfg.setDaemon(true);

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:32,代码来源:IgniteDynamicCacheStartSelfTest.java

示例14: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder).setForceServerMode(true);

    if (addTemplate) {
        CacheConfiguration dfltCfg = new CacheConfiguration("*");

        dfltCfg.setAtomicityMode(TRANSACTIONAL);
        dfltCfg.setBackups(2);

        CacheConfiguration templateCfg1 = new CacheConfiguration(DEFAULT_CACHE_NAME);

        templateCfg1.setName(TEMPLATE1);
        templateCfg1.setBackups(3);

        CacheConfiguration templateCfg2 = new CacheConfiguration(DEFAULT_CACHE_NAME);

        templateCfg2.setName(TEMPLATE2);
        templateCfg2.setBackups(4);

        cfg.setCacheConfiguration(dfltCfg, templateCfg1, templateCfg2);
    }

    cfg.setClientMode(clientMode);

    cfg.setIncludeEventTypes(EventType.EVT_CACHE_REBALANCE_STARTED, EventType.EVT_CACHE_REBALANCE_STOPPED);

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:32,代码来源:IgniteCacheConfigurationTemplateTest.java

示例15: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER).setForceServerMode(true));

    FileSystemConfiguration igfsCfg = new FileSystemConfiguration();

    igfsCfg.setName("igfs");
    igfsCfg.setDataCacheConfiguration(cacheConfiguration(igniteInstanceName, "data"));
    igfsCfg.setMetaCacheConfiguration(cacheConfiguration(igniteInstanceName, "meta"));

    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.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);

    if (cnt == 0)
        cfg.setClientMode(true);

    cnt++;

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:33,代码来源:IgfsNearOnlyMultiNodeSelfTest.java


注:本文中的org.apache.ignite.configuration.IgniteConfiguration.setIncludeEventTypes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。