flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhenzhongxu <...@git.apache.org>
Subject [GitHub] flink pull request #4187: [FLINK-6998][Kafka Connector] Add kafka offset com...
Date Mon, 17 Jul 2017 22:31:15 GMT
Github user zhenzhongxu commented on a diff in the pull request:

    --- Diff: flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBase.java
    @@ -505,6 +519,21 @@ public void run(SourceContext<T> sourceContext) throws Exception
     			throw new Exception("The partitions were not set for the consumer");
    +		// initialize commit metrics and default offset callback method
    +		this.successfulCommits = this.getRuntimeContext().getMetricGroup().counter("commitsSucceeded");
    +		this.failedCommits =  this.getRuntimeContext().getMetricGroup().counter("commitsFailed");
    +		this.offsetCommitCallback = new KafkaCommitCallback() {
    +			@Override
    +			public void onComplete(Exception exception) {
    +				if (exception == null) {
    +					successfulCommits.inc();
    --- End diff --
    I think I'll add a detailed javadoc to describe the current unprotected implementation.
I am hesitant to add in lock protection because higher level abstraction currently guarantees
no concurrent commit at the moment.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message