ZooKeeper
PHP Manual

Класс Zookeeper

(PECL zookeeper >= 0.1.0)

Введение

Представляет сессию ZooKeeper.

Обзор классов

Zookeeper {
/* Методы */
public __construct ([ string $host = '' [, callable $watcher_cb = null [, int $recv_timeout = 10000 ]]] )
public bool addAuth ( string $scheme , string $cert [, callable $completion_cb = null ] )
public void connect ( string $host [, callable $watcher_cb = null [, int $recv_timeout = 10000 ]] )
public string create ( string $path , string $value , array $acls [, int $flags = null ] )
public bool delete ( string $path [, int $version = -1 ] )
public bool exists ( string $path [, callable $watcher_cb = null ] )
public string get ( string $path [, callable $watcher_cb = null [, array &$stat = null [, int $max_size = 0 ]]] )
public array getAcl ( string $path )
public array getChildren ( string $path [, callable $watcher_cb = null ] )
public int getClientId ( void )
public int getRecvTimeout ( void )
public int getState ( void )
public bool isRecoverable ( void )
public bool set ( string $path , string $value [, int $version = -1 [, array &$stat = null ]] )
public bool setAcl ( string $path , int $version , array $acl )
public static bool setDebugLevel ( int $logLevel )
public static bool setDeterministicConnOrder ( bool $yesOrNo )
public bool setLogStream ( resource $stream )
public bool setWatcher ( callable $watcher_cb )
/* Константы */
const integer PERM_READ = 1 ;
const integer PERM_WRITE = 2 ;
const integer PERM_CREATE = 4 ;
const integer PERM_DELETE = 8 ;
const integer PERM_ADMIN = 16 ;
const integer PERM_ALL = 31 ;
const integer LOG_LEVEL_ERROR = 1 ;
const integer LOG_LEVEL_WARN = 2 ;
const integer LOG_LEVEL_INFO = 3 ;
const integer LOG_LEVEL_DEBUG = 4 ;
const integer EXPIRED_SESSION_STATE = -112 ;
const integer AUTH_FAILED_STATE = -113 ;
const integer CONNECTING_STATE = 1 ;
const integer ASSOCIATING_STATE = 2 ;
const integer CONNECTED_STATE = 3 ;
const integer READONLY_STATE = 5 ;
const integer NOTCONNECTED_STATE = 999 ;
}

Предопределенные константы

Разрешения ZooKeeper

Zookeeper::PERM_READ

Можно читать значение узла и список дочерних узлов

Zookeeper::PERM_WRITE

Можно устанавливать значение узла

Zookeeper::PERM_CREATE

Можно создавать дочерние элементы

Zookeeper::PERM_DELETE

Можно удалять дочерние элементы

Zookeeper::PERM_ADMIN

Можно запускать set_acl()

Zookeeper::PERM_ALL

Можно делать все описанное выше

Уровень логирования ZooKeeper

Zookeeper::LOG_LEVEL_ERROR

Выводить только сообщения об ошибках

Zookeeper::LOG_LEVEL_WARN

Выводить ошибки и предупреждения

Zookeeper::LOG_LEVEL_INFO

Выводить большие сообщения о действиях помимо ошибок и предупреждений

Zookeeper::LOG_LEVEL_DEBUG

Выводить все

Состояния ZooKeeper

Zookeeper::EXPIRED_SESSION_STATE

Соединение установлено, но просрочено

Zookeeper::AUTH_FAILED_STATE

Соединение установлено, но аутентификация провалена

Zookeeper::CONNECTING_STATE

Устанавливается соединение

Zookeeper::ASSOCIATING_STATE

Ассоциирование

Zookeeper::CONNECTED_STATE

Соединение установлено

Zookeeper::READONLY_STATE

TODO: помогите нам улучшить это расширение

Zookeeper::NOTCONNECTED_STATE

Соединение не установлено

Содержание


ZooKeeper
PHP Manual