Module: CephRuby::ClusterHelper
Overview
Helper Methods for CephRuby::Cluster
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #default_options ⇒ Object
- #eql?(other) ⇒ Boolean
- #log(message) ⇒ Object
- #setup_handle(options) ⇒ Object
- #uint?(value) ⇒ Boolean
Instance Method Details
#<=>(other) ⇒ Object
30 31 32 |
# File 'lib/ceph-ruby/cluster_helper.rb', line 30 def <=>(other) other. <=> end |
#default_options ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/ceph-ruby/cluster_helper.rb', line 14 def { config_path: '/etc/ceph', user: 'client.admin', cluster: 'ceph' } end |
#eql?(other) ⇒ Boolean
34 35 36 37 |
# File 'lib/ceph-ruby/cluster_helper.rb', line 34 def eql?(other) return false if other.class != self.class self == other end |
#log(message) ⇒ Object
26 27 28 |
# File 'lib/ceph-ruby/cluster_helper.rb', line 26 def log() CephRuby.log("cluster #{message}") end |
#setup_handle(options) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/ceph-ruby/cluster_helper.rb', line 4 def setup_handle() handle_p = FFI::MemoryPointer.new(:pointer) ret = Lib::Rados.rados_create2(handle_p, [:cluster], [:user], [:flags]) raise SystemCallError.new('open of cluster failed', -ret) if ret < 0 handle_p.get_pointer(0) end |
#uint?(value) ⇒ Boolean
22 23 24 |
# File 'lib/ceph-ruby/cluster_helper.rb', line 22 def uint?(value) value.is_a?(Integer) && value >= 0 end |