Module: Zookeeper::Constants

Includes:
ACLs::Constants
Included in:
Zookeeper, CZookeeper, ClientMethods, Continuation, Exceptions, ZookeeperBase, ZookeeperConstants
Defined in:
lib/zookeeper/constants.rb

Constant Summary collapse

ZOO_EPHEMERAL =

file type masks

1
ZOO_SEQUENCE =
2
ZOO_EXPIRED_SESSION_STATE =

session state

-112
ZOO_AUTH_FAILED_STATE =
-113
ZOO_CLOSED_STATE =
0
ZOO_CONNECTING_STATE =
1
ZOO_ASSOCIATING_STATE =
2
ZOO_CONNECTED_STATE =
3
ZOO_CREATED_EVENT =

watch types

1
ZOO_DELETED_EVENT =
2
ZOO_CHANGED_EVENT =
3
ZOO_CHILD_EVENT =
4
ZOO_SESSION_EVENT =
-1
ZOO_NOTWATCHING_EVENT =
-2
ZOO_LOG_LEVEL_ERROR =

only used by the C extension

1
ZOO_LOG_LEVEL_WARN =
2
ZOO_LOG_LEVEL_INFO =
3
ZOO_LOG_LEVEL_DEBUG =
4
ZOK =

exceptions/errors

0
ZSYSTEMERROR =
-1
ZRUNTIMEINCONSISTENCY =
-2
ZDATAINCONSISTENCY =
-3
ZCONNECTIONLOSS =
-4
ZMARSHALLINGERROR =
-5
ZUNIMPLEMENTED =
-6
ZOPERATIONTIMEOUT =
-7
ZBADARGUMENTS =
-8
ZINVALIDSTATE =
-9
ZAPIERROR =

api errors

-100
ZNONODE =
-101
ZNOAUTH =
-102
ZBADVERSION =
-103
ZNOCHILDRENFOREPHEMERALS =
-108
ZNODEEXISTS =
-110
ZNOTEMPTY =
-111
ZSESSIONEXPIRED =
-112
ZINVALIDCALLBACK =
-113
ZINVALIDACL =
-114
ZAUTHFAILED =
-115
ZCLOSING =
-116
ZNOTHING =
-117
ZSESSIONMOVED =
-118
ZKRB_GLOBAL_CB_REQ =
-1
ZKRB_ASYNC_CONTN_ID =
-2
CONNECTED_EVENT_VALUES =
[Constants::ZKRB_GLOBAL_CB_REQ, 
Constants::ZOO_SESSION_EVENT, 
Constants::ZOO_CONNECTED_STATE].freeze
EVENT_TYPE_NAMES =

used to find the name for a numeric event

{
  1   => 'created',
  2   => 'deleted',
  3   => 'changed',
  4   => 'child',
  -1  => 'session',
  -2  => 'notwatching',
}
STATE_NAMES =

used to pretty print the state name

{
  -112 => 'expired_session',
  -113 => 'auth_failed',
  0    => 'closed',
  1    => 'connecting',
  2    => 'associating',
  3    => 'connected',
}

Constants included from ACLs::Constants

ACLs::Constants::ZOO_ANYONE_ID_UNSAFE, ACLs::Constants::ZOO_AUTH_IDS, ACLs::Constants::ZOO_CREATOR_ALL_ACL, ACLs::Constants::ZOO_OPEN_ACL_UNSAFE, ACLs::Constants::ZOO_PERM_ADMIN, ACLs::Constants::ZOO_PERM_ALL, ACLs::Constants::ZOO_PERM_CREATE, ACLs::Constants::ZOO_PERM_DELETE, ACLs::Constants::ZOO_PERM_READ, ACLs::Constants::ZOO_PERM_WRITE, ACLs::Constants::ZOO_READ_ACL_UNSAFE

Instance Method Summary collapse

Instance Method Details

#event_by_value(v) ⇒ Object


89
90
91
# File 'lib/zookeeper/constants.rb', line 89

def event_by_value(v)
  (name = EVENT_TYPE_NAMES[v]) ?  "ZOO_#{name.upcase}_EVENT" : ''
end

#state_by_value(v) ⇒ Object


93
94
95
# File 'lib/zookeeper/constants.rb', line 93

def state_by_value(v)
  (name = STATE_NAMES[v]) ?  "ZOO_#{name.upcase}_STATE" : ''
end