java.lang.Object
org.apache.beam.sdk.io.gcp.bigtable.changestreams.estimator.CoderSizeEstimator<T>
All Implemented Interfaces:
Serializable, SizeEstimator<T>

@Internal public class CoderSizeEstimator<T> extends Object implements SizeEstimator<T>, 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:
  • Constructor Details

    • CoderSizeEstimator

      public CoderSizeEstimator(Coder<T> coder)
  • Method Details

    • sizeOf

      public long sizeOf(T element)
      Estimates the size in bytes of the given element with the configured Coder .
      Specified by:
      sizeOf in interface SizeEstimator<T>
      Parameters:
      element - the element instance to be estimated
      Returns:
      the estimated size in bytes of the given element