Package net.minecraft.util.thread
Class ParallelMapTransform.SplitterBase<K,U,V>
java.lang.Object
net.minecraft.util.thread.ParallelMapTransform.SplitterBase<K,U,V>
- Direct Known Subclasses:
ParallelMapTransform.BatchedTaskSplitter
,ParallelMapTransform.SingleTaskSplitter
- Enclosing class:
ParallelMapTransform
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private final ParallelMapTransform.Container
<K, U, V> private int
private int
private final CompletableFuture<?>[]
-
Constructor Summary
ConstructorsConstructorDescriptionSplitterBase
(BiFunction<K, U, V> pOperation, int pContainerSize, int pNumBatches) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract int
batchSize
(int pBatchIndex) private int
protected abstract CompletableFuture
<?> scheduleBatch
(ParallelMapTransform.Container<K, U, V> pContainer, int pLastScheduledIndex, int pCurrentIndex, Executor pExecutor) protected abstract CompletableFuture
<Map<K, V>> scheduleFinalOperation
(CompletableFuture<?> pFuture, ParallelMapTransform.Container<K, U, V> pContainer) scheduleTasks
(Map<K, U> pInputs, Executor pExecutor)
-
Field Details
-
lastScheduledIndex
private int lastScheduledIndex -
currentIndex
private int currentIndex -
tasks
-
batchIndex
private int batchIndex -
container
-
-
Constructor Details
-
SplitterBase
SplitterBase(BiFunction<K, U, V> pOperation, int pContainerSize, int pNumBatches)
-
-
Method Details
-
pendingBatchSize
private int pendingBatchSize() -
scheduleTasks
-
batchSize
protected abstract int batchSize(int pBatchIndex) -
scheduleBatch
protected abstract CompletableFuture<?> scheduleBatch(ParallelMapTransform.Container<K, U, V> pContainer, int pLastScheduledIndex, int pCurrentIndex, Executor pExecutor) -
scheduleFinalOperation
protected abstract CompletableFuture<Map<K,V>> scheduleFinalOperation(CompletableFuture<?> pFuture, ParallelMapTransform.Container<K, U, V> pContainer)
-