Class BaseDeleteLoader

java.lang.Object
org.apache.iceberg.data.BaseDeleteLoader
All Implemented Interfaces:
DeleteLoader

public class BaseDeleteLoader extends Object implements DeleteLoader
  • Constructor Details

  • Method Details

    • canCache

      protected boolean canCache(long size)
      Checks if the given number of bytes can be cached.

      Implementations should override this method if they support caching. It is also recommended to use the provided size as a guideline to decide whether the value is eligible for caching. For instance, it may be beneficial to discard values that are too large to optimize the cache performance and utilization.

    • getOrLoad

      protected <V> V getOrLoad(String key, Supplier<V> valueSupplier, long valueSize)
      Gets the cached value for the key or populates the cache with a new mapping.

      If the value for the specified key is in the cache, it should be returned. If the value is not in the cache, implementations should compute the value using the provided supplier, cache it, and then return it.

      This method will be called only if canCache(long) returned true.

    • loadEqualityDeletes

      public StructLikeSet loadEqualityDeletes(Iterable<DeleteFile> deleteFiles, Schema projection)
      Description copied from interface: DeleteLoader
      Loads the content of equality delete files into a set.
      Specified by:
      loadEqualityDeletes in interface DeleteLoader
      Parameters:
      deleteFiles - equality delete files
      projection - a projection of columns to load
      Returns:
      a set of equality deletes
    • loadPositionDeletes

      public PositionDeleteIndex loadPositionDeletes(Iterable<DeleteFile> deleteFiles, CharSequence filePath)
      Description copied from interface: DeleteLoader
      Loads the content of position delete files for a given data file path into a position index.
      Specified by:
      loadPositionDeletes in interface DeleteLoader
      Parameters:
      deleteFiles - position delete files
      filePath - the data file path for which to load deletes
      Returns:
      a position delete index for the provided data file path