You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Rajeshbabu Chintaguntla (Jira)" <ji...@apache.org> on 2024/04/17 09:46:00 UTC

[jira] [Created] (HBASE-28530) Better not use threads when parallel seek enabled and only one storescanner to seek

Rajeshbabu Chintaguntla created HBASE-28530:
-----------------------------------------------

             Summary: Better not use threads when parallel seek enabled and only one storescanner to seek
                 Key: HBASE-28530
                 URL: https://issues.apache.org/jira/browse/HBASE-28530
             Project: HBase
          Issue Type: Improvement
            Reporter: Rajeshbabu Chintaguntla
            Assignee: Rajeshbabu Chintaguntla


When parallel seek enabled, seeking through the scanners using multiple threads and waiting on the countdown lock to complete the seek on all the scanners. It would be better not to use threads when there is only one scanners to seek. Might not be significant improvement but will be useful when a region has one store file post major compaction.

{code:java}
  private void parallelSeek(final List<? extends KeyValueScanner> scanners, final Cell kv)
    throws IOException {
    if (scanners.isEmpty()) return;
    int storeFileScannerCount = scanners.size();
    CountDownLatch latch = new CountDownLatch(storeFileScannerCount);
    List<ParallelSeekHandler> handlers = new ArrayList<>(storeFileScannerCount);
    for (KeyValueScanner scanner : scanners) {
      if (scanner instanceof StoreFileScanner) {
        ParallelSeekHandler seekHandler = new ParallelSeekHandler(scanner, kv, this.readPt, latch);
        executor.submit(seekHandler);
        handlers.add(seekHandler);
      } else {
        scanner.seek(kv);
        latch.countDown();
      }
    }

    try {
      latch.await();
    } catch (InterruptedException ie) {
      throw (InterruptedIOException) new InterruptedIOException().initCause(ie);
    }
{code}




--
This message was sent by Atlassian Jira
(v8.20.10#820010)