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


Java U.maskName方法代码示例

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


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

示例1: validatePreloadOrder

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的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

示例2: validateTopology

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public IgniteCheckedException validateTopology(
    GridCacheSharedContext cctx,
    boolean read,
    GridDhtTopologyFuture topFut
) {
    if (cacheCtx == null)
        return null;

    Throwable err = topFut.validateCache(cacheCtx, recovery, read, null, entry);

    if (err != null) {
        return new IgniteCheckedException(
            "Failed to perform cache operation (cache topology is not valid): "
                + U.maskName(cacheCtx.name()), err);
    }

    if (CU.affinityNodes(cacheCtx, topFut.topologyVersion()).isEmpty()) {
        return new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all " +
            "partition nodes left the grid): " + cacheCtx.name());
    }

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

示例3: entryMapping

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * @param cacheName Cache name.
 * @param typeId Type id.
 * @return Entry mapping.
 * @throws CacheException If mapping for key was not found.
 */
private EntryMapping entryMapping(String cacheName, Object typeId) throws CacheException {
    Map<Object, EntryMapping> mappings = getOrCreateCacheMappings(cacheName);

    EntryMapping em = mappings.get(typeId);

    if (em == null) {
        String maskedCacheName = U.maskName(cacheName);

        throw new CacheException("Failed to find mapping description [cache=" + maskedCacheName +
            ", typeId=" + typeId + "]. Please configure JdbcType to associate cache '" + maskedCacheName +
            "' with JdbcPojoStore.");
    }

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

示例4: validateCacheConfiguration

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void validateCacheConfiguration(CacheConfiguration cfg) throws IgniteCheckedException {
    EvictionPolicy evictPlc = cfg.getEvictionPolicyFactory() != null ?
        (EvictionPolicy)cfg.getEvictionPolicyFactory().create()
        : cfg.getEvictionPolicy();

    if (evictPlc != null && evictPlc instanceof IgfsPerBlockLruEvictionPolicy) {
        EvictionFilter evictFilter = cfg.getEvictionFilter();

        if (evictFilter != null && !(evictFilter instanceof IgfsEvictionFilter))
            throw new IgniteCheckedException("Eviction filter cannot be set explicitly when using " +
                "IgfsPerBlockLruEvictionPolicy: " + U.maskName(cfg.getName()));
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:15,代码来源:IgfsHelperImpl.java

示例5: extractPojoParameter

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Get field value from POJO for use as query parameter.
 *
 * @param cacheName Cache name.
 * @param typeName Type name.
 * @param fldName Field name.
 * @param obj Cache object.
 * @return Field value from object.
 * @throws CacheException in case of error.
 */
@Nullable private Object extractPojoParameter(@Nullable String cacheName, String typeName, String fldName,
    Object obj) throws CacheException {
    try {
        Map<String, PojoPropertiesCache> cacheProps = pojosProps.get(cacheName);

        if (cacheProps == null)
            throw new CacheException("Failed to find POJO type metadata for cache: " + U.maskName(cacheName));

        PojoPropertiesCache ppc = cacheProps.get(typeName);

        if (ppc == null)
            throw new CacheException("Failed to find POJO type metadata for type: " + typeName);

        ClassProperty prop = ppc.props.get(fldName);

        if (prop == null)
            throw new CacheLoaderException("Failed to find property in POJO class [class=" + typeName +
                ", prop=" + fldName + "]");

        return prop.get(obj);
    }
    catch (Exception e) {
        throw new CacheException("Failed to read object property [cache=" + U.maskName(cacheName) +
            ", type=" + typeName + ", prop=" + fldName + "]", e);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:37,代码来源:CacheJdbcPojoStore.java

示例6: prepareBuilders

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Prepare internal store specific builders for provided types metadata.
 *
 * @param cacheName Cache name to prepare builders for.
 * @param types Collection of types.
 * @throws CacheException If failed to prepare internal builders for types.
 */
@Override protected void prepareBuilders(@Nullable String cacheName, Collection<JdbcType> types)
    throws CacheException {
    Map<String, PojoPropertiesCache> pojoProps = U.newHashMap(types.size() * 2);

    for (JdbcType type : types) {
        String keyTypeName = type.getKeyType();

        TypeKind keyKind = kindForName(keyTypeName);

        if (keyKind == TypeKind.POJO) {
            if (pojoProps.containsKey(keyTypeName))
                throw new CacheException("Found duplicate key type [cache=" + U.maskName(cacheName) +
                    ", keyType=" + keyTypeName + "]");

            pojoProps.put(keyTypeName, new PojoPropertiesCache(keyTypeName, type.getKeyFields()));
        }

        String valTypeName = type.getValueType();

        TypeKind valKind = kindForName(valTypeName);

        if (valKind == TypeKind.POJO)
            pojoProps.put(valTypeName, new PojoPropertiesCache(valTypeName, type.getValueFields()));
    }

    if (!pojoProps.isEmpty()) {
        Map<String, Map<String, PojoPropertiesCache>> newPojosProps = new HashMap<>(pojosProps);

        newPojosProps.put(cacheName, pojoProps);

        pojosProps = newPojosProps;
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:41,代码来源:CacheJdbcPojoStore.java

示例7: getName

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public String getName() {
    return U.maskName(memPlcCfg.getName());
}
 
开发者ID:apache,项目名称:ignite,代码行数:5,代码来源:DataRegionMetricsImpl.java

示例8: ackCacheConfiguration

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 *
 */
private void ackCacheConfiguration() {
    CacheConfiguration[] cacheCfgs = cfg.getCacheConfiguration();

    if (cacheCfgs == null || cacheCfgs.length == 0)
        U.warn(log, "Cache is not configured - in-memory data grid is off.");
    else {
        SB sb = new SB();

        HashMap<String, ArrayList<String>> memPlcNamesMapping = new HashMap<>();

        for (CacheConfiguration c : cacheCfgs) {
            String cacheName = U.maskName(c.getName());

            String memPlcName = c.getDataRegionName();

            if (CU.isSystemCache(cacheName))
                memPlcName = "sysMemPlc";
            else if (memPlcName == null && cfg.getDataStorageConfiguration() != null)
                memPlcName = cfg.getDataStorageConfiguration().getDefaultDataRegionConfiguration().getName();

            if (!memPlcNamesMapping.containsKey(memPlcName))
                memPlcNamesMapping.put(memPlcName, new ArrayList<String>());

            ArrayList<String> cacheNames = memPlcNamesMapping.get(memPlcName);

            cacheNames.add(cacheName);
        }

        for (Map.Entry<String, ArrayList<String>> e : memPlcNamesMapping.entrySet()) {
            sb.a("in '").a(e.getKey()).a("' dataRegion: [");

            for (String s : e.getValue())
                sb.a("'").a(s).a("', ");

            sb.d(sb.length() - 2, sb.length()).a("], ");
        }

        U.log(log, "Configured caches [" + sb.d(sb.length() - 2, sb.length()).toString() + ']');
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:44,代码来源:IgniteKernal.java

示例9: startInfo

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Startup info.
 *
 * @return Startup info.
 */
protected final String startInfo() {
    return "Cache started: " + U.maskName(ctx.config().getName());
}
 
开发者ID:apache,项目名称:ignite,代码行数:9,代码来源:GridCacheAdapter.java

示例10: stopInfo

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Stop info.
 *
 * @return Stop info.
 */
protected final String stopInfo() {
    return "Cache stopped: " + U.maskName(ctx.config().getName());
}
 
开发者ID:apache,项目名称:ignite,代码行数:9,代码来源:GridCacheAdapter.java


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