Package org.openrefine.runners.local.pll
Class MapPartitionsPLL<U,T>
- java.lang.Object
- 
- org.openrefine.runners.local.pll.PLL<T>
- 
- org.openrefine.runners.local.pll.MapPartitionsPLL<U,T>
 
 
- 
- Type Parameters:
- U-
- T-
 
 public class MapPartitionsPLL<U,T> extends PLL<T> A PLL obtained by transforming each partition independently. The supplied function takes two arguments: the first is the index of the partition to map, the second is a stream of its contents.- Author:
- Antonin Delpeuch
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.openrefine.runners.local.pll.PLLPLL.LastFlush, PLL.PLLExecutionError
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected BiFunction<Integer,CloseableIterator<U>,CloseableIterator<T>>mapFunctionprotected PLL<U>parentprotected booleanpreservesSizes- 
Fields inherited from class org.openrefine.runners.local.pll.PLLcachedPartitions, context, id, name
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description MapPartitionsPLL(PLL<U> parent, BiFunction<Integer,CloseableIterator<U>,CloseableIterator<T>> mapFunction, String mapFunctionDescription)Constructs a PLL with partitions derived one-to-one from the parent.protectedMapPartitionsPLL(PLL<U> parent, BiFunction<Integer,CloseableIterator<U>,CloseableIterator<T>> mapFunction, String mapFunctionDescription, boolean preservesSizes)Constructs a PLL with partitions derived one-to-one from the parent.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description CloseableIterator<T>compute(Partition partition)Iterate over the elements of the given partition.io.vavr.collection.Array<Long>computePartitionSizes()List<PLL<?>>getParents()Returns the PLLs that this PLL depends on, to compute its contents.io.vavr.collection.Array<? extends Partition>getPartitions()booleanhasCachedPartitionSizes()Is this PLL aware of the size of its partitions?- 
Methods inherited from class org.openrefine.runners.local.pll.PLLaggregate, batchPartitions, cacheAsync, collect, collectPartitionsAsync, concatenate, concatenate, count, dropFirstElements, dropLastElements, filter, flatMap, getContext, getId, getPartitionSizes, getQueryTree, isCached, isEmpty, iterate, iterateFromPartition, iterator, limitPartitions, map, mapPartitions, mapToPair, mapToPair, numPartitions, retainPartitions, runOnPartitions, runOnPartitions, runOnPartitionsAsync, runOnPartitionsAsync, runOnPartitionsWithoutInterruption, runOnPartitionsWithoutInterruption, saveAsTextFile, saveAsTextFileAsync, scanMap, scanMapStream, sort, take, toString, uncache, withCachedPartitionSizes, writeOriginalPartition, writePartition, writePlannedPartition, zipWithIndex
 
- 
 
- 
- 
- 
Field Detail- 
mapFunctionprotected final BiFunction<Integer,CloseableIterator<U>,CloseableIterator<T>> mapFunction 
 - 
preservesSizesprotected final boolean preservesSizes 
 
- 
 - 
Constructor Detail- 
MapPartitionsPLLpublic MapPartitionsPLL(PLL<U> parent, BiFunction<Integer,CloseableIterator<U>,CloseableIterator<T>> mapFunction, String mapFunctionDescription) Constructs a PLL with partitions derived one-to-one from the parent.- Parameters:
- parent- the source list
- mapFunction- the function to apply to each partition
- mapFunctionDescription- a short description of the map function for debugging purposes
 
 - 
MapPartitionsPLLprotected MapPartitionsPLL(PLL<U> parent, BiFunction<Integer,CloseableIterator<U>,CloseableIterator<T>> mapFunction, String mapFunctionDescription, boolean preservesSizes) Constructs a PLL with partitions derived one-to-one from the parent.- Parameters:
- parent- the source list
- mapFunction- the function to apply to each partition
- mapFunctionDescription- a short description of the map function for debugging purposes
- preservesSizes- whether partition sizes are know to be the same as the parent's
 
 
- 
 - 
Method Detail- 
hasCachedPartitionSizespublic boolean hasCachedPartitionSizes() Description copied from class:PLLIs this PLL aware of the size of its partitions?- Overrides:
- hasCachedPartitionSizesin class- PLL<T>
 
 - 
computePartitionSizespublic io.vavr.collection.Array<Long> computePartitionSizes() - Overrides:
- computePartitionSizesin class- PLL<T>
 
 - 
computepublic CloseableIterator<T> compute(Partition partition) Description copied from class:PLLIterate over the elements of the given partition. This is the method that should be implemented by subclasses. As this method forces computation, ignoring any caching, consumers should not call it directly but rather usePLL.iterate(Partition). Once the iterator is not needed anymore, it should be closed. This makes it possible to release the underlying resources supporting it, such as open files or sockets.
 - 
getPartitionspublic io.vavr.collection.Array<? extends Partition> getPartitions() - Specified by:
- getPartitionsin class- PLL<T>
- Returns:
- the partitions in this list
 
 - 
getParentspublic List<PLL<?>> getParents() Description copied from class:PLLReturns the PLLs that this PLL depends on, to compute its contents. This is used for debugging purposes, to display the tree of dependencies of a given PLL.- Specified by:
- getParentsin class- PLL<T>
- See Also:
- PLL.getQueryTree()
 
 
- 
 
-