ceph_storage 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f11517603a21b107977fee01ece18f2974dc0d98
4
- data.tar.gz: 033f874f008ff2e9e30f658bb68a8ed195877dd4
3
+ metadata.gz: 0981d68ce0a4d2f0cb64f60f590e96cda49856a1
4
+ data.tar.gz: 831b926902b31f70ed7ccc1f2cc827949cd1625b
5
5
  SHA512:
6
- metadata.gz: 79aa89777a93a9fa26d30e2db0886b6aa70ba0ab6ee008e7a3be6d0abf46597246fc56851cc3e9bda9921af26358e758eedea21237ebf26eaf754ecebe8e1506
7
- data.tar.gz: dbe0c85a8d9739bc50f78ac44783341c8717ca13f7692d8fc0bfec40af556812a3c2bb1b2ba61ccdb26c2c07e46049d78e3574a543758a5879e07900dc1654c5
6
+ metadata.gz: e469f49a394e22242f78af65518f779beaa8678ec3c7e2fd0b7257d37ca7dccd557f1c3272c677e8edcaaff1e1701666875a0e817e575ebfbafa2c10b9ff48f2
7
+ data.tar.gz: 0be6ed488c1ff14c92c22eb3a5c611cfc3205dc1d19800ce8ac8368a9b0e4a1c522e3a8dd1af9e8aa3066ae43dfffea23051249f3733711e76decb780f1c1df7
@@ -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'
@@ -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 < ClusterFactory
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 < ::CephRuby::Cluster
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
@@ -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 < PoolFactory
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 < ::CephRuby::Pool
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
@@ -1,3 +1,3 @@
1
1
  module CephStorage
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
@@ -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::PoolFactory
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 PoolFactory' do
13
- expect(subject).to be_a CephStorage::PoolFactory
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.0
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-23 00:00:00.000000000 Z
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.6.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: