Class DefaultIngestionRunRepository
- java.lang.Object
-
- com.snowflake.connectors.application.observability.DefaultIngestionRunRepository
-
- All Implemented Interfaces:
CrudIngestionRunRepository,IngestionRunRepository
public class DefaultIngestionRunRepository extends Object implements IngestionRunRepository, CrudIngestionRunRepository
Default implementation ofIngestionRunRepositoryandCrudIngestionRunRepository.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.snowflake.connectors.application.observability.IngestionRunRepository
IngestionRunRepository.Mode
-
-
Constructor Summary
Constructors Constructor Description DefaultIngestionRunRepository(Session session)Creates a newDefaultIngestionRunRepository.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteAllByResourceId(String resourceIngestionDefinitionId)Deletes all ingestion runs with the specified resource ingestion definition id.voidendRun(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.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>findBy(Column condition, Column sort)Finds first ingestion run matching specified condition from sorted result.Optional<IngestionRun>findById(String id)Finds an ingestion run with the specified id.List<IngestionRun>findOngoingIngestionRuns()Finds all ingestion runs with the status ofIN_PROGRESS.List<IngestionRun>findOngoingIngestionRuns(String resourceIngestionDefinitionId)Finds all ingestion runs created for the specified resource ingestion definition id and with the status ofIN_PROGRESS.List<IngestionRun>findOngoingIngestionRunsWhere(Column condition)Finds all ingestion runs satisfying the specified condition and with the status ofIN_PROGRESS.List<IngestionRun>findWhere(Column condition)Finds all ingestion runs satisfying the specified condition.voidsave(IngestionRun ingestionRun)Saves the provided ingestion run.StringstartRun(String resourceIngestionDefinitionId, String ingestionConfigurationId, String ingestionProcessId, Variant metadata)Starts a new ingestion run with the provided definition id, configuration id, process id, and metadata.voidupdateIngestedRows(String id, Long ingestedRows, IngestionRunRepository.Mode mode)Updates the number of ingested rows for the specified ingestion run.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.snowflake.connectors.application.observability.IngestionRunRepository
endRun, startRun, updateIngestedRows
-
-
-
-
Constructor Detail
-
DefaultIngestionRunRepository
public DefaultIngestionRunRepository(Session session)
Creates a newDefaultIngestionRunRepository.- Parameters:
session- Snowpark session object
-
-
Method Detail
-
startRun
public String startRun(String resourceIngestionDefinitionId, String ingestionConfigurationId, String ingestionProcessId, Variant metadata)
Description copied from interface:IngestionRunRepositoryStarts a new ingestion run with the provided definition id, configuration id, process id, and metadata.- Specified by:
startRunin interfaceIngestionRunRepository- Parameters:
resourceIngestionDefinitionId- resource ingestion definition idingestionConfigurationId- ingestion configuration definition idingestionProcessId- ingestion process idmetadata- ingestion run metadata- Returns:
- id of the started ingestion run
-
endRun
public void endRun(String id, IngestionRun.IngestionStatus status, Long ingestedRows, IngestionRunRepository.Mode mode, Variant metadata)
Description copied from interface:IngestionRunRepositoryEnds the specified ingestion run, setting the run status, number of ingested rows, and metadata.- Specified by:
endRunin interfaceIngestionRunRepository- 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
-
updateIngestedRows
public void updateIngestedRows(String id, Long ingestedRows, IngestionRunRepository.Mode mode)
Description copied from interface:IngestionRunRepositoryUpdates the number of ingested rows for the specified ingestion run.- Specified by:
updateIngestedRowsin interfaceIngestionRunRepository- Parameters:
id- ingestion run idingestedRows- number of ingested rowsmode- specifies how the number of ingested rows will be persisted
-
findById
public Optional<IngestionRun> findById(String id)
Description copied from interface:IngestionRunRepositoryFinds an ingestion run with the specified id.- Specified by:
findByIdin interfaceIngestionRunRepository- Parameters:
id- id of the ingestion run- Returns:
- ingestion run with the specified id
-
findBy
public Optional<IngestionRun> findBy(Column condition, Column sort)
Description copied from interface:CrudIngestionRunRepositoryFinds first ingestion run matching specified condition from sorted result.- Specified by:
findByin interfaceCrudIngestionRunRepository- Parameters:
condition- condition matching ingestion runssort- sorting order- Returns:
- first ingestion run matching specified condition from sorted result
-
fetchAllByResourceId
public List<IngestionRun> fetchAllByResourceId(String resourceIngestionDefinitionId)
Description copied from interface:IngestionRunRepositoryFetches all ingestion runs created for the specified resource ingestion definition id.- Specified by:
fetchAllByResourceIdin interfaceIngestionRunRepository- Parameters:
resourceIngestionDefinitionId- resource ingestion definition id- Returns:
- all ingestion runs created for the specified resource ingestion definition id
-
fetchAllByProcessId
public List<IngestionRun> fetchAllByProcessId(String processId)
Description copied from interface:IngestionRunRepositoryFetches all ingestion runs created for the specified ingestion process id.- Specified by:
fetchAllByProcessIdin interfaceIngestionRunRepository- Parameters:
processId- ingestion process id- Returns:
- all ingestion runs created for the specified ingestion process id
-
deleteAllByResourceId
public void deleteAllByResourceId(String resourceIngestionDefinitionId)
Description copied from interface:IngestionRunRepositoryDeletes all ingestion runs with the specified resource ingestion definition id.- Specified by:
deleteAllByResourceIdin interfaceIngestionRunRepository- Parameters:
resourceIngestionDefinitionId- resource ingestion definition id
-
save
public void save(IngestionRun ingestionRun)
Description copied from interface:CrudIngestionRunRepositorySaves the provided ingestion run.Since the
startedAtandupdatedAtproperties of the run are required, they will be set to default values if not provided, despite the simple nature of this repository.- Specified by:
savein interfaceCrudIngestionRunRepository- Parameters:
ingestionRun- ingestion run
-
findWhere
public List<IngestionRun> findWhere(Column condition)
Description copied from interface:CrudIngestionRunRepositoryFinds all ingestion runs satisfying the specified condition.- Specified by:
findWherein interfaceCrudIngestionRunRepository- Parameters:
condition- ingestion run condition- Returns:
- all ingestion runs satisfying the specified condition
-
findOngoingIngestionRuns
public List<IngestionRun> findOngoingIngestionRuns()
Description copied from interface:CrudIngestionRunRepositoryFinds all ingestion runs with the status ofIN_PROGRESS.- Specified by:
findOngoingIngestionRunsin interfaceCrudIngestionRunRepository- Returns:
- all ongoing ingestion runs
-
findOngoingIngestionRuns
public List<IngestionRun> findOngoingIngestionRuns(String resourceIngestionDefinitionId)
Description copied from interface:CrudIngestionRunRepositoryFinds all ingestion runs created for the specified resource ingestion definition id and with the status ofIN_PROGRESS.- Specified by:
findOngoingIngestionRunsin interfaceCrudIngestionRunRepository- Parameters:
resourceIngestionDefinitionId- resource ingestion definition id- Returns:
- all ongoing ingestion runs created for the specified resource ingestion definition id
-
findOngoingIngestionRunsWhere
public List<IngestionRun> findOngoingIngestionRunsWhere(Column condition)
Description copied from interface:CrudIngestionRunRepositoryFinds all ingestion runs satisfying the specified condition and with the status ofIN_PROGRESS.- Specified by:
findOngoingIngestionRunsWherein interfaceCrudIngestionRunRepository- Parameters:
condition- condition for the ingestion run- Returns:
- all ongoing ingestion runs satisfying the specified condition
-
-