swcdb 0.5.8.0 → 0.5.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ac0f51b3821b37093237ed4602a8279a344f7035c36ca849b4ee230870c7a19
4
- data.tar.gz: 6ff502f0083ce9fe1cb8556ec96b8b9e44b61c90e0f27781e84a01200d1a3eb6
3
+ metadata.gz: d41102b7e109b988aa4a94e3ccc6da85e744d409088a2337c6c40c3553f59706
4
+ data.tar.gz: b9115fc94ddf5731570db6b7c12212b987cb12718795ee9670f0b0fa2f54f6dc
5
5
  SHA512:
6
- metadata.gz: ceef39f9135846677708d412b89e4e2f063d3fade4b0c2db9c053197be91b3f979146fa0efdf27485efbb309739a9dfaf2181f3859ceb1f1cbd1e9f6d75eeed5
7
- data.tar.gz: 2253d6ef65d1b6e4485eaf5cd92c3ab2a9911fe592a917fb218c6d485e1c5c930cfb409a2e8f79a40b7a232200954a567b7d3640a23255619036cbd9e1601f2c
6
+ metadata.gz: 0a7ad6bac8a2c322a188cb4c860b225dc71de8b202dc1ef179a1de215978280f1c552578f3d8d0c4c285fc7274d79882ad31e98ce2ac67685307d92a337713bd
7
+ data.tar.gz: 4641cab2067856f009dc2fb982892576b84fdc603b54a45109170c2da7b6094250b83ce8d06a2c0a4bcf6eba76ae006f9a9ad587e988597a88e0e03cd46dedf0
@@ -10,6 +10,16 @@ require 'swcdb/thrift/gen/service_types'
10
10
  module Swcdb
11
11
  module Thrift
12
12
  module Gen
13
+ FU_CTRL_DEFAULT = 0
14
+
15
+ FU_CTRL_NO_ADD_FIELD = 1
16
+
17
+ FU_CTRL_DELETE_FIELD = 2
18
+
19
+ FU_CTRL_VALUE_SET = 4
20
+
21
+ FU_CTRL_VALUE_DEL = 8
22
+
13
23
  end
14
24
  end
15
25
  end
@@ -140,6 +140,23 @@ module Swcdb
140
140
  VALID_VALUES = Set.new([UPDATING, DELETING]).freeze
141
141
  end
142
142
 
143
+ module UpdateOP
144
+ # The OP supported by column-types: PLAIN, SERIAL, COUNTER. Replaces with the update value (_default as well if other OP not supported by the col-type_)
145
+ REPLACE = 0
146
+ # The OP supported by column-types: PLAIN, SERIAL. Appends the update value to the cell's current
147
+ APPEND = 1
148
+ # The OP supported by column-types: PLAIN, SERIAL. Prepends the update value to the cell's current
149
+ PREPEND = 2
150
+ # The OP supported by column-type PLAIN. Inserts the update value at position in current value (appends if pos above value)
151
+ INSERT = 3
152
+ # The OP supported by column-type PLAIN. Overwrites the current value at position with new value (appends if pos above value)
153
+ OVERWRITE = 4
154
+ # The OP supported by column-type SERIAL. update is done by the inner serial-fields defintions
155
+ SERIAL = 5
156
+ VALUE_MAP = {0 => "REPLACE", 1 => "APPEND", 2 => "PREPEND", 3 => "INSERT", 4 => "OVERWRITE", 5 => "SERIAL"}
157
+ VALID_VALUES = Set.new([REPLACE, APPEND, PREPEND, INSERT, OVERWRITE, SERIAL]).freeze
158
+ end
159
+
143
160
  module Flag
144
161
  # Unknown/Undefined
145
162
  NONE = 0
@@ -153,6 +170,42 @@ module Swcdb
153
170
  VALID_VALUES = Set.new([NONE, INSERT, DELETE_LE, DELETE_EQ]).freeze
154
171
  end
155
172
 
173
+ module FU_MATH_OP
174
+ # set field value to the new value
175
+ EQUAL = 0
176
+ # plus new value to field's value (negative number allowed)
177
+ PLUS = 1
178
+ # multiply current value by update value
179
+ MULTIPLY = 2
180
+ # divide current value by the new value (ignored at zero)
181
+ DIVIDE = 3
182
+ VALUE_MAP = {0 => "EQUAL", 1 => "PLUS", 2 => "MULTIPLY", 3 => "DIVIDE"}
183
+ VALID_VALUES = Set.new([EQUAL, PLUS, MULTIPLY, DIVIDE]).freeze
184
+ end
185
+
186
+ module FU_LIST_OP
187
+ # Supported by field-types: BYTES, LIST_BYTES, LIST_INT64. Replaces with the update value
188
+ REPLACE = 0
189
+ # Supported by field-types: BYTES, LIST_BYTES, LIST_INT64. Appends the update value to a field value
190
+ APPEND = 1
191
+ # Supported by field-types: BYTES, LIST_BYTES, LIST_INT64. Prepends the update value to a field value
192
+ PREPEND = 2
193
+ # Supported by field-types: BYTES, LIST_BYTES, LIST_INT64. Insert the update value at position in a field value (appends if pos above value)
194
+ INSERT = 3
195
+ # Supported by field-types: BYTES, LIST_BYTES, LIST_INT64. Overwrites a field value at position with new value (appends if pos above value)
196
+ OVERWRITE = 4
197
+ # Supported by field-types: BYTES, LIST_BYTES, LIST_INT64. Erases the position in a field value
198
+ ERASE = 5
199
+ # Supported by field-types: LIST_BYTES, LIST_INT64. The field value items have CTRL_VALUE_SET/DEL OP
200
+ BY_UNIQUE = 6
201
+ # Supported by field-types: LIST_BYTES, LIST_INT64. The field value items have CTRL_VALUE_SET/DEL OP and Comparator
202
+ BY_COND = 7
203
+ # Supported by field-types: LIST_BYTES, LIST_INT64. The field value is with Postion & OP in items
204
+ BY_INDEX = 8
205
+ VALUE_MAP = {0 => "REPLACE", 1 => "APPEND", 2 => "PREPEND", 3 => "INSERT", 4 => "OVERWRITE", 5 => "ERASE", 6 => "BY_UNIQUE", 7 => "BY_COND", 8 => "BY_INDEX"}
206
+ VALID_VALUES = Set.new([REPLACE, APPEND, PREPEND, INSERT, OVERWRITE, ERASE, BY_UNIQUE, BY_COND, BY_INDEX]).freeze
207
+ end
208
+
156
209
  module CellsResult
157
210
  # Correspond to result on Cells (Cells in list)
158
211
  IN_LIST = 0
@@ -188,6 +241,8 @@ module Swcdb
188
241
 
189
242
  class SpecValue; end
190
243
 
244
+ class SpecUpdateOP; end
245
+
191
246
  class SpecIntervalUpdate; end
192
247
 
193
248
  class SpecIntervalUpdateSerial; end
@@ -222,6 +277,18 @@ module Swcdb
222
277
 
223
278
  class CellValueSerial; end
224
279
 
280
+ class FU_INT64; end
281
+
282
+ class FU_DOUBLE; end
283
+
284
+ class FU_BYTES; end
285
+
286
+ class FU_LI; end
287
+
288
+ class FU_LB; end
289
+
290
+ class CellValueSerialOp; end
291
+
225
292
  class UCellSerial; end
226
293
 
227
294
  class Cell; end
@@ -570,12 +637,36 @@ module Swcdb
570
637
  ::Thrift::Struct.generate_accessors self
571
638
  end
572
639
 
640
+ class SpecUpdateOP
641
+ include ::Thrift::Struct, ::Thrift::Struct_Union
642
+ OP = 1
643
+ POS = 2
644
+
645
+ FIELDS = {
646
+ # The Operation of update
647
+ OP => {:type => ::Thrift::Types::I32, :name => 'op', :enum_class => ::Swcdb::Thrift::Gen::UpdateOP},
648
+ # The position/index of INSERT and OVERWRITE update operations
649
+ POS => {:type => ::Thrift::Types::I32, :name => 'pos', :optional => true}
650
+ }
651
+
652
+ def struct_fields; FIELDS; end
653
+
654
+ def validate
655
+ unless @op.nil? || ::Swcdb::Thrift::Gen::UpdateOP::VALID_VALUES.include?(@op)
656
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field op!')
657
+ end
658
+ end
659
+
660
+ ::Thrift::Struct.generate_accessors self
661
+ end
662
+
573
663
  # The Value specs for an Updating Interval of 'updating' in SpecInterval
574
664
  class SpecIntervalUpdate
575
665
  include ::Thrift::Struct, ::Thrift::Struct_Union
576
666
  V = 1
577
667
  TS = 2
578
668
  ENCODER = 3
669
+ UPDATE_OP = 4
579
670
 
580
671
  FIELDS = {
581
672
  # The value for the updated cell
@@ -583,7 +674,9 @@ module Swcdb
583
674
  # The timestamp for the updated cell NULL: MIN_INT64+1, AUTO:MIN_INT64+2 (or not-set)
584
675
  TS => {:type => ::Thrift::Types::I64, :name => 'ts', :optional => true},
585
676
  # Optionally the Cell Value Encoding Type: ZLIB/SNAPPY/ZSTD
586
- ENCODER => {:type => ::Thrift::Types::I32, :name => 'encoder', :optional => true, :enum_class => ::Swcdb::Thrift::Gen::EncodingType}
677
+ ENCODER => {:type => ::Thrift::Types::I32, :name => 'encoder', :optional => true, :enum_class => ::Swcdb::Thrift::Gen::EncodingType},
678
+ # Optionally the operaton of value update
679
+ UPDATE_OP => {:type => ::Thrift::Types::STRUCT, :name => 'update_op', :class => ::Swcdb::Thrift::Gen::SpecUpdateOP, :optional => true}
587
680
  }
588
681
 
589
682
  def struct_fields; FIELDS; end
@@ -602,15 +695,21 @@ module Swcdb
602
695
  include ::Thrift::Struct, ::Thrift::Struct_Union
603
696
  TS = 1
604
697
  V = 2
605
- ENCODER = 3
698
+ V_OP = 3
699
+ ENCODER = 4
700
+ UPDATE_OP = 5
606
701
 
607
702
  FIELDS = {
608
703
  # The timestamp for the updated cell NULL: MIN_INT64-1, AUTO:MIN_INT64-1
609
704
  TS => {:type => ::Thrift::Types::I64, :name => 'ts'},
610
- # The value for the updated cell
705
+ # The values of serial-fields for the updated cell
611
706
  V => {:type => ::Thrift::Types::LIST, :name => 'v', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Swcdb::Thrift::Gen::CellValueSerial}},
707
+ # The values of serial-fields for the the SERIAL operation update
708
+ V_OP => {:type => ::Thrift::Types::LIST, :name => 'v_op', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Swcdb::Thrift::Gen::CellValueSerialOp}},
612
709
  # Optionally the Cell Value Encoding Type: ZLIB/SNAPPY/ZSTD
613
- ENCODER => {:type => ::Thrift::Types::I32, :name => 'encoder', :optional => true, :enum_class => ::Swcdb::Thrift::Gen::EncodingType}
710
+ ENCODER => {:type => ::Thrift::Types::I32, :name => 'encoder', :optional => true, :enum_class => ::Swcdb::Thrift::Gen::EncodingType},
711
+ # Optionally the operaton of value update
712
+ UPDATE_OP => {:type => ::Thrift::Types::STRUCT, :name => 'update_op', :class => ::Swcdb::Thrift::Gen::SpecUpdateOP, :optional => true}
614
713
  }
615
714
 
616
715
  def struct_fields; FIELDS; end
@@ -1070,6 +1169,187 @@ module Swcdb
1070
1169
  ::Thrift::Struct.generate_accessors self
1071
1170
  end
1072
1171
 
1172
+ # Serial INT64 Field Update
1173
+ class FU_INT64
1174
+ include ::Thrift::Struct, ::Thrift::Struct_Union
1175
+ CTRL = 1
1176
+ OP = 2
1177
+ POS = 3
1178
+ COMP = 4
1179
+ V = 5
1180
+
1181
+ FIELDS = {
1182
+ CTRL => {:type => ::Thrift::Types::BYTE, :name => 'ctrl', :default => 0},
1183
+ OP => {:type => ::Thrift::Types::I32, :name => 'op', :default => 0, :enum_class => ::Swcdb::Thrift::Gen::FU_MATH_OP},
1184
+ POS => {:type => ::Thrift::Types::I32, :name => 'pos', :optional => true},
1185
+ COMP => {:type => ::Thrift::Types::I32, :name => 'comp', :optional => true, :enum_class => ::Swcdb::Thrift::Gen::Comp},
1186
+ V => {:type => ::Thrift::Types::I64, :name => 'v'}
1187
+ }
1188
+
1189
+ def struct_fields; FIELDS; end
1190
+
1191
+ def validate
1192
+ unless @op.nil? || ::Swcdb::Thrift::Gen::FU_MATH_OP::VALID_VALUES.include?(@op)
1193
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field op!')
1194
+ end
1195
+ unless @comp.nil? || ::Swcdb::Thrift::Gen::Comp::VALID_VALUES.include?(@comp)
1196
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field comp!')
1197
+ end
1198
+ end
1199
+
1200
+ ::Thrift::Struct.generate_accessors self
1201
+ end
1202
+
1203
+ # Serial DOUBLE Field Update
1204
+ class FU_DOUBLE
1205
+ include ::Thrift::Struct, ::Thrift::Struct_Union
1206
+ CTRL = 1
1207
+ OP = 2
1208
+ POS = 3
1209
+ COMP = 4
1210
+ V = 5
1211
+
1212
+ FIELDS = {
1213
+ CTRL => {:type => ::Thrift::Types::BYTE, :name => 'ctrl', :default => 0},
1214
+ OP => {:type => ::Thrift::Types::I32, :name => 'op', :default => 0, :enum_class => ::Swcdb::Thrift::Gen::FU_MATH_OP},
1215
+ POS => {:type => ::Thrift::Types::I32, :name => 'pos', :optional => true},
1216
+ COMP => {:type => ::Thrift::Types::I32, :name => 'comp', :optional => true, :enum_class => ::Swcdb::Thrift::Gen::Comp},
1217
+ V => {:type => ::Thrift::Types::DOUBLE, :name => 'v'}
1218
+ }
1219
+
1220
+ def struct_fields; FIELDS; end
1221
+
1222
+ def validate
1223
+ unless @op.nil? || ::Swcdb::Thrift::Gen::FU_MATH_OP::VALID_VALUES.include?(@op)
1224
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field op!')
1225
+ end
1226
+ unless @comp.nil? || ::Swcdb::Thrift::Gen::Comp::VALID_VALUES.include?(@comp)
1227
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field comp!')
1228
+ end
1229
+ end
1230
+
1231
+ ::Thrift::Struct.generate_accessors self
1232
+ end
1233
+
1234
+ # Serial BYTES Field Update
1235
+ class FU_BYTES
1236
+ include ::Thrift::Struct, ::Thrift::Struct_Union
1237
+ CTRL = 1
1238
+ OP = 2
1239
+ POS = 3
1240
+ COMP = 4
1241
+ V = 5
1242
+
1243
+ FIELDS = {
1244
+ CTRL => {:type => ::Thrift::Types::BYTE, :name => 'ctrl', :default => 0},
1245
+ OP => {:type => ::Thrift::Types::I32, :name => 'op', :default => 0, :enum_class => ::Swcdb::Thrift::Gen::FU_LIST_OP},
1246
+ POS => {:type => ::Thrift::Types::I32, :name => 'pos', :optional => true},
1247
+ COMP => {:type => ::Thrift::Types::I32, :name => 'comp', :optional => true, :enum_class => ::Swcdb::Thrift::Gen::Comp},
1248
+ V => {:type => ::Thrift::Types::STRING, :name => 'v', :binary => true}
1249
+ }
1250
+
1251
+ def struct_fields; FIELDS; end
1252
+
1253
+ def validate
1254
+ unless @op.nil? || ::Swcdb::Thrift::Gen::FU_LIST_OP::VALID_VALUES.include?(@op)
1255
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field op!')
1256
+ end
1257
+ unless @comp.nil? || ::Swcdb::Thrift::Gen::Comp::VALID_VALUES.include?(@comp)
1258
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field comp!')
1259
+ end
1260
+ end
1261
+
1262
+ ::Thrift::Struct.generate_accessors self
1263
+ end
1264
+
1265
+ # Serial LIST_INT64 Field Update
1266
+ class FU_LI
1267
+ include ::Thrift::Struct, ::Thrift::Struct_Union
1268
+ CTRL = 1
1269
+ OP = 2
1270
+ POS = 3
1271
+ V = 4
1272
+
1273
+ FIELDS = {
1274
+ CTRL => {:type => ::Thrift::Types::BYTE, :name => 'ctrl', :default => 0},
1275
+ OP => {:type => ::Thrift::Types::I32, :name => 'op', :default => 0, :enum_class => ::Swcdb::Thrift::Gen::FU_LIST_OP},
1276
+ POS => {:type => ::Thrift::Types::I32, :name => 'pos', :optional => true},
1277
+ V => {:type => ::Thrift::Types::LIST, :name => 'v', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Swcdb::Thrift::Gen::FU_INT64}}
1278
+ }
1279
+
1280
+ def struct_fields; FIELDS; end
1281
+
1282
+ def validate
1283
+ unless @op.nil? || ::Swcdb::Thrift::Gen::FU_LIST_OP::VALID_VALUES.include?(@op)
1284
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field op!')
1285
+ end
1286
+ end
1287
+
1288
+ ::Thrift::Struct.generate_accessors self
1289
+ end
1290
+
1291
+ # Serial LIST_BYTES Field Update
1292
+ class FU_LB
1293
+ include ::Thrift::Struct, ::Thrift::Struct_Union
1294
+ CTRL = 1
1295
+ OP = 2
1296
+ POS = 3
1297
+ V = 4
1298
+
1299
+ FIELDS = {
1300
+ CTRL => {:type => ::Thrift::Types::BYTE, :name => 'ctrl', :default => 0},
1301
+ OP => {:type => ::Thrift::Types::I32, :name => 'op', :default => 0, :enum_class => ::Swcdb::Thrift::Gen::FU_LIST_OP},
1302
+ POS => {:type => ::Thrift::Types::I32, :name => 'pos', :optional => true},
1303
+ V => {:type => ::Thrift::Types::LIST, :name => 'v', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Swcdb::Thrift::Gen::FU_BYTES}}
1304
+ }
1305
+
1306
+ def struct_fields; FIELDS; end
1307
+
1308
+ def validate
1309
+ unless @op.nil? || ::Swcdb::Thrift::Gen::FU_LIST_OP::VALID_VALUES.include?(@op)
1310
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field op!')
1311
+ end
1312
+ end
1313
+
1314
+ ::Thrift::Struct.generate_accessors self
1315
+ end
1316
+
1317
+ # The Serial Values Cell field with Update Operation
1318
+ class CellValueSerialOp
1319
+ include ::Thrift::Struct, ::Thrift::Struct_Union
1320
+ FIELD_ID = 1
1321
+ V_INT64 = 2
1322
+ V_DOUBLE = 3
1323
+ V_BYTES = 4
1324
+ V_KEY = 5
1325
+ V_LI = 6
1326
+ V_LB = 7
1327
+
1328
+ FIELDS = {
1329
+ # The Field ID, a single ID can have any/all the field types
1330
+ FIELD_ID => {:type => ::Thrift::Types::I32, :name => 'field_id'},
1331
+ # The INT64 type update-field
1332
+ V_INT64 => {:type => ::Thrift::Types::STRUCT, :name => 'v_int64', :class => ::Swcdb::Thrift::Gen::FU_INT64, :optional => true},
1333
+ # The DOUBLE type update-field
1334
+ V_DOUBLE => {:type => ::Thrift::Types::STRUCT, :name => 'v_double', :class => ::Swcdb::Thrift::Gen::FU_DOUBLE, :optional => true},
1335
+ # The BYTES type update-field
1336
+ V_BYTES => {:type => ::Thrift::Types::STRUCT, :name => 'v_bytes', :class => ::Swcdb::Thrift::Gen::FU_BYTES, :optional => true},
1337
+ # The Cell KEY type update-field
1338
+ V_KEY => {:type => ::Thrift::Types::LIST, :name => 'v_key', :element => {:type => ::Thrift::Types::STRING, :binary => true}},
1339
+ # The LIST INT64 type update-field
1340
+ V_LI => {:type => ::Thrift::Types::STRUCT, :name => 'v_li', :class => ::Swcdb::Thrift::Gen::FU_LI, :optional => true},
1341
+ # The LIST BYTES type update-field
1342
+ V_LB => {:type => ::Thrift::Types::STRUCT, :name => 'v_lb', :class => ::Swcdb::Thrift::Gen::FU_LB, :optional => true}
1343
+ }
1344
+
1345
+ def struct_fields; FIELDS; end
1346
+
1347
+ def validate
1348
+ end
1349
+
1350
+ ::Thrift::Struct.generate_accessors self
1351
+ end
1352
+
1073
1353
  # The Cell data for using with Update of SERIAL Column Type
1074
1354
  class UCellSerial
1075
1355
  include ::Thrift::Struct, ::Thrift::Struct_Union
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swcdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8.0
4
+ version: 0.5.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Kashirin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-26 00:00:00.000000000 Z
11
+ date: 2022-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thrift