Class IndexedPLL<T>

  • Type Parameters:
    T -

    public class IndexedPLL<T>
    extends PLL<Tuple2<Long,​T>>
    A PLL indexed in sequential order. For each entry, the key is the index of the element in the list. This comes with a partitioner which makes it more efficient to retrieve elements by index than scanning the entire collection.
    Author:
    Antonin Delpeuch
    • Constructor Detail

      • IndexedPLL

        protected IndexedPLL​(PLL<T> parent)
    • Method Detail

      • index

        public static <T> PairPLL<Long,​T> index​(PLL<T> pll)
        Create an indexed PLL by indexing an existing PLL. This triggers a task to count the number of elements in all partitions but the last one.
        Type Parameters:
        T -
        Parameters:
        pll -
        Returns:
      • compute

        protected CloseableIterator<Tuple2<Long,​T>> compute​(Partition partition)
        Description copied from class: PLL
        Iterate 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 use PLL.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.
        Specified by:
        compute in class PLL<Tuple2<Long,​T>>
        Parameters:
        partition - the partition to iterate over
        Returns:
      • getPartitions

        public io.vavr.collection.Array<? extends Partition> getPartitions()
        Specified by:
        getPartitions in class PLL<Tuple2<Long,​T>>
        Returns:
        the partitions in this list
      • getParents

        public List<PLL<?>> getParents()
        Description copied from class: PLL
        Returns 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:
        getParents in class PLL<Tuple2<Long,​T>>
        See Also:
        PLL.getQueryTree()