protected static function _encodeProcudePartion($values, $compression)
{
if (!isset($values['partition_id'])) {
throw new \Kafka\Exception\Protocol('given produce data invalid. `partition_id` is undefined.');
}
if (!isset($values['messages']) || empty($values['messages'])) {
throw new \Kafka\Exception\Protocol('given produce data invalid. `messages` is undefined.');
}
$data = self::pack(self::BIT_B32, $values['partition_id']);
$data .= self::encodeString(self::encodeMessageSet($values['messages'], $compression), self::PACK_INT32);
return $data;
}