Interface IngestionRunRepository
-
- All Known Implementing Classes:
DefaultIngestionRunRepository
public interface IngestionRunRepository
A repository for basic storage of the ingestion run information. This repository should only be used for logging purposes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IngestionRunRepository.Mode
Update mode for the number of rows ingested during an ingestion run.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
endRun(String id, IngestionRun.IngestionStatus status, Long ingestedRows, IngestionRunRepository.Mode mode, Variant metadata)
Ends the specified ingestion run, setting the run status, number of ingested rows, and metadata.default void
endRun(String id, IngestionRun.IngestionStatus status, Long ingestedRows, Variant metadata)
Ends the specified ingestion run, setting the run status, number of ingested rows, and metadata.List<IngestionRun>
fetchAllByProcessId(String processId)
Fetches all ingestion runs created for the specified ingestion process id.List<IngestionRun>
fetchAllByResourceId(String resourceIngestionDefinitionId)
Fetches all ingestion runs created for the specified resource ingestion definition id.Optional<IngestionRun>
findById(String id)
Finds an ingestion run with the specified id.static IngestionRunRepository
getInstance(Session session)
Returns a new instance of the default repository implementation.default String
startRun(String resourceIngestionDefinitionId, String ingestionConfigurationId, Variant metadata)
Starts a new ingestion run with the provided definition id, configuration id, and metadata.String
startRun(String resourceIngestionDefinitionId, String ingestionConfigurationId, String ingestionProcessId, Variant metadata)
Starts a new ingestion run with the provided definition id, configuration id, process id, and metadata.default void
updateIngestedRows(String id, Long ingestedRows)
Updates the number of ingested rows for the specified ingestion run.void
updateIngestedRows(String id, Long ingestedRows, IngestionRunRepository.Mode mode)
Updates the number of ingested rows for the specified ingestion run.
-
-
-
Method Detail
-
startRun
String startRun(String resourceIngestionDefinitionId, String ingestionConfigurationId, String ingestionProcessId, Variant metadata)
Starts a new ingestion run with the provided definition id, configuration id, process id, and metadata.- Parameters:
resourceIngestionDefinitionId
- resource ingestion definition idingestionConfigurationId
- ingestion configuration definition idingestionProcessId
- ingestion process idmetadata
- ingestion run metadata- Returns:
- id of the started ingestion run
- Throws:
IngestionRunsReferenceException
- if insufficient ingestion information is provided
-
startRun
default String startRun(String resourceIngestionDefinitionId, String ingestionConfigurationId, Variant metadata)
Starts a new ingestion run with the provided definition id, configuration id, and metadata.No ingestion process id is used for the new ingestion run.
- Parameters:
resourceIngestionDefinitionId
- resource ingestion definition idingestionConfigurationId
- ingestion configuration definition idmetadata
- ingestion run metadata- Returns:
- id of the started ingestion run
- Throws:
IngestionRunsReferenceException
- if insufficient ingestion information is provided
-
endRun
void endRun(String id, IngestionRun.IngestionStatus status, Long ingestedRows, IngestionRunRepository.Mode mode, Variant metadata)
Ends the specified ingestion run, setting the run status, number of ingested rows, and metadata.- Parameters:
id
- ingestion run idstatus
- ingestion run statusingestedRows
- number of ingested rowsmode
- specifies how the number of ingested rows will be persistedmetadata
- ingestion run metadata- Throws:
IngestionRunsBadStatusException
- if the provided status cannot be used when ending an ingestion run
-
endRun
default void endRun(String id, IngestionRun.IngestionStatus status, Long ingestedRows, Variant metadata)
Ends the specified ingestion run, setting the run status, number of ingested rows, and metadata.The currently persisted number of ingested rows will be overwritten by the provided value.
- Parameters:
id
- ingestion run idstatus
- ingestion run statusingestedRows
- number of ingested rowsmetadata
- ingestion run metadata- Throws:
IngestionRunsBadStatusException
- if the provided status cannot be used when ending an ingestion run
-
updateIngestedRows
void updateIngestedRows(String id, Long ingestedRows, IngestionRunRepository.Mode mode)
Updates the number of ingested rows for the specified ingestion run.- Parameters:
id
- ingestion run idingestedRows
- number of ingested rowsmode
- specifies how the number of ingested rows will be persisted- Throws:
IngestionRunsUpdateException
- if the specified ingestion run does not exist
-
updateIngestedRows
default void updateIngestedRows(String id, Long ingestedRows)
Updates the number of ingested rows for the specified ingestion run.The currently persisted number of ingested rows will be overwritten by the provided value.
- Parameters:
id
- ingestion run idingestedRows
- number of ingested rows- Throws:
IngestionRunsUpdateException
- if the specified ingestion run does not exist
-
findById
Optional<IngestionRun> findById(String id)
Finds an ingestion run with the specified id.- Parameters:
id
- id of the ingestion run- Returns:
- ingestion run with the specified id
-
fetchAllByResourceId
List<IngestionRun> fetchAllByResourceId(String resourceIngestionDefinitionId)
Fetches all ingestion runs created for the specified resource ingestion definition id.- Parameters:
resourceIngestionDefinitionId
- resource ingestion definition id- Returns:
- all ingestion runs created for the specified resource ingestion definition id
-
fetchAllByProcessId
List<IngestionRun> fetchAllByProcessId(String processId)
Fetches all ingestion runs created for the specified ingestion process id.- Parameters:
processId
- ingestion process id- Returns:
- all ingestion runs created for the specified ingestion process id
-
getInstance
static IngestionRunRepository getInstance(Session session)
Returns a new instance of the default repository implementation.Default implementation of the repository uses the
STATE.INGESTION_RUN
table.Default implementation of the repository also implements additional methods from the
CrudIngestionRunRepository
interface.- Parameters:
session
- Snowpark session object- Returns:
- a new repository instance
-
-