@FunctionalInterface public static interface HybridSource.SourceFactory<T,SourceT extends Source<T,?,?>,FromEnumT extends SplitEnumerator> extends Serializable
This factory permits building of a source at graph construction time or deferred at switch time. Provides the ability to set a start position in any way a specific source allows. Future convenience could be built on top of it, for example a default implementation that recognizes optional interfaces to transfer position in a universal format.
Called when the current enumerator has finished. The previous source's final state can thus be used to construct the next source, as required for dynamic position transfer at time of switching.
If start position is known at job submission time, the source can be constructed in the entry point and simply wrapped into the factory, providing the benefit of validation during submission.
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.