function nodesCapacity() { try { return $this->zookeeper->get($this->path)->numChildren; } catch (Scalr_Service_Zookeeper_Exception $e) { if ($e->getCode() == Scalr_Service_Zookeeper_Exception::NOT_FOUND) { return 0; } throw $e; } }
function capacity() { $this->init(); if ($this->children) { return count($this->children); } else { $stat = $this->zookeeper->get($this->path); return $stat->numChildren; } }
private function getStatus() { try { $stat = $this->zookeeper->get("{$this->path}/status"); return unserialize(base64_decode($stat->data64)); } catch (Scalr_Service_Zookeeper_Exception $e) { if ($e->getCode() == Scalr_Service_Zookeeper_Exception::NOT_FOUND) { return self::STATUS_NOTSET; } throw $e; } }