Class WeightedList<T>

java.lang.Object
org.apache.beam.sdk.fn.data.WeightedList<T>
All Implemented Interfaces:
org.apache.beam.sdk.util.Weighted

public class WeightedList<T> extends Object implements org.apache.beam.sdk.util.Weighted
Facade for a List<T> that keeps track of weight, for cache limit reasons.
  • Constructor Details

    • WeightedList

      public WeightedList(List<T> backing, long weight)
  • Method Details

    • of

      public static <T> WeightedList<T> of(List<T> backing, long weight)
    • getBacking

      public List<T> getBacking()
    • size

      public int size()
    • isEmpty

      public boolean isEmpty()
    • getWeight

      public long getWeight()
      Specified by:
      getWeight in interface org.apache.beam.sdk.util.Weighted
    • add

      public void add(T element, long weight)
    • addAll

      public void addAll(WeightedList<T> values)
    • addAll

      public void addAll(List<T> values, long weight)
    • accumulateWeight

      public void accumulateWeight(long weight)