Search in sources :

Example 1 with Iterator

use of org.apache.geode.internal.cache.tier.sockets.VersionedObjectList.Iterator in project geode by apache.

the class ServerRegionProxy method getAll.

@Override
public VersionedObjectList getAll(List keys, Object callback) {
    recordTXOperation(ServerRegionOperation.GET_ALL, null, keys);
    int txID = TXManagerImpl.getCurrentTXUniqueId();
    VersionedObjectList result;
    if (this.pool.getPRSingleHopEnabled() && (txID == TXManagerImpl.NOTX)) {
        result = GetAllOp.execute(this.pool, this.region, keys, this.pool.getRetryAttempts(), callback);
    } else {
        result = GetAllOp.execute(this.pool, this.regionName, keys, callback);
    }
    if (result != null) {
        for (Iterator it = result.iterator(); it.hasNext(); ) {
            VersionedObjectList.Entry entry = it.next();
            Object key = entry.getKey();
            Object value = entry.getValue();
            boolean isOnServer = entry.isKeyNotOnServer();
            if (!isOnServer) {
                if (value instanceof Throwable) {
                    logger.warn(LocalizedMessage.create(LocalizedStrings.GetAll_0_CAUGHT_THE_FOLLOWING_EXCEPTION_ATTEMPTING_TO_GET_VALUE_FOR_KEY_1, new Object[] { value, key }), (Throwable) value);
                }
            }
        }
    }
    return result;
}
Also used : Iterator(org.apache.geode.internal.cache.tier.sockets.VersionedObjectList.Iterator) VersionedObjectList(org.apache.geode.internal.cache.tier.sockets.VersionedObjectList)

Aggregations

VersionedObjectList (org.apache.geode.internal.cache.tier.sockets.VersionedObjectList)1 Iterator (org.apache.geode.internal.cache.tier.sockets.VersionedObjectList.Iterator)1