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

public class SizeEstimator<T> extends Object implements 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

    • SizeEstimator

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

    • 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