pyper_rb 1.2.0 → 1.3.0
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 +4 -4
- data/lib/pyper/pipes/cassandra/reader.rb +7 -1
- data/lib/pyper/version.rb +1 -1
- data/test/test_helper.rb +1 -0
- data/test/unit/pyper/pipes/cassandra/reader_test.rb +11 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbe0e9d75ef82ad036192095dc82f409999427a6
|
4
|
+
data.tar.gz: a819f5c7d2278890f9ce052fd2e8b7857f761a36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82df8f313cf6585c615e4411e13f260233d83e0d1303ff450d325e4ac98ee5941d5170dca7e659a2d64559205e086aaf22afc0fd8cac5180dc2d90c8249d4f55
|
7
|
+
data.tar.gz: 577d3a953d375cb8e50f028d00627e6fdf66ce5d64e57f7d505df43574ecdf2916f5fc44b0ccf10d7da5e5054599a944610886a0fd339f27d7f5f726a481c963
|
@@ -9,6 +9,8 @@ module Pyper::Pipes::Cassandra
|
|
9
9
|
# @option arguments [Array] :order A pair [clustering_column, :desc|:asc] determining how to order the results.
|
10
10
|
# @option arguments [Object] :paging_state
|
11
11
|
# @option arguments [Integer] :page_size
|
12
|
+
# @option arguments [Symbol] :consistency The consistency for the request. Must be
|
13
|
+
# one of Cassandra::CONSISTENCIES.
|
12
14
|
# @param status [Hash] The mutable status field
|
13
15
|
# @return [Enumerator::Lazy<Hash>] enumerator of items
|
14
16
|
def pipe(arguments, status = {})
|
@@ -17,8 +19,12 @@ module Pyper::Pipes::Cassandra
|
|
17
19
|
paging_state = arguments.delete(:paging_state)
|
18
20
|
order = arguments.delete(:order)
|
19
21
|
columns = arguments.delete(:columns)
|
22
|
+
consistency = arguments.delete(:consistency)
|
20
23
|
|
21
|
-
opts =
|
24
|
+
opts = options.nil? ? {} : options.dup
|
25
|
+
opts[:page_size] = page_size if page_size
|
26
|
+
opts[:paging_state] = paging_state if paging_state
|
27
|
+
opts[:consistency] = consistency if consistency
|
22
28
|
|
23
29
|
query = client.select(table, columns).where(arguments)
|
24
30
|
query = query.limit(limit) if limit
|
data/lib/pyper/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -62,6 +62,17 @@ module Pyper::Pipes::Cassandra
|
|
62
62
|
assert_equal false, status[:last_page]
|
63
63
|
end
|
64
64
|
|
65
|
+
should "allow custom consistency to be passed for a single request" do
|
66
|
+
original_opts = @pipe.client.session.instance_variable_get(:@options)
|
67
|
+
refute_equal original_opts.consistency, :all
|
68
|
+
|
69
|
+
expected_opts_with_all = original_opts.override(:consistency => :all, :arguments => ["id"])
|
70
|
+
original_opts.expects(:override).with { |opts| opts[:consistency] == :all }.returns(expected_opts_with_all)
|
71
|
+
|
72
|
+
out = @pipe.pipe({id: 'id', :consistency => :all}, {})
|
73
|
+
assert_equal 2, out.count
|
74
|
+
end
|
75
|
+
|
65
76
|
context "columns selecting" do
|
66
77
|
should "only select given columns from columns argument" do
|
67
78
|
out = @pipe.pipe({id: 'id', :columns => [:a]}).to_a
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pyper_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arron Norwell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.2.2
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: Create pipelines for storing data.
|
@@ -145,3 +145,4 @@ test_files:
|
|
145
145
|
- test/unit/pyper/pipes/model/virtus_deserializer_test.rb
|
146
146
|
- test/unit/pyper/pipes/no_op_test.rb
|
147
147
|
- test/unit/pyper/pipes/remove_fields_test.rb
|
148
|
+
has_rdoc:
|