io.delta.flink.source.internal.file.AddFileEnumerator Maven / Gradle / Ivy
package io.delta.flink.source.internal.file;
import java.io.Serializable;
import java.util.List;
import java.util.function.Predicate;
import io.delta.flink.source.internal.state.DeltaSourceSplit;
import org.apache.flink.core.fs.Path;
import io.delta.standalone.actions.AddFile;
/**
* The {@code AddFileEnumerator}'s task is to convert all discovered {@link AddFile} to set of
* {@link DeltaSourceSplit}.
*/
public interface AddFileEnumerator {
/**
* Creates {@link DeltaSourceSplit} for the given {@link AddFile}. The {@code splitFilter}
* decides which AddFiles should be excluded from conversion.
*
* @param context {@link AddFileEnumeratorContext} input object for Split conversion.
* @param splitFilter {@link SplitFilter} instance that will be used to filter out {@link
* AddFile} from split conversion.
* @return List of Splits.
*/
List enumerateSplits(AddFileEnumeratorContext context, SplitFilter splitFilter);
// ------------------------------------------------------------------------
/**
* Factory for the {@code AddFileEnumerator}
*/
@FunctionalInterface
interface Provider extends Serializable {
AddFileEnumerator create();
}
/**
* A functional interface that can be used by {@code AddFileEnumerator} to exclude {@link
* AddFile} from conversion to {@link DeltaSourceSplit}.
*
* @param - Parametrized {@code SplitFilter} instance.
*/
@FunctionalInterface
interface SplitFilter extends Predicate, Serializable {
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy