MINOR: add toString to Subscription classes
Reviewers: Chia-Ping Tsai
@@ -132,6 +132,16 @@ public interface ConsumerPartitionAssignor {
public Optional<String> groupInstanceId() {
return groupInstanceId;
}
+
+ @Override
+ public String toString() {
+ return "Subscription(" +
+ "topics=" + topics +
+ (userData == null ? "" : ", userDataSize=" + userData.remaining()) +
+ ", ownedPartitions=" + ownedPartitions +
+ ", groupInstanceId=" + (groupInstanceId.map(String::toString).orElse("null")) +
+ ")";
+ }
}
final class Assignment {
@@ -174,6 +184,13 @@ public interface ConsumerPartitionAssignor {
public Map<String, Subscription> groupSubscription() {
return subscriptions;
}
+
+ @Override
+ public String toString() {
+ return "GroupSubscription(" +
+ "subscriptions=" + subscriptions +
+ ")";
+ }
}
final class GroupAssignment {
@@ -186,6 +203,13 @@ public interface ConsumerPartitionAssignor {
public Map<String, Assignment> groupAssignment() {
return assignments;
}
+
+ @Override
+ public String toString() {
+ return "GroupAssignment(" +
+ "assignments=" + assignments +
+ ")";
+ }
}
/**
