You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Stevo Slavić <ss...@gmail.com> on 2016/06/20 10:08:06 UTC

PartitionMetadata hasLeader

Hello Apache Kafka community,

Scala API had hasLeader method in PartitionMetadata of MetadatResponse. I
see new Java API does not have such method and there's no javadoc on the
class. Can somebody please explain - will leader reference be null or
something when partition has no leader? Why not encode this into a method
like hasLeader?

Kind regards,
Stevo Slavic.

Re: PartitionMetadata hasLeader

Posted by Stevo Slavić <ss...@gmail.com>.
Correction, leader was an Option, and I guess Optional cannot be used yet
because Java language level compatibility is too low. What a mess, Java and
Scala in codebase, and even new code being written in old Java.

On Mon, Jun 20, 2016 at 12:08 PM, Stevo Slavić <ss...@gmail.com> wrote:

> Hello Apache Kafka community,
>
> Scala API had hasLeader method in PartitionMetadata of MetadatResponse. I
> see new Java API does not have such method and there's no javadoc on the
> class. Can somebody please explain - will leader reference be null or
> something when partition has no leader? Why not encode this into a method
> like hasLeader?
>
> Kind regards,
> Stevo Slavic.
>