flare-tools 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ === 0.7.2 / 2016-03-01
2
+ * Minor Enhancements
3
+ * Modify 'index' subcommand to output node_map_version with Flare 1.3.1 or later.
4
+
1
5
  === 0.7.1 / 2015-09-10
2
6
  * Minor Enhancements
3
7
  * Fixed short commands. (ex. `flare-stats`)
data/README.txt CHANGED
@@ -342,6 +342,7 @@ subcommands:
342
342
  [index] print the index XML document from a cluster information.
343
343
  Usage: flare-admin index
344
344
  --output=[FILE] output index to a file
345
+ --increment=[VERSION] increment node_map_version
345
346
 
346
347
  [reconstruct] reconstruct the database of nodes by copying.
347
348
  Usage: flare-admin reconstruct [hostname:port] ...
@@ -9,8 +9,8 @@ module Flare
9
9
  # flare-tools module.
10
10
  module Tools
11
11
  # the version number of flare-tools
12
- VERSION = '0.7.1'
13
- TITLE = "Flare-tools version #{VERSION} Copyright (C) GREE, Inc. 2011-2015"
12
+ VERSION = '0.7.2'
13
+ TITLE = "Flare-tools version #{VERSION} Copyright (C) GREE, Inc. 2011-2016"
14
14
  autoload :Common, 'flare/tools/common'
15
15
  autoload :Cluster, 'flare/tools/cluster'
16
16
  autoload :Stats, 'flare/tools/stats'
@@ -24,22 +24,24 @@ module Flare
24
24
  def setup
25
25
  super
26
26
  set_option_index_server
27
- @optp.on('--output=FILE', "output index to a file") {|v| @output = v}
27
+ @optp.on('--output=FILE', "output index to a file" ) {|v| @output = v}
28
+ @optp.on('--increment=VERSION', "increment node_map_version") {|v| @increment = v}
28
29
  end
29
30
 
30
31
  def initialize
31
32
  super
32
33
  @output = nil
34
+ @increment = nil
33
35
  end
34
36
 
35
37
  def execute(config, args)
36
38
  parse_index_server(config, args)
37
- cluster = Flare::Tools::Stats.open(config[:index_server_hostname], config[:index_server_port], @timeout) do |s|
39
+ cluster, node_map_version = Flare::Tools::Stats.open(config[:index_server_hostname], config[:index_server_port], @timeout) do |s|
38
40
  nodes = s.stats_nodes.sort_by{|key, val| [val['partition'], val['role'], key]}
39
- Flare::Tools::Cluster.new(s.host, s.port, s.stats_nodes)
41
+ [Flare::Tools::Cluster.new(s.host, s.port, s.stats_nodes), s.stats['node_map_version']]
40
42
  end
41
43
 
42
- output = cluster.serialize
44
+ output = cluster.serialize(node_map_version.to_i + @increment.to_i)
43
45
  if @output.nil?
44
46
  info output
45
47
  else
@@ -241,7 +241,7 @@ module Flare
241
241
  " class_id=\"#{x['class_id']}\" tracking_level=\"#{x['tracking_level']}\" version=\"#{x['version']}\""
242
242
  end
243
243
 
244
- def serialize
244
+ def serialize(node_map_version = nil)
245
245
  thread_type = 0
246
246
 
247
247
  node_map_id = {"class_id"=>"0", "tracking_level"=>"0", "version"=>"0"}
@@ -252,7 +252,15 @@ module Flare
252
252
  <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
253
253
  <!DOCTYPE boost_serialization>
254
254
  <boost_serialization signature="serialization::archive" version="4">
255
- <version>0</version>
255
+ EOS
256
+
257
+ if node_map_version
258
+ output +=<<"EOS"
259
+ <version>#{node_map_version}</version>
260
+ EOS
261
+ end
262
+
263
+ output +=<<"EOS"
256
264
  <node_map#{serattr_(node_map_id)}>
257
265
  \t<count>#{@nodes.size}</count>
258
266
  \t<item_version>0</item_version>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flare-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-09-11 00:00:00.000000000 Z
13
+ date: 2016-03-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: log4r
@@ -225,7 +225,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
225
225
  version: '0'
226
226
  segments:
227
227
  - 0
228
- hash: 3590447130553905001
228
+ hash: -3541811138210506065
229
229
  required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  none: false
231
231
  requirements: