public class BaseDeleteLoader extends java.lang.Object implements DeleteLoader
Constructor and Description |
---|
BaseDeleteLoader(java.util.function.Function<DeleteFile,InputFile> loadInputFile) |
BaseDeleteLoader(java.util.function.Function<DeleteFile,InputFile> loadInputFile,
java.util.concurrent.ExecutorService workerPool) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canCache(long size)
Checks if the given number of bytes can be cached.
|
protected <V> V |
getOrLoad(java.lang.String key,
java.util.function.Supplier<V> valueSupplier,
long valueSize)
Gets the cached value for the key or populates the cache with a new mapping.
|
StructLikeSet |
loadEqualityDeletes(java.lang.Iterable<DeleteFile> deleteFiles,
Schema projection)
Loads the content of equality delete files into a set.
|
PositionDeleteIndex |
loadPositionDeletes(java.lang.Iterable<DeleteFile> deleteFiles,
java.lang.CharSequence filePath)
Loads the content of position delete files for a given data file path into a position index.
|
public BaseDeleteLoader(java.util.function.Function<DeleteFile,InputFile> loadInputFile)
public BaseDeleteLoader(java.util.function.Function<DeleteFile,InputFile> loadInputFile, java.util.concurrent.ExecutorService workerPool)
protected boolean canCache(long size)
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.
protected <V> V getOrLoad(java.lang.String key, java.util.function.Supplier<V> valueSupplier, long valueSize)
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.
public StructLikeSet loadEqualityDeletes(java.lang.Iterable<DeleteFile> deleteFiles, Schema projection)
DeleteLoader
loadEqualityDeletes
in interface DeleteLoader
deleteFiles
- equality delete filesprojection
- a projection of columns to loadpublic PositionDeleteIndex loadPositionDeletes(java.lang.Iterable<DeleteFile> deleteFiles, java.lang.CharSequence filePath)
DeleteLoader
loadPositionDeletes
in interface DeleteLoader
deleteFiles
- position delete filesfilePath
- the data file path for which to load deletes