public function listBrokers()
{
// If broker cache hasn't been populated
if (count($this->brokers) == 0) {
// Populate broker cache
$result = array();
$lists = $this->zookeeper->getChildren(self::BROKER_PATH);
if (!empty($lists)) {
foreach ($lists as $brokerId) {
$brokerDetail = $this->getBrokerDetail($brokerId);
if (!$brokerDetail) {
continue;
}
$result[$brokerId] = $brokerDetail;
}
}
$this->brokers = $result;
}
return $this->brokers;
}