es_dump_restore 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/es_dump_restore/app.rb +9 -7
- data/lib/es_dump_restore/version.rb +1 -1
- metadata +17 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25b8f8d2c2f59f52f984d2fadbd629977f89d00f
|
4
|
+
data.tar.gz: ceabcfcc74883b3661b9d032743783d1e09aa365
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 191dbeb2a56e3e4ff754f0d9afa8ab673fac01a8c685f499e74dde58ef325c8736a14622a77ca6289898dfb80b6500267c3ba785de1dc8bc7dad715f14effb39
|
7
|
+
data.tar.gz: b894f31f696b91dd24096eebd7094d679f304b924fc8b30ee073460a2f9b12cfa2bd6011a4fa04cfaa379762d41e380d9726c77951d23b0e4dc1547ae43bb2ae
|
data/CHANGELOG.md
ADDED
data/lib/es_dump_restore/app.rb
CHANGED
@@ -6,6 +6,8 @@ require "multi_json"
|
|
6
6
|
|
7
7
|
module EsDumpRestore
|
8
8
|
class App < Thor
|
9
|
+
|
10
|
+
option :noprogressbar, :type => :boolean # switch for showing progress bar
|
9
11
|
|
10
12
|
desc "dump URL INDEX_NAME FILENAME", "Creates a dumpfile based on the given ElasticSearch index"
|
11
13
|
def dump(url, index_name, filename)
|
@@ -19,13 +21,13 @@ module EsDumpRestore
|
|
19
21
|
|
20
22
|
client.start_scan do |scroll_id, total|
|
21
23
|
dumpfile.num_objects = total
|
22
|
-
bar = ProgressBar.new(total)
|
24
|
+
bar = ProgressBar.new(total) unless options[:noprogressbar]
|
23
25
|
|
24
26
|
dumpfile.get_objects_output_stream do |out|
|
25
27
|
client.each_scroll_hit(scroll_id) do |hit|
|
26
28
|
metadata = { index: { _type: hit["_type"], _id: hit["_id"] } }
|
27
29
|
out.write("#{MultiJson.dump(metadata)}\n#{MultiJson.dump(hit["_source"])}\n")
|
28
|
-
bar.increment!
|
30
|
+
bar.increment! unless options[:noprogressbar]
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
@@ -44,13 +46,13 @@ module EsDumpRestore
|
|
44
46
|
|
45
47
|
client.start_scan do |scroll_id, total|
|
46
48
|
dumpfile.num_objects = total
|
47
|
-
bar = ProgressBar.new(total)
|
49
|
+
bar = ProgressBar.new(total) unless options[:noprogressbar]
|
48
50
|
|
49
51
|
dumpfile.get_objects_output_stream do |out|
|
50
52
|
client.each_scroll_hit(scroll_id) do |hit|
|
51
53
|
metadata = { index: { _type: hit["_type"], _id: hit["_id"] } }
|
52
54
|
out.write("#{MultiJson.dump(metadata)}\n#{MultiJson.dump(hit["_source"])}\n")
|
53
|
-
bar.increment!
|
55
|
+
bar.increment! unless options[:noprogressbar]
|
54
56
|
end
|
55
57
|
end
|
56
58
|
end
|
@@ -64,13 +66,13 @@ module EsDumpRestore
|
|
64
66
|
Dumpfile.read(filename) do |dumpfile|
|
65
67
|
client.create_index(dumpfile.index)
|
66
68
|
|
67
|
-
bar = ProgressBar.new(dumpfile.num_objects)
|
69
|
+
bar = ProgressBar.new(dumpfile.num_objects) unless options[:noprogressbar]
|
68
70
|
dumpfile.scan_objects(1000) do |batch, size|
|
69
71
|
client.bulk_index batch
|
70
|
-
bar.increment!(size)
|
72
|
+
bar.increment!(size) unless options[:noprogressbar]
|
71
73
|
end
|
72
74
|
end
|
73
75
|
end
|
74
76
|
|
75
77
|
end
|
76
|
-
end
|
78
|
+
end
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: es_dump_restore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nat Budin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: httpclient
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: thor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rubyzip
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.0.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.0.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: progress_bar
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
description: A utility for dumping the contents of an ElasticSearch index to a compressed
|
@@ -89,7 +89,8 @@ executables:
|
|
89
89
|
extensions: []
|
90
90
|
extra_rdoc_files: []
|
91
91
|
files:
|
92
|
-
- .gitignore
|
92
|
+
- ".gitignore"
|
93
|
+
- CHANGELOG.md
|
93
94
|
- Gemfile
|
94
95
|
- LICENSE.txt
|
95
96
|
- README.md
|
@@ -110,17 +111,17 @@ require_paths:
|
|
110
111
|
- lib
|
111
112
|
required_ruby_version: !ruby/object:Gem::Requirement
|
112
113
|
requirements:
|
113
|
-
- -
|
114
|
+
- - ">="
|
114
115
|
- !ruby/object:Gem::Version
|
115
116
|
version: '0'
|
116
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
118
|
requirements:
|
118
|
-
- -
|
119
|
+
- - ">="
|
119
120
|
- !ruby/object:Gem::Version
|
120
121
|
version: '0'
|
121
122
|
requirements: []
|
122
123
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
124
|
+
rubygems_version: 2.2.2
|
124
125
|
signing_key:
|
125
126
|
specification_version: 4
|
126
127
|
summary: Dump ElasticSearch indexes to files and restore them back
|