scalastic 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scalastic/partitions_client.rb +11 -4
- data/lib/scalastic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db0c2019184cf395101e628c12380028c616cecb
|
4
|
+
data.tar.gz: fb827f64ffcc8cb8b9beeef11839fae4eb0537bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 916ca019138061d26daf42ac486ee8f346dc16b01c5b869525ad09ec064e88728910e1207b55ebf691ff3d5ef7544c6af4a1bde6f45d681d16a8546e90e93296
|
7
|
+
data.tar.gz: 5511b43df76519259a6625a5ca1b8f18562766f83cc0ac9d52c936fdd4e1c54c7495f6a8df87ef468205692689819d90b5ab289c38b7833916e36d5b0cf24832
|
@@ -3,6 +3,8 @@ require "scalastic/es_actions_generator"
|
|
3
3
|
|
4
4
|
module Scalastic
|
5
5
|
class PartitionsClient
|
6
|
+
include Enumerable
|
7
|
+
|
6
8
|
attr_reader(:es_client)
|
7
9
|
attr_reader(:config)
|
8
10
|
|
@@ -37,10 +39,8 @@ module Scalastic
|
|
37
39
|
Partition.new(es_client, config, id)
|
38
40
|
end
|
39
41
|
|
40
|
-
def
|
41
|
-
|
42
|
-
partition_ids = aliases.map{|_, data| data['aliases'].keys}.flatten.map{|a| config.get_partition_id(a)}.compact.uniq
|
43
|
-
partition_ids.map{|id| Partition.new(es_client, config, id)}
|
42
|
+
def each(&_block)
|
43
|
+
partition_ids.each{|pid| yield Partition.new(es_client, config, pid) if block_given?}
|
44
44
|
end
|
45
45
|
|
46
46
|
def prepare_index(args)
|
@@ -49,5 +49,12 @@ module Scalastic
|
|
49
49
|
es_client.indices.put_mapping(index: index, type: '_default_', body: {'_default_' => mapping})
|
50
50
|
es_client.indices.put_mapping(index: index, type: 'scalastic', body: {'scalastic' => mapping})
|
51
51
|
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
def partition_ids
|
56
|
+
aliases = es_client.indices.get_aliases
|
57
|
+
partition_ids = aliases.map{|_, data| data['aliases'].keys}.flatten.map{|a| config.get_partition_id(a)}.compact.uniq
|
58
|
+
end
|
52
59
|
end
|
53
60
|
end
|
data/lib/scalastic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scalastic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aliaksei Baturytski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|