Interface SimpleIngestion<I,M,C,D>
-
- Type Parameters:
I- resource id class, containing properties which identify the resource in the source systemM- resource metadata class, containing additional properties which identify the resource in the source system. The properties can be fetched automatically or calculated by the connectorC- custom ingestion configuration class, containing custom ingestion propertiesD- destination configuration class, containing properties describing where the ingested data should be stored
public interface SimpleIngestion<I,M,C,D>Interface that should be implemented by users of task reactor and passed over toIngestionWorkerinstance.
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.LoggerlogLogger instance for use in the default methods of this interface.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidfetchData(SimpleIngestionWorkItem<I,M,C,D> workItem, String ingestionRunId)Fetches data from source, can be also responsible for creating necessary objects like tables.default voidonFailedIngestionCallback(SimpleIngestionWorkItem<I,M,C,D> workItem, String ingestionRunId)Executes callback when failed ingestion is registered.default voidonSuccessfulIngestionCallback(SimpleIngestionWorkItem<I,M,C,D> workItem, String ingestionRunId)Executes callback when successful ingestion is registered.longpersistData(SimpleIngestionWorkItem<I,M,C,D> workItem, String ingestionRunId)Persists data in the destination.default voidpostIngestion(SimpleIngestionWorkItem<I,M,C,D> workItem, String ingestionRunId)Does steps after successful ingestion.
-
-
-
Method Detail
-
fetchData
default void fetchData(SimpleIngestionWorkItem<I,M,C,D> workItem, String ingestionRunId)
Fetches data from source, can be also responsible for creating necessary objects like tables. It is optional step since data can be fetched in a persistData method.- Parameters:
workItem- work item provided by the dispatcher.ingestionRunId- ingestion run id created by the worker.
-
persistData
long persistData(SimpleIngestionWorkItem<I,M,C,D> workItem, String ingestionRunId)
Persists data in the destination. Data can be fetched here if it must be done in one transactional step.- Parameters:
workItem- work item provided by the dispatcher.ingestionRunId- ingestion run id created by the worker.- Returns:
- number of rows persisted to the destination.
-
onSuccessfulIngestionCallback
default void onSuccessfulIngestionCallback(SimpleIngestionWorkItem<I,M,C,D> workItem, String ingestionRunId)
Executes callback when successful ingestion is registered.- Parameters:
workItem- work item provided by the dispatcher.ingestionRunId- ingestion run id created by the worker.
-
onFailedIngestionCallback
default void onFailedIngestionCallback(SimpleIngestionWorkItem<I,M,C,D> workItem, String ingestionRunId)
Executes callback when failed ingestion is registered.- Parameters:
workItem- work item provided by the dispatcher.ingestionRunId- ingestion run id created by the worker.
-
-