use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.
the class LatestByAllRecordCursor method buildTreeMap.
@Override
protected void buildTreeMap(SqlExecutionContext executionContext) {
DataFrame frame;
try {
while ((frame = this.dataFrameCursor.next()) != null) {
final int partitionIndex = frame.getPartitionIndex();
final long rowLo = frame.getRowLo();
final long rowHi = frame.getRowHi() - 1;
recordA.jumpTo(frame.getPartitionIndex(), rowHi);
for (long row = rowHi; row >= rowLo; row--) {
recordA.setRecordIndex(row);
MapKey key = map.withKey();
key.put(recordA, recordSink);
if (key.create()) {
rows.add(Rows.toRowID(partitionIndex, row));
}
}
}
} finally {
map.clear();
}
}
use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.
the class HashJoinLightRecordCursorFactory method buildMapOfSlaveRecords.
private void buildMapOfSlaveRecords(RecordCursor slaveCursor, SqlExecutionInterruptor interruptor) {
slaveChain.clear();
joinKeyMap.clear();
final Record record = slaveCursor.getRecord();
while (slaveCursor.hasNext()) {
interruptor.checkInterrupted();
MapKey key = joinKeyMap.withKey();
key.put(record, slaveKeySink);
MapValue value = key.createValue();
if (value.isNew()) {
final long offset = slaveChain.put(record.getRowId(), -1);
value.putLong(0, offset);
value.putLong(1, offset);
} else {
value.putLong(1, slaveChain.put(record.getRowId(), value.getLong(1)));
}
}
}
use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.
the class HashOuterJoinLightRecordCursorFactory method buildMapOfSlaveRecords.
private void buildMapOfSlaveRecords(RecordCursor slaveCursor, SqlExecutionInterruptor interruptor) {
slaveChain.clear();
joinKeyMap.clear();
final Record record = slaveCursor.getRecord();
while (slaveCursor.hasNext()) {
interruptor.checkInterrupted();
MapKey key = joinKeyMap.withKey();
key.put(record, slaveKeySink);
MapValue value = key.createValue();
if (value.isNew()) {
final long offset = slaveChain.put(record.getRowId(), -1);
value.putLong(0, offset);
value.putLong(1, offset);
} else {
value.putLong(1, slaveChain.put(record.getRowId(), value.getLong(1)));
}
}
}
use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.
the class QMapReadBenchmark method testDirectMap.
@Benchmark
public MapValue testDirectMap() {
MapKey key = map.withKey();
key.putStr(rnd.nextChars(M));
return key.findValue();
}
use of io.questdb.cairo.map.MapKey in project questdb by bluestreak01.
the class QMapReadBenchmark method testQMap.
@Benchmark
public MapValue testQMap() {
MapKey key = qmap.withKey();
key.putStr(rnd.nextChars(M));
return key.findValue();
}
Aggregations