public KafkaSchemaRegistry create(Properties props) { return new KafkaAvroSchemaRegistry(props); } }
public SchemaRegistryVersionWriter(Config config) throws IOException { this(new KafkaAvroSchemaRegistry(ConfigUtils.configToProperties(config)), Optional.<String>absent(), Optional.<Schema>absent()); }
/** * Get a {@link org.apache.gobblin.metrics.kafka.KafkaReporter.Builder} for this reporting format. * * @param properties {@link Properties} containing information to build reporters. * @return {@link org.apache.gobblin.metrics.kafka.KafkaReporter.Builder}. */ public KafkaReporter.Builder<?> metricReporterBuilder(Properties properties) { switch (this) { case AVRO: KafkaAvroReporter.Builder<?> builder = KafkaAvroReporter.BuilderFactory.newBuilder(); if (Boolean.valueOf(properties.getProperty(ConfigurationKeys.METRICS_REPORTING_KAFKA_USE_SCHEMA_REGISTRY, ConfigurationKeys.DEFAULT_METRICS_REPORTING_KAFKA_USE_SCHEMA_REGISTRY))) { builder.withSchemaRegistry(new KafkaAvroSchemaRegistry(properties)); } return builder; case JSON: return KafkaReporter.BuilderFactory.newBuilder(); default: // This should never happen. throw new IllegalArgumentException("KafkaReportingFormat not recognized."); } }
if (Boolean.valueOf(properties.getProperty(ConfigurationKeys.METRICS_REPORTING_KAFKA_USE_SCHEMA_REGISTRY, ConfigurationKeys.DEFAULT_METRICS_REPORTING_KAFKA_USE_SCHEMA_REGISTRY))) { kafkaAvroEventReporterBuilder.withSchemaRegistry(new KafkaAvroSchemaRegistry(properties)); kafkaAvroEventKeyValueReporterBuilder.withSchemaRegistry(new KafkaAvroSchemaRegistry(properties));
public KafkaSchemaRegistry create(Properties props) { return new KafkaAvroSchemaRegistry(props); } }
public SchemaRegistryVersionWriter(Config config) throws IOException { this(new KafkaAvroSchemaRegistry(ConfigUtils.configToProperties(config)), Optional.<String>absent(), Optional.<Schema>absent()); }
/** * Get a {@link org.apache.gobblin.metrics.kafka.KafkaReporter.Builder} for this reporting format. * * @param properties {@link Properties} containing information to build reporters. * @return {@link org.apache.gobblin.metrics.kafka.KafkaReporter.Builder}. */ public KafkaReporter.Builder<?> metricReporterBuilder(Properties properties) { switch (this) { case AVRO: KafkaAvroReporter.Builder<?> builder = KafkaAvroReporter.BuilderFactory.newBuilder(); if (Boolean.valueOf(properties.getProperty(ConfigurationKeys.METRICS_REPORTING_KAFKA_USE_SCHEMA_REGISTRY, ConfigurationKeys.DEFAULT_METRICS_REPORTING_KAFKA_USE_SCHEMA_REGISTRY))) { builder.withSchemaRegistry(new KafkaAvroSchemaRegistry(properties)); } return builder; case JSON: return KafkaReporter.BuilderFactory.newBuilder(); default: // This should never happen. throw new IllegalArgumentException("KafkaReportingFormat not recognized."); } }
/** * Get a {@link org.apache.gobblin.metrics.kafka.KafkaEventReporter.Builder} for this reporting format. * @param context {@link MetricContext} that should be reported. * @param properties {@link Properties} containing information to build reporters. * @return {@link org.apache.gobblin.metrics.kafka.KafkaEventReporter.Builder}. */ public KafkaEventReporter.Builder<?> eventReporterBuilder(MetricContext context, Properties properties) { switch (this) { case AVRO: KafkaAvroEventReporter.Builder<?> builder = KafkaAvroEventReporter.Factory.forContext(context); if (Boolean.valueOf(properties.getProperty(ConfigurationKeys.METRICS_REPORTING_KAFKA_USE_SCHEMA_REGISTRY, ConfigurationKeys.DEFAULT_METRICS_REPORTING_KAFKA_USE_SCHEMA_REGISTRY))) { builder.withSchemaRegistry(new KafkaAvroSchemaRegistry(properties)); } return builder; case JSON: return KafkaEventReporter.Factory.forContext(context); default: // This should never happen. throw new IllegalArgumentException("KafkaReportingFormat not recognized."); } } }