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


Java IgniteCache.remove方法代码示例

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


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

示例1: getReference

import org.apache.ignite.IgniteCache; //导入方法依赖的package包/类
public static <V> Reference<V> getReference(Ignite ignite, final String name, boolean create) {
    final IgniteCache<Object, Object> cache = create ? ignite.getOrCreateCache(NAME) : ignite.cache(NAME);
    return new Reference<V>() {
        @Override
        public V get() {
            return cache == null ? null : (V) cache.get(name);
        }

        @Override
        public void set(V value) {
            if (value == null) {
                cache.remove(name);
            } else {
                cache.put(name, value);
            }
        }
    };
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:19,代码来源:MetadataAtomicsHelper.java

示例2: singleCommit

import org.apache.ignite.IgniteCache; //导入方法依赖的package包/类
protected void singleCommit(TransactionSupplier txSupplier, IgniteInClosure<Long> onSingleCommit, long txId) {
    TransactionDataIterator it = txSupplier.dataIterator(txId);

    try (Transaction tx = ignite.transactions().txStart()) {
        while (it.hasNextCache()) {
            IgniteCache<Object, Object> cache = ignite.cache(it.nextCache());

            while (it.hasNextEntry()) {
                it.advance();
                Object value = it.getValue();
                if (ActiveCacheStore.TOMBSTONE.equals(value)) {
                    cache.remove(it.getKey());
                } else {
                    cache.put(it.getKey(), value);
                }
            }
        }
        tx.commit();
    }
    onSingleCommit.apply(txId);
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:22,代码来源:AbstractIgniteCommitter.java

示例3: testManualHBaseInsertion

import org.apache.ignite.IgniteCache; //导入方法依赖的package包/类
@Test
public void testManualHBaseInsertion() throws ServiceException, IOException {
  IgniteConfiguration cfg = prepareConfig(false);
  IgniteConfiguration cfg2 = new IgniteConfiguration(cfg);
  cfg.setGridName("first");
  cfg2.setGridName("second");
  String cacheName = "myCache";
  try (Ignite ignite = Ignition.getOrStart(cfg); Ignite ignite2 = Ignition.getOrStart(cfg2)) {
    IgniteCache<String, String> cache = ignite.getOrCreateCache(cacheName);
    cache.remove("Hello");
    assertNull(cache.get("Hello"));
    try (Connection conn = getHBaseConnection()) {
      TableName tableName = TableName.valueOf(TABLE_NAME);
      Table table = conn.getTable(tableName);
      Serializer<Object> serializer = ObjectSerializer.INSTANCE;
      Put put = new Put(serializer.serialize("Hello"));
      put.addColumn(cacheName.getBytes(), QUALIFIER, serializer.serialize("World"));
      table.put(put);
    }
    assertEquals("World", cache.get("Hello"));
  }
}
 
开发者ID:bakdata,项目名称:ignite-hbase,代码行数:23,代码来源:HBaseCacheStoreTest.java

示例4: testDelete

import org.apache.ignite.IgniteCache; //导入方法依赖的package包/类
@Test
public void testDelete() {
  IgniteConfiguration cfg = prepareConfig();
  IgniteConfiguration cfg2 = new IgniteConfiguration(cfg);
  cfg.setGridName("first");
  cfg2.setGridName("second");
  try (Ignite ignite = Ignition.getOrStart(cfg); Ignite ignite2 = Ignition.getOrStart(cfg2)) {
    IgniteCache<String, String> cache = ignite.getOrCreateCache("myCache");
    cache.put("Hello", "World");
    cache.put("Hello", "World");
    assertEquals("World", cache.get("Hello"));
    cache.remove("Hello");
    assertNull(cache.get("Hello"));
  }
}
 
开发者ID:bakdata,项目名称:ignite-hbase,代码行数:16,代码来源:HBaseCacheStoreTest.java

示例5: deleteAlertEntry

import org.apache.ignite.IgniteCache; //导入方法依赖的package包/类
@Override
public void deleteAlertEntry(String alertId) {
    final IgniteCache<String, AlertEntry> alertsCache = getAlertsCache();
    alertsCache.remove(alertId);
}
 
开发者ID:Romeh,项目名称:spring-boot-ignite,代码行数:6,代码来源:IgniteAlertsStore.java

示例6: removeTuple

import org.apache.ignite.IgniteCache; //导入方法依赖的package包/类
@Override
public void removeTuple(EntityKey key, TupleContext tupleContext) {
	IgniteCache<Object, BinaryObject> entityCache = provider.getEntityCache( key.getMetadata() );
	entityCache.remove( provider.createKeyObject( key ) );
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-ignite,代码行数:6,代码来源:IgniteDialect.java


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