org.apache.kafka.streams.kstream.Transformer Java Examples

The following examples show how to use org.apache.kafka.streams.kstream.Transformer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TracingTransformer.java    From brave with Apache License 2.0 5 votes vote down vote up
TracingTransformer(KafkaStreamsTracing kafkaStreamsTracing, String spanName,
  Transformer<K, V, R> delegateTransformer) {
  this.kafkaStreamsTracing = kafkaStreamsTracing;
  this.tracer = kafkaStreamsTracing.tracer;
  this.spanName = spanName;
  this.delegateTransformer = delegateTransformer;
}
 
Example #2
Source File: KafkaStreamsTracingTest.java    From brave with Apache License 2.0 5 votes vote down vote up
@Test
public void transformSupplier_should_tag_app_id_and_task_id() {
  Transformer<String, String, KeyValue<String, String>> processor = fakeTransformerSupplier.get();
  processor.init(processorContextSupplier.apply(new RecordHeaders()));
  processor.transform(TEST_KEY, TEST_VALUE);

  assertThat(spans.get(0).tags())
    .containsOnly(
      entry("kafka.streams.application.id", TEST_APPLICATION_ID),
      entry("kafka.streams.task.id", TEST_TASK_ID));
}
 
Example #3
Source File: MetricDataTransformerSupplier.java    From adaptive-alerting with Apache License 2.0 4 votes vote down vote up
@Override
public Transformer<String, MetricData, KeyValue<String, MapperResult>> get() {
    return new MetricDataTransformer(detectorMapper, stateStoreName);
}
 
Example #4
Source File: TracingFilterTransformerSupplier.java    From brave with Apache License 2.0 4 votes vote down vote up
@Override public Transformer<K, V, KeyValue<K, V>> get() {
  return new TracingFilterTransformer<>(kafkaStreamsTracing, spanName, delegatePredicate,
    filterNot);
}
 
Example #5
Source File: TracingTransformerSupplier.java    From brave with Apache License 2.0 4 votes vote down vote up
/** This wraps transform method to enable tracing. */
@Override public Transformer<K, V, R> get() {
  return new TracingTransformer<>(kafkaStreamsTracing, spanName, delegateTransformerSupplier.get());
}