Class SizeEstimator<T>

  • All Implemented Interfaces:
    java.io.Serializable

    public class SizeEstimator<T>
    extends java.lang.Object
    implements java.io.Serializable
    This class is used to estimate the size in bytes of a given element. It uses the given Coder to calculate the size of the element.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SizeEstimator​(org.apache.beam.sdk.coders.Coder<T> coder)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long sizeOf​(T element)
      Estimates the size in bytes of the given element with the configured Coder .
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SizeEstimator

        public SizeEstimator​(org.apache.beam.sdk.coders.Coder<T> coder)
    • Method Detail

      • sizeOf

        public long sizeOf​(T element)
        Estimates the size in bytes of the given element with the configured Coder .
        Parameters:
        element - the element instance to be estimated
        Returns:
        the estimated size in bytes of the given element