redis_ring 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- redis_ring (0.0.2)
4
+ redis_ring (0.1.1)
5
5
  daemons-mikehale
6
6
  json
7
7
  sinatra
@@ -1,3 +1,7 @@
1
+ # You can have multiple clusters running in the same zookeeper
2
+ # by providing different cluster names
3
+ cluster_name: redis-ring
4
+
1
5
  # By default RedisRing tries to guess the local IP address
2
6
  # setting host_name should be necessary only if that is not possible
3
7
  #host_name: localhost
@@ -11,7 +11,8 @@ module RedisRing
11
11
  @master_rpc = MasterRPC.new(http_client)
12
12
  @slave_rpc = SlaveRPC.new(http_client)
13
13
  @node_provider = NodeProvider.new(slave_rpc)
14
- @zookeeper_connection = ZookeeperConnection.new(config.host_name,
14
+ @zookeeper_connection = ZookeeperConnection.new(config.cluster_name,
15
+ config.host_name,
15
16
  config.base_port,
16
17
  config.zookeeper_address)
17
18
  @master = Master.new(zookeeper_connection, config.ring_size, node_provider)
@@ -6,7 +6,7 @@ module RedisRing
6
6
 
7
7
  class Configuration
8
8
 
9
- PARAMETERS = [:host_name, :base_port, :ring_size, :redis_path, :redis_config_template_path,
9
+ PARAMETERS = [:cluster_name, :host_name, :base_port, :ring_size, :redis_path, :redis_config_template_path,
10
10
  :total_vm_size, :base_directory, :password, :total_max_memory, :vm_page_size, :zookeeper_address]
11
11
 
12
12
  attr_reader *PARAMETERS
@@ -41,6 +41,7 @@ module RedisRing
41
41
  end
42
42
 
43
43
  def set_defaults
44
+ self.cluster_name ||= "redis-ring"
44
45
  self.host_name ||= guess_host_name
45
46
  self.base_port ||= 6400
46
47
  self.ring_size ||= 32
@@ -1,3 +1,3 @@
1
1
  module RedisRing
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -4,12 +4,12 @@ module RedisRing
4
4
 
5
5
  attr_reader :current_node
6
6
 
7
- def initialize(host_name, base_port, zookeeper_address)
7
+ def initialize(cluster_name, host_name, base_port, zookeeper_address)
8
8
  @host_name = host_name
9
9
  @base_port = base_port
10
10
  @zookeeper_address = zookeeper_address
11
11
  @connected = false
12
- @base_path = "/nodes"
12
+ @base_path = "/#{cluster_name}"
13
13
  @mutex = Mutex.new
14
14
  end
15
15
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adam Pohorecki
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-03-22 00:00:00 +01:00
17
+ date: 2011-04-11 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency