Module: ZK::Stat
- Included in:
- ZookeeperStat::Stat
- Defined in:
- lib/zk/stat.rb
Overview
Included in ZookeeperStat::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
- MEMBERS =
[:version, :exists, :czxid, :mzxid, :ctime, :mtime, :cversion, :aversion, :ephemeralOwner, :dataLength, :numChildren, :pzxid].freeze
Instance Method Summary (collapse)
- - (Object) ==(other)
-
- (Fixnum) acl_list_version
The number of changes to the ACL of this znode.
-
- (Fixnum) child_list_version
The number of changes to the children of this znode.
-
- (Fixnum) created_time
The time in milliseconds from epoch when this znode was created.
-
- (Object) created_zxid
The zxid of the change that caused this znode to be created.
-
- (Time) ctime_t
The time when this znode was created.
-
- (Fixnum) data_length
The length of the data field of this znode.
-
- (Boolean) ephemeral?
returns true if the node is ephemeral (will be cleaned up when the current session expires).
-
- (Fixnum) last_modified_time
The time in milliseconds from epoch when this znode was last modified.
-
- (Object) last_modified_zxid
The zxid of the change that last modified this znode.
-
- (Time) mtime_t
The time when this znode was last modified.
-
- (Fixnum) num_children
The number of children of this znode.
-
- (Fixnum) version
The number of changes to the data of this znode.
Instance Method Details
- (Object) ==(other)
14 15 16 |
# File 'lib/zk/stat.rb', line 14 def ==(other) MEMBERS.all? { |m| self.__send__(m) == other.__send__(m) } end |
- (Fixnum) acl_list_version
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 |
- (Fixnum) child_list_version
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 |
- (Fixnum) created_time
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 |
- (Object) created_zxid
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 |
- (Time) ctime_t
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 |
- (Fixnum) data_length
The length of the data field of this znode.
99 100 101 |
# File 'lib/zk/stat.rb', line 99 def data_length super end |
- (Boolean) ephemeral?
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 |
- (Fixnum) last_modified_time
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 |
- (Object) last_modified_zxid
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 |
- (Time) mtime_t
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 |
- (Fixnum) num_children
The number of children of this znode.
106 107 108 |
# File 'lib/zk/stat.rb', line 106 def num_children super end |
- (Fixnum) version
The number of changes to the data of this znode.
92 93 94 |
# File 'lib/zk/stat.rb', line 92 def version super end |