Class InMemoryPLL<T>

  • Type Parameters:
    T -

    public class InMemoryPLL<T>
    extends PLL<T>
    A PLL which is created out of a regular Java collection. The collection is split into contiguous partitions which can be enumerated from independently.
    Author:
    Antonin Delpeuch
    • Constructor Detail

    • Method Detail

      • compute

        public CloseableIterator<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<T>
        Parameters:
        partition - the partition to iterate over
        Returns:
      • hasCachedPartitionSizes

        public boolean hasCachedPartitionSizes()
        Description copied from class: PLL
        Is this PLL aware of the size of its partitions?
        Overrides:
        hasCachedPartitionSizes in class PLL<T>
      • getPartitions

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

        public boolean isCached()
        Description copied from class: PLL
        Are the contents of this collection loaded in memory?
        Overrides:
        isCached in class PLL<T>
      • uncache

        public void uncache()
        Description copied from class: PLL
        Unloads the partition contents from memory
        Overrides:
        uncache in class PLL<T>
      • 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<T>
        See Also:
        PLL.getQueryTree()
      • createPartitions

        protected static io.vavr.collection.Array<InMemoryPLL.InMemoryPartition> createPartitions​(int size,
                                                                                                  int nbPartitions)
        Computes the list of partitions given the size of the collection and the desired number of partitions.
        Parameters:
        size -
        nbPartitions -
        Returns: