org.apache.ignite.Ignite.getOrCreateNearCache()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.apache.ignite.Ignite.getOrCreateNearCache()方法的一些代码示例,展示了Ignite.getOrCreateNearCache()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ignite.getOrCreateNearCache()方法的具体详情如下:
包路径:org.apache.ignite.Ignite
类名称:Ignite
方法名:getOrCreateNearCache

Ignite.getOrCreateNearCache介绍

[英]Gets existing near cache with the given name or creates a new one.
[中]获取具有给定名称的现有近缓存或创建新缓存。

代码示例

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public <K, V> IgniteCache<K, V> getOrCreateNearCache(@Nullable String cacheName, NearCacheConfiguration<K, V> nearCfg) {
  checkIgnite();
  return g.getOrCreateNearCache(cacheName, nearCfg);
}

代码示例来源:origin: apache/ignite

@Override public Object call() throws Exception {
    ignite1.getOrCreateNearCache(cacheName, new NearCacheConfiguration<>());
    return null;
  }
}, CacheException.class, null);

代码示例来源:origin: apache/ignite

@Override public Object call() throws Exception {
    int idx = cnt.getAndIncrement();
    try {
      if (nearOnly)
        ignite(idx).getOrCreateNearCache(DYNAMIC_CACHE_NAME, new NearCacheConfiguration<>());
      else
        ignite(idx).getOrCreateCache(cacheCfg, new NearCacheConfiguration<>());
    }
    catch (Exception ex) {
      err.compareAndSet(null, ex);
    }
    return null;
  }
}, clientCnt, "starter");

代码示例来源:origin: apache/ignite

/** */
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();
}

代码示例来源:origin: org.apache.ignite/ignite-spring

/** {@inheritDoc} */
@Override public <K, V> IgniteCache<K, V> getOrCreateNearCache(@Nullable String cacheName, NearCacheConfiguration<K, V> nearCfg) {
  checkIgnite();
  return g.getOrCreateNearCache(cacheName, nearCfg);
}

代码示例来源:origin: apache/ignite

ignite2.getOrCreateNearCache(CACHE_NAME1, new NearCacheConfiguration<>());
else
  ignite2.cache(CACHE_NAME1);

相关文章