gizzmo 0.11.1 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.11.1
1
+ 0.11.2
data/gizzmo.gemspec ADDED
@@ -0,0 +1,101 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{gizzmo}
8
+ s.version = "0.11.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Kyle Maxwell"]
12
+ s.date = %q{2011-01-06}
13
+ s.description = %q{Gizzmo is a command-line client for managing gizzard clusters.}
14
+ s.email = %q{kmaxwell@twitter.com}
15
+ s.executables = ["gizzmo", "setup_shards"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE",
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "bin/gizzmo",
27
+ "bin/setup_shards",
28
+ "gizzmo.gemspec",
29
+ "lib/gizzard.rb",
30
+ "lib/gizzard/commands.rb",
31
+ "lib/gizzard/digest.rb",
32
+ "lib/gizzard/migrator.rb",
33
+ "lib/gizzard/nameserver.rb",
34
+ "lib/gizzard/shard_template.rb",
35
+ "lib/gizzard/thrift.rb",
36
+ "lib/gizzard/transformation.rb",
37
+ "lib/gizzard/transformation_op.rb",
38
+ "lib/gizzard/transformation_scheduler.rb",
39
+ "lib/gizzmo.rb",
40
+ "lib/vendor/thrift_client/simple.rb",
41
+ "test/config.yaml",
42
+ "test/expected/deep.txt",
43
+ "test/expected/dry-wrap-table_b_0.txt",
44
+ "test/expected/empty-file.txt",
45
+ "test/expected/find-only-sql-shard-type.txt",
46
+ "test/expected/forwardings.txt",
47
+ "test/expected/help-info.txt",
48
+ "test/expected/info.txt",
49
+ "test/expected/links-for-replicating_table_b_0.txt",
50
+ "test/expected/links-for-table_b_0.txt",
51
+ "test/expected/links-for-table_repl_0.txt",
52
+ "test/expected/original-find.txt",
53
+ "test/expected/subtree-info.txt",
54
+ "test/expected/subtree.txt",
55
+ "test/expected/unwrapped-replicating_table_b_0.txt",
56
+ "test/expected/unwrapped-table_b_0.txt",
57
+ "test/expected/wrap-table_b_0.txt",
58
+ "test/gizzmo_spec.rb",
59
+ "test/helper.rb",
60
+ "test/nameserver_spec.rb",
61
+ "test/recreate.sql",
62
+ "test/scheduler_spec.rb",
63
+ "test/shard_template_spec.rb",
64
+ "test/spec.opts",
65
+ "test/spec_helper.rb",
66
+ "test/test.sh",
67
+ "test/test_server/.gitignore",
68
+ "test/test_server/project/build.properties",
69
+ "test/test_server/project/build/Project.scala",
70
+ "test/test_server/project/plugins/Plugins.scala",
71
+ "test/test_server/src/main/scala/Main.scala",
72
+ "test/test_server/src/main/scala/TestServer.scala",
73
+ "test/test_server/src/main/thrift/TestServer.thrift",
74
+ "test/transformation_spec.rb"
75
+ ]
76
+ s.homepage = %q{http://github.com/twitter/gizzmo}
77
+ s.rdoc_options = ["--charset=UTF-8"]
78
+ s.require_paths = ["lib"]
79
+ s.rubygems_version = %q{1.3.6}
80
+ s.summary = %q{Gizzmo is a command-line client for managing gizzard clusters.}
81
+ s.test_files = [
82
+ "test/gizzmo_spec.rb",
83
+ "test/helper.rb",
84
+ "test/nameserver_spec.rb",
85
+ "test/scheduler_spec.rb",
86
+ "test/shard_template_spec.rb",
87
+ "test/spec_helper.rb",
88
+ "test/transformation_spec.rb"
89
+ ]
90
+
91
+ if s.respond_to? :specification_version then
92
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
93
+ s.specification_version = 3
94
+
95
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
96
+ else
97
+ end
98
+ else
99
+ end
100
+ end
101
+
@@ -93,6 +93,24 @@ module Gizzard
93
93
  end
94
94
  end
95
95
 
96
+ class DumpCommand < Command
97
+ def run
98
+ table_ids = argv.map{|e| e.to_i }
99
+ manifest = manager.manifest(*table_ids)
100
+ manifest.trees.values.each do |tree|
101
+ down(tree, 0)
102
+ end
103
+ end
104
+
105
+ def down(shard, depth)
106
+ printable = " " * depth + shard.info.id.to_unix
107
+ output printable
108
+ shard.children.each do |child|
109
+ down(child, depth + 1)
110
+ end
111
+ end
112
+ end
113
+
96
114
  class DeleteforwardingCommand < Command
97
115
  def run
98
116
  help! if argv.length != 3
data/lib/gizzmo.rb CHANGED
@@ -11,6 +11,7 @@ DOC_STRINGS = {
11
11
  "addlink" => "Add a relationship link between two shards.",
12
12
  "create" => "Create shard(s) of a given Java/Scala class. If you don't know the list of available classes, you can just try a bogus class, and the exception will include a list of valid classes.",
13
13
  "drill" => "Show shard trees for replicas of a given structure signature (from 'report').",
14
+ "dump" => "Show shard trees for given table ids.",
14
15
  "find" => "Show all shards with a given hostname.",
15
16
  "finish-replica" => "Remove the write-only barrier in front of a shard that's finished being copied after 'setup-replica'.",
16
17
  "flush" => "Flush error queue for a given priority.",
@@ -81,6 +82,7 @@ end
81
82
 
82
83
  def load_config(options, filename)
83
84
  YAML.load(File.open(filename)).each do |k, v|
85
+ k = "hosts" if k == "host"
84
86
  v = v.split(",").map {|h| h.strip } if k == "hosts"
85
87
  options.send("#{k}=", v)
86
88
  end
@@ -117,6 +119,10 @@ subcommands = {
117
119
  subcommand_options.destination_type = s
118
120
  end
119
121
  end,
122
+ 'dump' => OptionParser.new do |opts|
123
+ opts.banner = "Usage: #{zero} dump TABLE_ID [TABLE_ID...]"
124
+ separators(opts, DOC_STRINGS["dump"])
125
+ end,
120
126
  'wrap' => OptionParser.new do |opts|
121
127
  opts.banner = "Usage: #{zero} wrap CLASS_NAME SHARD_ID_TO_WRAP [MORE SHARD_IDS...]"
122
128
  separators(opts, DOC_STRINGS["wrap"])
@@ -328,8 +334,9 @@ subcommands = {
328
334
  end
329
335
  }
330
336
 
331
- if ENV['GIZZMORC']
332
- load_config(global_options, ENV['GIZZMORC'])
337
+ rc_path = ENV['GIZZMORC'] || "#{ENV["HOME"]}/.gizzmorc"
338
+ if File.exists?(rc_path)
339
+ load_config(global_options, rc_path)
333
340
  end
334
341
 
335
342
  global = OptionParser.new do |opts|
@@ -367,6 +374,12 @@ global = OptionParser.new do |opts|
367
374
  global_options.hosts = hosts.split(",").map {|h| h.strip }
368
375
  end
369
376
 
377
+ opts.on("-H", "--host=HOST", "HOST of application servers") do |hosts|
378
+ global_options.hosts = hosts.split(",").map {|h| h.strip }
379
+ end
380
+
381
+
382
+
370
383
  opts.on("-P", "--port=PORT", "PORT of remote manager service. default 7920") do |port|
371
384
  global_options.port = port.to_i
372
385
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 11
8
- - 1
9
- version: 0.11.1
8
+ - 2
9
+ version: 0.11.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kyle Maxwell
@@ -36,6 +36,7 @@ files:
36
36
  - VERSION
37
37
  - bin/gizzmo
38
38
  - bin/setup_shards
39
+ - gizzmo.gemspec
39
40
  - lib/gizzard.rb
40
41
  - lib/gizzard/commands.rb
41
42
  - lib/gizzard/digest.rb