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


Java CacheConfiguration.getName方法代码示例

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


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

示例1: registerCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void registerCache(CacheConfiguration<?, ?> cfg) throws IgniteCheckedException {
    String cacheLookupClsName = cfg.getTransactionManagerLookupClassName();

    if (cacheLookupClsName != null) {
        CacheTmLookup tmLookup = tmLookupRef.get();

        if (tmLookup == null) {
            tmLookup = createTmLookup(cacheLookupClsName);

            if (tmLookupRef.compareAndSet(null, tmLookup))
                return;

            tmLookup = tmLookupRef.get();
        }

        if (!cacheLookupClsName.equals(tmLookup.getClass().getName()))
            throw new IgniteCheckedException("Failed to start cache with CacheTmLookup that specified in cache " +
                "configuration, because node uses another CacheTmLookup [cache" + cfg.getName() +
                ", tmLookupClassName=" + cacheLookupClsName + ", tmLookupUsedByNode="
                + tmLookup.getClass().getName() + ']');
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:24,代码来源:CacheJtaManager.java

示例2: validatePreloadOrder

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Checks that preload-order-dependant caches has SYNC or ASYNC preloading mode.
 *
 * @param cfgs Caches.
 * @return Maximum detected preload order.
 * @throws IgniteCheckedException If validation failed.
 */
private int validatePreloadOrder(CacheConfiguration[] cfgs) throws IgniteCheckedException {
    int maxOrder = 0;

    for (CacheConfiguration cfg : cfgs) {
        int rebalanceOrder = cfg.getRebalanceOrder();

        if (rebalanceOrder > 0) {
            if (cfg.getCacheMode() == LOCAL)
                throw new IgniteCheckedException("Rebalance order set for local cache (fix configuration and restart the " +
                    "node): " + U.maskName(cfg.getName()));

            if (cfg.getRebalanceMode() == CacheRebalanceMode.NONE)
                throw new IgniteCheckedException("Only caches with SYNC or ASYNC rebalance mode can be set as rebalance " +
                    "dependency for other caches [cacheName=" + U.maskName(cfg.getName()) +
                    ", rebalanceMode=" + cfg.getRebalanceMode() + ", rebalanceOrder=" + cfg.getRebalanceOrder() + ']');

            maxOrder = Math.max(maxOrder, rebalanceOrder);
        }
        else if (rebalanceOrder < 0)
            throw new IgniteCheckedException("Rebalance order cannot be negative for cache (fix configuration and restart " +
                "the node) [cacheName=" + cfg.getName() + ", rebalanceOrder=" + rebalanceOrder + ']');
    }

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

示例3: CacheObjectBinaryContext

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param kernalCtx Kernal context.
 * @param ccfg Cache configuration.
 * @param binaryEnabled Binary enabled flag.
 * @param cpyOnGet Copy on get flag.
 * @param storeVal {@code True} if should store unmarshalled value in cache.
 * @param depEnabled {@code true} if deployment is enabled for the given cache.
 */
public CacheObjectBinaryContext(GridKernalContext kernalCtx,
    CacheConfiguration ccfg,
    boolean cpyOnGet,
    boolean storeVal,
    boolean binaryEnabled,
    boolean depEnabled) {
    super(kernalCtx,
        ccfg.getName(),
        binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper(ccfg.getKeyConfiguration()) :
            new GridCacheDefaultAffinityKeyMapper(),
        cpyOnGet,
        storeVal,
        depEnabled);

    this.binaryEnabled = binaryEnabled;
}
 
开发者ID:apache,项目名称:ignite,代码行数:25,代码来源:CacheObjectBinaryContext.java

示例4: cacheStoreWrapper

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
@SuppressWarnings({"unchecked"})
private CacheStore cacheStoreWrapper(GridKernalContext ctx,
    @Nullable CacheStore cfgStore,
    CacheConfiguration cfg) {
    if (cfgStore == null || !cfg.isWriteBehindEnabled())
        return cfgStore;

    GridCacheWriteBehindStore store = new GridCacheWriteBehindStore(this,
        ctx.igniteInstanceName(),
        cfg.getName(),
        ctx.log(GridCacheWriteBehindStore.class),
        cfgStore);

    store.setFlushSize(cfg.getWriteBehindFlushSize());
    store.setFlushThreadCount(cfg.getWriteBehindFlushThreadCount());
    store.setFlushFrequency(cfg.getWriteBehindFlushFrequency());
    store.setBatchSize(cfg.getWriteBehindBatchSize());
    store.setWriteCoalescing(cfg.getWriteBehindCoalescing());

    return store;
}
 
开发者ID:apache,项目名称:ignite,代码行数:22,代码来源:GridCacheStoreManagerAdapter.java

示例5: ackRebalanceConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 *
 */
private void ackRebalanceConfiguration() throws IgniteCheckedException {
    if (cfg.getSystemThreadPoolSize() <= cfg.getRebalanceThreadPoolSize())
        throw new IgniteCheckedException("Rebalance thread pool size exceed or equals System thread pool size. " +
            "Change IgniteConfiguration.rebalanceThreadPoolSize property before next start.");

    if (cfg.getRebalanceThreadPoolSize() < 1)
        throw new IgniteCheckedException("Rebalance thread pool size minimal allowed value is 1. " +
            "Change IgniteConfiguration.rebalanceThreadPoolSize property before next start.");

    for (CacheConfiguration ccfg : cfg.getCacheConfiguration()) {
        if (ccfg.getRebalanceBatchesPrefetchCount() < 1)
            throw new IgniteCheckedException("Rebalance batches prefetch count minimal allowed value is 1. " +
                "Change CacheConfiguration.rebalanceBatchesPrefetchCount property before next start. " +
                "[cache=" + ccfg.getName() + "]");
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:20,代码来源:IgniteKernal.java

示例6: executeForNodeAndCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** */
private void executeForNodeAndCache(CacheConfiguration ccfg, Ignite ignite, TestClosure clo,
    TransactionConcurrency concurrency, TransactionIsolation isolation) throws Exception {
    String cacheName = ccfg.getName();

    IgniteCache cache;

    if (ignite.configuration().isClientMode() &&
        ccfg.getCacheMode() == CacheMode.PARTITIONED &&
        ccfg.getNearConfiguration() != null)
        cache = ignite.getOrCreateNearCache(ccfg.getName(), ccfg.getNearConfiguration());
    else
        cache = ignite.cache(ccfg.getName());

    cache.removeAll();

    assertEquals(0, cache.size());

    clo.configure(ignite, cache, concurrency, isolation);

    log.info("Running test with node " + ignite.name() + ", cache " + cacheName);

    clo.key1 = 1;
    clo.key2 = 4;

    clo.run();
}
 
开发者ID:apache,项目名称:ignite,代码行数:28,代码来源:IgniteSqlNotNullConstraintTest.java

示例7: validateCacheGroupsAttributesMismatch

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param cfg1 Existing configuration.
 * @param cfg2 Cache configuration to start.
 * @param attrName Short attribute name for error message.
 * @param attrMsg Full attribute name for error message.
 * @param val1 Attribute value in existing configuration.
 * @param val2 Attribute value in starting configuration.
 * @param fail If true throws IgniteCheckedException in case of attribute values mismatch, otherwise logs warning.
 * @throws IgniteCheckedException If validation failed.
 */
public static void validateCacheGroupsAttributesMismatch(IgniteLogger log,
    CacheConfiguration cfg1,
    CacheConfiguration cfg2,
    String attrName,
    String attrMsg,
    Object val1,
    Object val2,
    boolean fail) throws IgniteCheckedException {
    if (F.eq(val1, val2))
        return;

    if (fail) {
        throw new IgniteCheckedException(attrMsg + " mismatch for caches related to the same group " +
            "[groupName=" + cfg1.getGroupName() +
            ", existingCache=" + cfg1.getName() +
            ", existing" + capitalize(attrName) + "=" + val1 +
            ", startingCache=" + cfg2.getName() +
            ", starting" + capitalize(attrName) + "=" + val2 + ']');
    }
    else {
        U.warn(log, attrMsg + " mismatch for caches related to the same group " +
            "[groupName=" + cfg1.getGroupName() +
            ", existingCache=" + cfg1.getName() +
            ", existing" + capitalize(attrName) + "=" + val1 +
            ", startingCache=" + cfg2.getName() +
            ", starting" + capitalize(attrName) + "=" + val2 + ']');
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:39,代码来源:GridCacheUtils.java

示例8: validateHashIdResolvers

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param node Joining node.
 * @return Validation result or {@code null} in case of success.
 */
@Nullable private IgniteNodeValidationResult validateHashIdResolvers(ClusterNode node) {
    if (!node.isClient()) {
        for (DynamicCacheDescriptor desc : cacheDescriptors().values()) {
            CacheConfiguration cfg = desc.cacheConfiguration();

            if (cfg.getAffinity() instanceof RendezvousAffinityFunction) {
                RendezvousAffinityFunction aff = (RendezvousAffinityFunction)cfg.getAffinity();

                Object nodeHashObj = aff.resolveNodeHash(node);

                for (ClusterNode topNode : ctx.discovery().allNodes()) {
                    Object topNodeHashObj = aff.resolveNodeHash(topNode);

                    if (nodeHashObj.hashCode() == topNodeHashObj.hashCode()) {
                        String errMsg = "Failed to add node to topology because it has the same hash code for " +
                            "partitioned affinity as one of existing nodes [cacheName=" +
                            cfg.getName() + ", existingNodeId=" + topNode.id() + ']';

                        String sndMsg = "Failed to add node to topology because it has the same hash code for " +
                            "partitioned affinity as one of existing nodes [cacheName=" +
                            cfg.getName() + ", existingNodeId=" + topNode.id() + ']';

                        return new IgniteNodeValidationResult(topNode.id(), errMsg, sndMsg);
                    }
                }
            }
        }
    }

    return null;
}
 
开发者ID:apache,项目名称:ignite,代码行数:36,代码来源:GridCacheProcessor.java

示例9: addTemplateRequest

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param ctx Context.
 * @param cfg0 Template configuration.
 * @return Request to add template.
 */
static DynamicCacheChangeRequest addTemplateRequest(GridKernalContext ctx, CacheConfiguration<?, ?> cfg0) {
    CacheConfiguration<?, ?> cfg = new CacheConfiguration<>(cfg0);

    DynamicCacheChangeRequest req = new DynamicCacheChangeRequest(UUID.randomUUID(), cfg.getName(), ctx.localNodeId());

    req.template(true);
    req.startCacheConfiguration(cfg);
    req.schema(new QuerySchema(cfg.getQueryEntities()));
    req.deploymentId(IgniteUuid.randomUuid());

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

示例10: addCacheOnJoin

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param cfg Cache configuration.
 * @param sql SQL flag.
 * @param caches Caches map.
 * @param templates Templates map.
 * @throws IgniteCheckedException If failed.
 */
private void addCacheOnJoin(CacheConfiguration<?, ?> cfg, boolean sql,
    Map<String, CacheInfo> caches,
    Map<String, CacheInfo> templates) throws IgniteCheckedException {
    String cacheName = cfg.getName();

    CU.validateCacheName(cacheName);

    cloneCheckSerializable(cfg);

    CacheObjectContext cacheObjCtx = ctx.cacheObjects().contextForCache(cfg);

    // Initialize defaults.
    initialize(cfg, cacheObjCtx);

    StoredCacheData cacheData = new StoredCacheData(cfg);

    cacheData.sql(sql);

    boolean template = cacheName.endsWith("*");

    if (!template) {
        if (caches.containsKey(cacheName)) {
            throw new IgniteCheckedException("Duplicate cache name found (check configuration and " +
                "assign unique name to each cache): " + cacheName);
        }

        CacheType cacheType = cacheType(cacheName);

        if (cacheType != CacheType.USER && cfg.getDataRegionName() == null)
            cfg.setDataRegionName(sharedCtx.database().systemDateRegionName());

        if (!cacheType.userCache())
            stopSeq.addLast(cacheName);
        else
            stopSeq.addFirst(cacheName);

        caches.put(cacheName, new CacheJoinNodeDiscoveryData.CacheInfo(cacheData, cacheType, cacheData.sql(), 0));
    }
    else
        templates.put(cacheName, new CacheJoinNodeDiscoveryData.CacheInfo(cacheData, CacheType.USER, false, 0));
}
 
开发者ID:apache,项目名称:ignite,代码行数:49,代码来源:GridCacheProcessor.java

示例11: VisorCacheConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Create data transfer object for cache configuration properties.
 *
 * @param ignite Grid.
 * @param ccfg Cache configuration.
 * @param dynamicDeploymentId Dynamic deployment ID.
 */
public VisorCacheConfiguration(IgniteEx ignite, CacheConfiguration ccfg, IgniteUuid dynamicDeploymentId) {
    name = ccfg.getName();
    grpName = ccfg.getGroupName();
    this.dynamicDeploymentId = dynamicDeploymentId;
    mode = ccfg.getCacheMode();
    atomicityMode = ccfg.getAtomicityMode();
    eagerTtl = ccfg.isEagerTtl();
    writeSynchronizationMode = ccfg.getWriteSynchronizationMode();
    invalidate = ccfg.isInvalidate();
    maxConcurrentAsyncOps = ccfg.getMaxConcurrentAsyncOperations();
    interceptor = compactClass(ccfg.getInterceptor());
    dfltLockTimeout = ccfg.getDefaultLockTimeout();
    qryEntities = VisorQueryEntity.list(ccfg.getQueryEntities());
    jdbcTypes = VisorCacheJdbcType.list(ccfg.getCacheStoreFactory());
    statisticsEnabled = ccfg.isStatisticsEnabled();
    mgmtEnabled = ccfg.isManagementEnabled();
    ldrFactory = compactClass(ccfg.getCacheLoaderFactory());
    writerFactory = compactClass(ccfg.getCacheWriterFactory());
    expiryPlcFactory = compactClass(ccfg.getExpiryPolicyFactory());

    sys = ignite.context().cache().systemCache(ccfg.getName());
    storeKeepBinary = ccfg.isStoreKeepBinary();
    onheapCache = ccfg.isOnheapCacheEnabled();
    partLossPlc = ccfg.getPartitionLossPolicy();
    qryParallelism = ccfg.getQueryParallelism();

    affinityCfg = new VisorCacheAffinityConfiguration(ccfg);
    rebalanceCfg = new VisorCacheRebalanceConfiguration(ccfg);
    evictCfg = new VisorCacheEvictionConfiguration(ccfg);
    nearCfg = new VisorCacheNearConfiguration(ccfg);

    storeCfg = new VisorCacheStoreConfiguration(ignite, ccfg);

    qryCfg = new VisorQueryConfiguration(ccfg);

    cpOnRead = ccfg.isCopyOnRead();
    evictFilter = compactClass(ccfg.getEvictionFilter());
    lsnrConfigurations = compactIterable(ccfg.getCacheEntryListenerConfigurations());
    loadPrevVal = ccfg.isLoadPreviousValue();
    dataRegName = ccfg.getDataRegionName();
    sqlIdxMaxInlineSize = ccfg.getSqlIndexMaxInlineSize();
    nodeFilter = compactClass(ccfg.getNodeFilter());
    qryDetailMetricsSz = ccfg.getQueryDetailMetricsSize();
    readFromBackup = ccfg.isReadFromBackup();
    tmLookupClsName = ccfg.getTransactionManagerLookupClassName();
    topValidator = compactClass(ccfg.getTopologyValidator());
}
 
开发者ID:apache,项目名称:ignite,代码行数:55,代码来源:VisorCacheConfiguration.java


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