Search in sources :

Example 1 with CacheJdbcPojoStore

use of org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStore in project ignite by apache.

the class GridCacheStoreManagerAdapter method initialize.

/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
public void initialize(@Nullable CacheStore cfgStore, Map sesHolders) throws IgniteCheckedException {
    GridKernalContext ctx = igniteContext();
    CacheConfiguration cfg = cacheConfiguration();
    writeThrough = cfg.isWriteThrough();
    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;
}
Also used : GridKernalContext(org.apache.ignite.internal.GridKernalContext) CacheStore(org.apache.ignite.cache.store.CacheStore) CacheJdbcPojoStore(org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStore) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) CacheStoreBalancingWrapper(org.apache.ignite.internal.processors.cache.CacheStoreBalancingWrapper)

Aggregations

CacheStore (org.apache.ignite.cache.store.CacheStore)1 CacheJdbcPojoStore (org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStore)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 GridKernalContext (org.apache.ignite.internal.GridKernalContext)1 CacheStoreBalancingWrapper (org.apache.ignite.internal.processors.cache.CacheStoreBalancingWrapper)1