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 ofIngestionRunRepository
andCrudIngestionRunRepository
.
-
-
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)
-
Method Summary
All Methods Instance Methods Concrete 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.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.void
save(IngestionRun ingestionRun)
Saves the provided ingestion run.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.void
updateIngestedRows(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)
-
-
Method Detail
-
startRun
public String startRun(String resourceIngestionDefinitionId, String ingestionConfigurationId, String ingestionProcessId, Variant metadata)
Description copied from interface:IngestionRunRepository
Starts a new ingestion run with the provided definition id, configuration id, process id, and metadata.- Specified by:
startRun
in 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:IngestionRunRepository
Ends the specified ingestion run, setting the run status, number of ingested rows, and metadata.- Specified by:
endRun
in 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:IngestionRunRepository
Updates the number of ingested rows for the specified ingestion run.- Specified by:
updateIngestedRows
in 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:IngestionRunRepository
Finds an ingestion run with the specified id.- Specified by:
findById
in 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:CrudIngestionRunRepository
Finds first ingestion run matching specified condition from sorted result.- Specified by:
findBy
in 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:IngestionRunRepository
Fetches all ingestion runs created for the specified resource ingestion definition id.- Specified by:
fetchAllByResourceId
in 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:IngestionRunRepository
Fetches all ingestion runs created for the specified ingestion process id.- Specified by:
fetchAllByProcessId
in interfaceIngestionRunRepository
- Parameters:
processId
- ingestion process id- Returns:
- all ingestion runs created for the specified ingestion process id
-
save
public void save(IngestionRun ingestionRun)
Description copied from interface:CrudIngestionRunRepository
Saves the provided ingestion run.Since the
startedAt
andupdatedAt
properties of the run are required, they will be set to default values if not provided, despite the simple nature of this repository.- Specified by:
save
in interfaceCrudIngestionRunRepository
- Parameters:
ingestionRun
- ingestion run
-
findWhere
public List<IngestionRun> findWhere(Column condition)
Description copied from interface:CrudIngestionRunRepository
Finds all ingestion runs satisfying the specified condition.- Specified by:
findWhere
in interfaceCrudIngestionRunRepository
- Parameters:
condition
- ingestion run condition- Returns:
- all ingestion runs satisfying the specified condition
-
findOngoingIngestionRuns
public List<IngestionRun> findOngoingIngestionRuns()
Description copied from interface:CrudIngestionRunRepository
Finds all ingestion runs with the status ofIN_PROGRESS
.- Specified by:
findOngoingIngestionRuns
in interfaceCrudIngestionRunRepository
- Returns:
- all ongoing ingestion runs
-
findOngoingIngestionRuns
public List<IngestionRun> findOngoingIngestionRuns(String resourceIngestionDefinitionId)
Description copied from interface:CrudIngestionRunRepository
Finds all ingestion runs created for the specified resource ingestion definition id and with the status ofIN_PROGRESS
.- Specified by:
findOngoingIngestionRuns
in 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:CrudIngestionRunRepository
Finds all ingestion runs satisfying the specified condition and with the status ofIN_PROGRESS
.- Specified by:
findOngoingIngestionRunsWhere
in interfaceCrudIngestionRunRepository
- Parameters:
condition
- condition for the ingestion run- Returns:
- all ongoing ingestion runs satisfying the specified condition
-
-