org.infinispan.iteration.impl.TransactionAwareCloseableIterator Maven / Gradle / Ivy
package org.infinispan.iteration.impl;
import org.infinispan.Cache;
import org.infinispan.commons.util.CloseableIterator;
import org.infinispan.container.entries.CacheEntry;
import org.infinispan.context.impl.TxInvocationContext;
import org.infinispan.transaction.impl.LocalTransaction;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Class that provides transactional support so that the iterator will use the values in the context if they exist.
* This will keep track of seen values from the transactional context and if the transactional context is updated while
* iterating on this iterator it will see those updates unless the changed value was already seen by the iterator.
*
* @author wburns
* @since 7.0
*/
public class TransactionAwareCloseableIterator extends RemovableEntryIterator {
private final TxInvocationContext ctx;
// We store all the not yet seen context entries here. We rely on the fact that the cache entry reference is updated
// if a change occurs in between iterations to see updates.
private final List contextEntries;
private final Set
© 2015 - 2025 Weber Informatics LLC | Privacy Policy