Interface NativeSourceData<K extends Comparable<K>,N,O extends OffsetManager.OffsetManagerEntry<O>,T extends AbstractSourceRecord<K,N,O,T>>
public interface NativeSourceData<K extends Comparable<K>,N,O extends OffsetManager.OffsetManagerEntry<O>,T extends AbstractSourceRecord<K,N,O,T>>
-
Method Summary
Modifier and TypeMethodDescriptioncreateOffsetManagerEntry
(N nativeObject) Creates an OffsetManagerEntry for a native object.createSourceRecord
(N nativeObject) Creates an instance of the concrete implementation of AbstractSourceRecord for the native object.org.apache.commons.io.function.IOSupplier<InputStream>
getInputStream
(T sourceRecord) Gets an IOSupplier for the specific source record.getNativeItemStream
(K offset) Get a stream of Native object from the underlying storage layer.getNativeKey
(N nativeObject) Retrieves the native key for the underlying storage that is associated with the native object.getOffsetManagerKey
(K nativeKey) Creates an offset manager key for the native key.Gets the name for the source type.
-
Method Details
-
getSourceName
String getSourceName()Gets the name for the source type. -
getNativeItemStream
Get a stream of Native object from the underlying storage layer. The implementation must return the native objects in a repeatable order based on the key. In addition, the underlying storage must be able to start streaming from a specific previously returned key.- Parameters:
offset
- the native key to start from. May benull
ot indicate start at the beginning.- Returns:
- A stream of native objects. May be empty but not
null
.
-
getInputStream
Gets an IOSupplier for the specific source record. The implementation should accept an AbstractSourceRecord created from a sourceRecord returned from a previous call tocreateSourceRecord(N)
.- Parameters:
sourceRecord
- the source record to get the input stream from.- Returns:
- the IOSupplier that retrieves an InputStream from the source record.
-
getNativeKey
Retrieves the native key for the underlying storage that is associated with the native object.- Parameters:
nativeObject
- the native object to retrieve the native key for.- Returns:
- The native key for the native object.
-
createSourceRecord
Creates an instance of the concrete implementation of AbstractSourceRecord for the native object. The SAbstractSourceRecord need only contain theNativeInfo
instance.- Parameters:
nativeObject
- the native object to get the AbstractSourceRecord for.- Returns:
- the AbstractSourceRecord for the native object.
-
createOffsetManagerEntry
Creates an OffsetManagerEntry for a native object.- Parameters:
nativeObject
- the native object to create the OffsetManagerEntry for.- Returns:
- An OffsetManagerEntry for a native object.
-
getOffsetManagerKey
Creates an offset manager key for the native key.- Parameters:
nativeKey
- THe native key to create an offset manager key for.- Returns:
- An offset manager key.
-