@Test public void testExtract() { val mmd = TestObjectMother.mappedMetricData(); val metricData = mmd.getMetricData(); val record = new ConsumerRecord<Object, Object>("some-topic", 1, 0, "some-key", mmd); val expectedTimestamp = metricData.getTimestamp() * 1000L; val actualTimestamp = new MappedMetricDataTimestampExtractor().extract(record, -1L); assertEquals(expectedTimestamp, actualTimestamp); }
@Override public long extract(ConsumerRecord<Object, Object> record, long previousTimestamp) { val mappedMetricData = (MappedMetricData) record.value(); if (mappedMetricData == null || mappedMetricData.getMetricData() == null) { return -1L; } return mappedMetricData.getMetricData().getTimestamp() * 1000L; }
MappedMetricDataTimestampExtractor implements TimestampExtractor { @Override public long extract(ConsumerRecord<Object, Object> record, long previousTimestamp) { val mappedMetricData = (MappedMetricData) record.value(); if (mappedMetricData == null || mappedMetricData.getMetricData() == null) { return -1L; } return mappedMetricData.getMetricData().getTimestamp() * 1000L; } }
MappedMetricDataTimestampExtractor implements TimestampExtractor { @Override public long extract(ConsumerRecord<Object, Object> record, long previousTimestamp) { val mappedMetricData = (MappedMetricData) record.value(); if (mappedMetricData == null || mappedMetricData.getMetricData() == null) { return -1L; } return mappedMetricData.getMetricData().getTimestamp() * 1000L; }  }
MappedMetricDataTimestampExtractor implements TimestampExtractor { @Override public long extract(ConsumerRecord<Object, Object> record, long previousTimestamp) { val mappedMetricData = (MappedMetricData) record.value(); if (mappedMetricData == null || mappedMetricData.getMetricData() == null) { return -1L; } return mappedMetricData.getMetricData().getTimestamp() * 1000L; }  @Override long extract(ConsumerRecord<Object, Object> record, long previousTimestamp); }
MappedMetricDataTimestampExtractor implements TimestampExtractor { @Override public long extract(ConsumerRecord<Object, Object> record, long previousTimestamp) { val mappedMetricData = (MappedMetricData) record.value(); if (mappedMetricData == null || mappedMetricData.getMetricData() == null) { return -1L; } return mappedMetricData.getMetricData().getTimestamp() * 1000L; }  @Override long extract(ConsumerRecord<Object, Object> record, long previousTimestamp);  }