use of com.questdb.std.ex.JournalException in project questdb by bluestreak01.
the class KvIndexSymAllHeadRowSource method prepareCursor.
@Override
public RowCursor prepareCursor(PartitionSlice slice) {
try {
Partition partition = rec.partition = slice.partition.open();
KVIndex index = partition.getIndexForColumn(columnIndex);
long lo = slice.lo - 1;
long hi = slice.calcHi ? partition.size() : slice.hi + 1;
rows.clear();
for (int i = 0, n = valueCount; i < n; i++) {
IndexCursor c = index.cursor(i);
while (c.hasNext()) {
long r = rec.rowid = c.next();
if (r > lo && r < hi && (filter == null || filter.getBool(rec))) {
rows.add(r);
break;
}
}
}
rows.sort();
cursor = 0;
return this;
} catch (JournalException e) {
throw new JournalRuntimeException(e);
}
}
use of com.questdb.std.ex.JournalException in project questdb by bluestreak01.
the class KvIndexSymListHeadRowSource method prepareCursor.
@Override
public RowCursor prepareCursor(PartitionSlice slice) {
try {
Partition partition = rec.partition = slice.partition.open();
KVIndex index = partition.getIndexForColumn(columnIndex);
long lo = slice.lo - 1;
long hi = slice.calcHi ? partition.size() : slice.hi + 1;
rows.clear();
for (int i = 0, n = keys.size(); i < n; i++) {
IndexCursor c = index.cursor(keys.getQuick(i));
long r = -1;
boolean found = false;
while (c.hasNext()) {
r = rec.rowid = c.next();
if (r > lo && r < hi && (filter == null || filter.getBool(rec))) {
found = true;
break;
}
}
if (found) {
rows.add(r);
}
}
rows.sort();
keyIndex = 0;
return this;
} catch (JournalException e) {
throw new JournalRuntimeException(e);
}
}
use of com.questdb.std.ex.JournalException in project questdb by bluestreak01.
the class KvIndexSymLookupRowSource method prepareCursor.
@Override
public RowCursor prepareCursor(PartitionSlice slice) {
try {
KVIndex index = slice.partition.getIndexForColumn(columnIndex);
this.indexCursor = newCursor ? index.newFwdCursor(symbolKey) : index.fwdCursor(symbolKey);
this.full = slice.lo == 0 && slice.calcHi;
this.lo = slice.lo - 1;
this.hi = slice.calcHi ? slice.partition.open().size() : slice.hi + 1;
} catch (JournalException e) {
throw new JournalRuntimeException(e);
}
return this;
}
Aggregations