ceph_storage 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ceph_storage.rb +2 -2
- data/lib/ceph_storage/cluster.rb +7 -1
- data/lib/ceph_storage/cluster_factory.rb +1 -5
- data/lib/ceph_storage/pool.rb +5 -1
- data/lib/ceph_storage/pool_factory.rb +1 -3
- data/lib/ceph_storage/version.rb +1 -1
- data/spec/ceph_storage_cluster_spec.rb +1 -5
- data/spec/ceph_storage_pool_spec.rb +5 -2
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0981d68ce0a4d2f0cb64f60f590e96cda49856a1
|
|
4
|
+
data.tar.gz: 831b926902b31f70ed7ccc1f2cc827949cd1625b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e469f49a394e22242f78af65518f779beaa8678ec3c7e2fd0b7257d37ca7dccd557f1c3272c677e8edcaaff1e1701666875a0e817e575ebfbafa2c10b9ff48f2
|
|
7
|
+
data.tar.gz: 0be6ed488c1ff14c92c22eb3a5c611cfc3205dc1d19800ce8ac8368a9b0e4a1c522e3a8dd1af9e8aa3066ae43dfffea23051249f3733711e76decb780f1c1df7
|
data/lib/ceph_storage.rb
CHANGED
|
@@ -2,11 +2,11 @@ require 'thread'
|
|
|
2
2
|
require 'ceph-ruby'
|
|
3
3
|
require 'facets/multiton'
|
|
4
4
|
require 'ceph_storage/cluster_wrapper'
|
|
5
|
-
require 'ceph_storage/cluster_factory'
|
|
6
5
|
require 'ceph_storage/cluster'
|
|
6
|
+
require 'ceph_storage/cluster_factory'
|
|
7
7
|
require 'ceph_storage/pool_wrapper'
|
|
8
|
-
require 'ceph_storage/pool_factory'
|
|
9
8
|
require 'ceph_storage/pool'
|
|
9
|
+
require 'ceph_storage/pool_factory'
|
|
10
10
|
require 'ceph_storage/pool_enumerator'
|
|
11
11
|
require 'ceph_storage/storage_object'
|
|
12
12
|
require 'ceph_storage/storage_object/rados_wrapper'
|
data/lib/ceph_storage/cluster.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module CephStorage
|
|
2
2
|
# Create a cluster object
|
|
3
3
|
# Returns only a single cluster object for given settings
|
|
4
|
-
class Cluster <
|
|
4
|
+
class Cluster < ::CephRuby::Cluster
|
|
5
5
|
extend CephStorage::ClusterWrapper
|
|
6
6
|
include Multiton
|
|
7
7
|
# Configure default values for this object
|
|
@@ -11,6 +11,12 @@ module CephStorage
|
|
|
11
11
|
|
|
12
12
|
private :connect, :setup_using_file
|
|
13
13
|
|
|
14
|
+
class << self
|
|
15
|
+
# Make this private otherwise the self.new {} returns a different
|
|
16
|
+
# Object to self.new {CONFIG_DIR, CLUSTER, USER}
|
|
17
|
+
protected :new
|
|
18
|
+
end
|
|
19
|
+
|
|
14
20
|
# Create a new object
|
|
15
21
|
def initialize(config_dir: CONFIG_DIR, cluster: CLUSTER,
|
|
16
22
|
user: USER, flags: FLAGS)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module CephStorage
|
|
2
2
|
# Factory Class to create a Cluster reference object
|
|
3
|
-
class ClusterFactory < ::
|
|
3
|
+
class ClusterFactory < ::CephStorage::Cluster
|
|
4
4
|
# Defaults
|
|
5
5
|
CONFIG_DIR = '/etc/ceph'.freeze
|
|
6
6
|
CLUSTER = 'ceph'.freeze
|
|
@@ -15,10 +15,6 @@ module CephStorage
|
|
|
15
15
|
yield(c) if block_given?
|
|
16
16
|
c
|
|
17
17
|
end
|
|
18
|
-
|
|
19
|
-
# Make this private otherwise the self.new {} returns a different
|
|
20
|
-
# Object to self.new {CONFIG_DIR, CLUSTER, USER}
|
|
21
|
-
private :new
|
|
22
18
|
end
|
|
23
19
|
end
|
|
24
20
|
end
|
data/lib/ceph_storage/pool.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module CephStorage
|
|
2
2
|
# A reference to a Ceph pool
|
|
3
3
|
# This is a collection of held open pool IOctx's for a given pool
|
|
4
|
-
class Pool <
|
|
4
|
+
class Pool < ::CephRuby::Pool
|
|
5
5
|
extend CephStorage::PoolWrapper
|
|
6
6
|
include Multiton
|
|
7
7
|
attr_accessor :cartridges, :cluster, :name, :close_lock, :pop_lock
|
|
@@ -9,6 +9,10 @@ module CephStorage
|
|
|
9
9
|
wrap_me :create, :exists?, :id, :auid=, :auid,
|
|
10
10
|
:rados_block_device, :destroy, :stat, :flush_aio
|
|
11
11
|
|
|
12
|
+
class << self
|
|
13
|
+
protected :new
|
|
14
|
+
end
|
|
15
|
+
|
|
12
16
|
def initialize(cluster, name)
|
|
13
17
|
log("init #{name}")
|
|
14
18
|
self.close_lock = Mutex.new
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
module CephStorage
|
|
2
2
|
# Creates a Pool Object
|
|
3
3
|
# Returns only a single pool object out of the cartridges available
|
|
4
|
-
class PoolFactory < ::
|
|
4
|
+
class PoolFactory < ::CephStorage::Pool
|
|
5
5
|
class << self
|
|
6
6
|
def build(cluster, name)
|
|
7
7
|
p = CephStorage::Pool.new(cluster, name)
|
|
8
8
|
yield(p) if block_given?
|
|
9
9
|
p
|
|
10
10
|
end
|
|
11
|
-
# So behaviour is consistent with the cluster factory class
|
|
12
|
-
private :new
|
|
13
11
|
end
|
|
14
12
|
end
|
|
15
13
|
end
|
data/lib/ceph_storage/version.rb
CHANGED
|
@@ -29,10 +29,6 @@ describe CephStorage::Cluster do
|
|
|
29
29
|
expect(subject).to respond_to :ensure_open
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
it 'should be a ClusterFactory' do
|
|
33
|
-
expect(subject).to be_a CephStorage::ClusterFactory
|
|
34
|
-
end
|
|
35
|
-
|
|
36
32
|
it 'should be a ::CephRuby::Cluster' do
|
|
37
33
|
expect(subject).to be_a ::CephRuby::Cluster
|
|
38
34
|
end
|
|
@@ -58,7 +54,7 @@ describe CephStorage::Cluster do
|
|
|
58
54
|
subject { pool }
|
|
59
55
|
|
|
60
56
|
it 'should be a pool factory' do
|
|
61
|
-
expect(subject).to be_a CephStorage::
|
|
57
|
+
expect(subject).to be_a CephStorage::Pool
|
|
62
58
|
end
|
|
63
59
|
end
|
|
64
60
|
|
|
@@ -9,10 +9,13 @@ describe CephStorage::Pool do
|
|
|
9
9
|
let(:object_name) { spconfig[:pool][:object] }
|
|
10
10
|
subject { pool }
|
|
11
11
|
|
|
12
|
-
it 'should be a
|
|
13
|
-
expect(subject).to be_a CephStorage::
|
|
12
|
+
it 'should be a Pool' do
|
|
13
|
+
expect(subject).to be_a ::CephStorage::Pool
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
+
it 'should be a ::CephRuby::Pool' do
|
|
17
|
+
expect(subject).to be_a ::CephRuby::Pool
|
|
18
|
+
end
|
|
16
19
|
it 'should respond to rados_pool' do
|
|
17
20
|
expect(subject).to respond_to :rados_pool
|
|
18
21
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ceph_storage
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Livelink Technology LTD
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2016-05-
|
|
12
|
+
date: 2016-05-27 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: ffi
|
|
@@ -260,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
260
260
|
version: '0'
|
|
261
261
|
requirements: []
|
|
262
262
|
rubyforge_project:
|
|
263
|
-
rubygems_version: 2.
|
|
263
|
+
rubygems_version: 2.2.2
|
|
264
264
|
signing_key:
|
|
265
265
|
specification_version: 4
|
|
266
266
|
summary: Ceph-ruby provides an API, however this gem provides consistent connection
|
|
@@ -278,4 +278,3 @@ test_files:
|
|
|
278
278
|
- spec/ceph_storage_xattr_enumerator_spec.rb
|
|
279
279
|
- spec/ceph_storage_xattr_spec.rb
|
|
280
280
|
- spec/spec_helper.rb
|
|
281
|
-
has_rdoc:
|