riak-client-noenc 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +7 -0
  2. data/.document +5 -0
  3. data/.gitignore +42 -0
  4. data/.rspec +1 -0
  5. data/Gemfile +17 -0
  6. data/Guardfile +20 -0
  7. data/LICENSE.md +16 -0
  8. data/README.markdown +640 -0
  9. data/RELEASE_NOTES.md +392 -0
  10. data/Rakefile +119 -0
  11. data/lib/riak.rb +22 -0
  12. data/lib/riak/bucket.rb +297 -0
  13. data/lib/riak/bucket_properties.rb +74 -0
  14. data/lib/riak/bucket_type.rb +77 -0
  15. data/lib/riak/bucket_typed/bucket.rb +121 -0
  16. data/lib/riak/client.rb +433 -0
  17. data/lib/riak/client/beefcake/bucket_properties_operator.rb +178 -0
  18. data/lib/riak/client/beefcake/crdt/counter_loader.rb +18 -0
  19. data/lib/riak/client/beefcake/crdt/map_loader.rb +64 -0
  20. data/lib/riak/client/beefcake/crdt/set_loader.rb +18 -0
  21. data/lib/riak/client/beefcake/crdt_loader.rb +84 -0
  22. data/lib/riak/client/beefcake/crdt_operator.rb +223 -0
  23. data/lib/riak/client/beefcake/footer +4 -0
  24. data/lib/riak/client/beefcake/header +6 -0
  25. data/lib/riak/client/beefcake/message_codes.rb +89 -0
  26. data/lib/riak/client/beefcake/message_overlay.rb +87 -0
  27. data/lib/riak/client/beefcake/messages.rb +772 -0
  28. data/lib/riak/client/beefcake/object_methods.rb +112 -0
  29. data/lib/riak/client/beefcake/protocol.rb +105 -0
  30. data/lib/riak/client/beefcake/socket.rb +260 -0
  31. data/lib/riak/client/beefcake_protobuffs_backend.rb +538 -0
  32. data/lib/riak/client/decaying.rb +36 -0
  33. data/lib/riak/client/feature_detection.rb +120 -0
  34. data/lib/riak/client/instrumentation.rb +19 -0
  35. data/lib/riak/client/node.rb +49 -0
  36. data/lib/riak/client/protobuffs_backend.rb +143 -0
  37. data/lib/riak/client/search.rb +27 -0
  38. data/lib/riak/client/yokozuna.rb +52 -0
  39. data/lib/riak/conflict.rb +13 -0
  40. data/lib/riak/core_ext.rb +7 -0
  41. data/lib/riak/core_ext/blank.rb +53 -0
  42. data/lib/riak/core_ext/deep_dup.rb +13 -0
  43. data/lib/riak/core_ext/extract_options.rb +7 -0
  44. data/lib/riak/core_ext/json.rb +15 -0
  45. data/lib/riak/core_ext/slice.rb +18 -0
  46. data/lib/riak/core_ext/stringify_keys.rb +10 -0
  47. data/lib/riak/core_ext/symbolize_keys.rb +10 -0
  48. data/lib/riak/core_ext/to_param.rb +31 -0
  49. data/lib/riak/counter.rb +101 -0
  50. data/lib/riak/crdt.rb +21 -0
  51. data/lib/riak/crdt/base.rb +183 -0
  52. data/lib/riak/crdt/batch_counter.rb +19 -0
  53. data/lib/riak/crdt/batch_map.rb +41 -0
  54. data/lib/riak/crdt/counter.rb +82 -0
  55. data/lib/riak/crdt/inner_counter.rb +81 -0
  56. data/lib/riak/crdt/inner_flag.rb +42 -0
  57. data/lib/riak/crdt/inner_map.rb +75 -0
  58. data/lib/riak/crdt/inner_register.rb +26 -0
  59. data/lib/riak/crdt/inner_set.rb +102 -0
  60. data/lib/riak/crdt/map.rb +121 -0
  61. data/lib/riak/crdt/operation.rb +19 -0
  62. data/lib/riak/crdt/set.rb +166 -0
  63. data/lib/riak/crdt/typed_collection.rb +181 -0
  64. data/lib/riak/encoding.rb +6 -0
  65. data/lib/riak/errors/backend_creation.rb +9 -0
  66. data/lib/riak/errors/base.rb +9 -0
  67. data/lib/riak/errors/connection_error.rb +50 -0
  68. data/lib/riak/errors/crdt_error.rb +38 -0
  69. data/lib/riak/errors/failed_request.rb +58 -0
  70. data/lib/riak/errors/protobuffs_error.rb +11 -0
  71. data/lib/riak/errors/search_error.rb +35 -0
  72. data/lib/riak/i18n.rb +7 -0
  73. data/lib/riak/index_collection.rb +71 -0
  74. data/lib/riak/instrumentation.rb +6 -0
  75. data/lib/riak/json.rb +52 -0
  76. data/lib/riak/link.rb +96 -0
  77. data/lib/riak/list_buckets.rb +28 -0
  78. data/lib/riak/locale/en.yml +107 -0
  79. data/lib/riak/locale/fr.yml +51 -0
  80. data/lib/riak/map_reduce.rb +295 -0
  81. data/lib/riak/map_reduce/filter_builder.rb +103 -0
  82. data/lib/riak/map_reduce/phase.rb +98 -0
  83. data/lib/riak/map_reduce/results.rb +49 -0
  84. data/lib/riak/map_reduce_error.rb +7 -0
  85. data/lib/riak/multiget.rb +122 -0
  86. data/lib/riak/preflist_item.rb +7 -0
  87. data/lib/riak/rcontent.rb +173 -0
  88. data/lib/riak/robject.rb +222 -0
  89. data/lib/riak/search.rb +11 -0
  90. data/lib/riak/search/index.rb +87 -0
  91. data/lib/riak/search/query.rb +141 -0
  92. data/lib/riak/search/result_collection.rb +144 -0
  93. data/lib/riak/search/result_document.rb +129 -0
  94. data/lib/riak/search/schema.rb +65 -0
  95. data/lib/riak/secondary_index.rb +81 -0
  96. data/lib/riak/serializers.rb +73 -0
  97. data/lib/riak/stamp.rb +77 -0
  98. data/lib/riak/util/escape.rb +80 -0
  99. data/lib/riak/util/tcp_socket_extensions.rb +58 -0
  100. data/lib/riak/util/translation.rb +18 -0
  101. data/lib/riak/version.rb +3 -0
  102. data/lib/riak/walk_spec.rb +145 -0
  103. data/spec/failover/failover.rb +59 -0
  104. data/spec/fixtures/bitcask.txt +25 -0
  105. data/spec/fixtures/cat.jpg +0 -0
  106. data/spec/fixtures/multipart-basic-conflict.txt +15 -0
  107. data/spec/fixtures/multipart-blank.txt +7 -0
  108. data/spec/fixtures/multipart-mapreduce.txt +10 -0
  109. data/spec/fixtures/multipart-with-body.txt +16 -0
  110. data/spec/fixtures/multipart-with-marked-tombstones.txt +17 -0
  111. data/spec/fixtures/multipart-with-unmarked-tombstone.txt +16 -0
  112. data/spec/fixtures/server.cert.crt +15 -0
  113. data/spec/fixtures/server.cert.key +15 -0
  114. data/spec/fixtures/test.pem +1 -0
  115. data/spec/fixtures/yz_schema_template.xml +18 -0
  116. data/spec/integration/riak/bucket_types_spec.rb +270 -0
  117. data/spec/integration/riak/conflict_resolution_spec.rb +96 -0
  118. data/spec/integration/riak/counters_spec.rb +36 -0
  119. data/spec/integration/riak/crdt/configuration_spec.rb +37 -0
  120. data/spec/integration/riak/crdt_search_spec.rb +176 -0
  121. data/spec/integration/riak/crdt_spec.rb +250 -0
  122. data/spec/integration/riak/crdt_validation/map_spec.rb +63 -0
  123. data/spec/integration/riak/crdt_validation/set_spec.rb +122 -0
  124. data/spec/integration/riak/preflist_spec.rb +31 -0
  125. data/spec/integration/riak/properties_spec.rb +69 -0
  126. data/spec/integration/riak/protobuffs/interrupted_request_spec.rb +33 -0
  127. data/spec/integration/riak/protobuffs_backends_spec.rb +40 -0
  128. data/spec/integration/riak/search_spec.rb +104 -0
  129. data/spec/integration/riak/secondary_index_spec.rb +72 -0
  130. data/spec/integration/riak/security_spec.rb +100 -0
  131. data/spec/integration/riak/threading_spec.rb +150 -0
  132. data/spec/integration/yokozuna/index_spec.rb +61 -0
  133. data/spec/integration/yokozuna/queries_spec.rb +115 -0
  134. data/spec/integration/yokozuna/schema_spec.rb +49 -0
  135. data/spec/riak/beefcake_protobuffs_backend/bucket_properties_operator_spec.rb +247 -0
  136. data/spec/riak/beefcake_protobuffs_backend/crdt_operator_spec.rb +222 -0
  137. data/spec/riak/beefcake_protobuffs_backend/object_methods_spec.rb +23 -0
  138. data/spec/riak/beefcake_protobuffs_backend/protocol_spec.rb +189 -0
  139. data/spec/riak/beefcake_protobuffs_backend_spec.rb +162 -0
  140. data/spec/riak/bucket_properties_spec.rb +135 -0
  141. data/spec/riak/bucket_spec.rb +275 -0
  142. data/spec/riak/bucket_type_spec.rb +50 -0
  143. data/spec/riak/bucket_typed/bucket_spec.rb +62 -0
  144. data/spec/riak/client_spec.rb +246 -0
  145. data/spec/riak/core_ext/to_param_spec.rb +15 -0
  146. data/spec/riak/counter_spec.rb +122 -0
  147. data/spec/riak/crdt/counter_spec.rb +55 -0
  148. data/spec/riak/crdt/inner_counter_spec.rb +21 -0
  149. data/spec/riak/crdt/inner_flag_spec.rb +39 -0
  150. data/spec/riak/crdt/inner_map_spec.rb +47 -0
  151. data/spec/riak/crdt/inner_register_spec.rb +40 -0
  152. data/spec/riak/crdt/inner_set_spec.rb +33 -0
  153. data/spec/riak/crdt/map_spec.rb +78 -0
  154. data/spec/riak/crdt/set_spec.rb +61 -0
  155. data/spec/riak/crdt/shared_examples.rb +74 -0
  156. data/spec/riak/crdt/typed_collection_spec.rb +225 -0
  157. data/spec/riak/escape_spec.rb +72 -0
  158. data/spec/riak/feature_detection_spec.rb +77 -0
  159. data/spec/riak/index_collection_spec.rb +53 -0
  160. data/spec/riak/instrumentation_spec.rb +124 -0
  161. data/spec/riak/link_spec.rb +85 -0
  162. data/spec/riak/list_buckets_spec.rb +41 -0
  163. data/spec/riak/map_reduce/filter_builder_spec.rb +32 -0
  164. data/spec/riak/map_reduce/phase_spec.rb +142 -0
  165. data/spec/riak/map_reduce_spec.rb +434 -0
  166. data/spec/riak/multiget_spec.rb +81 -0
  167. data/spec/riak/node_spec.rb +26 -0
  168. data/spec/riak/robject_spec.rb +496 -0
  169. data/spec/riak/search/index_spec.rb +72 -0
  170. data/spec/riak/search/query_spec.rb +88 -0
  171. data/spec/riak/search/result_collection_spec.rb +89 -0
  172. data/spec/riak/search/result_document_spec.rb +106 -0
  173. data/spec/riak/search/schema_spec.rb +63 -0
  174. data/spec/riak/search_spec.rb +107 -0
  175. data/spec/riak/secondary_index_spec.rb +225 -0
  176. data/spec/riak/serializers_spec.rb +121 -0
  177. data/spec/riak/stamp_spec.rb +54 -0
  178. data/spec/riak/walk_spec_spec.rb +203 -0
  179. data/spec/spec_helper.rb +66 -0
  180. data/spec/support/certs/README.md +13 -0
  181. data/spec/support/certs/ca.crt +21 -0
  182. data/spec/support/certs/client.crl +13 -0
  183. data/spec/support/certs/client.crt +94 -0
  184. data/spec/support/certs/client.csr +18 -0
  185. data/spec/support/certs/client.key +27 -0
  186. data/spec/support/certs/empty_ca.crt +21 -0
  187. data/spec/support/certs/server.crl +13 -0
  188. data/spec/support/certs/server.crt +94 -0
  189. data/spec/support/certs/server.key +27 -0
  190. data/spec/support/crdt_search_config.rb +112 -0
  191. data/spec/support/crdt_search_fixtures.rb +42 -0
  192. data/spec/support/integration_setup.rb +10 -0
  193. data/spec/support/search_config.rb +83 -0
  194. data/spec/support/search_corpus_setup.rb +39 -0
  195. data/spec/support/test_client.rb +46 -0
  196. data/spec/support/test_client.yml.example +10 -0
  197. data/spec/support/unified_backend_examples.rb +380 -0
  198. data/spec/support/version_filter.rb +12 -0
  199. data/spec/support/wait_until.rb +20 -0
  200. metadata +511 -0
@@ -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
@@ -0,0 +1,89 @@
1
+ module Riak
2
+ class Client
3
+ module BeefcakeMessageCodes
4
+ MESSAGE_TO_CODE = {
5
+ :ErrorResp => 0,
6
+ :PingReq => 1,
7
+ :PingResp => 2,
8
+ :GetClientIdReq => 3,
9
+ :GetClientIdResp => 4,
10
+ :SetClientIdReq => 5,
11
+ :SetClientIdResp => 6,
12
+ :GetServerInfoReq => 7,
13
+ :GetServerInfoResp => 8,
14
+ :GetReq => 9,
15
+ :GetResp => 10,
16
+ :PutReq => 11,
17
+ :PutResp => 12,
18
+ :DelReq => 13,
19
+ :DelResp => 14,
20
+ :ListBucketsReq => 15,
21
+ :ListBucketsResp => 16,
22
+ :ListKeysReq => 17,
23
+ :ListKeysResp => 18,
24
+ :GetBucketReq => 19,
25
+ :GetBucketResp => 20,
26
+ :SetBucketReq => 21,
27
+ :SetBucketResp => 22,
28
+ :MapRedReq => 23,
29
+ :MapRedResp => 24,
30
+ :IndexReq => 25,
31
+ :IndexResp => 26,
32
+ :SearchQueryReq => 27,
33
+ :SearchQueryResp => 28,
34
+ :ResetBucketReq => 29,
35
+ :ResetBucketResp => 30,
36
+
37
+ # bucket types
38
+ :GetBucketTypeReq => 31,
39
+ :SetBucketTypeReq => 32,
40
+ :ResetBucketTypeReq => 33,
41
+
42
+ # preflist
43
+ :GetBucketKeyPreflistReq => 33,
44
+ :GetBucketKeyPreflistResp => 34,
45
+
46
+ # riak cs
47
+ :CSBucketReq => 40,
48
+ :CSBucketResp => 41,
49
+
50
+ # 1.4 counters
51
+ :CounterUpdateReq => 50,
52
+ :CounterUpdateResp => 51,
53
+ :CounterGetReq => 52,
54
+ :CounterGetResp => 53,
55
+
56
+ # yokozuna
57
+ :YokozunaIndexGetReq => 54,
58
+ :YokozunaIndexGetResp => 55,
59
+ :YokozunaIndexPutReq => 56,
60
+ :YokozunaIndexDeleteReq => 57,
61
+ :YokozunaSchemaGetReq => 58,
62
+ :YokozunaSchemaGetResp => 59,
63
+ :YokozunaSchemaPutReq => 60,
64
+
65
+ # riak 2 CRDT
66
+ :DtFetchReq => 80,
67
+ :DtFetchResp => 81,
68
+ :DtUpdateReq => 82,
69
+ :DtUpdateResp => 83,
70
+
71
+ # internal
72
+ :AuthReq => 253,
73
+ :AuthResp => 254,
74
+ :StartTls => 255
75
+ }
76
+
77
+ CODE_TO_MESSAGE = MESSAGE_TO_CODE.invert
78
+
79
+ # ugly shims
80
+ def self.index(message_name)
81
+ MESSAGE_TO_CODE[message_name]
82
+ end
83
+
84
+ def self.[](message_code)
85
+ CODE_TO_MESSAGE[message_code]
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,87 @@
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 RpbBucketKeyPreflistItem
13
+ include Riak::PreflistItem
14
+ end
15
+
16
+ class RpbBucketProps
17
+
18
+ # "repeated" elements with zero items are indistinguishable
19
+ # from a nil, so we have to manage has_precommit/has_postcommit
20
+ # flags.
21
+ def precommit=(newval)
22
+ newval = clean_hook newval
23
+ @precommit = newval
24
+ @has_precommit = !!newval
25
+ end
26
+
27
+ def has_precommit=(newval)
28
+ @has_precommit = newval
29
+ @precommit ||= [] if newval
30
+ end
31
+
32
+ def postcommit=(newval)
33
+ newval = clean_hook newval
34
+ @postcommit = newval
35
+ @has_postcommit = !!newval
36
+ end
37
+
38
+ def has_postcommit=(newval)
39
+ @has_postcommit = newval
40
+ @postcommit ||= [] if newval
41
+ end
42
+
43
+ def chash_keyfun=(newval)
44
+ @chash_keyfun = clean_modfun newval
45
+ end
46
+
47
+ def linkfun=(newval)
48
+ @linkfun = clean_modfun newval
49
+ end
50
+
51
+ private
52
+
53
+ def clean_hook(newval)
54
+ if newval.is_a? Array
55
+ return newval.map{|v| clean_hook v}
56
+ end
57
+
58
+ newval = newval.symbolize_keys if newval.is_a? Hash
59
+ if newval.is_a?(Hash) && newval[:module] && newval[:function]
60
+ modfun = RpbModFun.new newval
61
+ hook = RpbCommitHook.new modfun: modfun
62
+ newval = hook
63
+ elsif newval.is_a?(Hash) && newval[:name]
64
+ hook = RpbCommitHook.new newval
65
+ newval = hook
66
+ elsif newval.is_a? String
67
+ hook = RpbCommitHook.new name: newval
68
+ newval = hook
69
+ end
70
+
71
+ return newval
72
+ end
73
+
74
+ def clean_modfun(newval)
75
+ return newval unless newval.is_a? Hash
76
+
77
+ newval = newval.symbolize_keys
78
+ if newval[:mod] && newval[:fun]
79
+ modfun = RpbModFun.new :'module' => newval[:mod], function: newval[:fun]
80
+ end
81
+
82
+ return modfun
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,772 @@
1
+ require 'beefcake'
2
+
3
+ module Riak
4
+ class Client
5
+ # @private
6
+ class BeefcakeProtobuffsBackend
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
+ optional :write_once, :bool, 28
153
+ end
154
+
155
+ class RpbAuthReq
156
+ required :user, :bytes, 1
157
+ required :password, :bytes, 2
158
+ end
159
+ ## Generated from riak_kv.proto for
160
+ require "beefcake"
161
+
162
+
163
+ class RpbGetClientIdResp
164
+ include Beefcake::Message
165
+ end
166
+
167
+ class RpbSetClientIdReq
168
+ include Beefcake::Message
169
+ end
170
+
171
+ class RpbGetReq
172
+ include Beefcake::Message
173
+ end
174
+
175
+ class RpbGetResp
176
+ include Beefcake::Message
177
+ end
178
+
179
+ class RpbPutReq
180
+ include Beefcake::Message
181
+ end
182
+
183
+ class RpbPutResp
184
+ include Beefcake::Message
185
+ end
186
+
187
+ class RpbDelReq
188
+ include Beefcake::Message
189
+ end
190
+
191
+ class RpbListBucketsReq
192
+ include Beefcake::Message
193
+ end
194
+
195
+ class RpbListBucketsResp
196
+ include Beefcake::Message
197
+ end
198
+
199
+ class RpbListKeysReq
200
+ include Beefcake::Message
201
+ end
202
+
203
+ class RpbListKeysResp
204
+ include Beefcake::Message
205
+ end
206
+
207
+ class RpbMapRedReq
208
+ include Beefcake::Message
209
+ end
210
+
211
+ class RpbMapRedResp
212
+ include Beefcake::Message
213
+ end
214
+
215
+ class RpbIndexReq
216
+ include Beefcake::Message
217
+
218
+ module IndexQueryType
219
+ eq = 0
220
+ range = 1
221
+ end
222
+ end
223
+
224
+ class RpbIndexResp
225
+ include Beefcake::Message
226
+ end
227
+
228
+ class RpbCSBucketReq
229
+ include Beefcake::Message
230
+ end
231
+
232
+ class RpbCSBucketResp
233
+ include Beefcake::Message
234
+ end
235
+
236
+ class RpbIndexObject
237
+ include Beefcake::Message
238
+ end
239
+
240
+ class RpbContent
241
+ include Beefcake::Message
242
+ end
243
+
244
+ class RpbLink
245
+ include Beefcake::Message
246
+ end
247
+
248
+ class RpbCounterUpdateReq
249
+ include Beefcake::Message
250
+ end
251
+
252
+ class RpbCounterUpdateResp
253
+ include Beefcake::Message
254
+ end
255
+
256
+ class RpbCounterGetReq
257
+ include Beefcake::Message
258
+ end
259
+
260
+ class RpbCounterGetResp
261
+ include Beefcake::Message
262
+ end
263
+
264
+ class RpbGetBucketKeyPreflistReq
265
+ include Beefcake::Message
266
+ end
267
+
268
+ class RpbGetBucketKeyPreflistResp
269
+ include Beefcake::Message
270
+ end
271
+
272
+ class RpbBucketKeyPreflistItem
273
+ include Beefcake::Message
274
+ end
275
+
276
+ class RpbGetClientIdResp
277
+ required :client_id, :bytes, 1
278
+ end
279
+
280
+ class RpbSetClientIdReq
281
+ required :client_id, :bytes, 1
282
+ end
283
+
284
+ class RpbGetReq
285
+ required :bucket, :bytes, 1
286
+ required :key, :bytes, 2
287
+ optional :r, :uint32, 3
288
+ optional :pr, :uint32, 4
289
+ optional :basic_quorum, :bool, 5
290
+ optional :notfound_ok, :bool, 6
291
+ optional :if_modified, :bytes, 7
292
+ optional :head, :bool, 8
293
+ optional :deletedvclock, :bool, 9
294
+ optional :timeout, :uint32, 10
295
+ optional :sloppy_quorum, :bool, 11
296
+ optional :n_val, :uint32, 12
297
+ optional :type, :bytes, 13
298
+ end
299
+
300
+ class RpbGetResp
301
+ repeated :content, RpbContent, 1
302
+ optional :vclock, :bytes, 2
303
+ optional :unchanged, :bool, 3
304
+ end
305
+
306
+ class RpbPutReq
307
+ required :bucket, :bytes, 1
308
+ optional :key, :bytes, 2
309
+ optional :vclock, :bytes, 3
310
+ required :content, RpbContent, 4
311
+ optional :w, :uint32, 5
312
+ optional :dw, :uint32, 6
313
+ optional :return_body, :bool, 7
314
+ optional :pw, :uint32, 8
315
+ optional :if_not_modified, :bool, 9
316
+ optional :if_none_match, :bool, 10
317
+ optional :return_head, :bool, 11
318
+ optional :timeout, :uint32, 12
319
+ optional :asis, :bool, 13
320
+ optional :sloppy_quorum, :bool, 14
321
+ optional :n_val, :uint32, 15
322
+ optional :type, :bytes, 16
323
+ end
324
+
325
+ class RpbPutResp
326
+ repeated :content, RpbContent, 1
327
+ optional :vclock, :bytes, 2
328
+ optional :key, :bytes, 3
329
+ end
330
+
331
+ class RpbDelReq
332
+ required :bucket, :bytes, 1
333
+ required :key, :bytes, 2
334
+ optional :rw, :uint32, 3
335
+ optional :vclock, :bytes, 4
336
+ optional :r, :uint32, 5
337
+ optional :w, :uint32, 6
338
+ optional :pr, :uint32, 7
339
+ optional :pw, :uint32, 8
340
+ optional :dw, :uint32, 9
341
+ optional :timeout, :uint32, 10
342
+ optional :sloppy_quorum, :bool, 11
343
+ optional :n_val, :uint32, 12
344
+ optional :type, :bytes, 13
345
+ end
346
+
347
+ class RpbListBucketsReq
348
+ optional :timeout, :uint32, 1
349
+ optional :stream, :bool, 2
350
+ optional :type, :bytes, 3
351
+ end
352
+
353
+ class RpbListBucketsResp
354
+ repeated :buckets, :bytes, 1
355
+ optional :done, :bool, 2
356
+ end
357
+
358
+ class RpbListKeysReq
359
+ required :bucket, :bytes, 1
360
+ optional :timeout, :uint32, 2
361
+ optional :type, :bytes, 3
362
+ end
363
+
364
+ class RpbListKeysResp
365
+ repeated :keys, :bytes, 1
366
+ optional :done, :bool, 2
367
+ end
368
+
369
+ class RpbMapRedReq
370
+ required :request, :bytes, 1
371
+ required :content_type, :bytes, 2
372
+ end
373
+
374
+ class RpbMapRedResp
375
+ optional :phase, :uint32, 1
376
+ optional :response, :bytes, 2
377
+ optional :done, :bool, 3
378
+ end
379
+
380
+ class RpbIndexReq
381
+ required :bucket, :bytes, 1
382
+ required :index, :bytes, 2
383
+ required :qtype, RpbIndexReq::IndexQueryType, 3
384
+ optional :key, :bytes, 4
385
+ optional :range_min, :bytes, 5
386
+ optional :range_max, :bytes, 6
387
+ optional :return_terms, :bool, 7
388
+ optional :stream, :bool, 8
389
+ optional :max_results, :uint32, 9
390
+ optional :continuation, :bytes, 10
391
+ optional :timeout, :uint32, 11
392
+ optional :type, :bytes, 12
393
+ optional :term_regex, :bytes, 13
394
+ optional :pagination_sort, :bool, 14
395
+ end
396
+
397
+ class RpbIndexResp
398
+ repeated :keys, :bytes, 1
399
+ repeated :results, RpbPair, 2
400
+ optional :continuation, :bytes, 3
401
+ optional :done, :bool, 4
402
+ end
403
+
404
+ class RpbCSBucketReq
405
+ required :bucket, :bytes, 1
406
+ required :start_key, :bytes, 2
407
+ optional :end_key, :bytes, 3
408
+ optional :start_incl, :bool, 4, :default => true
409
+ optional :end_incl, :bool, 5, :default => false
410
+ optional :continuation, :bytes, 6
411
+ optional :max_results, :uint32, 7
412
+ optional :timeout, :uint32, 8
413
+ optional :type, :bytes, 9
414
+ end
415
+
416
+ class RpbCSBucketResp
417
+ repeated :objects, RpbIndexObject, 1
418
+ optional :continuation, :bytes, 2
419
+ optional :done, :bool, 3
420
+ end
421
+
422
+ class RpbIndexObject
423
+ required :key, :bytes, 1
424
+ required :object, RpbGetResp, 2
425
+ end
426
+
427
+ class RpbContent
428
+ required :value, :bytes, 1
429
+ optional :content_type, :bytes, 2
430
+ optional :charset, :bytes, 3
431
+ optional :content_encoding, :bytes, 4
432
+ optional :vtag, :bytes, 5
433
+ repeated :links, RpbLink, 6
434
+ optional :last_mod, :uint32, 7
435
+ optional :last_mod_usecs, :uint32, 8
436
+ repeated :usermeta, RpbPair, 9
437
+ repeated :indexes, RpbPair, 10
438
+ optional :deleted, :bool, 11
439
+ end
440
+
441
+ class RpbLink
442
+ optional :bucket, :bytes, 1
443
+ optional :key, :bytes, 2
444
+ optional :tag, :bytes, 3
445
+ end
446
+
447
+ class RpbCounterUpdateReq
448
+ required :bucket, :bytes, 1
449
+ required :key, :bytes, 2
450
+ required :amount, :sint64, 3
451
+ optional :w, :uint32, 4
452
+ optional :dw, :uint32, 5
453
+ optional :pw, :uint32, 6
454
+ optional :returnvalue, :bool, 7
455
+ end
456
+
457
+ class RpbCounterUpdateResp
458
+ optional :value, :sint64, 1
459
+ end
460
+
461
+ class RpbCounterGetReq
462
+ required :bucket, :bytes, 1
463
+ required :key, :bytes, 2
464
+ optional :r, :uint32, 3
465
+ optional :pr, :uint32, 4
466
+ optional :basic_quorum, :bool, 5
467
+ optional :notfound_ok, :bool, 6
468
+ end
469
+
470
+ class RpbCounterGetResp
471
+ optional :value, :sint64, 1
472
+ end
473
+
474
+ class RpbGetBucketKeyPreflistReq
475
+ required :bucket, :bytes, 1
476
+ required :key, :bytes, 2
477
+ optional :type, :bytes, 3
478
+ end
479
+
480
+ class RpbGetBucketKeyPreflistResp
481
+ repeated :preflist, RpbBucketKeyPreflistItem, 1
482
+ end
483
+
484
+ class RpbBucketKeyPreflistItem
485
+ required :partition, :int64, 1
486
+ required :node, :bytes, 2
487
+ required :primary, :bool, 3
488
+ end
489
+ ## Generated from riak_search.proto for
490
+ require "beefcake"
491
+
492
+
493
+ class RpbSearchDoc
494
+ include Beefcake::Message
495
+ end
496
+
497
+ class RpbSearchQueryReq
498
+ include Beefcake::Message
499
+ end
500
+
501
+ class RpbSearchQueryResp
502
+ include Beefcake::Message
503
+ end
504
+
505
+ class RpbSearchDoc
506
+ repeated :fields, RpbPair, 1
507
+ end
508
+
509
+ class RpbSearchQueryReq
510
+ required :q, :bytes, 1
511
+ required :index, :bytes, 2
512
+ optional :rows, :uint32, 3
513
+ optional :start, :uint32, 4
514
+ optional :sort, :bytes, 5
515
+ optional :filter, :bytes, 6
516
+ optional :df, :bytes, 7
517
+ optional :op, :bytes, 8
518
+ repeated :fl, :bytes, 9
519
+ optional :presort, :bytes, 10
520
+ end
521
+
522
+ class RpbSearchQueryResp
523
+ repeated :docs, RpbSearchDoc, 1
524
+ optional :max_score, :float, 2
525
+ optional :num_found, :uint32, 3
526
+ end
527
+ ## Generated from riak_yokozuna.proto for
528
+ require "beefcake"
529
+
530
+
531
+ class RpbYokozunaIndex
532
+ include Beefcake::Message
533
+ end
534
+
535
+ class RpbYokozunaIndexGetReq
536
+ include Beefcake::Message
537
+ end
538
+
539
+ class RpbYokozunaIndexGetResp
540
+ include Beefcake::Message
541
+ end
542
+
543
+ class RpbYokozunaIndexPutReq
544
+ include Beefcake::Message
545
+ end
546
+
547
+ class RpbYokozunaIndexDeleteReq
548
+ include Beefcake::Message
549
+ end
550
+
551
+ class RpbYokozunaSchema
552
+ include Beefcake::Message
553
+ end
554
+
555
+ class RpbYokozunaSchemaPutReq
556
+ include Beefcake::Message
557
+ end
558
+
559
+ class RpbYokozunaSchemaGetReq
560
+ include Beefcake::Message
561
+ end
562
+
563
+ class RpbYokozunaSchemaGetResp
564
+ include Beefcake::Message
565
+ end
566
+
567
+ class RpbYokozunaIndex
568
+ required :name, :bytes, 1
569
+ optional :schema, :bytes, 2
570
+ optional :n_val, :uint32, 3
571
+ end
572
+
573
+ class RpbYokozunaIndexGetReq
574
+ optional :name, :bytes, 1
575
+ end
576
+
577
+ class RpbYokozunaIndexGetResp
578
+ repeated :index, RpbYokozunaIndex, 1
579
+ end
580
+
581
+ class RpbYokozunaIndexPutReq
582
+ required :index, RpbYokozunaIndex, 1
583
+ optional :timeout, :uint32, 2
584
+ end
585
+
586
+ class RpbYokozunaIndexDeleteReq
587
+ required :name, :bytes, 1
588
+ end
589
+
590
+ class RpbYokozunaSchema
591
+ required :name, :bytes, 1
592
+ optional :content, :bytes, 2
593
+ end
594
+
595
+ class RpbYokozunaSchemaPutReq
596
+ required :schema, RpbYokozunaSchema, 1
597
+ end
598
+
599
+ class RpbYokozunaSchemaGetReq
600
+ required :name, :bytes, 1
601
+ end
602
+
603
+ class RpbYokozunaSchemaGetResp
604
+ required :schema, RpbYokozunaSchema, 1
605
+ end
606
+ ## Generated from riak_dt.proto for
607
+ require "beefcake"
608
+
609
+
610
+ class MapField
611
+ include Beefcake::Message
612
+
613
+ module MapFieldType
614
+ COUNTER = 1
615
+ SET = 2
616
+ REGISTER = 3
617
+ FLAG = 4
618
+ MAP = 5
619
+ end
620
+ end
621
+
622
+ class MapEntry
623
+ include Beefcake::Message
624
+ end
625
+
626
+ class DtFetchReq
627
+ include Beefcake::Message
628
+ end
629
+
630
+ class DtValue
631
+ include Beefcake::Message
632
+ end
633
+
634
+ class DtFetchResp
635
+ include Beefcake::Message
636
+
637
+ module DataType
638
+ COUNTER = 1
639
+ SET = 2
640
+ MAP = 3
641
+ end
642
+ end
643
+
644
+ class CounterOp
645
+ include Beefcake::Message
646
+ end
647
+
648
+ class SetOp
649
+ include Beefcake::Message
650
+ end
651
+
652
+ class MapUpdate
653
+ include Beefcake::Message
654
+
655
+ module FlagOp
656
+ ENABLE = 1
657
+ DISABLE = 2
658
+ end
659
+ end
660
+
661
+ class MapOp
662
+ include Beefcake::Message
663
+ end
664
+
665
+ class DtOp
666
+ include Beefcake::Message
667
+ end
668
+
669
+ class DtUpdateReq
670
+ include Beefcake::Message
671
+ end
672
+
673
+ class DtUpdateResp
674
+ include Beefcake::Message
675
+ end
676
+
677
+ class MapField
678
+ required :name, :bytes, 1
679
+ required :type, MapField::MapFieldType, 2
680
+ end
681
+
682
+ class MapEntry
683
+ required :field, MapField, 1
684
+ optional :counter_value, :sint64, 2
685
+ repeated :set_value, :bytes, 3
686
+ optional :register_value, :bytes, 4
687
+ optional :flag_value, :bool, 5
688
+ repeated :map_value, MapEntry, 6
689
+ end
690
+
691
+ class DtFetchReq
692
+ required :bucket, :bytes, 1
693
+ required :key, :bytes, 2
694
+ required :type, :bytes, 3
695
+ optional :r, :uint32, 4
696
+ optional :pr, :uint32, 5
697
+ optional :basic_quorum, :bool, 6
698
+ optional :notfound_ok, :bool, 7
699
+ optional :timeout, :uint32, 8
700
+ optional :sloppy_quorum, :bool, 9
701
+ optional :n_val, :uint32, 10
702
+ optional :include_context, :bool, 11, :default => true
703
+ end
704
+
705
+ class DtValue
706
+ optional :counter_value, :sint64, 1
707
+ repeated :set_value, :bytes, 2
708
+ repeated :map_value, MapEntry, 3
709
+ end
710
+
711
+ class DtFetchResp
712
+ optional :context, :bytes, 1
713
+ required :type, DtFetchResp::DataType, 2
714
+ optional :value, DtValue, 3
715
+ end
716
+
717
+ class CounterOp
718
+ optional :increment, :sint64, 1
719
+ end
720
+
721
+ class SetOp
722
+ repeated :adds, :bytes, 1
723
+ repeated :removes, :bytes, 2
724
+ end
725
+
726
+ class MapUpdate
727
+ required :field, MapField, 1
728
+ optional :counter_op, CounterOp, 2
729
+ optional :set_op, SetOp, 3
730
+ optional :register_op, :bytes, 4
731
+ optional :flag_op, MapUpdate::FlagOp, 5
732
+ optional :map_op, MapOp, 6
733
+ end
734
+
735
+ class MapOp
736
+ repeated :removes, MapField, 1
737
+ repeated :updates, MapUpdate, 2
738
+ end
739
+
740
+ class DtOp
741
+ optional :counter_op, CounterOp, 1
742
+ optional :set_op, SetOp, 2
743
+ optional :map_op, MapOp, 3
744
+ end
745
+
746
+ class DtUpdateReq
747
+ required :bucket, :bytes, 1
748
+ optional :key, :bytes, 2
749
+ required :type, :bytes, 3
750
+ optional :context, :bytes, 4
751
+ required :op, DtOp, 5
752
+ optional :w, :uint32, 6
753
+ optional :dw, :uint32, 7
754
+ optional :pw, :uint32, 8
755
+ optional :return_body, :bool, 9, :default => false
756
+ optional :timeout, :uint32, 10
757
+ optional :sloppy_quorum, :bool, 11
758
+ optional :n_val, :uint32, 12
759
+ optional :include_context, :bool, 13, :default => true
760
+ end
761
+
762
+ class DtUpdateResp
763
+ optional :key, :bytes, 1
764
+ optional :context, :bytes, 2
765
+ optional :counter_value, :sint64, 3
766
+ repeated :set_value, :bytes, 4
767
+ repeated :map_value, MapEntry, 5
768
+ end
769
+
770
+ end
771
+ end
772
+ end