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


Java MutableEntry.getValue方法代码示例

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


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

示例1: process

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

    BinaryObject val = entry.getValue();

    /** The message will be printed on the node that stores the entry! */
    System.out.println(">> Before update:");
    System.out.println(val);

    if (increase)
        val = val.toBuilder().setField("POPULATION", (int)val.field("POPULATION") + delta).build();
    else
        val = val.toBuilder().setField("POPULATION", (int)val.field("POPULATION") - delta).build();

    entry.setValue(val);

    return entry;
}
 
开发者ID:dmagda,项目名称:ignite_world_demo,代码行数:19,代码来源:KeyValueBinaryDataProcessing.java

示例2: process

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

    Map<String, String> tmp = oldInfo.properties();

    tmp = tmp == null ? new GridLeanMap<String, String>(props.size()) : new GridLeanMap<>(tmp);

    for (Map.Entry<String, String> e : props.entrySet()) {
        if (e.getValue() == null)
            // Remove properties with 'null' values.
            tmp.remove(e.getKey());
        else
            // Add/overwrite property.
            tmp.put(e.getKey(), e.getValue());
    }

    IgfsEntryInfo newInfo = oldInfo.properties(tmp);

    entry.setValue(newInfo);

    return newInfo;
}
 
开发者ID:apache,项目名称:ignite,代码行数:25,代码来源:IgfsMetaUpdatePropertiesProcessor.java

示例3: process

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

    boolean rmvd = queueRemoved(hdr, id);

    if (rmvd || !spaceAvailable(hdr, size))
        return rmvd ? QUEUE_REMOVED_IDX : null;

    GridCacheQueueHeader newHdr = new GridCacheQueueHeader(hdr.id(),
        hdr.capacity(),
        hdr.collocated(),
        hdr.head(),
        hdr.tail() + size,
        hdr.removedIndexes());

    e.setValue(newHdr);

    return hdr.tail();
}
 
开发者ID:apache,项目名称:ignite,代码行数:21,代码来源:GridCacheQueueAdapter.java

示例4: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Long process(MutableEntry<String, Long> entry,
    Object... arguments) throws EntryProcessorException {
    long newVal = entry.getValue() == null ? 0 : entry.getValue() + 1;

    entry.setValue(newVal);

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

示例5: process

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

  return entry.getValue();
}
 
开发者ID:diennea,项目名称:blazingcache,代码行数:10,代码来源:SetEntryProcessor.java

示例6: process

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

    if (val == null)
        throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name());

    long curVal = val.get();

    if (curVal == expVal)
        e.setValue(new GridCacheAtomicLongValue(newVal));

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

示例7: 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

示例8: process

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

    return true;
}
 
开发者ID:apache,项目名称:ignite,代码行数:8,代码来源:CacheDeploymentBinaryObjectEntryProcessor.java

示例9: process

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

    return true;
}
 
开发者ID:apache,项目名称:ignite,代码行数:8,代码来源:CacheDeploymentEntryProcessor.java

示例10: 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

示例11: process

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

    if (currVal == null)
        entry.setValue(0);
    else
        entry.setValue(currVal + 1);

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

示例12: process

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

    e.setValue(val);

    return old == null ? 0 : old;
}
 
开发者ID:apache,项目名称:ignite,代码行数:9,代码来源:IgniteCachePutRetryAbstractSelfTest.java

示例13: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
public Void process(MutableEntry<IgfsBlockKey, byte[]> entry, Object... args)
    throws EntryProcessorException {
    byte[] curVal = entry.getValue();

    if (curVal == null || newVal.length > curVal.length)
        entry.setValue(newVal);

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

示例14: process

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

    if (val == null)
        throw new EntryProcessorException("Failed to find atomic stamped with given name: " + e.getKey().name());

    e.setValue(new GridCacheAtomicStampedValue<>(newVal, newStamp));

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

示例15: process

import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
@Override
public Object process(MutableEntry<Object, Object> entry, Object... arguments) throws EntryProcessorException {
    return "processor-" + entry.getValue();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:JCacheProducerInvokeTest.java


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