Search in sources :

Example 1 with MvccVersionAware

use of org.apache.ignite.internal.processors.cache.mvcc.MvccVersionAware in project ignite by apache.

the class GridDhtPartitionSupplier method extractEntryInfo.

/**
 * Extracts entry info from row.
 *
 * @param row Cache data row.
 * @return Entry info.
 */
private GridCacheEntryInfo extractEntryInfo(CacheDataRow row) {
    GridCacheEntryInfo info = grp.mvccEnabled() ? new GridCacheMvccEntryInfo() : new GridCacheEntryInfo();
    info.key(row.key());
    info.cacheId(row.cacheId());
    if (grp.mvccEnabled()) {
        assert row.mvccCoordinatorVersion() != MvccUtils.MVCC_CRD_COUNTER_NA;
        // Rows from rebalance iterator have actual states already.
        if (row.mvccTxState() != TxState.COMMITTED)
            return null;
        ((MvccVersionAware) info).mvccVersion(row);
        ((GridCacheMvccEntryInfo) info).mvccTxState(TxState.COMMITTED);
        if (row.newMvccCoordinatorVersion() != MvccUtils.MVCC_CRD_COUNTER_NA && row.newMvccTxState() == TxState.COMMITTED) {
            ((MvccUpdateVersionAware) info).newMvccVersion(row);
            ((GridCacheMvccEntryInfo) info).newMvccTxState(TxState.COMMITTED);
        }
    }
    info.value(row.value());
    info.version(row.version());
    info.expireTime(row.expireTime());
    return info;
}
Also used : GridCacheEntryInfo(org.apache.ignite.internal.processors.cache.GridCacheEntryInfo) MvccVersionAware(org.apache.ignite.internal.processors.cache.mvcc.MvccVersionAware) GridCacheMvccEntryInfo(org.apache.ignite.internal.processors.cache.GridCacheMvccEntryInfo) MvccUpdateVersionAware(org.apache.ignite.internal.processors.cache.mvcc.MvccUpdateVersionAware)

Aggregations

GridCacheEntryInfo (org.apache.ignite.internal.processors.cache.GridCacheEntryInfo)1 GridCacheMvccEntryInfo (org.apache.ignite.internal.processors.cache.GridCacheMvccEntryInfo)1 MvccUpdateVersionAware (org.apache.ignite.internal.processors.cache.mvcc.MvccUpdateVersionAware)1 MvccVersionAware (org.apache.ignite.internal.processors.cache.mvcc.MvccVersionAware)1