Search in sources :

Example 1 with MetricsContainer

use of io.confluent.kafka.schemaregistry.metrics.MetricsContainer in project schema-registry by confluentinc.

the class KafkaStoreMessageHandler method handleSchemaUpdate.

private void handleSchemaUpdate(SchemaKey schemaKey, SchemaValue schemaValue, SchemaValue oldSchemaValue) {
    final MetricsContainer metricsContainer = schemaRegistry.getMetricsContainer();
    if (schemaValue != null) {
        // Update the maximum id seen so far
        idGenerator.schemaRegistered(schemaKey, schemaValue);
        if (schemaValue.isDeleted()) {
            lookupCache.schemaDeleted(schemaKey, schemaValue, oldSchemaValue);
            updateMetrics(metricsContainer.getSchemasDeleted(), metricsContainer.getSchemasDeleted(getSchemaType(schemaValue)));
        } else {
            lookupCache.schemaRegistered(schemaKey, schemaValue, oldSchemaValue);
            updateMetrics(metricsContainer.getSchemasCreated(), metricsContainer.getSchemasCreated(getSchemaType(schemaValue)));
        }
    } else {
        lookupCache.schemaTombstoned(schemaKey, oldSchemaValue);
    }
}
Also used : MetricsContainer(io.confluent.kafka.schemaregistry.metrics.MetricsContainer)

Aggregations

MetricsContainer (io.confluent.kafka.schemaregistry.metrics.MetricsContainer)1