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


Java MutableEntry.remove方法代码示例

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


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

示例1: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Void process(MutableEntry<HadoopJobId, HadoopJobMetadata> e, Object... args) {
    HadoopJobMetadata val = apply(e.getValue());

    if (val != null)
        e.setValue(val);
    else
        e.remove();

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

示例2: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object process(MutableEntry<Object, Object> entry, Object... arguments) {
    Object oldVal = entry.getValue();

    entry.remove();

    return oldVal;
}
 
开发者ID:apache,项目名称:ignite,代码行数:9,代码来源:IgniteCacheRandomOperationBenchmark.java

示例3: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object process(MutableEntry<Object, Object> e, Object... args) {
    Object old = retOld ? e.getValue() : null;

    if (val != null)
        e.setValue(val);
    else
        e.remove();

    return old;
}
 
开发者ID:apache,项目名称:ignite,代码行数:12,代码来源:CacheInterceptorPartitionCounterRandomOperationsTest.java

示例4: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object process(MutableEntry<Object, Object> e, Object... args) {
    if (skipModify)
        return null;

    Object old = retOld ? e.getValue() : null;

    if (val != null)
        e.setValue(val);
    else
        e.remove();

    return old;
}
 
开发者ID:apache,项目名称:ignite,代码行数:15,代码来源:CacheContinuousQueryRandomOperationsTest.java

示例5: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Integer process(MutableEntry<Integer, Integer> e,
    Object... arguments) throws EntryProcessorException {
    assertTrue(e.exists());

    if (expVal != null)
        assertEquals(expVal, e.getValue());

    e.remove();

    assertFalse(e.exists());

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

示例6: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Integer process(MutableEntry<Integer, Integer> entry, Object... arguments) {
    Integer val = entry.getValue();

    if (newVal == null)
        entry.remove();
    else
        entry.setValue(newVal);

    return val;
}
 
开发者ID:apache,项目名称:ignite,代码行数:12,代码来源:CacheSerializableTransactionsTest.java

示例7: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Integer process(
    final MutableEntry<Integer, Integer> entry,
    final Object... arguments
) throws EntryProcessorException {
    entry.remove();

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

示例8: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object process(MutableEntry<Long, String> entry, Object... args) {
    long key = entry.getKey();

    if (key % 2 == 0)
        entry.remove();
    else
        entry.setValue(entry.getValue() + "-");

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

示例9: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
@Override
public T process(MutableEntry<K, V> entry, Object... arguments) {
    T result = null;
    if (assertExists) {
        assertTrue(entry.exists());
        result = (T)entry.getValue();
    }
    entry.remove();
    assertFalse(entry.exists());

    return result;
}
 
开发者ID:diennea,项目名称:blazingcache,代码行数:13,代码来源:RemoveEntryProcessor.java

示例10: testInvoke

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
@Test
public void testInvoke()
{
    final CacheLoader<String, Integer> cacheLoader = new CacheLoader<String, Integer>()
    {
        @Override
        public Integer load(String key)
            throws CacheLoaderException
        {
            return Integer.valueOf(key);
        }

        @Override
        public Map<String, Integer> loadAll(Iterable<? extends String> keys)
            throws CacheLoaderException
        {
            throw new UnsupportedOperationException("Not supported yet.");
        }
    };

    final EntryProcessor<String, Integer, Boolean> entryProcessor = new EntryProcessor<String, Integer, Boolean>()
    {
        @Override
        public Boolean process(MutableEntry<String, Integer> entry, Object... arguments)
            throws EntryProcessorException
        {
            assertTrue(entry.exists());
            assertEquals(Integer.valueOf(1), entry.getValue());
            entry.setValue(2);
            assertEquals(Integer.valueOf(2), entry.getValue());
            entry.remove();
            assertFalse(entry.exists());

            return Boolean.TRUE;
        }
    };

    MutableConfiguration<String, Integer> custom = new MutableConfiguration<>(configuration);

    custom.setReadThrough(true);
    custom.setCacheLoaderFactory
    (
        new Factory<CacheLoader<String, Integer>>()
        {
            @Override
            public CacheLoader<String, Integer> create()
            {
                return cacheLoader;
            }
        }
    );

    Cache<String, Integer> invokingCache = cacheManager.createCache("invokingCache", custom);

    assertTrue(invokingCache.invoke("1", entryProcessor));
    assertFalse(invokingCache.containsKey("1"));
}
 
开发者ID:ocafebabe,项目名称:guava-jcache,代码行数:58,代码来源:GuavaCacheTest.java

示例11: apply

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void apply(MutableEntry<Object, Object> e) {
    e.remove();
}
 
开发者ID:apache,项目名称:ignite,代码行数:5,代码来源:DmlStatementsProcessor.java

示例12: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object process(MutableEntry<Object, Object> e, Object... args) {
    e.remove();

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

示例13: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
@Override public Void process(MutableEntry<String, Integer> e, Object... args) {
    e.remove();

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

示例14: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Integer process(MutableEntry<String, Integer> e, Object... args) {
    e.remove();

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


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