提交 0fa0f09c authored 作者: S.Vladykin's avatar S.Vladykin

wip

上级 0dd766c9
...@@ -60,7 +60,7 @@ public final class JoinBatch { ...@@ -60,7 +60,7 @@ public final class JoinBatch {
private static final Future<Cursor> PLACEHOLDER = new DoneFuture<Cursor>(null); private static final Future<Cursor> PLACEHOLDER = new DoneFuture<Cursor>(null);
private ViewIndexLookupBatch lookupBatchWrapper; private ViewIndexLookupBatch viewIndexLookupBatch;
private JoinFilter[] filters; private JoinFilter[] filters;
private JoinFilter top; private JoinFilter top;
...@@ -156,7 +156,7 @@ public final class JoinBatch { ...@@ -156,7 +156,7 @@ public final class JoinBatch {
private void start() { private void start() {
// initialize current row // initialize current row
current = new JoinRow(new Object[filters.length]); current = new JoinRow(new Object[filters.length]);
if (lookupBatchWrapper == null) { if (viewIndexLookupBatch == null) {
current.updateRow(top.id, top.filter.getIndexCursor(), JoinRow.S_NULL, JoinRow.S_CURSOR); current.updateRow(top.id, top.filter.getIndexCursor(), JoinRow.S_NULL, JoinRow.S_CURSOR);
// initialize top cursor // initialize top cursor
top.filter.getIndexCursor().find(top.filter.getSession(), top.filter.getIndexConditions()); top.filter.getIndexCursor().find(top.filter.getSession(), top.filter.getIndexConditions());
...@@ -352,10 +352,10 @@ public final class JoinBatch { ...@@ -352,10 +352,10 @@ public final class JoinBatch {
* @return Adapter to allow joining to this batch in sub-queries. * @return Adapter to allow joining to this batch in sub-queries.
*/ */
public IndexLookupBatch asViewIndexLookupBatch(ViewIndex viewIndex) { public IndexLookupBatch asViewIndexLookupBatch(ViewIndex viewIndex) {
if (lookupBatchWrapper == null) { if (viewIndexLookupBatch == null) {
lookupBatchWrapper = new ViewIndexLookupBatch(viewIndex); viewIndexLookupBatch = new ViewIndexLookupBatch(viewIndex);
} }
return lookupBatchWrapper; return viewIndexLookupBatch;
} }
@Override @Override
...@@ -685,6 +685,7 @@ public final class JoinBatch { ...@@ -685,6 +685,7 @@ public final class JoinBatch {
private final ViewIndex viewIndex; private final ViewIndex viewIndex;
private final ArrayList<Future<Cursor>> result = New.arrayList(); private final ArrayList<Future<Cursor>> result = New.arrayList();
private boolean findCalled; private boolean findCalled;
private boolean full;
private ViewIndexLookupBatch(ViewIndex viewIndex) { private ViewIndexLookupBatch(ViewIndex viewIndex) {
this.viewIndex = viewIndex; this.viewIndex = viewIndex;
...@@ -706,6 +707,10 @@ public final class JoinBatch { ...@@ -706,6 +707,10 @@ public final class JoinBatch {
result.add(null); result.add(null);
} }
} }
private void fetch() {
}
@Override @Override
public boolean isBatchFull() { public boolean isBatchFull() {
...@@ -715,15 +720,6 @@ public final class JoinBatch { ...@@ -715,15 +720,6 @@ public final class JoinBatch {
@Override @Override
public List<Future<Cursor>> find() { public List<Future<Cursor>> find() {
JoinBatch jb = JoinBatch.this;
List<Future<Cursor>> topCursors = top.find();
for (int i = 0; i < topCursors.size(); i++) {
// jb.setCursor
while (jb.next()) {
// collect result
}
}
findCalled = true; findCalled = true;
return result; return result;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论