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 Details

    • getSourceName

      String getSourceName()
      Gets the name for the source type.
    • getNativeItemStream

      Stream<N> getNativeItemStream(K offset)
      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 be null ot indicate start at the beginning.
      Returns:
      A stream of native objects. May be empty but not null.
    • getInputStream

      org.apache.commons.io.function.IOSupplier<InputStream> getInputStream(T sourceRecord)
      Gets an IOSupplier for the specific source record. The implementation should accept an AbstractSourceRecord created from a sourceRecord returned from a previous call to createSourceRecord(N).
      Parameters:
      sourceRecord - the source record to get the input stream from.
      Returns:
      the IOSupplier that retrieves an InputStream from the source record.
    • getNativeKey

      K getNativeKey(N nativeObject)
      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

      T createSourceRecord(N nativeObject)
      Creates an instance of the concrete implementation of AbstractSourceRecord for the native object. The SAbstractSourceRecord need only contain the NativeInfo instance.
      Parameters:
      nativeObject - the native object to get the AbstractSourceRecord for.
      Returns:
      the AbstractSourceRecord for the native object.
    • createOffsetManagerEntry

      O createOffsetManagerEntry(N nativeObject)
      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

      OffsetManager.OffsetManagerKey getOffsetManagerKey(K nativeKey)
      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.