提交 e635e003 authored 作者: Sergi Vladykin's avatar Sergi Vladykin

Minor API change: Index.createLookupBatch

上级 749aa5a5
......@@ -473,7 +473,7 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
}
@Override
public IndexLookupBatch createLookupBatch(TableFilter filter) {
public IndexLookupBatch createLookupBatch(TableFilter[] filters, int filter) {
// Lookup batching is not supported.
return null;
}
......
......@@ -263,9 +263,10 @@ public interface Index extends SchemaObject {
* Creates new lookup batch. Note that returned {@link IndexLookupBatch}
* instance can be used multiple times.
*
* @param filter Table filter.
* @param filters the table filters
* @param filter the filter index (0, 1,...)
* @return created batch or {@code null} if batched lookup is not supported
* by this index.
*/
IndexLookupBatch createLookupBatch(TableFilter filter);
IndexLookupBatch createLookupBatch(TableFilter[] filters, int filter);
}
......@@ -389,7 +389,7 @@ public class MultiVersionIndex implements Index {
}
@Override
public IndexLookupBatch createLookupBatch(TableFilter filter) {
public IndexLookupBatch createLookupBatch(TableFilter[] filters, int filter) {
// Lookup batching is not supported.
return null;
}
......
......@@ -110,7 +110,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
}
@Override
public IndexLookupBatch createLookupBatch(TableFilter filter) {
public IndexLookupBatch createLookupBatch(TableFilter[] filters, int filter) {
if (recursive) {
// we do not support batching for recursive queries
return null;
......
......@@ -393,6 +393,7 @@ public class TableFilter implements ColumnResolver {
* lookups, {@code null} otherwise
*/
public JoinBatch prepareJoinBatch(JoinBatch jb, TableFilter[] filters, int filter) {
assert filters[filter] == this;
joinBatch = null;
joinFilterId = -1;
if (getTable().isView()) {
......@@ -414,7 +415,7 @@ public class TableFilter implements ColumnResolver {
// sub-query.
IndexLookupBatch lookupBatch = null;
if (jb == null && select != null && !isAlwaysTopTableFilter(filter)) {
lookupBatch = index.createLookupBatch(this);
lookupBatch = index.createLookupBatch(filters, filter);
if (lookupBatch != null) {
jb = new JoinBatch(filter + 1, join);
}
......@@ -429,7 +430,7 @@ public class TableFilter implements ColumnResolver {
// createLookupBatch will be called at most once because jb can
// be created only if lookupBatch is already not null from the
// call above.
lookupBatch = index.createLookupBatch(this);
lookupBatch = index.createLookupBatch(filters, filter);
if (lookupBatch == null) {
// the index does not support lookup batching, need to fake
// it because we are not top
......
......@@ -1348,7 +1348,8 @@ public class TestTableEngines extends TestBase {
}
@Override
public IndexLookupBatch createLookupBatch(final TableFilter filter) {
public IndexLookupBatch createLookupBatch(TableFilter[] filters, int f) {
final TableFilter filter = filters[f];
assert0(filter.getMasks() != null || "scan".equals(getName()), "masks");
final int preferredSize = preferredBatchSize;
if (preferredSize == 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论