mongo_mapper_parallel 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/mongo_mapper_parallel.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDQ3Yjk5OTg1YTYyYzQ0MWU4MjliNDlhNDUxMDAxYmVkZjY4ZDQwOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDI0ZWM1MTQ2Yzk4NmZiMTM4ZTIzNzNmOGY2ZWMwYjA3OTZmNTNjZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmVjYWE5MTI5YjkwY2ZiMzRiMzdmN2I5Mjk3ZWNlNzJhNzY2ZWVjZmNmODQx
|
10
|
+
OGI0ZDA5N2ZiZTM4ZWM4MWFmY2Q3N2RmNGM1ZjYwNjc0MGU1ZTc4NTJkOWM4
|
11
|
+
N2JmNGMxODEwOGRiZjU2YWIyYzA2ZjY5MTM2NzQ3ZThmM2Q5ZjQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjJmMTBjNTQ1OTAyMjkzMjcxYTgwYjlhYjU2ZDljYzhkZDFjNWJjZjI5ZjQx
|
14
|
+
M2MwZTFhNDllOWM4MGZlMTIzZjcxYzAyM2YyMDc2Y2QzMjI4NTE4YTkwOTAy
|
15
|
+
Y2FiNzYzOGVkOWI5M2I5Mzc2ZWNiNGEyYTZhMDg0ZWExMjNjYzM=
|
@@ -73,6 +73,15 @@ class MongoMapperParallel
|
|
73
73
|
splits.each_with_index do |split_key,k|
|
74
74
|
@split_keys << MongoMapperParallel::Key.new(:compiler => self, :key => split_key[@split.to_s], :future_key => (splits[k+1] ? splits[k+1][@split.to_s] : nil))
|
75
75
|
end
|
76
|
+
if @split_keys.length == 0 and @command_class.count > 0 then get_extreme_split_keys end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Obtains the splitVectors keys by looking at the first and last element of the database if no splitVector is returned.
|
80
|
+
#
|
81
|
+
# @return [Array<MongoMapperParallel::Key>] the list of the keys that will be used for parallel operation
|
82
|
+
def get_extreme_split_keys
|
83
|
+
split_key = @command_class.where().order(@split.to_sym).fields(@split.to_sym).first.send(@split.to_sym)
|
84
|
+
@split_keys << MongoMapperParallel::Key.new(:compiler => self, :key => split_key, :future_key => nil)
|
76
85
|
end
|
77
86
|
|
78
87
|
# Instantiates the parallel operation object with the right class, javascript function, and field
|