use of org.apache.ignite.internal.processors.query.h2.opt.GridH2Row in project ignite by apache.
the class H2RowFactory method getRow.
/**
* !!! This method must be invoked in read or write lock of referring index page. It is needed to
* !!! make sure that row at this link will be invisible, when the link will be removed from
* !!! from all the index pages, so that row can be safely erased from the data page.
*
* @param link Link.
* @return Row.
* @throws IgniteCheckedException If failed.
*/
public GridH2Row getRow(long link) throws IgniteCheckedException {
// TODO Avoid extra garbage generation. In upcoming H2 1.4.193 Row will become an interface,
// TODO we need to refactor all this to return CacheDataRowAdapter implementing Row here.
final CacheDataRowAdapter rowBuilder = new CacheDataRowAdapter(link);
rowBuilder.initFromLink(cctx.group(), CacheDataRowAdapter.RowData.FULL);
GridH2Row row;
try {
row = rowDesc.createRow(rowBuilder);
} catch (IgniteCheckedException e) {
throw new IgniteException(e);
}
assert row.version() != null;
return row;
}
use of org.apache.ignite.internal.processors.query.h2.opt.GridH2Row in project ignite by apache.
the class H2ExtrasInnerIO method storeByOffset.
/**
* {@inheritDoc}
*/
@SuppressWarnings("ForLoopReplaceableByForEach")
@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());
}
Aggregations