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


Java IgniteConfiguration.setCacheKeyConfiguration方法代码示例

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


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

示例1: getConfiguration

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

    CacheKeyConfiguration keyCfg = new CacheKeyConfiguration("MyCache", "affKey");

    cfg.setCacheKeyConfiguration(keyCfg);

    cfg.setPeerClassLoadingEnabled(false);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

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

示例2: getConfiguration

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

    CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(TestKey.class.getName(), "affKey");

    cfg.setCacheKeyConfiguration(keyCfg);

    cfg.setPeerClassLoadingEnabled(false);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

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

示例3: 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(IP_FINDER);

    CacheKeyConfiguration keyCfg = new CacheKeyConfiguration();

    keyCfg.setTypeName(TestKeyWithAffinity.class.getName());
    keyCfg.setAffinityKeyFieldName("affKey");

    cfg.setCacheKeyConfiguration(keyCfg);

    cfg.setClientMode(client);

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

示例4: getConfiguration

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

    if (customWorkSubDir != null)
        cfg.setWorkDirectory(Paths.get(U.defaultWorkDirectory(), customWorkSubDir).toString());

    cfg.setClientMode(clientMode);

    cfg.setDataStorageConfiguration(
        new DataStorageConfiguration()
            .setWalMode(WALMode.LOG_ONLY)
            .setDefaultDataRegionConfiguration(new DataRegionConfiguration()
                .setPersistenceEnabled(true)
                .setMaxSize(100 * 1024 * 1024))
    );

    BinaryConfiguration bCfg = new BinaryConfiguration();

    BinaryTypeConfiguration binaryEnumCfg = new BinaryTypeConfiguration(EnumType.class.getName());

    binaryEnumCfg.setEnum(true);
    binaryEnumCfg.setEnumValues(F.asMap(EnumType.ENUM_VAL_0.name(),
        EnumType.ENUM_VAL_0.ordinal(),
        EnumType.ENUM_VAL_1.name(),
        EnumType.ENUM_VAL_1.ordinal()));

    bCfg.setTypeConfigurations(Arrays.asList(binaryEnumCfg));

    cfg.setBinaryConfiguration(bCfg);

    CacheKeyConfiguration dynamicMetaKeyCfg = new CacheKeyConfiguration(DYNAMIC_TYPE_NAME, DYNAMIC_INT_FIELD_NAME);

    cfg.setCacheKeyConfiguration(dynamicMetaKeyCfg);

    cfg.setCacheConfiguration(new CacheConfiguration()
        .setName(CACHE_NAME)
        .setAffinity(new RendezvousAffinityFunction())
        .setCacheMode(CacheMode.REPLICATED));

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

示例5: getConfiguration

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

    BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();

    typeCfg.setTypeName(AffinityTestKey.class.getName());

    CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(AffinityTestKey.class.getName(), "affKey");

    cfg.setCacheKeyConfiguration(keyCfg);

    BinaryConfiguration bCfg = new BinaryConfiguration();

    bCfg.setTypeConfigurations(Collections.singleton(typeCfg));

    cfg.setBinaryConfiguration(bCfg);

    cfg.setMarshaller(new BinaryMarshaller());

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

示例6: getConfiguration

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

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(IP_FINDER);

    c.setDiscoverySpi(disco);

    c.setMarshaller(new BinaryMarshaller());

    List<CacheConfiguration> ccfgs = new ArrayList<>();

    CacheConfiguration ccfg = buildCacheConfiguration(gridName);

    if (ccfg != null)
        ccfgs.add(ccfg);

    ccfgs.add(buildCacheConfiguration(CACHE_PERSON));
    ccfgs.add(buildCacheConfiguration(CACHE_CALL));

    c.setCacheConfiguration(ccfgs.toArray(new CacheConfiguration[ccfgs.size()]));

    if (gridName.equals(NODE_CLIENT))
        c.setClientMode(true);

    c.setCacheKeyConfiguration(new CacheKeyConfiguration(CallKey.class));

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

示例7: getConfiguration

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

    BinaryMarshaller marsh = new BinaryMarshaller();

    BinaryConfiguration bCfg = new BinaryConfiguration();

    bCfg.setClassNames(Arrays.asList(TestObject1.class.getName(), TestObject2.class.getName()));

    BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();

    typeCfg.setTypeName(TestObject1.class.getName());

    CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(TestObject1.class.getName(), "val2");

    cfg.setCacheKeyConfiguration(keyCfg);

    bCfg.setTypeConfigurations(Arrays.asList(typeCfg));

    cfg.setBinaryConfiguration(bCfg);

    if (igniteInstanceName.equals(getTestIgniteInstanceName(gridCount() - 1)))
        cfg.setClientMode(true);

    cfg.setMarshaller(marsh);

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

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

示例8: getConfiguration

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

    BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();

    typeCfg.setTypeName(TestObject.class.getName());

    BinaryConfiguration bCfg = new BinaryConfiguration();

    bCfg.setTypeConfigurations(Collections.singleton(typeCfg));

    cfg.setBinaryConfiguration(bCfg);

    CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(TestObject.class.getName(), "affKey");
    CacheKeyConfiguration keyCfg2 = new CacheKeyConfiguration("TestObject2", "affKey");

    cfg.setCacheKeyConfiguration(keyCfg, keyCfg2);

    cfg.setMarshaller(new BinaryMarshaller());

    if (!igniteInstanceName.equals(getTestIgniteInstanceName(GRID_CNT))) {
        CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

        cacheCfg.setCacheMode(PARTITIONED);

        cfg.setCacheConfiguration(cacheCfg);
    }

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

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

示例9: getConfiguration

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

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(IP_FINDER);

    cfg.setDiscoverySpi(disco);

    CacheConfiguration cacheCfg = createCacheConfig();

    cacheCfg.setCacheStoreFactory(singletonFactory(new TestStore()));

    CacheConfiguration binKeysCacheCfg = createCacheConfig();

    binKeysCacheCfg.setCacheStoreFactory(singletonFactory(new MapCacheStoreStrategy.MapCacheStore()));
    binKeysCacheCfg.setStoreKeepBinary(true);
    binKeysCacheCfg.setName("BinKeysCache");

    cfg.setCacheConfiguration(cacheCfg, binKeysCacheCfg);
    cfg.setMarshaller(new BinaryMarshaller());

    List<BinaryTypeConfiguration> binTypes = new ArrayList<>();

    binTypes.add(new BinaryTypeConfiguration() {{
        setTypeName("ArrayHashedKey");
    }});

    BinaryConfiguration binCfg = new BinaryConfiguration();
    binCfg.setTypeConfigurations(binTypes);

    cfg.setBinaryConfiguration(binCfg);

    CacheKeyConfiguration arrayHashCfg = new CacheKeyConfiguration("ArrayHashedKey", "fld1");

    cfg.setCacheKeyConfiguration(arrayHashCfg);

    GridCacheBinaryObjectsAbstractSelfTest.cfg = cfg;

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


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