tablestore-ruby-sdk 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: 86177da99a4888d0a61d1b52b20f90b43fb3624d
4
- data.tar.gz: 37ad84d31c752483becbd23dcebc212ce054607c
3
+ metadata.gz: 2f7be149c8559324647e8e01f7a5478659af2752
4
+ data.tar.gz: 35c6271e490bb2788487c9b5027a03ac1ac04d81
5
5
  SHA512:
6
- metadata.gz: ffcd6971f6c6b5e7311e5495bec618db4f2eef6797f7e8dd701e594252ee60f6ac05e3a3ab047e36f86862c348c6d463f777b2c1d60543a9ad6c1a49726810f1
7
- data.tar.gz: 6aadd6fb901ddab23eab2dbe74bcd78e283f7cf7f16f1f3b05f3627c9a39c3a395ed7e261ef28ad51866c5ff862b15a55ddfe44ea8c3c6b3aa525c7c3c404051
6
+ metadata.gz: 57db261be3591b37f77f4e652e0962ffb31eff63e3c36e9ba503a8c5b404ad9a8efe2c18d9173aefecfc76c18212dbfb1b716874ba6dbeb14a8aa06f56d76bb0
7
+ data.tar.gz: b264e2454e8a6f2709af4b3140139faf173193e5ad14fbb94a3e351d6bda69ec43fae11be68cf09bddb94761a558ecddb9f49be326997bb977bb138ae49aa84e
@@ -47,16 +47,16 @@ class PlainBufferCodedOutputStream
47
47
  cell_check_sum = PlainBufferCrc8.crc_int64(cell_check_sum, value)
48
48
  elsif value.is_a?(String)
49
49
  prefix_length = LITTLE_ENDIAN_32_SIZE + 1
50
- @output_stream.write_raw_little_endian32(prefix_length + value.length)
50
+ @output_stream.write_raw_little_endian32(prefix_length + value.bytes.length)
51
51
  @output_stream.write_raw_byte(VT_STRING)
52
52
  @output_stream.write_raw_little_endian32(value.length)
53
53
  @output_stream.write_bytes(value)
54
54
  cell_check_sum = PlainBufferCrc8.crc_int8(cell_check_sum, VT_STRING)
55
- cell_check_sum = PlainBufferCrc8.crc_int32(cell_check_sum, value.length)
55
+ cell_check_sum = PlainBufferCrc8.crc_int32(cell_check_sum, value.bytes.length)
56
56
  cell_check_sum = PlainBufferCrc8.crc_string(cell_check_sum, value)
57
57
  # elsif value.is_a?()
58
58
  else
59
- raise TableStoreClientError.new("Unsupported primary key type: " + value.class)
59
+ raise TableStoreClientError.new("Unsupported primary key type: #{value.class}")
60
60
  end
61
61
  cell_check_sum
62
62
  end
@@ -81,12 +81,12 @@ class PlainBufferCodedOutputStream
81
81
  cell_check_sum = PlainBufferCrc8.crc_int64(cell_check_sum, value)
82
82
  elsif value.is_a?(String)
83
83
  prefix_length = LITTLE_ENDIAN_32_SIZE + 1
84
- @output_stream.write_raw_little_endian32(prefix_length + value.length)
84
+ @output_stream.write_raw_little_endian32(prefix_length + value.bytes.length)
85
85
  @output_stream.write_raw_byte(VT_STRING)
86
- @output_stream.write_raw_little_endian32(value.length)
86
+ @output_stream.write_raw_little_endian32(value.bytes.length)
87
87
  @output_stream.write_bytes(value)
88
88
  cell_check_sum = PlainBufferCrc8.crc_int8(cell_check_sum, VT_STRING)
89
- cell_check_sum = PlainBufferCrc8.crc_int32(cell_check_sum, value.length)
89
+ cell_check_sum = PlainBufferCrc8.crc_int32(cell_check_sum, value.bytes.length)
90
90
  cell_check_sum = PlainBufferCrc8.crc_string(cell_check_sum, value)
91
91
  elsif value.is_a?(Float)
92
92
  if SYS_BITS == 64
@@ -100,7 +100,7 @@ class PlainBufferCodedOutputStream
100
100
  cell_check_sum = PlainBufferCrc8.crc_int8(cell_check_sum, VT_DOUBLE)
101
101
  cell_check_sum = PlainBufferCrc8.crc_int64(cell_check_sum, double_in_long)
102
102
  else
103
- raise TableStoreClientError.new("Unsupported column type: " + value.class)
103
+ raise TableStoreClientError.new("Unsupported column type: #{value.class}")
104
104
  end
105
105
  cell_check_sum
106
106
  end
@@ -113,13 +113,13 @@ class PlainBufferCodedOutputStream
113
113
  @output_stream.write_raw_little_endian64(value)
114
114
  elsif value.is_a?(String)
115
115
  @output_stream.write_raw_byte(VT_STRING)
116
- @output_stream.write_raw_little_endian32(value.length)
116
+ @output_stream.write_raw_little_endian32(value.bytes.length)
117
117
  @output_stream.write_bytes(value)
118
118
  elsif value.is_a?(Float)
119
119
  @output_stream.write_raw_byte(VT_DOUBLE)
120
120
  @output_stream.write_double(value)
121
121
  else
122
- raise TableStoreClientError.new("Unsupported column type: " + value.class)
122
+ raise TableStoreClientError.new("Unsupported column type: #{value.class}")
123
123
  end
124
124
  end
125
125
 
@@ -140,7 +140,7 @@ class PlainBufferCodedOutputStream
140
140
  cell_check_sum = write_cell_name(column_name, cell_check_sum)
141
141
  cell_check_sum = write_column_value_with_checksum(column_value, cell_check_sum)
142
142
 
143
- unless timestamp.nil?
143
+ if timestamp
144
144
  write_tag(TAG_CELL_TIMESTAMP)
145
145
  @output_stream.write_raw_little_endian64(timestamp)
146
146
  cell_check_sum = PlainBufferCrc8.crc_int64(cell_check_sum, timestamp)
@@ -16,6 +16,9 @@ class TableStoreClient
16
16
  proto.exclusive_end_primary_key = serialize_primary_key(request[:exclusive_end_primary_key])
17
17
  proto.max_versions = request[:max_version]
18
18
  proto.limit = request[:limit]
19
+ if request[:column_filter]
20
+ proto.filter = make_column_condition(request[:column_filter]).serialize_to_string
21
+ end
19
22
  proto.serialize_to_string
20
23
  end
21
24
 
@@ -498,7 +501,7 @@ class TableStoreClient
498
501
  elsif value.is_a?(Float)
499
502
  size += LITTLE_ENDIAN_64_SIZE
500
503
  else
501
- raise TableStoreClientError.new("Unsupported column type: " + value.class)
504
+ raise TableStoreClientError.new("Unsupported column type: #{value.class}" )
502
505
  end
503
506
  size
504
507
  end
@@ -520,7 +523,7 @@ class TableStoreClient
520
523
  elsif columns.length >= 2
521
524
  compute_column_size2(column[0], column[1], update_type)
522
525
  else
523
- #raise OTSClientError("Unsupported column type:" + str(type(columns)))
526
+ raise OTSClientError("Unsupported column type:#{columns.class}")
524
527
  end
525
528
  end
526
529
  end
@@ -94,8 +94,8 @@ class TableStore
94
94
  url = base_url + '/' + api_name
95
95
  begin
96
96
  RestClient.post(url, body, headers)
97
- rescue => e
98
- raise '请检查传入参数'
97
+ rescue RestClient::ExceptionWithResponse => e
98
+ raise e.response
99
99
  end
100
100
  end
101
101
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tablestore-ruby-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - seveninches
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-11 00:00:00.000000000 Z
11
+ date: 2018-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client