Class: CephStorage::StorageObject::RadosStorageObject

Inherits:
CephRuby::RadosObject
  • Object
show all
Extended by:
RadosWrapper
Includes:
CephStorage::StorageObject
Defined in:
lib/ceph_storage/storage_object/rados_storage_object.rb

Overview

Ceph Storage Object

Instance Attribute Summary collapse

Attributes included from CephStorage::StorageObject

#name

Instance Method Summary collapse

Methods included from RadosWrapper

wrap_me

Methods included from CephStorage::StorageObject

#copy, #copy_xattrs, #log, #move, supports_xattr?, #xattr_supported?

Constructor Details

#initialize(pool_factory, name) ⇒ RadosStorageObject

Returns a new instance of RadosStorageObject.



9
10
11
12
13
# File 'lib/ceph_storage/storage_object/rados_storage_object.rb', line 9

def initialize(pool_factory, name)
  log("init #{name}")
  self.pool_factory = pool_factory
  super(nil, name)
end

Instance Attribute Details

#pool_factoryObject

Returns the value of attribute pool_factory.



7
8
9
# File 'lib/ceph_storage/storage_object/rados_storage_object.rb', line 7

def pool_factory
  @pool_factory
end

Instance Method Details

#pathObject



36
37
38
# File 'lib/ceph_storage/storage_object/rados_storage_object.rb', line 36

def path
  "ceph://#{pool_factory.cluster.cluster}/#{pool_factory.name}/#{name}"
end

#read_fileObject



18
19
20
21
# File 'lib/ceph_storage/storage_object/rados_storage_object.rb', line 18

def read_file
  log('read file')
  read_full
end

#write_file(contents) ⇒ Object



23
24
25
26
# File 'lib/ceph_storage/storage_object/rados_storage_object.rb', line 23

def write_file(contents)
  log("write file #{contents.length}")
  overwrite(contents)
end

#xattr(name, &block) ⇒ Object



28
29
30
# File 'lib/ceph_storage/storage_object/rados_storage_object.rb', line 28

def xattr(name, &block)
  Xattr.new(self, name, &block)
end

#xattr_enumerator(&block) ⇒ Object



32
33
34
# File 'lib/ceph_storage/storage_object/rados_storage_object.rb', line 32

def xattr_enumerator(&block)
  XattrEnumerator.new(self, &block)
end