Module org.apache.lucene.misc
Package org.apache.lucene.misc.index
Class BPIndexReorderer.IndexReorderingTask
java.lang.Object
java.util.concurrent.ForkJoinTask<Void>
java.util.concurrent.RecursiveAction
org.apache.lucene.misc.index.BPIndexReorderer.BaseRecursiveAction
org.apache.lucene.misc.index.BPIndexReorderer.IndexReorderingTask
- All Implemented Interfaces:
Serializable,Future<Void>
- Enclosing class:
BPIndexReorderer
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IntsRefprivate final float[]private final CloseableThreadLocal<BPIndexReorderer.PerThreadState> Fields inherited from class org.apache.lucene.misc.index.BPIndexReorderer.BaseRecursiveAction
depth -
Constructor Summary
ConstructorsConstructorDescriptionIndexReorderingTask(IntsRef docIDs, float[] gains, CloseableThreadLocal<BPIndexReorderer.PerThreadState> threadLocal, int depth) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcompute()private voidcomputeDocFreqs(IntsRef docs, BPIndexReorderer.ForwardIndex forwardIndex, int[] docFreqs) private booleanshuffle(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 voidswap(int[] docs, int left, int right, BPIndexReorderer.ForwardIndex forwardIndex, int[] leftDocFreqs, int[] rightDocFreqs) Methods inherited from class org.apache.lucene.misc.index.BPIndexReorderer.BaseRecursiveAction
shouldForkMethods inherited from class java.util.concurrent.RecursiveAction
exec, getRawResult, setRawResultMethods inherited from class java.util.concurrent.ForkJoinTask
adapt, adapt, adapt, adaptInterruptible, cancel, compareAndSetForkJoinTaskTag, complete, completeExceptionally, exceptionNow, 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, quietlyJoin, quietlyJoinUninterruptibly, reinitialize, resultNow, setForkJoinTaskTag, state, tryUnfork
-
Field Details
-
docIDs
-
gains
private final float[] gains -
threadLocal
-
-
Constructor Details
-
IndexReorderingTask
IndexReorderingTask(IntsRef docIDs, float[] gains, CloseableThreadLocal<BPIndexReorderer.PerThreadState> threadLocal, int depth)
-
-
Method Details
-
computeDocFreqs
private void computeDocFreqs(IntsRef docs, BPIndexReorderer.ForwardIndex forwardIndex, int[] docFreqs) -
compute
protected void compute()- Specified by:
computein classRecursiveAction
-
shuffle
private boolean shuffle(BPIndexReorderer.ForwardIndex forwardIndex, IntsRef left, IntsRef right, int[] leftDocFreqs, int[] rightDocFreqs, float[] gains, int iter) throws IOException Shuffle doc IDs across both partitions so that each partition has lower gaps between consecutive postings.- Throws:
IOException
-
swap
private void swap(int[] docs, int left, int right, BPIndexReorderer.ForwardIndex forwardIndex, int[] leftDocFreqs, int[] rightDocFreqs) throws IOException - Throws:
IOException
-