Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-vinogradov committed Sep 19, 2023
1 parent 6f77083 commit fc85b51
Showing 1 changed file with 0 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
import org.apache.ignite.internal.util.IgniteTree;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.lang.GridClosureException;
import org.apache.ignite.internal.util.lang.GridCursor;
import org.apache.ignite.internal.util.lang.GridMetadataAwareAdapter;
import org.apache.ignite.internal.util.lang.GridTuple;
import org.apache.ignite.internal.util.lang.GridTuple3;
Expand Down Expand Up @@ -125,7 +124,6 @@
import static org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState.RENTING;
import static org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.MVCC_MAX_SNAPSHOT;
import static org.apache.ignite.internal.processors.cache.mvcc.MvccUtils.compareIgnoreOpCounter;
import static org.apache.ignite.internal.processors.cache.persistence.CacheDataRowAdapter.RowData.NO_KEY;
import static org.apache.ignite.internal.processors.cache.version.GridCacheVersionEx.addConflictVersion;
import static org.apache.ignite.internal.processors.dr.GridDrType.DR_NONE;

Expand Down Expand Up @@ -443,77 +441,6 @@ protected GridDhtLocalPartition localPartition() {
return info;
}

/** {@inheritDoc} */
@Nullable @Override public List<GridCacheEntryInfo> allVersionsInfo() throws IgniteCheckedException {
assert false; // assert mvcc enabled

lockEntry();

try {
if (obsolete())
return Collections.emptyList();

GridCursor<? extends CacheDataRow> cur =
cctx.offheap().dataStore(localPartition()).mvccAllVersionsCursor(cctx, key, NO_KEY);

List<GridCacheEntryInfo> res = new ArrayList<>();

while (cur.next()) {
CacheDataRow row = cur.get();

GridCacheMvccEntryInfo info = new GridCacheMvccEntryInfo();

info.key(key);
info.value(row.value());
info.cacheId(cctx.cacheId());
info.version(row.version());
info.setNew(false);
info.setDeleted(false);

byte txState = row.mvccTxState() != TxState.NA ? row.mvccTxState() :
MvccUtils.state(cctx, row.mvccCoordinatorVersion(), row.mvccCounter(),
row.mvccOperationCounter());

if (txState == TxState.ABORTED)
continue;

info.mvccVersion(row.mvccCoordinatorVersion(), row.mvccCounter(), row.mvccOperationCounter());
info.mvccTxState(txState);

byte newTxState = row.newMvccTxState() != TxState.NA ? row.newMvccTxState() :
MvccUtils.state(cctx, row.newMvccCoordinatorVersion(), row.newMvccCounter(),
row.newMvccOperationCounter());

if (newTxState != TxState.ABORTED) {
info.newMvccVersion(row.newMvccCoordinatorVersion(),
row.newMvccCounter(),
row.newMvccOperationCounter());

info.newMvccTxState(newTxState);
}

long expireTime = row.expireTime();

long ttl;

ttl = expireTime == CU.EXPIRE_TIME_ETERNAL ? CU.TTL_ETERNAL : expireTime - U.currentTimeMillis();

if (ttl < 0)
ttl = CU.TTL_MINIMUM;

info.ttl(ttl);
info.expireTime(expireTime);

res.add(info);
}

return res;
}
finally {
unlockEntry();
}
}

/** {@inheritDoc} */
@Override public final CacheObject unswap() throws IgniteCheckedException, GridCacheEntryRemovedException {
return unswap(true);
Expand Down

0 comments on commit fc85b51

Please sign in to comment.