Thanks for the feedback. You are of course right, that we cannot remove toString() -- we used the @deprecated annotation to imply that the overwrite will be removed and toString() will fall back to Object.toString() in the future and thus not provide any useful information (at least this was the plan).
Using localThreadMetadata() within toString() and print whatever it return might be an alternative. However, I am not sure if we gain much. Also, KafkaConsumer/Producer/AdminClient don't overwrite toString() -- IMHO, not overwriting toString() aligns better with other parts of the code. About @Evolving: that is correct, too. We just try to be nice and provide backward compatibility even if we never promised :) -Matthias On 2/26/18 1:38 AM, Jacek Laskowski wrote: > Hi, > > I've just found that KafkaStreams.toString [1] is deprecated, but I think > that it does not make sense. > > The parameterless toString is simply part of the java.lang.Object contract > and I don't think it could ever get deprecated (unless it is by Object). > > I think it'd be much better if the method used whatever it's recommended > for a toString-like functionality (which seems that > KafkaStreams.localThreadsMetadata [2] is or something based on that). > > Thoughts? > > p.s. I also think that since KafkaStreams is marked > as @InterfaceStability.Evolving using @Deprecated markers does not add much > if anything. I thought that Evolving was to say that literally everything > could change without warning at any time, couldn't it? > > [1] > https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java?utf8=%E2%9C%93#L900 > > [2] > https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java?utf8=%E2%9C%93#L1061 > > Pozdrawiam, > Jacek Laskowski > ---- > https://about.me/JacekLaskowski > Mastering Spark SQL https://bit.ly/mastering-spark-sql > Spark Structured Streaming https://bit.ly/spark-structured-streaming > Mastering Kafka Streams https://bit.ly/mastering-kafka-streams > Follow me at https://twitter.com/jaceklaskowski >
signature.asc
Description: OpenPGP digital signature