Search in sources :

Example 1 with ReuseBag

use of org.apache.ignite.internal.pagememory.reuse.ReuseBag in project ignite-3 by apache.

the class AbstractFreeList method removeDataRowByLink.

/**
 * {@inheritDoc}
 */
@Override
public void removeDataRowByLink(long link, IoStatisticsHolder statHolder) throws IgniteInternalCheckedException {
    assert link != 0;
    try {
        long pageId = pageId(link);
        int itemId = itemId(link);
        ReuseBag bag = new LongListReuseBag();
        long nextLink = write(pageId, rmvRow, bag, itemId, FAIL_L, statHolder);
        // Can't fail here.
        assert nextLink != FAIL_L;
        while (nextLink != 0L) {
            itemId = itemId(nextLink);
            pageId = pageId(nextLink);
            nextLink = write(pageId, rmvRow, bag, itemId, FAIL_L, statHolder);
            // Can't fail here.
            assert nextLink != FAIL_L;
        }
        reuseList.addForRecycle(bag);
    } catch (AssertionError e) {
        throw corruptedFreeListException(e);
    } catch (IgniteInternalCheckedException | Error e) {
        throw e;
    } catch (Throwable t) {
        throw new CorruptedFreeListException("Failed to remove data by link", t, grpId);
    }
}
Also used : LongListReuseBag(org.apache.ignite.internal.pagememory.reuse.LongListReuseBag) IgniteInternalCheckedException(org.apache.ignite.lang.IgniteInternalCheckedException) LongListReuseBag(org.apache.ignite.internal.pagememory.reuse.LongListReuseBag) ReuseBag(org.apache.ignite.internal.pagememory.reuse.ReuseBag)

Aggregations

LongListReuseBag (org.apache.ignite.internal.pagememory.reuse.LongListReuseBag)1 ReuseBag (org.apache.ignite.internal.pagememory.reuse.ReuseBag)1 IgniteInternalCheckedException (org.apache.ignite.lang.IgniteInternalCheckedException)1