Module: ZK::Stat
- Included in:
- Zookeeper::Stat
- Defined in:
- lib/zk/stat.rb
Overview
Included in Zookeeper::Stat, extends it with some conveniences for dealing with Stat objects. Also provides docuemntation here for the meaning of these values.
Some of the methods added are to match the names in the documentation
Some of this may eventually be pushed down to slyphon-zookeeper
Constant Summary collapse
- MEMBERS =
[:version, :exists, :czxid, :mzxid, :ctime, :mtime, :cversion, :aversion, :ephemeralOwner, :dataLength, :numChildren, :pzxid].freeze
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#acl_list_version ⇒ Fixnum
The number of changes to the ACL of this znode.
-
#child_list_version ⇒ Fixnum
The number of changes to the children of this znode.
-
#created_time ⇒ Fixnum
The time in milliseconds from epoch when this znode was created.
-
#created_zxid ⇒ Object
The zxid of the change that caused this znode to be created.
-
#ctime_t ⇒ Time
The time when this znode was created.
-
#data_length ⇒ Fixnum
The length of the data field of this znode.
-
#ephemeral? ⇒ Boolean
returns true if the node is ephemeral (will be cleaned up when the current session expires).
-
#last_modified_time ⇒ Fixnum
The time in milliseconds from epoch when this znode was last modified.
-
#last_modified_zxid ⇒ Object
The zxid of the change that last modified this znode.
-
#mtime_t ⇒ Time
The time when this znode was last modified.
-
#num_children ⇒ Fixnum
The number of children of this znode.
-
#version ⇒ Fixnum
The number of changes to the data of this znode.
Instance Method Details
#==(other) ⇒ Object
14 15 16 |
# File 'lib/zk/stat.rb', line 14 def ==(other) MEMBERS.all? { |m| self.__send__(m) == other.__send__(m) } end |
#acl_list_version ⇒ Fixnum
The number of changes to the ACL of this znode.
(also: #aversion)
85 86 87 |
# File 'lib/zk/stat.rb', line 85 def acl_list_version aversion end |
#child_list_version ⇒ Fixnum
The number of changes to the children of this znode
(also: #cversion)
77 78 79 |
# File 'lib/zk/stat.rb', line 77 def child_list_version cversion end |
#created_time ⇒ Fixnum
The time in milliseconds from epoch when this znode was created
(also: created_time)
45 46 47 |
# File 'lib/zk/stat.rb', line 45 def created_time ctime end |
#created_zxid ⇒ Object
The zxid of the change that caused this znode to be created.
(also: czxid)
27 28 29 30 |
# File 'lib/zk/stat.rb', line 27 def created_zxid # @!parse alias czxid created_zxid czxid end |
#ctime_t ⇒ Time
The time when this znode was created
52 53 54 |
# File 'lib/zk/stat.rb', line 52 def ctime_t Time.at(ctime * 0.001) end |
#data_length ⇒ Fixnum
The length of the data field of this znode.
99 100 101 |
# File 'lib/zk/stat.rb', line 99 def data_length super end |
#ephemeral? ⇒ Boolean
returns true if the node is ephemeral (will be cleaned up when the current session expires)
20 21 22 |
# File 'lib/zk/stat.rb', line 20 def ephemeral? ephemeral_owner && (ephemeral_owner != 0) end |
#last_modified_time ⇒ Fixnum
The time in milliseconds from epoch when this znode was last modified.
(also: mtime)
61 62 63 |
# File 'lib/zk/stat.rb', line 61 def last_modified_time mtime end |
#last_modified_zxid ⇒ Object
The zxid of the change that last modified this znode.
(also: mzxid)
35 36 37 |
# File 'lib/zk/stat.rb', line 35 def last_modified_zxid mzxid end |
#mtime_t ⇒ Time
The time when this znode was last modified
69 70 71 |
# File 'lib/zk/stat.rb', line 69 def mtime_t Time.at(mtime * 0.001) end |
#num_children ⇒ Fixnum
The number of children of this znode.
106 107 108 |
# File 'lib/zk/stat.rb', line 106 def num_children super end |
#version ⇒ Fixnum
The number of changes to the data of this znode.
92 93 94 |
# File 'lib/zk/stat.rb', line 92 def version super end |