Search in sources :

Example 1 with GridH2KeyValueRowOffheap

use of org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOffheap in project ignite by apache.

the class H2RowDescriptor method createRow.

/** {@inheritDoc} */
@Override
public GridH2Row createRow(KeyCacheObject key, int partId, @Nullable CacheObject val, GridCacheVersion ver, long expirationTime) throws IgniteCheckedException {
    GridH2Row row;
    try {
        if (// Only can happen for remove operation, can create simple search row.
        val == null)
            row = GridH2RowFactory.create(wrap(key, keyType));
        else
            row = schema.offheap() == null ? new GridH2KeyValueRowOnheap(this, key, keyType, val, valType, ver, expirationTime) : new GridH2KeyValueRowOffheap(this, key, keyType, val, valType, ver, expirationTime);
    } catch (ClassCastException e) {
        throw new IgniteCheckedException("Failed to convert key to SQL type. " + "Please make sure that you always store each value type with the same key type " + "or configure key type as common super class for all actual keys for this value type.", e);
    }
    row.ver = ver;
    row.key = key;
    row.val = val;
    row.partId = partId;
    return row;
}
Also used : IgniteCheckedException(org.apache.ignite.IgniteCheckedException) GridH2KeyValueRowOffheap(org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOffheap) GridH2Row(org.apache.ignite.internal.processors.query.h2.opt.GridH2Row) GridH2KeyValueRowOnheap(org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOnheap)

Aggregations

IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 GridH2KeyValueRowOffheap (org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOffheap)1 GridH2KeyValueRowOnheap (org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOnheap)1 GridH2Row (org.apache.ignite.internal.processors.query.h2.opt.GridH2Row)1