riak-client 2.2.2 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/RELEASE_NOTES.md +16 -0
- data/Rakefile +3 -2
- data/lib/riak/client/beefcake/message_codes.rb +12 -0
- data/lib/riak/client/beefcake/messages.rb +205 -5
- data/lib/riak/client/beefcake/object_methods.rb +1 -2
- data/lib/riak/client/beefcake/operator.rb +9 -0
- data/lib/riak/client/beefcake/time_series_delete_operator.rb +24 -0
- data/lib/riak/client/beefcake/time_series_get_operator.rb +35 -0
- data/lib/riak/client/beefcake/time_series_list_operator.rb +42 -0
- data/lib/riak/client/beefcake/time_series_put_operator.rb +32 -0
- data/lib/riak/client/beefcake/time_series_query_operator.rb +42 -0
- data/lib/riak/client/beefcake/ts_cell_codec.rb +63 -0
- data/lib/riak/client/beefcake_protobuffs_backend.rb +5 -0
- data/lib/riak/client.rb +3 -0
- data/lib/riak/errors/time_series.rb +23 -0
- data/lib/riak/locale/en.yml +5 -0
- data/lib/riak/time_series/collection.rb +5 -0
- data/lib/riak/time_series/deletion.rb +26 -0
- data/lib/riak/time_series/list.rb +66 -0
- data/lib/riak/time_series/query.rb +43 -0
- data/lib/riak/time_series/read.rb +18 -0
- data/lib/riak/time_series/row.rb +4 -0
- data/lib/riak/time_series/submission.rb +32 -0
- data/lib/riak/time_series.rb +17 -0
- data/lib/riak/version.rb +1 -1
- data/lib/riak.rb +16 -0
- data/spec/integration/riak/bucket_types_spec.rb +6 -6
- data/spec/integration/riak/time_series_spec.rb +168 -0
- data/spec/riak/beefcake_protobuffs_backend/object_methods_spec.rb +31 -2
- data/spec/riak/beefcake_protobuffs_backend/ts_cell_codec_spec.rb +116 -0
- data/spec/riak/client_spec.rb +11 -0
- data/spec/riak/crdt/inner_flag_spec.rb +1 -1
- data/spec/riak/time_series/deletion_spec.rb +33 -0
- data/spec/riak/time_series/listing_spec.rb +50 -0
- data/spec/riak/time_series/submission_spec.rb +35 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/test_client.yml +0 -1
- metadata +29 -3
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Riak::TimeSeries::List do
|
4
|
+
subject { described_class.new client, table_name }
|
5
|
+
let(:table_name){ 'GeoCheckin' }
|
6
|
+
let(:client){ instance_double('Riak::Client') }
|
7
|
+
let(:key){ double 'key' }
|
8
|
+
let(:backend) do
|
9
|
+
instance_double('Riak::Client::BeefcakeProtobuffsBackend').tap do |be|
|
10
|
+
allow(client).to receive(:backend).and_yield be
|
11
|
+
end
|
12
|
+
end
|
13
|
+
let(:operator) do
|
14
|
+
Riak::Client::BeefcakeProtobuffsBackend.configured?
|
15
|
+
instance_double(
|
16
|
+
'Riak::Client::BeefcakeProtobuffsBackend::TimeSeriesListOperator'
|
17
|
+
).tap do |op|
|
18
|
+
allow(backend).to receive(:time_series_list_operator).
|
19
|
+
and_return(op)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
let(:list_results) do
|
24
|
+
Riak::TimeSeries::Collection.new.tap do |buf|
|
25
|
+
%w{family series timestamp}
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'initializes with client and table name' do
|
30
|
+
expect{ described_class.new client, table_name }.to_not raise_error
|
31
|
+
expect{ described_class.new client }.to raise_error ArgumentError
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'passes a block to the operator' do
|
35
|
+
streamer = proc { double 'block contents' }
|
36
|
+
|
37
|
+
expect(operator).to receive(:list).with(table_name, streamer, timeout: nil)
|
38
|
+
|
39
|
+
subject.issue! &streamer
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'returns a list of results' do
|
43
|
+
expect(operator).to receive(:list).
|
44
|
+
with(table_name, nil, timeout: nil).
|
45
|
+
and_return(list_results)
|
46
|
+
|
47
|
+
expect(subject.issue!).to eq list_results
|
48
|
+
expect(subject.results).to eq list_results
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Riak::TimeSeries::Submission do
|
4
|
+
subject{ described_class.new client, table_name }
|
5
|
+
let(:table_name){ 'GeoCheckin' }
|
6
|
+
let(:client){ instance_double('Riak::Client') }
|
7
|
+
let(:measurements){ double 'measurements' }
|
8
|
+
let(:backend) do
|
9
|
+
instance_double('Riak::Client::BeefcakeProtobuffsBackend').tap do |be|
|
10
|
+
allow(client).to receive(:backend).and_yield be
|
11
|
+
end
|
12
|
+
end
|
13
|
+
let(:operator) do
|
14
|
+
Riak::Client::BeefcakeProtobuffsBackend.configured?
|
15
|
+
instance_double(
|
16
|
+
'Riak::Client::BeefcakeProtobuffsBackend::TimeSeriesPutOperator'
|
17
|
+
).tap do |po|
|
18
|
+
allow(backend).to receive(:time_series_put_operator).
|
19
|
+
and_return(po)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'initializes with client and table name' do
|
24
|
+
expect{ described_class.new client, table_name }.to_not raise_error
|
25
|
+
expect{ described_class.new client }.to raise_error ArgumentError
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'passes measurements to a put operator' do
|
29
|
+
expect{ subject.measurements = measurements }.to_not raise_error
|
30
|
+
|
31
|
+
expect(operator).to receive(:put).with(table_name, measurements)
|
32
|
+
|
33
|
+
expect{ subject.write! }.to_not raise_error
|
34
|
+
end
|
35
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riak-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryce Kerley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -214,8 +214,15 @@ files:
|
|
214
214
|
- lib/riak/client/beefcake/message_overlay.rb
|
215
215
|
- lib/riak/client/beefcake/messages.rb
|
216
216
|
- lib/riak/client/beefcake/object_methods.rb
|
217
|
+
- lib/riak/client/beefcake/operator.rb
|
217
218
|
- lib/riak/client/beefcake/protocol.rb
|
218
219
|
- lib/riak/client/beefcake/socket.rb
|
220
|
+
- lib/riak/client/beefcake/time_series_delete_operator.rb
|
221
|
+
- lib/riak/client/beefcake/time_series_get_operator.rb
|
222
|
+
- lib/riak/client/beefcake/time_series_list_operator.rb
|
223
|
+
- lib/riak/client/beefcake/time_series_put_operator.rb
|
224
|
+
- lib/riak/client/beefcake/time_series_query_operator.rb
|
225
|
+
- lib/riak/client/beefcake/ts_cell_codec.rb
|
219
226
|
- lib/riak/client/beefcake_protobuffs_backend.rb
|
220
227
|
- lib/riak/client/decaying.rb
|
221
228
|
- lib/riak/client/feature_detection.rb
|
@@ -257,6 +264,7 @@ files:
|
|
257
264
|
- lib/riak/errors/failed_request.rb
|
258
265
|
- lib/riak/errors/protobuffs_error.rb
|
259
266
|
- lib/riak/errors/search_error.rb
|
267
|
+
- lib/riak/errors/time_series.rb
|
260
268
|
- lib/riak/i18n.rb
|
261
269
|
- lib/riak/index_collection.rb
|
262
270
|
- lib/riak/instrumentation.rb
|
@@ -283,6 +291,14 @@ files:
|
|
283
291
|
- lib/riak/secondary_index.rb
|
284
292
|
- lib/riak/serializers.rb
|
285
293
|
- lib/riak/stamp.rb
|
294
|
+
- lib/riak/time_series.rb
|
295
|
+
- lib/riak/time_series/collection.rb
|
296
|
+
- lib/riak/time_series/deletion.rb
|
297
|
+
- lib/riak/time_series/list.rb
|
298
|
+
- lib/riak/time_series/query.rb
|
299
|
+
- lib/riak/time_series/read.rb
|
300
|
+
- lib/riak/time_series/row.rb
|
301
|
+
- lib/riak/time_series/submission.rb
|
286
302
|
- lib/riak/util/escape.rb
|
287
303
|
- lib/riak/util/tcp_socket_extensions.rb
|
288
304
|
- lib/riak/util/translation.rb
|
@@ -321,6 +337,7 @@ files:
|
|
321
337
|
- spec/integration/riak/secondary_index_spec.rb
|
322
338
|
- spec/integration/riak/security_spec.rb
|
323
339
|
- spec/integration/riak/threading_spec.rb
|
340
|
+
- spec/integration/riak/time_series_spec.rb
|
324
341
|
- spec/integration/yokozuna/index_spec.rb
|
325
342
|
- spec/integration/yokozuna/queries_spec.rb
|
326
343
|
- spec/integration/yokozuna/schema_spec.rb
|
@@ -328,6 +345,7 @@ files:
|
|
328
345
|
- spec/riak/beefcake_protobuffs_backend/crdt_operator_spec.rb
|
329
346
|
- spec/riak/beefcake_protobuffs_backend/object_methods_spec.rb
|
330
347
|
- spec/riak/beefcake_protobuffs_backend/protocol_spec.rb
|
348
|
+
- spec/riak/beefcake_protobuffs_backend/ts_cell_codec_spec.rb
|
331
349
|
- spec/riak/beefcake_protobuffs_backend_spec.rb
|
332
350
|
- spec/riak/bucket_properties_spec.rb
|
333
351
|
- spec/riak/bucket_spec.rb
|
@@ -367,6 +385,9 @@ files:
|
|
367
385
|
- spec/riak/secondary_index_spec.rb
|
368
386
|
- spec/riak/serializers_spec.rb
|
369
387
|
- spec/riak/stamp_spec.rb
|
388
|
+
- spec/riak/time_series/deletion_spec.rb
|
389
|
+
- spec/riak/time_series/listing_spec.rb
|
390
|
+
- spec/riak/time_series/submission_spec.rb
|
370
391
|
- spec/riak/walk_spec_spec.rb
|
371
392
|
- spec/spec_helper.rb
|
372
393
|
- spec/support/certs/README.md
|
@@ -410,7 +431,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
410
431
|
version: '0'
|
411
432
|
requirements: []
|
412
433
|
rubyforge_project:
|
413
|
-
rubygems_version: 2.4.
|
434
|
+
rubygems_version: 2.4.5.1
|
414
435
|
signing_key:
|
415
436
|
specification_version: 4
|
416
437
|
summary: riak-client is a rich client for Riak, the distributed database by Basho.
|
@@ -447,6 +468,7 @@ test_files:
|
|
447
468
|
- spec/integration/riak/secondary_index_spec.rb
|
448
469
|
- spec/integration/riak/security_spec.rb
|
449
470
|
- spec/integration/riak/threading_spec.rb
|
471
|
+
- spec/integration/riak/time_series_spec.rb
|
450
472
|
- spec/integration/yokozuna/index_spec.rb
|
451
473
|
- spec/integration/yokozuna/queries_spec.rb
|
452
474
|
- spec/integration/yokozuna/schema_spec.rb
|
@@ -454,6 +476,7 @@ test_files:
|
|
454
476
|
- spec/riak/beefcake_protobuffs_backend/crdt_operator_spec.rb
|
455
477
|
- spec/riak/beefcake_protobuffs_backend/object_methods_spec.rb
|
456
478
|
- spec/riak/beefcake_protobuffs_backend/protocol_spec.rb
|
479
|
+
- spec/riak/beefcake_protobuffs_backend/ts_cell_codec_spec.rb
|
457
480
|
- spec/riak/beefcake_protobuffs_backend_spec.rb
|
458
481
|
- spec/riak/bucket_properties_spec.rb
|
459
482
|
- spec/riak/bucket_spec.rb
|
@@ -493,6 +516,9 @@ test_files:
|
|
493
516
|
- spec/riak/secondary_index_spec.rb
|
494
517
|
- spec/riak/serializers_spec.rb
|
495
518
|
- spec/riak/stamp_spec.rb
|
519
|
+
- spec/riak/time_series/deletion_spec.rb
|
520
|
+
- spec/riak/time_series/listing_spec.rb
|
521
|
+
- spec/riak/time_series/submission_spec.rb
|
496
522
|
- spec/riak/walk_spec_spec.rb
|
497
523
|
- spec/spec_helper.rb
|
498
524
|
- spec/support/certs/README.md
|