Module org.apache.lucene.misc
Package org.apache.lucene.misc.index
Class BPIndexReorderer.IndexReorderingTask
- java.lang.Object
-
- java.util.concurrent.ForkJoinTask<java.lang.Void>
-
- java.util.concurrent.RecursiveAction
-
- org.apache.lucene.misc.index.BPIndexReorderer.BaseRecursiveAction
-
- org.apache.lucene.misc.index.BPIndexReorderer.IndexReorderingTask
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.concurrent.Future<java.lang.Void>
- Enclosing class:
- BPIndexReorderer
private class BPIndexReorderer.IndexReorderingTask extends BPIndexReorderer.BaseRecursiveAction
-
-
Field Summary
Fields Modifier and Type Field Description private IntsRef
docIDs
private float[]
gains
private CloseableThreadLocal<BPIndexReorderer.PerThreadState>
threadLocal
-
Fields inherited from class org.apache.lucene.misc.index.BPIndexReorderer.BaseRecursiveAction
depth
-
-
Constructor Summary
Constructors Constructor Description IndexReorderingTask(IntsRef docIDs, float[] gains, CloseableThreadLocal<BPIndexReorderer.PerThreadState> threadLocal, int depth)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
compute()
private void
computeDocFreqs(IntsRef docs, BPIndexReorderer.ForwardIndex forwardIndex, int[] docFreqs)
private boolean
shuffle(BPIndexReorderer.ForwardIndex forwardIndex, IntsRef left, IntsRef right, int[] leftDocFreqs, int[] rightDocFreqs, float[] gains, int iter)
Shuffle doc IDs across both partitions so that each partition has lower gaps between consecutive postings.private void
swap(int[] docs, int left, int right, BPIndexReorderer.ForwardIndex forwardIndex, int[] leftDocFreqs, int[] rightDocFreqs)
-
Methods inherited from class org.apache.lucene.misc.index.BPIndexReorderer.BaseRecursiveAction
shouldFork
-
Methods inherited from class java.util.concurrent.ForkJoinTask
adapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, complete, completeExceptionally, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollSubmission, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnfork
-
-
-
-
Field Detail
-
docIDs
private final IntsRef docIDs
-
gains
private final float[] gains
-
threadLocal
private final CloseableThreadLocal<BPIndexReorderer.PerThreadState> threadLocal
-
-
Constructor Detail
-
IndexReorderingTask
IndexReorderingTask(IntsRef docIDs, float[] gains, CloseableThreadLocal<BPIndexReorderer.PerThreadState> threadLocal, int depth)
-
-
Method Detail
-
computeDocFreqs
private void computeDocFreqs(IntsRef docs, BPIndexReorderer.ForwardIndex forwardIndex, int[] docFreqs)
-
compute
protected void compute()
- Specified by:
compute
in classjava.util.concurrent.RecursiveAction
-
shuffle
private boolean shuffle(BPIndexReorderer.ForwardIndex forwardIndex, IntsRef left, IntsRef right, int[] leftDocFreqs, int[] rightDocFreqs, float[] gains, int iter) throws java.io.IOException
Shuffle doc IDs across both partitions so that each partition has lower gaps between consecutive postings.- Throws:
java.io.IOException
-
swap
private void swap(int[] docs, int left, int right, BPIndexReorderer.ForwardIndex forwardIndex, int[] leftDocFreqs, int[] rightDocFreqs) throws java.io.IOException
- Throws:
java.io.IOException
-
-