riak-client 1.4.5 → 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/Gemfile +0 -1
  4. data/{LICENSE → LICENSE.md} +0 -0
  5. data/README.markdown +211 -66
  6. data/RELEASE_NOTES.md +22 -47
  7. data/Rakefile +45 -0
  8. data/lib/riak.rb +1 -1
  9. data/lib/riak/bucket.rb +2 -2
  10. data/lib/riak/client.rb +22 -195
  11. data/lib/riak/client/beefcake/crdt_loader.rb +127 -0
  12. data/lib/riak/client/beefcake/crdt_operator.rb +222 -0
  13. data/lib/riak/client/beefcake/footer +4 -0
  14. data/lib/riak/client/beefcake/header +6 -0
  15. data/lib/riak/client/beefcake/message_codes.rb +29 -0
  16. data/lib/riak/client/beefcake/message_overlay.rb +61 -0
  17. data/lib/riak/client/beefcake/messages.rb +733 -371
  18. data/lib/riak/client/beefcake/object_methods.rb +1 -1
  19. data/lib/riak/client/beefcake/protocol.rb +105 -0
  20. data/lib/riak/client/beefcake/socket.rb +243 -0
  21. data/lib/riak/client/beefcake_protobuffs_backend.rb +262 -122
  22. data/lib/riak/client/node.rb +4 -75
  23. data/lib/riak/client/protobuffs_backend.rb +6 -14
  24. data/lib/riak/client/search.rb +0 -64
  25. data/lib/riak/client/yokozuna.rb +52 -0
  26. data/lib/riak/counter.rb +1 -1
  27. data/lib/riak/crdt.rb +21 -0
  28. data/lib/riak/crdt/base.rb +97 -0
  29. data/lib/riak/crdt/batch_counter.rb +19 -0
  30. data/lib/riak/crdt/batch_map.rb +41 -0
  31. data/lib/riak/crdt/counter.rb +71 -0
  32. data/lib/riak/crdt/inner_counter.rb +74 -0
  33. data/lib/riak/crdt/inner_flag.rb +42 -0
  34. data/lib/riak/crdt/inner_map.rb +53 -0
  35. data/lib/riak/crdt/inner_register.rb +26 -0
  36. data/lib/riak/crdt/inner_set.rb +95 -0
  37. data/lib/riak/crdt/map.rb +88 -0
  38. data/lib/riak/crdt/operation.rb +19 -0
  39. data/lib/riak/crdt/set.rb +156 -0
  40. data/lib/riak/crdt/typed_collection.rb +131 -0
  41. data/lib/riak/errors/base.rb +9 -0
  42. data/lib/riak/errors/connection_error.rb +44 -0
  43. data/lib/riak/errors/crdt_error.rb +18 -0
  44. data/lib/riak/errors/failed_request.rb +56 -0
  45. data/lib/riak/errors/protobuffs_error.rb +11 -0
  46. data/lib/riak/i18n.rb +2 -0
  47. data/lib/riak/json.rb +1 -1
  48. data/lib/riak/locale/en.yml +26 -1
  49. data/lib/riak/locale/fr.yml +0 -1
  50. data/lib/riak/map_reduce.rb +1 -1
  51. data/lib/riak/map_reduce/results.rb +1 -1
  52. data/lib/riak/multiget.rb +1 -2
  53. data/lib/riak/rcontent.rb +8 -3
  54. data/lib/riak/robject.rb +2 -8
  55. data/lib/riak/secondary_index.rb +4 -4
  56. data/lib/riak/serializers.rb +1 -1
  57. data/lib/riak/util/escape.rb +3 -5
  58. data/lib/riak/version.rb +1 -1
  59. data/lib/riak/walk_spec.rb +7 -3
  60. data/riak-client.gemspec +10 -8
  61. data/spec/fixtures/bitcask.txt +25 -0
  62. data/spec/integration/riak/bucket_types_spec.rb +61 -0
  63. data/spec/integration/riak/counters_spec.rb +17 -32
  64. data/spec/integration/riak/crdt_spec.rb +181 -0
  65. data/spec/integration/riak/crdt_validation/map_spec.rb +63 -0
  66. data/spec/integration/riak/crdt_validation/set_spec.rb +122 -0
  67. data/spec/integration/riak/protobuffs_backends_spec.rb +9 -26
  68. data/spec/integration/riak/security_spec.rb +94 -0
  69. data/spec/integration/riak/threading_spec.rb +24 -67
  70. data/spec/integration/yokozuna/index_spec.rb +61 -0
  71. data/spec/integration/yokozuna/queries_spec.rb +116 -0
  72. data/spec/integration/yokozuna/schema_spec.rb +49 -0
  73. data/spec/riak/beefcake_protobuffs_backend/crdt_operator_spec.rb +222 -0
  74. data/spec/riak/beefcake_protobuffs_backend/object_methods_spec.rb +4 -4
  75. data/spec/riak/beefcake_protobuffs_backend/protocol_spec.rb +189 -0
  76. data/spec/riak/beefcake_protobuffs_backend/socket_spec.rb +151 -0
  77. data/spec/riak/beefcake_protobuffs_backend_spec.rb +68 -106
  78. data/spec/riak/bucket_spec.rb +81 -77
  79. data/spec/riak/client_spec.rb +43 -340
  80. data/spec/riak/core_ext/to_param_spec.rb +2 -2
  81. data/spec/riak/counter_spec.rb +20 -20
  82. data/spec/riak/crdt/counter_spec.rb +52 -0
  83. data/spec/riak/crdt/inner_counter_spec.rb +21 -0
  84. data/spec/riak/crdt/inner_flag_spec.rb +39 -0
  85. data/spec/riak/crdt/inner_map_spec.rb +47 -0
  86. data/spec/riak/crdt/inner_register_spec.rb +40 -0
  87. data/spec/riak/crdt/inner_set_spec.rb +33 -0
  88. data/spec/riak/crdt/map_spec.rb +77 -0
  89. data/spec/riak/crdt/set_spec.rb +58 -0
  90. data/spec/riak/crdt/shared_examples.rb +74 -0
  91. data/spec/riak/crdt/typed_collection_spec.rb +231 -0
  92. data/spec/riak/escape_spec.rb +33 -37
  93. data/spec/riak/feature_detection_spec.rb +45 -45
  94. data/spec/riak/index_collection_spec.rb +12 -12
  95. data/spec/riak/link_spec.rb +34 -34
  96. data/spec/riak/list_buckets_spec.rb +7 -7
  97. data/spec/riak/map_reduce/filter_builder_spec.rb +6 -6
  98. data/spec/riak/map_reduce/phase_spec.rb +35 -35
  99. data/spec/riak/map_reduce_spec.rb +89 -87
  100. data/spec/riak/multiget_spec.rb +20 -15
  101. data/spec/riak/node_spec.rb +5 -152
  102. data/spec/riak/robject_spec.rb +95 -108
  103. data/spec/riak/search_spec.rb +17 -139
  104. data/spec/riak/secondary_index_spec.rb +49 -49
  105. data/spec/riak/serializers_spec.rb +9 -9
  106. data/spec/riak/stamp_spec.rb +9 -9
  107. data/spec/riak/walk_spec_spec.rb +46 -46
  108. data/spec/spec_helper.rb +14 -22
  109. data/spec/support/certs/README.md +13 -0
  110. data/spec/support/certs/ca.crt +22 -0
  111. data/spec/support/certs/client.crt +95 -0
  112. data/spec/support/certs/client.key +27 -0
  113. data/spec/support/certs/empty_ca.crt +21 -0
  114. data/spec/support/certs/server.crl +13 -0
  115. data/spec/support/certs/server.crt +95 -0
  116. data/spec/support/certs/server.key +27 -0
  117. data/spec/support/integration_setup.rb +1 -1
  118. data/spec/support/search_corpus_setup.rb +29 -8
  119. data/spec/support/test_client.rb +46 -0
  120. data/spec/support/test_client.yml.example +10 -0
  121. data/spec/support/unified_backend_examples.rb +104 -83
  122. data/spec/support/version_filter.rb +2 -2
  123. data/spec/support/wait_until.rb +14 -0
  124. metadata +134 -132
  125. data/erl_src/riak_kv_test014_backend.beam +0 -0
  126. data/erl_src/riak_kv_test014_backend.erl +0 -189
  127. data/erl_src/riak_kv_test_backend.beam +0 -0
  128. data/erl_src/riak_kv_test_backend.erl +0 -731
  129. data/erl_src/riak_search_test_backend.beam +0 -0
  130. data/erl_src/riak_search_test_backend.erl +0 -175
  131. data/lib/riak/client/excon_backend.rb +0 -172
  132. data/lib/riak/client/http_backend.rb +0 -413
  133. data/lib/riak/client/http_backend/bucket_streamer.rb +0 -15
  134. data/lib/riak/client/http_backend/chunked_json_streamer.rb +0 -42
  135. data/lib/riak/client/http_backend/configuration.rb +0 -227
  136. data/lib/riak/client/http_backend/key_streamer.rb +0 -15
  137. data/lib/riak/client/http_backend/object_methods.rb +0 -114
  138. data/lib/riak/client/http_backend/request_headers.rb +0 -34
  139. data/lib/riak/client/http_backend/transport_methods.rb +0 -201
  140. data/lib/riak/client/instrumentation.rb +0 -25
  141. data/lib/riak/client/net_http_backend.rb +0 -82
  142. data/lib/riak/cluster.rb +0 -151
  143. data/lib/riak/failed_request.rb +0 -81
  144. data/lib/riak/instrumentation.rb +0 -6
  145. data/lib/riak/node.rb +0 -40
  146. data/lib/riak/node/configuration.rb +0 -304
  147. data/lib/riak/node/console.rb +0 -133
  148. data/lib/riak/node/control.rb +0 -207
  149. data/lib/riak/node/defaults.rb +0 -85
  150. data/lib/riak/node/generation.rb +0 -127
  151. data/lib/riak/node/log.rb +0 -34
  152. data/lib/riak/node/version.rb +0 -29
  153. data/lib/riak/search.rb +0 -3
  154. data/lib/riak/test_server.rb +0 -89
  155. data/lib/riak/util/headers.rb +0 -32
  156. data/lib/riak/util/multipart.rb +0 -52
  157. data/lib/riak/util/multipart/stream_parser.rb +0 -62
  158. data/spec/fixtures/munchausen.txt +0 -1033
  159. data/spec/integration/riak/cluster_spec.rb +0 -88
  160. data/spec/integration/riak/http_backends_spec.rb +0 -180
  161. data/spec/integration/riak/node_spec.rb +0 -170
  162. data/spec/integration/riak/test_server_spec.rb +0 -57
  163. data/spec/riak/excon_backend_spec.rb +0 -102
  164. data/spec/riak/headers_spec.rb +0 -21
  165. data/spec/riak/http_backend/configuration_spec.rb +0 -273
  166. data/spec/riak/http_backend/object_methods_spec.rb +0 -243
  167. data/spec/riak/http_backend/transport_methods_spec.rb +0 -97
  168. data/spec/riak/http_backend_spec.rb +0 -367
  169. data/spec/riak/instrumentation_spec.rb +0 -167
  170. data/spec/riak/multipart_spec.rb +0 -23
  171. data/spec/riak/net_http_backend_spec.rb +0 -15
  172. data/spec/riak/stream_parser_spec.rb +0 -53
  173. data/spec/support/drb_mock_server.rb +0 -39
  174. data/spec/support/http_backend_implementation_examples.rb +0 -253
  175. data/spec/support/mock_server.rb +0 -81
  176. data/spec/support/mocks.rb +0 -4
  177. data/spec/support/riak_test.rb +0 -77
  178. data/spec/support/sometimes.rb +0 -46
  179. data/spec/support/test_server.rb +0 -61
  180. data/spec/support/test_server.yml.example +0 -14
@@ -0,0 +1,222 @@
1
+ require 'riak/errors/crdt_error'
2
+
3
+ module Riak
4
+ class Client
5
+ class BeefcakeProtobuffsBackend
6
+
7
+ # Returns a new {CrdtOperator} for serializing CRDT operations into
8
+ # protobuffs and sending them to a Riak cluster.
9
+ # @api private
10
+ def crdt_operator
11
+ return CrdtOperator.new self
12
+ end
13
+
14
+ # Serializes and writes CRDT operations from {Riak::Crdt::Operation} members
15
+ # into protobuffs, and writes them to a Riak cluster.
16
+ # @api private
17
+ class CrdtOperator
18
+ include Util::Translation
19
+
20
+ attr_reader :backend
21
+
22
+ def initialize(backend)
23
+ @backend = backend
24
+ end
25
+
26
+ # Serializes and writes CRDT operations.
27
+ def operate(bucket, key, bucket_type, operation, options={})
28
+ serialized = serialize(operation)
29
+ args = {
30
+ bucket: bucket,
31
+ key: key,
32
+ type: bucket_type,
33
+ op: serialized
34
+ }.merge options
35
+ request = DtUpdateReq.new args
36
+ begin
37
+ return backend.protocol do |p|
38
+ p.write :DtUpdateReq, request
39
+ p.expect :DtUpdateResp, DtUpdateResp, empty_body_acceptable: true
40
+ end
41
+ rescue ProtobuffsErrorResponse => e
42
+ raise unless e.message =~ /precondition/
43
+ raise CrdtError::PreconditionError.new e.message
44
+ end
45
+ end
46
+
47
+ # Serializes CRDT operations without writing them.
48
+ def serialize(operations)
49
+ return serialize [operations] unless operations.is_a? Enumerable
50
+
51
+ serialize_wrap operations
52
+ end
53
+
54
+ private
55
+ def serialize_wrap(operations)
56
+ raise ArgumentError, t('crdt.serialize_no_ops') if operations.empty?
57
+ ops = serialize_group operations
58
+
59
+ DtOp.new(wrap_field_for(operations) => ops)
60
+ end
61
+
62
+ def wrap_field_for(ops)
63
+ "#{ops.first.type.to_s}_op".to_sym
64
+ end
65
+
66
+ def serialize_group(operations)
67
+ case operations.first.type
68
+ when :counter
69
+ serialize_counter operations
70
+ when :set
71
+ serialize_set operations
72
+ when :map
73
+ serialize_map operations
74
+ else
75
+ raise ArgumentError, t('crdt.unknown_field', symbol: operation.type.inspect)
76
+ end
77
+ end
78
+
79
+ def inner_serialize_group(operations)
80
+ updates, deletes = operations.partition do |op|
81
+ op.value.is_a? Riak::Crdt::Operation::Update
82
+ end
83
+ serialized_updates = updates.map do |operation|
84
+ inner_serialize operation.value
85
+ end
86
+ serialized_deletes = deletes.map do |operation|
87
+ inner_serialize_delete operation.value
88
+ end
89
+
90
+ { updates: serialized_updates,
91
+ removes: serialized_deletes
92
+ }
93
+ end
94
+
95
+ def inner_serialize(operation)
96
+ case operation.type
97
+ when :counter
98
+ serialize_inner_counter operation
99
+ when :flag
100
+ serialize_flag operation
101
+ when :register
102
+ serialize_register operation
103
+ when :set
104
+ serialize_inner_set operation
105
+ when :map
106
+ serialize_inner_map operation
107
+ else
108
+ raise ArgumentError, t('crdt.unknown_inner_field',
109
+ symbol: operation.type.inspect)
110
+ end
111
+ end
112
+
113
+ def inner_serialize_delete(operation)
114
+ MapField.new(
115
+ name: operation.name,
116
+ type: type_symbol_to_type_enum(operation.type)
117
+ )
118
+ end
119
+
120
+ def serialize_counter(counter_ops)
121
+ amount = counter_ops.inject(0){|m, o| m += o.value }
122
+ CounterOp.new(increment: amount)
123
+ end
124
+
125
+ def serialize_inner_counter(counter_op)
126
+ MapUpdate.new(
127
+ field: MapField.new(
128
+ name: counter_op.name,
129
+ type: MapField::MapFieldType::COUNTER
130
+ ),
131
+ counter_op: CounterOp.new(
132
+ increment: counter_op.value
133
+ )
134
+ )
135
+ end
136
+
137
+ def serialize_flag(flag_op)
138
+ operation_value = flag_op.value ? MapUpdate::FlagOp::ENABLE : MapUpdate::FlagOp::DISABLE
139
+ MapUpdate.new(
140
+ field: MapField.new(
141
+ name: flag_op.name,
142
+ type: MapField::MapFieldType::FLAG
143
+ ),
144
+ flag_op: operation_value
145
+ )
146
+ end
147
+
148
+ def serialize_register(register_op)
149
+ MapUpdate.new(
150
+ field: MapField.new(
151
+ name: register_op.name,
152
+ type: MapField::MapFieldType::REGISTER
153
+ ),
154
+ register_op: register_op.value
155
+ )
156
+ end
157
+
158
+ def serialize_set(set_ops)
159
+ adds = ::Set.new
160
+ removes = ::Set.new
161
+ set_ops.each do |o|
162
+ adds.add [o.value[:add]] if o.value[:add]
163
+ removes.merge [o.value[:remove]] if o.value[:remove]
164
+ end
165
+
166
+ SetOp.new(
167
+ adds: adds.to_a.flatten,
168
+ removes: removes.to_a.flatten
169
+ )
170
+ end
171
+
172
+ def serialize_inner_set(set_op)
173
+ value = set_op.value or nil
174
+
175
+ MapUpdate.new(
176
+ field: MapField.new(
177
+ name: set_op.name,
178
+ type: MapField::MapFieldType::SET
179
+ ),
180
+ set_op: SetOp.new(
181
+ adds: value[:add],
182
+ removes: value[:remove]
183
+ )
184
+ )
185
+ end
186
+
187
+ def serialize_map(map_ops)
188
+ inner_serialized = inner_serialize_group map_ops
189
+
190
+ MapOp.new(inner_serialized)
191
+ end
192
+
193
+ def serialize_inner_map(map_op)
194
+ inner_op = map_op.value
195
+ if inner_op.is_a? Riak::Crdt::Operation::Delete
196
+ return MapUpdate.new(field: MapField.new(
197
+ name: map_op.name,
198
+ type: MapField::MapFieldType::MAP
199
+ ),
200
+ map_op: MapOp.new(
201
+ removes: inner_op.name)
202
+ )
203
+ end
204
+ inner_serialized = inner_serialize inner_op
205
+
206
+ MapUpdate.new(
207
+ field: MapField.new(
208
+ name: map_op.name,
209
+ type: MapField::MapFieldType::MAP
210
+ ),
211
+ map_op: MapOp.new(
212
+ updates: [inner_serialized]
213
+ ))
214
+ end
215
+
216
+ def type_symbol_to_type_enum(sym)
217
+ MapField::MapFieldType.const_get sym.to_s.upcase
218
+ end
219
+ end
220
+ end
221
+ end
222
+ end
@@ -0,0 +1,4 @@
1
+
2
+ end
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ require 'beefcake'
2
+
3
+ module Riak
4
+ class Client
5
+ # @private
6
+ class BeefcakeProtobuffsBackend
@@ -33,12 +33,41 @@ module Riak
33
33
  :SearchQueryResp => 28,
34
34
  :ResetBucketReq => 29,
35
35
  :ResetBucketResp => 30,
36
+
37
+ # bucket types
38
+ :GetBucketTypeReq => 31,
39
+ :SetBucketTypeReq => 32,
40
+ :ResetBucketTypeReq => 33,
41
+
42
+ # riak cs
36
43
  :CSBucketReq => 40,
37
44
  :CSBucketResp => 41,
45
+
46
+ # 1.4 counters
38
47
  :CounterUpdateReq => 50,
39
48
  :CounterUpdateResp => 51,
40
49
  :CounterGetReq => 52,
41
50
  :CounterGetResp => 53,
51
+
52
+ # yokozuna
53
+ :YokozunaIndexGetReq => 54,
54
+ :YokozunaIndexGetResp => 55,
55
+ :YokozunaIndexPutReq => 56,
56
+ :YokozunaIndexDeleteReq => 57,
57
+ :YokozunaSchemaGetReq => 58,
58
+ :YokozunaSchemaGetResp => 59,
59
+ :YokozunaSchemaPutReq => 60,
60
+
61
+ # riak 2 CRDT
62
+ :DtFetchReq => 80,
63
+ :DtFetchResp => 81,
64
+ :DtUpdateReq => 82,
65
+ :DtUpdateResp => 83,
66
+
67
+ # internal
68
+ :AuthReq => 253,
69
+ :AuthResp => 254,
70
+ :StartTls => 255
42
71
  }
43
72
 
44
73
  CODE_TO_MESSAGE = MESSAGE_TO_CODE.invert
@@ -0,0 +1,61 @@
1
+ module Riak
2
+ class Client
3
+ # @private
4
+ class BeefcakeProtobuffsBackend
5
+ class RpbIndexReq
6
+ module IndexQueryType
7
+ EQ = 0
8
+ RANGE = 1
9
+ end
10
+ end
11
+
12
+ class RpbBucketProps
13
+ def clean_hook(newval)
14
+ if newval.is_a? Array
15
+ return newval.map{|v| clean_hook v}
16
+ end
17
+
18
+ newval = newval.symbolize_keys if newval.is_a? Hash
19
+ if newval.is_a?(Hash) && newval[:module] && newval[:function]
20
+ modfun = RpbModFun.new newval
21
+ hook = RpbCommitHook.new modfun: modfun
22
+ newval = hook
23
+ elsif newval.is_a?(Hash) && newval[:name]
24
+ hook = RpbCommitHook.new newval
25
+ newval = hook
26
+ elsif newval.is_a? String
27
+ hook = RpbCommitHook.new name: newval
28
+ newval = hook
29
+ end
30
+
31
+ return newval
32
+ end
33
+
34
+ # "repeated" elements with zero items are indistinguishable
35
+ # from a nil, so we have to manage has_precommit/has_postcommit
36
+ # flags.
37
+ def precommit=(newval)
38
+ newval = clean_hook newval
39
+ @precommit = newval
40
+ @has_precommit = !!newval
41
+ end
42
+
43
+ def has_precommit=(newval)
44
+ @has_precommit = newval
45
+ @precommit ||= [] if newval
46
+ end
47
+
48
+ def postcommit=(newval)
49
+ newval = clean_hook newval
50
+ @postcommit = newval
51
+ @has_postcommit = !!newval
52
+ end
53
+
54
+ def has_postcommit=(newval)
55
+ @has_postcommit = newval
56
+ @postcommit ||= [] if newval
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -4,377 +4,739 @@ module Riak
4
4
  class Client
5
5
  # @private
6
6
  class BeefcakeProtobuffsBackend
7
- # Embedded messages
8
- class RpbPair
9
- include Beefcake::Message
10
- required :key, :bytes, 1
11
- optional :value, :bytes, 2
12
- end
13
-
14
- # module-function pair for commit hooks and other properties that take
15
- # functions
16
- class RpbModFun
17
- include Beefcake::Message
18
-
19
- required :module, :bytes, 1
20
- required :function, :bytes, 2
21
- end
22
-
23
- class RpbCommitHook
24
- include Beefcake::Message
25
-
26
- optional :modfun, RpbModFun, 1
27
- optional :name, :bytes, 2
28
- end
29
-
30
- class RpbBucketProps
31
- include Beefcake::Message
32
-
33
- # riak_core_app
34
- optional :n_val, :uint32, 1
35
- optional :allow_mult, :bool, 2
36
- optional :last_write_wins, :bool, 3
37
-
38
- # riak_core values with special handling, see below
39
- repeated :precommit, RpbCommitHook, 4
40
- optional :has_precommit, :bool, 5, :default => false
41
- repeated :postcommit, RpbCommitHook, 6
42
- optional :has_postcommit, :bool, 7, :default => false
43
-
44
- optional :chash_keyfun, RpbModFun, 8
45
-
46
- # riak_kv_app
47
- optional :linkfun, RpbModFun, 9
48
- optional :old_vclock, :uint32, 10
49
- optional :young_vclock, :uint32, 11
50
- optional :big_vclock, :uint32, 12
51
- optional :small_vclock, :uint32, 13
52
- optional :pr, :uint32, 14
53
- optional :r, :uint32, 15
54
- optional :w, :uint32, 16
55
- optional :pw, :uint32, 17
56
- optional :dw, :uint32, 18
57
- optional :rw, :uint32, 19
58
- optional :basic_quorum, :bool, 20
59
- optional :notfound_ok, :bool, 21
60
-
61
- # riak_kv_multi_backend
62
- optional :backend, :bytes, 22
63
-
64
- # riak_search bucket fixup
65
- optional :search, :bool, 23
66
-
67
- module RpbReplMode
68
- FALSE = 0
69
- REALTIME = 1
70
- FULLSYNC = 2
71
- TRUE = 3
72
- end
73
-
74
- optional :repl, RpbReplMode, 24
75
-
76
- # "repeated" elements with zero items are indistinguishable
77
- # from a nil, so we have to manage has_precommit/has_postcommit
78
- # flags.
79
- def precommit=(newval)
80
- @precommit = newval
81
- @has_precommit = !!newval
82
- end
83
-
84
- def has_precommit=(newval)
85
- @has_precommit = newval
86
- @precommit ||= [] if newval
87
- end
88
-
89
- def postcommit=(newval)
90
- @postcommit = newval
91
- @has_postcommit = !!newval
92
- end
93
-
94
- def has_postcommit=(newval)
95
- @has_postcommit = newval
96
- @postcommit ||= [] if newval
97
- end
98
- end
99
-
100
- class RpbLink
101
- include Beefcake::Message
102
- optional :bucket, :bytes, 1
103
- optional :key, :bytes, 2
104
- optional :tag, :bytes, 3
105
- end
106
-
107
- class RpbContent
108
- include Beefcake::Message
109
- required :value, :bytes, 1
110
- optional :content_type, :bytes, 2
111
- optional :charset, :bytes, 3
112
- optional :content_encoding, :bytes, 4
113
- optional :vtag, :bytes, 5
114
- repeated :links, RpbLink, 6
115
- optional :last_mod, :uint32, 7
116
- optional :last_mod_usecs, :uint32, 8
117
- repeated :usermeta, RpbPair, 9
118
- repeated :indexes, RpbPair, 10
119
- end
120
-
121
- # Primary messages
122
- class RpbErrorResp
123
- include Beefcake::Message
124
- required :errmsg, :bytes, 1
125
- required :errcode, :uint32, 2
126
- end
127
-
128
- class RpbGetClientIdResp
129
- include Beefcake::Message
130
- required :client_id, :bytes, 1
131
- end
132
-
133
- class RpbSetClientIdReq
134
- include Beefcake::Message
135
- required :client_id, :bytes, 1
136
- end
137
-
138
- class RpbGetServerInfoResp
139
- include Beefcake::Message
140
- optional :node, :bytes, 1
141
- optional :server_version, :bytes, 2
142
- end
143
-
144
- class RpbGetReq
145
- include Beefcake::Message
146
- required :bucket, :bytes, 1
147
- required :key, :bytes, 2
148
- optional :r, :uint32, 3
149
- optional :pr, :uint32, 4
150
- optional :basic_quorum, :bool, 5
151
- optional :notfound_ok, :bool, 6
152
- optional :if_modified, :bytes, 7
153
- optional :head, :bool, 8
154
- optional :deletedvclock, :bool, 9
155
- optional :timeout, :uint32, 10
156
- optional :sloppy_quorum, :bool, 11
157
- optional :n_val, :uint32, 12
158
- end
159
-
160
- class RpbGetResp
161
- include Beefcake::Message
162
- repeated :content, RpbContent, 1
163
- optional :vclock, :bytes, 2
164
- optional :unchanged, :bool, 3
165
- end
166
-
167
- class RpbPutReq
168
- include Beefcake::Message
169
- required :bucket, :bytes, 1
170
- optional :key, :bytes, 2
171
- optional :vclock, :bytes, 3
172
- required :content, RpbContent, 4
173
- optional :w, :uint32, 5
174
- optional :dw, :uint32, 6
175
- optional :returnbody, :bool, 7
176
- optional :pw, :uint32, 8
177
- optional :if_not_modified, :bool, 9
178
- optional :if_none_match, :bool, 10
179
- optional :return_head, :bool, 11
180
- optional :timeout, :uint32, 12
181
- optional :asis, :bool, 13
182
- optional :sloppy_quorum, :bool, 14
183
- optional :n_val, :uint32, 15
184
- end
185
-
186
- class RpbPutResp
187
- include Beefcake::Message
188
- repeated :content, RpbContent, 1
189
- optional :vclock, :bytes, 2
190
- optional :key, :bytes, 3
191
- end
192
-
193
- class RpbDelReq
194
- include Beefcake::Message
195
- required :bucket, :bytes, 1
196
- required :key, :bytes, 2
197
- optional :rw, :uint32, 3
198
- optional :vclock, :bytes, 4
199
- optional :r, :uint32, 5
200
- optional :w, :uint32, 6
201
- optional :pr, :uint32, 7
202
- optional :pw, :uint32, 8
203
- optional :dw, :uint32, 9
204
- optional :timeout, :uint32, 10
205
- optional :sloppy_quorum, :bool, 11
206
- optional :n_val, :uint32, 12
207
- end
208
-
209
- class RpbListBucketsReq
210
- include Beefcake::Message
211
- optional :timeout, :uint32, 1
212
- optional :stream, :bool, 2
213
- end
214
-
215
- class RpbListBucketsResp
216
- include Beefcake::Message
217
- repeated :buckets, :bytes, 1
218
- optional :done, :bool, 2
219
- end
220
-
221
- class RpbListKeysReq
222
- include Beefcake::Message
223
- required :bucket, :bytes, 1
224
- optional :timeout, :uint32, 2
225
- end
226
-
227
- class RpbListKeysResp
228
- include Beefcake::Message
229
- repeated :keys, :bytes, 1
230
- optional :done, :bool, 2
231
- end
232
-
233
- class RpbGetBucketReq
234
- include Beefcake::Message
235
- required :bucket, :bytes, 1
236
- end
237
-
238
- class RpbGetBucketResp
239
- include Beefcake::Message
240
- required :props, RpbBucketProps, 1
241
- end
242
-
243
- class RpbSetBucketReq
244
- include Beefcake::Message
245
- required :bucket, :bytes, 1
246
- required :props, RpbBucketProps, 2
247
- end
248
-
249
- class RpbMapRedReq
250
- include Beefcake::Message
251
- required :request, :bytes, 1
252
- required :content_type, :bytes, 2
253
- end
254
-
255
- class RpbMapRedResp
256
- include Beefcake::Message
257
- optional :phase, :uint32, 1
258
- optional :response, :bytes, 2
259
- optional :done, :bool, 3
260
- end
261
-
262
- class RpbIndexReq
263
- include Beefcake::Message
264
- module IndexQueryType
265
- EQ = 0
266
- RANGE = 1
267
- end
268
-
269
- required :bucket, :bytes, 1
270
- required :index, :bytes, 2
271
- required :qtype, IndexQueryType, 3
272
- optional :key, :bytes, 4
273
- optional :range_min, :bytes, 5
274
- optional :range_max, :bytes, 6
275
- optional :return_terms, :bool, 7
276
- optional :stream, :bool, 8
277
- optional :max_results, :uint32, 9
278
- optional :continuation, :bytes, 10
279
- optional :timeout, :uint32, 11
280
- end
281
-
282
- class RpbIndexResp
283
- include Beefcake::Message
284
- repeated :keys, :bytes, 1
285
- repeated :results, RpbPair, 2
286
- optional :continuation, :bytes, 3
287
- optional :done, :bool, 4
288
- end
289
-
290
- class RpbSearchDoc
291
- include Beefcake::Message
292
- # We have to name this differently than the .proto file does
293
- # because Beefcake uses 'fields' as an instance method.
294
- repeated :properties, RpbPair, 1
295
- end
296
-
297
- class RpbSearchQueryReq
298
- include Beefcake::Message
299
- required :q, :bytes, 1
300
- required :index, :bytes, 2
301
- optional :rows, :uint32, 3
302
- optional :start, :uint32, 4
303
- optional :sort, :bytes, 5
304
- optional :filter, :bytes, 6
305
- optional :df, :bytes, 7
306
- optional :op, :bytes, 8
307
- repeated :fl, :bytes, 9
308
- optional :presort, :bytes, 10
309
- end
310
-
311
- class RpbSearchQueryResp
312
- include Beefcake::Message
313
- repeated :docs, RpbSearchDoc, 1, :default => []
314
- optional :max_score, :float, 2
315
- optional :num_found, :uint32, 3
316
- end
317
-
318
- class RpbResetBucketReq
319
- include Beefcake::Message
320
- required :bucket, :bytes, 1
321
- end
322
-
323
- class RpbCSBucketReq
324
- include Beefcake::Message
325
- required :bucket, :bytes, 1
326
- required :start_key, :bytes, 2
327
- optional :end_key, :bytes, 3
328
- optional :start_incl, :bool, 4, default: true
329
- optional :end_incl, :bool, 5, default: false
330
- optional :continuation, :bytes, 6
331
- optional :max_results, :uint32, 7
332
- optional :timeout, :uint32, 8
333
- end
334
-
335
- class RpbIndexObject
336
- include Beefcake::Message
337
- required :key, :bytes, 1
338
- required :object, RpbGetResp, 2
339
- end
340
-
341
- class RpbCSBucketResp
342
- include Beefcake::Message
343
- repeated :objects, RpbIndexObject, 1
344
- optional :continuation, :bytes, 2
345
- optional :done, :bool, 3
346
- end
347
-
348
- class RpbCounterUpdateReq
349
- include Beefcake::Message
350
- required :bucket, :bytes, 1
351
- required :key, :bytes, 2
352
- required :amount, :sint64, 3
353
- optional :w, :uint32, 4
354
- optional :dw, :uint32, 5
355
- optional :pw, :uint32, 6
356
- optional :returnvalue, :bool, 7
357
- end
358
-
359
- class RpbCounterUpdateResp
360
- include Beefcake::Message
361
- optional :value, :sint64, 1
362
- end
363
-
364
- class RpbCounterGetReq
365
- include Beefcake::Message
366
- required :bucket, :bytes, 1
367
- required :key, :bytes, 2
368
- optional :r, :uint32, 3
369
- optional :pr, :uint32, 4
370
- optional :basic_quorum, :bool, 5
371
- optional :notfound_ok, :bool, 6
372
- end
373
-
374
- class RpbCounterGetResp
375
- include Beefcake::Message
376
- optional :value, :sint64, 1
377
- end
7
+ ## Generated from riak.proto for
8
+ require "beefcake"
9
+
10
+
11
+ class RpbErrorResp
12
+ include Beefcake::Message
13
+ end
14
+
15
+ class RpbGetServerInfoResp
16
+ include Beefcake::Message
17
+ end
18
+
19
+ class RpbPair
20
+ include Beefcake::Message
21
+ end
22
+
23
+ class RpbGetBucketReq
24
+ include Beefcake::Message
25
+ end
26
+
27
+ class RpbGetBucketResp
28
+ include Beefcake::Message
29
+ end
30
+
31
+ class RpbSetBucketReq
32
+ include Beefcake::Message
33
+ end
34
+
35
+ class RpbResetBucketReq
36
+ include Beefcake::Message
37
+ end
38
+
39
+ class RpbGetBucketTypeReq
40
+ include Beefcake::Message
41
+ end
42
+
43
+ class RpbSetBucketTypeReq
44
+ include Beefcake::Message
45
+ end
46
+
47
+ class RpbModFun
48
+ include Beefcake::Message
49
+ end
50
+
51
+ class RpbCommitHook
52
+ include Beefcake::Message
53
+ end
54
+
55
+ class RpbBucketProps
56
+ include Beefcake::Message
57
+
58
+ module RpbReplMode
59
+ FALSE = 0
60
+ REALTIME = 1
61
+ FULLSYNC = 2
62
+ TRUE = 3
63
+ end
64
+ end
65
+
66
+ class RpbAuthReq
67
+ include Beefcake::Message
68
+ end
69
+
70
+ class RpbErrorResp
71
+ required :errmsg, :bytes, 1
72
+ required :errcode, :uint32, 2
73
+ end
74
+
75
+ class RpbGetServerInfoResp
76
+ optional :node, :bytes, 1
77
+ optional :server_version, :bytes, 2
78
+ end
79
+
80
+ class RpbPair
81
+ required :key, :bytes, 1
82
+ optional :value, :bytes, 2
83
+ end
84
+
85
+ class RpbGetBucketReq
86
+ required :bucket, :bytes, 1
87
+ optional :type, :bytes, 2
88
+ end
89
+
90
+ class RpbGetBucketResp
91
+ required :props, RpbBucketProps, 1
92
+ end
93
+
94
+ class RpbSetBucketReq
95
+ required :bucket, :bytes, 1
96
+ required :props, RpbBucketProps, 2
97
+ optional :type, :bytes, 3
98
+ end
99
+
100
+ class RpbResetBucketReq
101
+ required :bucket, :bytes, 1
102
+ optional :type, :bytes, 2
103
+ end
104
+
105
+ class RpbGetBucketTypeReq
106
+ required :type, :bytes, 1
107
+ end
108
+
109
+ class RpbSetBucketTypeReq
110
+ required :type, :bytes, 1
111
+ required :props, RpbBucketProps, 2
112
+ end
113
+
114
+ class RpbModFun
115
+ required :module, :bytes, 1
116
+ required :function, :bytes, 2
117
+ end
118
+
119
+ class RpbCommitHook
120
+ optional :modfun, RpbModFun, 1
121
+ optional :name, :bytes, 2
122
+ end
123
+
124
+ class RpbBucketProps
125
+ optional :n_val, :uint32, 1
126
+ optional :allow_mult, :bool, 2
127
+ optional :last_write_wins, :bool, 3
128
+ repeated :precommit, RpbCommitHook, 4
129
+ optional :has_precommit, :bool, 5, :default => false
130
+ repeated :postcommit, RpbCommitHook, 6
131
+ optional :has_postcommit, :bool, 7, :default => false
132
+ optional :chash_keyfun, RpbModFun, 8
133
+ optional :linkfun, RpbModFun, 9
134
+ optional :old_vclock, :uint32, 10
135
+ optional :young_vclock, :uint32, 11
136
+ optional :big_vclock, :uint32, 12
137
+ optional :small_vclock, :uint32, 13
138
+ optional :pr, :uint32, 14
139
+ optional :r, :uint32, 15
140
+ optional :w, :uint32, 16
141
+ optional :pw, :uint32, 17
142
+ optional :dw, :uint32, 18
143
+ optional :rw, :uint32, 19
144
+ optional :basic_quorum, :bool, 20
145
+ optional :notfound_ok, :bool, 21
146
+ optional :backend, :bytes, 22
147
+ optional :search, :bool, 23
148
+ optional :repl, RpbBucketProps::RpbReplMode, 24
149
+ optional :search_index, :bytes, 25
150
+ optional :datatype, :bytes, 26
151
+ optional :consistent, :bool, 27
152
+ end
153
+
154
+ class RpbAuthReq
155
+ required :user, :bytes, 1
156
+ required :password, :bytes, 2
157
+ end
158
+ ## Generated from riak_kv.proto for
159
+ require "beefcake"
160
+
161
+
162
+ class RpbGetClientIdResp
163
+ include Beefcake::Message
164
+ end
165
+
166
+ class RpbSetClientIdReq
167
+ include Beefcake::Message
168
+ end
169
+
170
+ class RpbGetReq
171
+ include Beefcake::Message
172
+ end
173
+
174
+ class RpbGetResp
175
+ include Beefcake::Message
176
+ end
177
+
178
+ class RpbPutReq
179
+ include Beefcake::Message
180
+ end
181
+
182
+ class RpbPutResp
183
+ include Beefcake::Message
184
+ end
185
+
186
+ class RpbDelReq
187
+ include Beefcake::Message
188
+ end
189
+
190
+ class RpbListBucketsReq
191
+ include Beefcake::Message
192
+ end
193
+
194
+ class RpbListBucketsResp
195
+ include Beefcake::Message
196
+ end
197
+
198
+ class RpbListKeysReq
199
+ include Beefcake::Message
200
+ end
201
+
202
+ class RpbListKeysResp
203
+ include Beefcake::Message
204
+ end
205
+
206
+ class RpbMapRedReq
207
+ include Beefcake::Message
208
+ end
209
+
210
+ class RpbMapRedResp
211
+ include Beefcake::Message
212
+ end
213
+
214
+ class RpbIndexReq
215
+ include Beefcake::Message
216
+
217
+ module IndexQueryType
218
+ eq = 0
219
+ range = 1
220
+ end
221
+ end
222
+
223
+ class RpbIndexResp
224
+ include Beefcake::Message
225
+ end
226
+
227
+ class RpbCSBucketReq
228
+ include Beefcake::Message
229
+ end
230
+
231
+ class RpbCSBucketResp
232
+ include Beefcake::Message
233
+ end
234
+
235
+ class RpbIndexObject
236
+ include Beefcake::Message
237
+ end
238
+
239
+ class RpbContent
240
+ include Beefcake::Message
241
+ end
242
+
243
+ class RpbLink
244
+ include Beefcake::Message
245
+ end
246
+
247
+ class RpbCounterUpdateReq
248
+ include Beefcake::Message
249
+ end
250
+
251
+ class RpbCounterUpdateResp
252
+ include Beefcake::Message
253
+ end
254
+
255
+ class RpbCounterGetReq
256
+ include Beefcake::Message
257
+ end
258
+
259
+ class RpbCounterGetResp
260
+ include Beefcake::Message
261
+ end
262
+
263
+ class RpbGetClientIdResp
264
+ required :client_id, :bytes, 1
265
+ end
266
+
267
+ class RpbSetClientIdReq
268
+ required :client_id, :bytes, 1
269
+ end
270
+
271
+ class RpbGetReq
272
+ required :bucket, :bytes, 1
273
+ required :key, :bytes, 2
274
+ optional :r, :uint32, 3
275
+ optional :pr, :uint32, 4
276
+ optional :basic_quorum, :bool, 5
277
+ optional :notfound_ok, :bool, 6
278
+ optional :if_modified, :bytes, 7
279
+ optional :head, :bool, 8
280
+ optional :deletedvclock, :bool, 9
281
+ optional :timeout, :uint32, 10
282
+ optional :sloppy_quorum, :bool, 11
283
+ optional :n_val, :uint32, 12
284
+ optional :type, :bytes, 13
285
+ end
286
+
287
+ class RpbGetResp
288
+ repeated :content, RpbContent, 1
289
+ optional :vclock, :bytes, 2
290
+ optional :unchanged, :bool, 3
291
+ end
292
+
293
+ class RpbPutReq
294
+ required :bucket, :bytes, 1
295
+ optional :key, :bytes, 2
296
+ optional :vclock, :bytes, 3
297
+ required :content, RpbContent, 4
298
+ optional :w, :uint32, 5
299
+ optional :dw, :uint32, 6
300
+ optional :return_body, :bool, 7
301
+ optional :pw, :uint32, 8
302
+ optional :if_not_modified, :bool, 9
303
+ optional :if_none_match, :bool, 10
304
+ optional :return_head, :bool, 11
305
+ optional :timeout, :uint32, 12
306
+ optional :asis, :bool, 13
307
+ optional :sloppy_quorum, :bool, 14
308
+ optional :n_val, :uint32, 15
309
+ optional :type, :bytes, 16
310
+ end
311
+
312
+ class RpbPutResp
313
+ repeated :content, RpbContent, 1
314
+ optional :vclock, :bytes, 2
315
+ optional :key, :bytes, 3
316
+ end
317
+
318
+ class RpbDelReq
319
+ required :bucket, :bytes, 1
320
+ required :key, :bytes, 2
321
+ optional :rw, :uint32, 3
322
+ optional :vclock, :bytes, 4
323
+ optional :r, :uint32, 5
324
+ optional :w, :uint32, 6
325
+ optional :pr, :uint32, 7
326
+ optional :pw, :uint32, 8
327
+ optional :dw, :uint32, 9
328
+ optional :timeout, :uint32, 10
329
+ optional :sloppy_quorum, :bool, 11
330
+ optional :n_val, :uint32, 12
331
+ optional :type, :bytes, 13
332
+ end
333
+
334
+ class RpbListBucketsReq
335
+ optional :timeout, :uint32, 1
336
+ optional :stream, :bool, 2
337
+ optional :type, :bytes, 3
338
+ end
339
+
340
+ class RpbListBucketsResp
341
+ repeated :buckets, :bytes, 1
342
+ optional :done, :bool, 2
343
+ end
344
+
345
+ class RpbListKeysReq
346
+ required :bucket, :bytes, 1
347
+ optional :timeout, :uint32, 2
348
+ optional :type, :bytes, 3
349
+ end
350
+
351
+ class RpbListKeysResp
352
+ repeated :keys, :bytes, 1
353
+ optional :done, :bool, 2
354
+ end
355
+
356
+ class RpbMapRedReq
357
+ required :request, :bytes, 1
358
+ required :content_type, :bytes, 2
359
+ end
360
+
361
+ class RpbMapRedResp
362
+ optional :phase, :uint32, 1
363
+ optional :response, :bytes, 2
364
+ optional :done, :bool, 3
365
+ end
366
+
367
+ class RpbIndexReq
368
+ required :bucket, :bytes, 1
369
+ required :index, :bytes, 2
370
+ required :qtype, RpbIndexReq::IndexQueryType, 3
371
+ optional :key, :bytes, 4
372
+ optional :range_min, :bytes, 5
373
+ optional :range_max, :bytes, 6
374
+ optional :return_terms, :bool, 7
375
+ optional :stream, :bool, 8
376
+ optional :max_results, :uint32, 9
377
+ optional :continuation, :bytes, 10
378
+ optional :timeout, :uint32, 11
379
+ optional :type, :bytes, 12
380
+ optional :term_regex, :bytes, 13
381
+ optional :pagination_sort, :bool, 14
382
+ end
383
+
384
+ class RpbIndexResp
385
+ repeated :keys, :bytes, 1
386
+ repeated :results, RpbPair, 2
387
+ optional :continuation, :bytes, 3
388
+ optional :done, :bool, 4
389
+ end
390
+
391
+ class RpbCSBucketReq
392
+ required :bucket, :bytes, 1
393
+ required :start_key, :bytes, 2
394
+ optional :end_key, :bytes, 3
395
+ optional :start_incl, :bool, 4, :default => true
396
+ optional :end_incl, :bool, 5, :default => false
397
+ optional :continuation, :bytes, 6
398
+ optional :max_results, :uint32, 7
399
+ optional :timeout, :uint32, 8
400
+ optional :type, :bytes, 9
401
+ end
402
+
403
+ class RpbCSBucketResp
404
+ repeated :objects, RpbIndexObject, 1
405
+ optional :continuation, :bytes, 2
406
+ optional :done, :bool, 3
407
+ end
408
+
409
+ class RpbIndexObject
410
+ required :key, :bytes, 1
411
+ required :object, RpbGetResp, 2
412
+ end
413
+
414
+ class RpbContent
415
+ required :value, :bytes, 1
416
+ optional :content_type, :bytes, 2
417
+ optional :charset, :bytes, 3
418
+ optional :content_encoding, :bytes, 4
419
+ optional :vtag, :bytes, 5
420
+ repeated :links, RpbLink, 6
421
+ optional :last_mod, :uint32, 7
422
+ optional :last_mod_usecs, :uint32, 8
423
+ repeated :usermeta, RpbPair, 9
424
+ repeated :indexes, RpbPair, 10
425
+ optional :deleted, :bool, 11
426
+ end
427
+
428
+ class RpbLink
429
+ optional :bucket, :bytes, 1
430
+ optional :key, :bytes, 2
431
+ optional :tag, :bytes, 3
432
+ end
433
+
434
+ class RpbCounterUpdateReq
435
+ required :bucket, :bytes, 1
436
+ required :key, :bytes, 2
437
+ required :amount, :sint64, 3
438
+ optional :w, :uint32, 4
439
+ optional :dw, :uint32, 5
440
+ optional :pw, :uint32, 6
441
+ optional :returnvalue, :bool, 7
442
+ end
443
+
444
+ class RpbCounterUpdateResp
445
+ optional :value, :sint64, 1
446
+ end
447
+
448
+ class RpbCounterGetReq
449
+ required :bucket, :bytes, 1
450
+ required :key, :bytes, 2
451
+ optional :r, :uint32, 3
452
+ optional :pr, :uint32, 4
453
+ optional :basic_quorum, :bool, 5
454
+ optional :notfound_ok, :bool, 6
455
+ end
456
+
457
+ class RpbCounterGetResp
458
+ optional :value, :sint64, 1
459
+ end
460
+ ## Generated from riak_search.proto for
461
+ require "beefcake"
462
+
463
+
464
+ class RpbSearchDoc
465
+ include Beefcake::Message
466
+ end
467
+
468
+ class RpbSearchQueryReq
469
+ include Beefcake::Message
470
+ end
471
+
472
+ class RpbSearchQueryResp
473
+ include Beefcake::Message
474
+ end
475
+
476
+ class RpbSearchDoc
477
+ repeated :fields, RpbPair, 1
478
+ end
479
+
480
+ class RpbSearchQueryReq
481
+ required :q, :bytes, 1
482
+ required :index, :bytes, 2
483
+ optional :rows, :uint32, 3
484
+ optional :start, :uint32, 4
485
+ optional :sort, :bytes, 5
486
+ optional :filter, :bytes, 6
487
+ optional :df, :bytes, 7
488
+ optional :op, :bytes, 8
489
+ repeated :fl, :bytes, 9
490
+ optional :presort, :bytes, 10
491
+ end
492
+
493
+ class RpbSearchQueryResp
494
+ repeated :docs, RpbSearchDoc, 1
495
+ optional :max_score, :float, 2
496
+ optional :num_found, :uint32, 3
497
+ end
498
+ ## Generated from riak_yokozuna.proto for
499
+ require "beefcake"
500
+
501
+
502
+ class RpbYokozunaIndex
503
+ include Beefcake::Message
504
+ end
505
+
506
+ class RpbYokozunaIndexGetReq
507
+ include Beefcake::Message
508
+ end
509
+
510
+ class RpbYokozunaIndexGetResp
511
+ include Beefcake::Message
512
+ end
513
+
514
+ class RpbYokozunaIndexPutReq
515
+ include Beefcake::Message
516
+ end
517
+
518
+ class RpbYokozunaIndexDeleteReq
519
+ include Beefcake::Message
520
+ end
521
+
522
+ class RpbYokozunaSchema
523
+ include Beefcake::Message
524
+ end
525
+
526
+ class RpbYokozunaSchemaPutReq
527
+ include Beefcake::Message
528
+ end
529
+
530
+ class RpbYokozunaSchemaGetReq
531
+ include Beefcake::Message
532
+ end
533
+
534
+ class RpbYokozunaSchemaGetResp
535
+ include Beefcake::Message
536
+ end
537
+
538
+ class RpbYokozunaIndex
539
+ required :name, :bytes, 1
540
+ optional :schema, :bytes, 2
541
+ optional :n_val, :uint32, 3
542
+ end
543
+
544
+ class RpbYokozunaIndexGetReq
545
+ optional :name, :bytes, 1
546
+ end
547
+
548
+ class RpbYokozunaIndexGetResp
549
+ repeated :index, RpbYokozunaIndex, 1
550
+ end
551
+
552
+ class RpbYokozunaIndexPutReq
553
+ required :index, RpbYokozunaIndex, 1
554
+ end
555
+
556
+ class RpbYokozunaIndexDeleteReq
557
+ required :name, :bytes, 1
558
+ end
559
+
560
+ class RpbYokozunaSchema
561
+ required :name, :bytes, 1
562
+ optional :content, :bytes, 2
563
+ end
564
+
565
+ class RpbYokozunaSchemaPutReq
566
+ required :schema, RpbYokozunaSchema, 1
567
+ end
568
+
569
+ class RpbYokozunaSchemaGetReq
570
+ required :name, :bytes, 1
571
+ end
572
+
573
+ class RpbYokozunaSchemaGetResp
574
+ required :schema, RpbYokozunaSchema, 1
575
+ end
576
+ ## Generated from riak_dt.proto for
577
+ require "beefcake"
578
+
579
+
580
+ class MapField
581
+ include Beefcake::Message
582
+
583
+ module MapFieldType
584
+ COUNTER = 1
585
+ SET = 2
586
+ REGISTER = 3
587
+ FLAG = 4
588
+ MAP = 5
589
+ end
590
+ end
591
+
592
+ class MapEntry
593
+ include Beefcake::Message
594
+ end
595
+
596
+ class DtFetchReq
597
+ include Beefcake::Message
598
+ end
599
+
600
+ class DtValue
601
+ include Beefcake::Message
602
+ end
603
+
604
+ class DtFetchResp
605
+ include Beefcake::Message
606
+
607
+ module DataType
608
+ COUNTER = 1
609
+ SET = 2
610
+ MAP = 3
611
+ end
612
+ end
613
+
614
+ class CounterOp
615
+ include Beefcake::Message
616
+ end
617
+
618
+ class SetOp
619
+ include Beefcake::Message
620
+ end
621
+
622
+ class MapUpdate
623
+ include Beefcake::Message
624
+
625
+ module FlagOp
626
+ ENABLE = 1
627
+ DISABLE = 2
628
+ end
629
+ end
630
+
631
+ class MapOp
632
+ include Beefcake::Message
633
+ end
634
+
635
+ class DtOp
636
+ include Beefcake::Message
637
+ end
638
+
639
+ class DtUpdateReq
640
+ include Beefcake::Message
641
+ end
642
+
643
+ class DtUpdateResp
644
+ include Beefcake::Message
645
+ end
646
+
647
+ class MapField
648
+ required :name, :bytes, 1
649
+ required :type, MapField::MapFieldType, 2
650
+ end
651
+
652
+ class MapEntry
653
+ required :field, MapField, 1
654
+ optional :counter_value, :sint64, 2
655
+ repeated :set_value, :bytes, 3
656
+ optional :register_value, :bytes, 4
657
+ optional :flag_value, :bool, 5
658
+ repeated :map_value, MapEntry, 6
659
+ end
660
+
661
+ class DtFetchReq
662
+ required :bucket, :bytes, 1
663
+ required :key, :bytes, 2
664
+ required :type, :bytes, 3
665
+ optional :r, :uint32, 4
666
+ optional :pr, :uint32, 5
667
+ optional :basic_quorum, :bool, 6
668
+ optional :notfound_ok, :bool, 7
669
+ optional :timeout, :uint32, 8
670
+ optional :sloppy_quorum, :bool, 9
671
+ optional :n_val, :uint32, 10
672
+ optional :include_context, :bool, 11, :default => true
673
+ end
674
+
675
+ class DtValue
676
+ optional :counter_value, :sint64, 1
677
+ repeated :set_value, :bytes, 2
678
+ repeated :map_value, MapEntry, 3
679
+ end
680
+
681
+ class DtFetchResp
682
+ optional :context, :bytes, 1
683
+ required :type, DtFetchResp::DataType, 2
684
+ optional :value, DtValue, 3
685
+ end
686
+
687
+ class CounterOp
688
+ optional :increment, :sint64, 1
689
+ end
690
+
691
+ class SetOp
692
+ repeated :adds, :bytes, 1
693
+ repeated :removes, :bytes, 2
694
+ end
695
+
696
+ class MapUpdate
697
+ required :field, MapField, 1
698
+ optional :counter_op, CounterOp, 2
699
+ optional :set_op, SetOp, 3
700
+ optional :register_op, :bytes, 4
701
+ optional :flag_op, MapUpdate::FlagOp, 5
702
+ optional :map_op, MapOp, 6
703
+ end
704
+
705
+ class MapOp
706
+ repeated :removes, MapField, 1
707
+ repeated :updates, MapUpdate, 2
708
+ end
709
+
710
+ class DtOp
711
+ optional :counter_op, CounterOp, 1
712
+ optional :set_op, SetOp, 2
713
+ optional :map_op, MapOp, 3
714
+ end
715
+
716
+ class DtUpdateReq
717
+ required :bucket, :bytes, 1
718
+ optional :key, :bytes, 2
719
+ required :type, :bytes, 3
720
+ optional :context, :bytes, 4
721
+ required :op, DtOp, 5
722
+ optional :w, :uint32, 6
723
+ optional :dw, :uint32, 7
724
+ optional :pw, :uint32, 8
725
+ optional :return_body, :bool, 9, :default => false
726
+ optional :timeout, :uint32, 10
727
+ optional :sloppy_quorum, :bool, 11
728
+ optional :n_val, :uint32, 12
729
+ optional :include_context, :bool, 13, :default => true
730
+ end
731
+
732
+ class DtUpdateResp
733
+ optional :key, :bytes, 1
734
+ optional :context, :bytes, 2
735
+ optional :counter_value, :sint64, 3
736
+ repeated :set_value, :bytes, 4
737
+ repeated :map_value, MapEntry, 5
738
+ end
739
+
378
740
  end
379
741
  end
380
742
  end