Search in sources :

Example 1 with DistributedLookupBatch

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

the class H2TreeIndex method createLookupBatch.

/**
 * {@inheritDoc}
 */
@Override
public IndexLookupBatch createLookupBatch(TableFilter[] filters, int filter) {
    QueryContext qctx = H2Utils.context(filters[filter].getSession());
    if (qctx == null || qctx.distributedJoinContext() == null || !getTable().isPartitioned())
        return null;
    IndexColumn affCol = getTable().getAffinityKeyColumn();
    GridH2RowDescriptor desc = getTable().rowDescriptor();
    int affColId = -1;
    boolean ucast = false;
    if (affCol != null) {
        affColId = affCol.column.getColumnId();
        int[] masks = filters[filter].getMasks();
        if (masks != null) {
            ucast = (masks[affColId] & IndexCondition.EQUALITY) != 0 || desc.checkKeyIndexCondition(masks, IndexCondition.EQUALITY);
        }
    }
    return new DistributedLookupBatch(this, cctx, ucast, affColId);
}
Also used : DistributedLookupBatch(org.apache.ignite.internal.processors.query.h2.opt.join.DistributedLookupBatch) GridH2RowDescriptor(org.apache.ignite.internal.processors.query.h2.opt.GridH2RowDescriptor) IndexQueryContext(org.apache.ignite.internal.cache.query.index.sorted.inline.IndexQueryContext) QueryContext(org.apache.ignite.internal.processors.query.h2.opt.QueryContext) IndexColumn(org.h2.table.IndexColumn)

Aggregations

IndexQueryContext (org.apache.ignite.internal.cache.query.index.sorted.inline.IndexQueryContext)1 GridH2RowDescriptor (org.apache.ignite.internal.processors.query.h2.opt.GridH2RowDescriptor)1 QueryContext (org.apache.ignite.internal.processors.query.h2.opt.QueryContext)1 DistributedLookupBatch (org.apache.ignite.internal.processors.query.h2.opt.join.DistributedLookupBatch)1 IndexColumn (org.h2.table.IndexColumn)1