private static String getSchemaId(Properties properties, Schema schema) throws SchemaRegistryException { KafkaAvroSchemaRegistry kafkaAvroSchemaRegistry = (KafkaAvroSchemaRegistry) new KafkaAvroSchemaRegistryFactory().create(properties); return kafkaAvroSchemaRegistry.register(schema); }
/** * Builds and returns {@link KafkaAvroReporter}. * * @param brokers string of Kafka brokers * @param topic topic to send metrics to * @return KafkaAvroReporter */ public KafkaAvroReporter build(String brokers, String topic, Properties props) throws IOException { this.brokers = brokers; this.topic = topic; // create a KafkaAvroReporter with metrics.* and gobblin.kafka.sharedConfig.* keys return new KafkaAvroReporter(this, KafkaReporter.getKafkaAndMetricsConfigFromProperties(props)); } }
/** * Returns a new {@link Builder} for {@link KafkaAvroEventReporter}. * * @param context the {@link MetricContext} to report * @return KafkaAvroReporter builder */ public static BuilderImpl forContext(MetricContext context) { return new BuilderImpl(context); } }
@Override public KafkaEventReporter.Builder<? extends KafkaEventReporter.Builder> getBuilder(MetricContext context, Pusher pusher) { KafkaAvroEventKeyValueReporter.Builder<?> builder = KafkaAvroEventKeyValueReporter.Factory.forContext(context); return builder.withKafkaPusher(pusher).withKeys(Lists.newArrayList("k1", "k2", "k3")); }
/** * Get builder for KafkaReporter (override if testing an extension of KafkaReporter) * @return KafkaReporter builder */ public KafkaReporter.Builder<? extends KafkaReporter.Builder> getBuilder(Pusher pusher) { return KafkaReporter.BuilderFactory.newBuilder().withKafkaPusher(pusher); }
@Override public KafkaReporter.Builder<? extends KafkaReporter.Builder> getBuilderFromContext(Pusher pusher) { return KafkaAvroReporter.BuilderFactory.newBuilder().withKafkaPusher(pusher); }
@Override public KafkaEventReporter.Builder<? extends KafkaEventReporter.Builder> getBuilder(MetricContext context, Pusher pusher) { return KafkaAvroEventReporter.forContext(context).withKafkaPusher(pusher); }
/** * Get builder for KafkaReporter (override if testing an extension of KafkaReporter) * @param context metricregistry * @return KafkaReporter builder */ public KafkaEventReporter.Builder<? extends KafkaEventReporter.Builder> getBuilder(MetricContext context, Pusher pusher) { return KafkaEventReporter.Factory.forContext(context).withKafkaPusher(pusher); }
/** * Builds and returns {@link KafkaAvroEventReporter}. * * @param brokers string of Kafka brokers * @param topic topic to send metrics to * @return KafkaAvroReporter */ public KafkaAvroEventReporter build(String brokers, String topic) throws IOException { this.brokers = brokers; this.topic = topic; return new KafkaAvroEventReporter(this); }
/** * Returns a new {@link Builder} for {@link KafkaEventReporter}. * Will automatically add all Context tags to the reporter. * * @param context the {@link MetricContext} to report * @return KafkaReporter builder */ public static BuilderImpl forContext(MetricContext context) { return new BuilderImpl(context); } }
/** * Builds and returns {@link KafkaEventReporter}. * * @param brokers string of Kafka brokers * @param topic topic to send metrics to * @return KafkaReporter */ public KafkaEventReporter build(String brokers, String topic) throws IOException { this.brokers = brokers; this.topic = topic; return new KafkaEventReporter(this); }
public KafkaSchemaRegistry create(Properties props) { return new KafkaAvroSchemaRegistry(props); } }
public static BuilderImpl newBuilder() { return new BuilderImpl(); } }
public static BuilderImpl newBuilder() { return new BuilderImpl(); } }
/** * Returns a new {@link Builder} for {@link KafkaEventKeyValueReporter}. * * @param context the {@link MetricContext} to report * @return KafkaAvroReporter builder */ public static BuilderImpl forContext(MetricContext context) { return new BuilderImpl(context); } }
/** * Returns a new {@link Builder} for {@link KafkaAvroEventKeyValueReporter}. * * @param context the {@link MetricContext} to report * @return KafkaAvroReporter builder */ public static BuilderImpl forContext(MetricContext context) { return new BuilderImpl(context); } }
/** * Builds and returns {@link KafkaAvroEventReporter}. * * @param brokers string of Kafka brokers * @param topic topic to send metrics to * @return KafkaAvroReporter */ public KafkaAvroEventKeyValueReporter build(String brokers, String topic) throws IOException { this.brokers = brokers; this.topic = topic; return new KafkaAvroEventKeyValueReporter(this); } }
@Override public void close() throws IOException { super.close(); }
public KafkaReporter.Builder<? extends KafkaReporter.Builder> getBuilderFromContext(Pusher pusher) { return KafkaReporter.BuilderFactory.newBuilder().withKafkaPusher(pusher); }
@Override public KafkaReporter.Builder<? extends KafkaReporter.Builder> getBuilder(Pusher pusher) { return KafkaAvroReporter.BuilderFactory.newBuilder().withKafkaPusher(pusher); }