-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
src/main/scala/uk/sky/kafka/topicloader/metrics/TopicLoaderMetrics.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
package uk.sky.kafka.topicloader.metrics | ||
|
||
import org.apache.kafka.clients.consumer.ConsumerRecord | ||
import org.apache.kafka.common.TopicPartition | ||
|
||
trait TopicLoaderMetrics { | ||
|
||
def onRecord[K, V](record: ConsumerRecord[K, V]): Unit | ||
|
||
def onLoading(): Unit | ||
def onLoading(topicPartitions: TopicPartition): Unit | ||
|
||
def onLoaded(): Unit | ||
def onLoaded(topicPartitions: TopicPartition): Unit | ||
|
||
def onError(): Unit | ||
def onError(topicPartitions: TopicPartition): Unit | ||
|
||
} | ||
|
||
object TopicLoaderMetrics { | ||
def noOp(): TopicLoaderMetrics = new TopicLoaderMetrics { | ||
override def onRecord[K, V](record: ConsumerRecord[K, V]): Unit = () | ||
|
||
override def onLoading(): Unit = () | ||
override def onLoading(topicPartitions: TopicPartition): Unit = () | ||
|
||
override def onLoaded(): Unit = () | ||
override def onLoaded(topicPartitions: TopicPartition): Unit = () | ||
|
||
override def onError(): Unit = () | ||
override def onError(topicPartitions: TopicPartition): Unit = () | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters