Github user hmcl commented on a diff in the pull request:
https://github.com/apache/storm/pull/1679#discussion_r79575910
--- Diff:
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/KafkaSpout.java
---
@@ -451,11 +454,11 @@ public int compare(KafkaSpoutMessageId m1,
KafkaSpoutMessageId m2) {
/**
* This class is not thread safe
*/
- private class OffsetEntry {
+ class OffsetEntry {
private final TopicPartition tp;
private final long initialFetchOffset; /* First offset to be
fetched. It is either set to the beginning, end, or to the first uncommitted
offset.
* Initial value depends
on offset strategy. See KafkaSpoutConsumerRebalanceListener */
- private long committedOffset; // last offset committed to
Kafka. Initially it is set to fetchOffset - 1
+ long committedOffset; // last offset committed to Kafka.
Initially it is set to fetchOffset - 1
--- End diff --
It violates encapsulation to make this field non private.
Is this package protected for test purposes? If so, wouldn't it be better
to use the testing tool reflection based methods to test for internal state,
rather than exposing the state to the outside.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---