Class SnowflakeTelemetryPipeStatus
- java.lang.Object
-
- com.snowflake.kafka.connector.internal.telemetry.SnowflakeTelemetryBasicInfo
-
- com.snowflake.kafka.connector.internal.telemetry.SnowflakeTelemetryPipeStatus
-
public class SnowflakeTelemetryPipeStatus extends SnowflakeTelemetryBasicInfo
Extension ofSnowflakeTelemetryBasicInfoclass used to send data to snowflake periodically.Check frequency of
SnowflakeTelemetryService.reportKafkaPartitionUsage(SnowflakeTelemetryBasicInfo, boolean)Most of the data sent to Snowflake is an aggregated data.
-
-
Field Summary
-
Fields inherited from class com.snowflake.kafka.connector.internal.telemetry.SnowflakeTelemetryBasicInfo
LOGGER, tableName, telemetryType
-
-
Constructor Summary
Constructors Constructor Description SnowflakeTelemetryPipeStatus(String tableName, String stageName, String pipeName, boolean enableCustomJMXConfig, MetricsJmxReporter metricsJmxReporter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAndGetFileCountOnIngestion(long fileCountOnIngestion)voidaddAndGetFileCountOnStage(long fileCountOnStage)voidaddAndGetFileCountPurged(long fileCountPurged)voidaddAndGetMemoryUsage(long memoryUsage)voidaddAndGetTotalNumberOfRecord(long totalNumberOfRecord)voidaddAndGetTotalSizeOfData(long totalSizeOfData)voiddumpTo(net.snowflake.client.jdbc.internal.fasterxml.jackson.databind.node.ObjectNode msg)Adds the required fields into the given ObjectNode which will then be used as payload in Telemetry APIlongincrementAndGetCleanerRestartCount()booleanisEmpty()voidresetMemoryUsage()voidsetAverageCommitLagFileCount(long averageCommitLagFileCount)voidsetAverageCommitLagMs(long averageCommitLagMs)voidsetAverageIngestionLagFileCount(long averageIngestionLagFileCount)voidsetAverageIngestionLagMs(long averageIngestionLagMs)voidsetAverageKafkaLagMs(long averageKafkaLagMs)voidsetAverageKafkaLagRecordCount(long averageKafkaLagRecordCount)voidsetCleanerRestartCount(long cleanerRestartCount)voidsetCommittedOffset(long committedOffset)voidsetFlushedOffset(long flushedOffset)voidsetProcessedOffset(long processedOffset)voidsetPurgedOffsetAtomically(LongUnaryOperator unaryOperator)Either keeps the same offset or updates the purgedOffset if a higher value offset is found in insertReport Snowpipe APIvoidupdateBrokenRecordMetrics(long n)When either key or value is broken.voidupdateCommitLag(long lag)Commit Lag is time between kafka connector commits the after calling insertFiles API and time file was flushed into internal stage.voidupdateFailedIngestionMetrics(long n)When Ingestion status of n number of files is not found/failed.voidupdateIngestionLag(long lag)Ingestion Lag is time between kafka connector flushes the file and time file was first found from insertReport/loadHistory API.voidupdateKafkaLag(long lag)Kafka Lag is time between kafka connector sees the record and time record was inserted into kafka.
-
-
-
Constructor Detail
-
SnowflakeTelemetryPipeStatus
public SnowflakeTelemetryPipeStatus(String tableName, String stageName, String pipeName, boolean enableCustomJMXConfig, MetricsJmxReporter metricsJmxReporter)
-
-
Method Detail
-
updateKafkaLag
public void updateKafkaLag(long lag)
Kafka Lag is time between kafka connector sees the record and time record was inserted into kafka.Check the implementation of updateLag on what is done with this lag.
- Parameters:
lag-
-
updateIngestionLag
public void updateIngestionLag(long lag)
Ingestion Lag is time between kafka connector flushes the file and time file was first found from insertReport/loadHistory API.Check the implementation of updateLag on what is done with this lag.
- Parameters:
lag-
-
updateCommitLag
public void updateCommitLag(long lag)
Commit Lag is time between kafka connector commits the after calling insertFiles API and time file was flushed into internal stage.Check the implementation of updateLag on what is done with this lag.
- Parameters:
lag-
-
updateBrokenRecordMetrics
public void updateBrokenRecordMetrics(long n)
When either key or value is broken.- Parameters:
n- number of records
-
updateFailedIngestionMetrics
public void updateFailedIngestionMetrics(long n)
When Ingestion status of n number of files is not found/failed.- Parameters:
n- number of files failed ingestion
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin classSnowflakeTelemetryBasicInfo- Returns:
- true if it would suggest that their was no update to corresponding implementation's member variables. Or, in other words, the corresponding partition didnt receive any records, in which case we would not call telemetry API.
-
dumpTo
public void dumpTo(net.snowflake.client.jdbc.internal.fasterxml.jackson.databind.node.ObjectNode msg)
Description copied from class:SnowflakeTelemetryBasicInfoAdds the required fields into the given ObjectNode which will then be used as payload in Telemetry API- Specified by:
dumpToin classSnowflakeTelemetryBasicInfo- Parameters:
msg- ObjectNode in which extra fields needs to be added.
-
setProcessedOffset
public void setProcessedOffset(long processedOffset)
-
setFlushedOffset
public void setFlushedOffset(long flushedOffset)
-
setCommittedOffset
public void setCommittedOffset(long committedOffset)
-
setPurgedOffsetAtomically
public void setPurgedOffsetAtomically(LongUnaryOperator unaryOperator)
Either keeps the same offset or updates the purgedOffset if a higher value offset is found in insertReport Snowpipe API- Parameters:
unaryOperator- the function to apply on purgedOffset
-
addAndGetFileCountOnStage
public void addAndGetFileCountOnStage(long fileCountOnStage)
-
addAndGetFileCountOnIngestion
public void addAndGetFileCountOnIngestion(long fileCountOnIngestion)
-
addAndGetFileCountPurged
public void addAndGetFileCountPurged(long fileCountPurged)
-
incrementAndGetCleanerRestartCount
public long incrementAndGetCleanerRestartCount()
-
addAndGetTotalNumberOfRecord
public void addAndGetTotalNumberOfRecord(long totalNumberOfRecord)
-
addAndGetTotalSizeOfData
public void addAndGetTotalSizeOfData(long totalSizeOfData)
-
addAndGetMemoryUsage
public void addAndGetMemoryUsage(long memoryUsage)
-
resetMemoryUsage
public void resetMemoryUsage()
-
setCleanerRestartCount
public void setCleanerRestartCount(long cleanerRestartCount)
-
setAverageKafkaLagMs
public void setAverageKafkaLagMs(long averageKafkaLagMs)
-
setAverageKafkaLagRecordCount
public void setAverageKafkaLagRecordCount(long averageKafkaLagRecordCount)
-
setAverageIngestionLagMs
public void setAverageIngestionLagMs(long averageIngestionLagMs)
-
setAverageIngestionLagFileCount
public void setAverageIngestionLagFileCount(long averageIngestionLagFileCount)
-
setAverageCommitLagMs
public void setAverageCommitLagMs(long averageCommitLagMs)
-
setAverageCommitLagFileCount
public void setAverageCommitLagFileCount(long averageCommitLagFileCount)
-
-