Search in sources :

Example 1 with ColumnIndexerTask

use of io.questdb.tasks.ColumnIndexerTask in project questdb by bluestreak01.

the class ColumnIndexerJob method doRun.

protected boolean doRun(int workerId, long cursor) {
    final ColumnIndexerTask queueItem = queue.get(cursor);
    // copy values and release queue item
    final ColumnIndexer indexer = queueItem.indexer;
    final long lo = queueItem.lo;
    final long hi = queueItem.hi;
    final long indexSequence = queueItem.sequence;
    final SOCountDownLatch latch = queueItem.countDownLatch;
    subSeq.done(cursor);
    // Using CAS allows main thread to steal only parts of its own job.
    if (indexer.tryLock(indexSequence)) {
        TableWriter.indexAndCountDown(indexer, lo, hi, latch);
        return true;
    }
    // work from under nose of this worker.
    return false;
}
Also used : ColumnIndexerTask(io.questdb.tasks.ColumnIndexerTask) SOCountDownLatch(io.questdb.mp.SOCountDownLatch)

Aggregations

SOCountDownLatch (io.questdb.mp.SOCountDownLatch)1 ColumnIndexerTask (io.questdb.tasks.ColumnIndexerTask)1