Search in sources :

Example 1 with InlineIndexHelper

use of org.apache.ignite.internal.processors.query.h2.database.InlineIndexHelper in project ignite by apache.

the class H2ExtrasLeafIO method storeByOffset.

/** {@inheritDoc} */
@Override
public void storeByOffset(long pageAddr, int off, SearchRow row) {
    GridH2Row row0 = (GridH2Row) row;
    assert row0.link != 0;
    List<InlineIndexHelper> inlineIdxs = InlineIndexHelper.getCurrentInlineIndexes();
    assert inlineIdxs != null : "no inline index helpers";
    int fieldOff = 0;
    for (int i = 0; i < inlineIdxs.size(); i++) {
        InlineIndexHelper idx = inlineIdxs.get(i);
        int size = idx.put(pageAddr, off + fieldOff, row.getValue(idx.columnIndex()), payloadSize - fieldOff);
        if (size == 0)
            break;
        fieldOff += size;
    }
    PageUtils.putLong(pageAddr, off + payloadSize, row0.link);
}
Also used : GridH2Row(org.apache.ignite.internal.processors.query.h2.opt.GridH2Row) InlineIndexHelper(org.apache.ignite.internal.processors.query.h2.database.InlineIndexHelper)

Example 2 with InlineIndexHelper

use of org.apache.ignite.internal.processors.query.h2.database.InlineIndexHelper in project ignite by apache.

the class H2ExtrasInnerIO method storeByOffset.

/** {@inheritDoc} */
@Override
public void storeByOffset(long pageAddr, int off, SearchRow row) {
    GridH2Row row0 = (GridH2Row) row;
    assert row0.link != 0 : row0;
    List<InlineIndexHelper> inlineIdxs = InlineIndexHelper.getCurrentInlineIndexes();
    assert inlineIdxs != null : "no inline index helpers";
    int fieldOff = 0;
    for (int i = 0; i < inlineIdxs.size(); i++) {
        InlineIndexHelper idx = inlineIdxs.get(i);
        int size = idx.put(pageAddr, off + fieldOff, row.getValue(idx.columnIndex()), payloadSize - fieldOff);
        if (size == 0)
            break;
        fieldOff += size;
    }
    PageUtils.putLong(pageAddr, off + payloadSize, row0.link);
}
Also used : GridH2Row(org.apache.ignite.internal.processors.query.h2.opt.GridH2Row) InlineIndexHelper(org.apache.ignite.internal.processors.query.h2.database.InlineIndexHelper)

Aggregations

InlineIndexHelper (org.apache.ignite.internal.processors.query.h2.database.InlineIndexHelper)2 GridH2Row (org.apache.ignite.internal.processors.query.h2.opt.GridH2Row)2