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


Java CacheConfiguration.isReadThrough方法代码示例

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


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

示例1: VisorCacheStoreConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Create data transfer object for cache store configuration properties.
 *
 * @param ignite Ignite instance.
 * @param ccfg Cache configuration.
 */
public VisorCacheStoreConfiguration(IgniteEx ignite, CacheConfiguration ccfg) {
    IgniteCacheProxy<Object, Object> c = ignite.context().cache().jcache(ccfg.getName());

    CacheStore cstore = c != null && c.context().started() ? c.context().store().configuredStore() : null;

    jdbcStore = cstore instanceof CacheAbstractJdbcStore;

    store = compactClass(cstore);
    storeFactory = compactClass(ccfg.getCacheStoreFactory());

    readThrough = ccfg.isReadThrough();
    writeThrough = ccfg.isWriteThrough();

    writeBehindEnabled = ccfg.isWriteBehindEnabled();
    batchSz = ccfg.getWriteBehindBatchSize();
    flushFreq = ccfg.getWriteBehindFlushFrequency();
    flushSz = ccfg.getWriteBehindFlushSize();
    flushThreadCnt = ccfg.getWriteBehindFlushThreadCount();

    storeKeepBinary = ccfg.isStoreKeepBinary();

    writeBehindCoalescing = ccfg.getWriteBehindCoalescing();
}
 
开发者ID:apache,项目名称:ignite,代码行数:30,代码来源:VisorCacheStoreConfiguration.java

示例2: checkNotNullAllowed

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Performs checks to forbid cache configurations that are not compatible with NOT NULL query fields.
 * See {@link QueryEntity#setNotNullFields(Set)}.
 *
 * @param cfg Cache configuration.
 */
public static void checkNotNullAllowed(CacheConfiguration cfg) {
    if (cfg.isReadThrough())
        throw new IgniteSQLException("NOT NULL constraint is not supported when CacheConfiguration.readThrough " +
            "is enabled.", IgniteQueryErrorCode.UNSUPPORTED_OPERATION);

    if (cfg.getInterceptor() != null)
        throw new IgniteSQLException("NOT NULL constraint is not supported when CacheConfiguration.interceptor " +
            "is set.", IgniteQueryErrorCode.UNSUPPORTED_OPERATION);
}
 
开发者ID:apache,项目名称:ignite,代码行数:16,代码来源:QueryUtils.java

示例3: isReadThrough

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public boolean isReadThrough() {
    CacheConfiguration ccfg = cctx.config();

    return ccfg != null && ccfg.isReadThrough();
}
 
开发者ID:apache,项目名称:ignite,代码行数:7,代码来源:CacheMetricsImpl.java

示例4: initialize

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public void initialize(@Nullable CacheStore cfgStore, Map sesHolders) throws IgniteCheckedException {
    GridKernalContext ctx = igniteContext();
    CacheConfiguration cfg = cacheConfiguration();

    writeThrough = cfg.isWriteThrough();

    readThrough = cfg.isReadThrough();

    this.cfgStore = cfgStore;

    store = cacheStoreWrapper(ctx, cfgStore, cfg);

    singleThreadGate = store == null ? null : new CacheStoreBalancingWrapper<>(store,
        cfg.getStoreConcurrentLoadAllThreshold());

    ThreadLocal<SessionData> sesHolder0 = null;

    if (cfgStore != null) {
        sesHolder0 = ((Map<CacheStore, ThreadLocal>)sesHolders).get(cfgStore);

        if (sesHolder0 == null) {
            sesHolder0 = new ThreadLocal<>();

            locSes = new ThreadLocalSession(sesHolder0);

            if (ctx.resource().injectStoreSession(cfgStore, locSes))
                sesHolders.put(cfgStore, sesHolder0);
        }
        else
            locSes = new ThreadLocalSession(sesHolder0);
    }

    sesHolder = sesHolder0;

    locStore = U.hasAnnotation(cfgStore, CacheLocalStore.class);

    if (cfgStore instanceof CacheJdbcPojoStore)
        alwaysKeepBinary = true;
}
 
开发者ID:apache,项目名称:ignite,代码行数:42,代码来源:GridCacheStoreManagerAdapter.java

示例5: start0

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void start0() throws IgniteCheckedException {
    if (store instanceof LifecycleAware) {
        try {
            // Avoid second start() call on store in case when near cache is enabled.
            if (cctx.config().isWriteBehindEnabled()) {
                if (!cctx.isNear())
                    ((LifecycleAware)store).start();
            }
        }
        catch (Exception e) {
            throw new IgniteCheckedException("Failed to start cache store: " + e, e);
        }
    }

    CacheConfiguration cfg = cctx.config();

    if (cfgStore != null) {
        if (!cfg.isWriteThrough() && !cfg.isReadThrough()) {
            U.quietAndWarn(log,
                "Persistence store is configured, but both read-through and write-through are disabled. This " +
                "configuration makes sense if the store implements loadCache method only. If this is the " +
                "case, ignore this warning. Otherwise, fix the configuration for the cache: " + cfg.getName(),
                "Persistence store is configured, but both read-through and write-through are disabled " +
                "for cache: " + cfg.getName());
        }

        if (!cfg.isWriteThrough() && cfg.isWriteBehindEnabled()) {
            U.quietAndWarn(log,
                "To enable write-behind mode for the cache store it's also required to set " +
                "CacheConfiguration.setWriteThrough(true) property, otherwise the persistence " +
                "store will be never updated. Consider fixing configuration for the cache: " + cfg.getName(),
                "Write-behind mode for the cache store also requires CacheConfiguration.setWriteThrough(true) " +
                "property. Fix configuration for the cache: " + cfg.getName());
        }

        if (cctx.group().persistenceEnabled() && (cfg.isWriteThrough() || cfg.isReadThrough()))
            U.quietAndWarn(log,
                "Both Ignite native persistence and CacheStore are configured for cache '" + cfg.getName() + "'. " +
                "This configuration does not guarantee strict consistency between CacheStore and Ignite data " +
                "storage upon restarts. Consult documentation for more details.");
    }

    sesLsnrs = CU.startStoreSessionListeners(cctx.kernalContext(), cfg.getCacheStoreSessionListenerFactories());

    if (sesLsnrs == null) {
        sesLsnrs = cctx.shared().storeSessionListeners();

        globalSesLsnrs = true;
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:52,代码来源:GridCacheStoreManagerAdapter.java


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