Class SnowflakeTelemetryChannelStatus


  • public class SnowflakeTelemetryChannelStatus
    extends SnowflakeTelemetryBasicInfo
    Extension of SnowflakeTelemetryBasicInfo class used to send data to snowflake when the TopicPartitionChannel closes. Also creates and registers various metrics with JMX

    Most of the data sent to Snowflake is aggregated data.

    • Constructor Detail

      • SnowflakeTelemetryChannelStatus

        public SnowflakeTelemetryChannelStatus​(String tableName,
                                               String connectorName,
                                               String channelName,
                                               long startTime,
                                               boolean enableCustomJMXConfig,
                                               MetricsJmxReporter metricsJmxReporter,
                                               AtomicLong offsetPersistedInSnowflake,
                                               AtomicLong processedOffset,
                                               AtomicLong latestConsumerOffset)
        Creates a new object tracking TopicPartitionChannel metrics with JMX and send telemetry data to snowflake
        Parameters:
        tableName - the table the channel is ingesting to
        channelName - the name of the TopicPartitionChannel to track
        enableCustomJMXConfig - if JMX metrics are enabled
        metricsJmxReporter - used to report JMX metrics
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in class SnowflakeTelemetryBasicInfo
        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: SnowflakeTelemetryBasicInfo
        Adds the required fields into the given ObjectNode which will then be used as payload in Telemetry API
        Specified by:
        dumpTo in class SnowflakeTelemetryBasicInfo
        Parameters:
        msg - ObjectNode in which extra fields needs to be added.
      • tryUnregisterChannelJMXMetrics

        public void tryUnregisterChannelJMXMetrics()
        Unregisters the JMX metrics if possible
      • getMetricsJmxReporter

        public MetricsJmxReporter getMetricsJmxReporter()
        Gets the JMX metrics reporter
        Returns:
        the JMX metrics reporter
      • getOffsetPersistedInSnowflake

        public long getOffsetPersistedInSnowflake()
      • getProcessedOffset

        public long getProcessedOffset()
      • getLatestConsumerOffset

        public long getLatestConsumerOffset()