Class SnowflakeTelemetryChannelStatus
- java.lang.Object
-
- com.snowflake.kafka.connector.internal.telemetry.SnowflakeTelemetryBasicInfo
-
- com.snowflake.kafka.connector.internal.streaming.telemetry.SnowflakeTelemetryChannelStatus
-
public class SnowflakeTelemetryChannelStatus extends SnowflakeTelemetryBasicInfo
Extension ofSnowflakeTelemetryBasicInfoclass used to send data to snowflake when the TopicPartitionChannel closes. Also creates and registers various metrics with JMXMost of the data sent to Snowflake is aggregated data.
-
-
Field Summary
Fields Modifier and Type Field Description static longNUM_METRICS-
Fields inherited from class com.snowflake.kafka.connector.internal.telemetry.SnowflakeTelemetryBasicInfo
LOGGER, tableName, telemetryType
-
-
Constructor Summary
Constructors Constructor Description SnowflakeTelemetryChannelStatus(String tableName, String connectorName, String channelName, long startTime, boolean enableCustomJMXConfig, MetricsJmxReporter metricsJmxReporter, AtomicLong offsetPersistedInSnowflake, AtomicLong processedOffset, AtomicLong latestConsumerOffset)Creates a new object trackingTopicPartitionChannelmetrics with JMX and send telemetry data to snowflake
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 APIlonggetLatestConsumerOffset()MetricsJmxReportergetMetricsJmxReporter()Gets the JMX metrics reporterlonggetOffsetPersistedInSnowflake()longgetProcessedOffset()booleanisEmpty()voidtryUnregisterChannelJMXMetrics()Unregisters the JMX metrics if possible
-
-
-
Field Detail
-
NUM_METRICS
public static final long NUM_METRICS
- See Also:
- Constant Field Values
-
-
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 trackingTopicPartitionChannelmetrics with JMX and send telemetry data to snowflake- Parameters:
tableName- the table the channel is ingesting tochannelName- the name of the TopicPartitionChannel to trackenableCustomJMXConfig- if JMX metrics are enabledmetricsJmxReporter- used to report JMX metrics
-
-
Method Detail
-
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.
-
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()
-
-