-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored because of deprecation of TopicPartitionCounter. Moved fun…
- Loading branch information
1 parent
139ea9f
commit a30c1ac
Showing
4 changed files
with
95 additions
and
23 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
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
49 changes: 49 additions & 0 deletions
49
src/main/java/com/github/jcustenborder/kafka/connect/redis/SinkOffsetState.java
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Copyright © 2017 Jeremy Custenborder (jcustenborder@gmail.com) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.github.jcustenborder.kafka.connect.redis; | ||
|
||
import com.fasterxml.jackson.annotation.JsonAutoDetect; | ||
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; | ||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import org.apache.kafka.common.TopicPartition; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
@JsonDeserialize(as = ImmutableSinkOffsetState.class) | ||
@JsonAutoDetect( | ||
fieldVisibility = Visibility.NONE, | ||
getterVisibility = Visibility.NONE, | ||
setterVisibility = Visibility.NONE, | ||
isGetterVisibility = Visibility.NONE, | ||
creatorVisibility = Visibility.NONE) | ||
public interface SinkOffsetState { | ||
@JsonProperty("topic") | ||
String topic(); | ||
|
||
@JsonProperty("partition") | ||
Integer partition(); | ||
|
||
@JsonProperty("offset") | ||
Long offset(); | ||
|
||
@JsonIgnore | ||
@Value.Derived | ||
default TopicPartition topicPartition() { | ||
return new TopicPartition(topic(), partition()); | ||
} | ||
} |
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