Kafka\Protocol\Fetch\Partition::getPartitionCount PHP Method

getPartitionCount() protected method

get message size only use to object init
protected getPartitionCount ( ) : integer
return integer
    protected function getPartitionCount()
    {
        // read topic count
        $data = $this->stream->read(4, true);
        $data = Decoder::unpack(Decoder::BIT_B32, $data);
        $count = array_shift($data);
        if ($count <= 0) {
            throw new \Kafka\Exception\OutOfRange($count . ' is not a valid partition count');
        }
        return $count;
    }