aerospike 2.19.0 → 2.21.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,6 +33,7 @@ module Aerospike
33
33
 
34
34
  INT16 = 's>'
35
35
  UINT16 = 'n'
36
+ UINT16LE = 'v'
36
37
  INT32 = 'l>'
37
38
  UINT32 = 'N'
38
39
  INT64 = 'q>'
@@ -92,6 +93,11 @@ module Aerospike
92
93
  2
93
94
  end
94
95
 
96
+ def write_uint16_little_endian(i, offset)
97
+ @buf[offset, 2] = [i].pack(UINT16LE)
98
+ 2
99
+ end
100
+
95
101
  def write_int32(i, offset)
96
102
  @buf[offset, 4] = [i].pack(INT32)
97
103
  4
@@ -130,16 +136,31 @@ module Aerospike
130
136
  vals.unpack(INT16)[0]
131
137
  end
132
138
 
139
+ def read_uint16(offset)
140
+ vals = @buf[offset..offset+1]
141
+ vals.unpack(UINT16)[0]
142
+ end
143
+
133
144
  def read_int32(offset)
134
145
  vals = @buf[offset..offset+3]
135
146
  vals.unpack(INT32)[0]
136
147
  end
137
148
 
149
+ def read_uint32(offset)
150
+ vals = @buf[offset..offset+3]
151
+ vals.unpack(UINT32)[0]
152
+ end
153
+
138
154
  def read_int64(offset)
139
155
  vals = @buf[offset..offset+7]
140
156
  vals.unpack(INT64)[0]
141
157
  end
142
158
 
159
+ def read_uint64(offset)
160
+ vals = @buf[offset..offset+7]
161
+ vals.unpack(UINT64)[0]
162
+ end
163
+
143
164
  def read_var_int64(offset, len)
144
165
  val = 0
145
166
  i = 0
@@ -156,6 +177,10 @@ module Aerospike
156
177
  vals.unpack(DOUBLE)[0]
157
178
  end
158
179
 
180
+ def read_bool(offset, length)
181
+ length <= 0 ? false : @buf[offset].ord != 0
182
+ end
183
+
159
184
  def to_s
160
185
  @buf[0..@slice_end-1]
161
186
  end
@@ -23,19 +23,8 @@ module Aerospike
23
23
  DOUBLE = 2
24
24
  STRING = 3
25
25
  BLOB = 4
26
- #TIMESTAMP = 5
27
- #DIGEST = 6
28
- #JBLOB = 7
29
- #CSHARP_BLOB = 8
30
- #PYTHON_BLOB = 9
31
26
  RUBY_BLOB = 10
32
- #PHP_BLOB = 11
33
- #ERLANG_BLOB = 12
34
- #SEGMENT_POINTER = 13
35
- #RTA_LIST = 14
36
- #RTA_DICT = 15
37
- #RTA_APPEND_DICT = 16
38
- #RTA_APPEND_LIST = 17
27
+ BOOL = 17
39
28
  HLL = 18
40
29
  MAP = 19
41
30
  LIST = 20
@@ -606,6 +606,9 @@ module Aerospike
606
606
  when Aerospike::ParticleType::DOUBLE
607
607
  buf.read_double(offset)
608
608
 
609
+ when Aerospike::ParticleType::BOOL
610
+ buf.read_bool(offset, length)
611
+
609
612
  when Aerospike::ParticleType::BLOB
610
613
  buf.read(offset,length)
611
614
 
@@ -658,7 +661,7 @@ module Aerospike
658
661
  #######################################
659
662
 
660
663
  # Boolean value.
661
- # This is private, and only used internally for bitwise CDTs
664
+ # Supported by Aerospike server 5.6+ only.
662
665
  class BoolValue < Value #:nodoc:
663
666
 
664
667
  def initialize(val)
@@ -671,7 +674,9 @@ module Aerospike
671
674
  end
672
675
 
673
676
  def write(buffer, offset)
674
- raise Exception.new("Unreachable")
677
+ val = @value ? 1 : 0
678
+ buffer.write_byte(val.ord, offset)
679
+ 1
675
680
  end
676
681
 
677
682
  def pack(packer)
@@ -679,7 +684,7 @@ module Aerospike
679
684
  end
680
685
 
681
686
  def type
682
- raise Exception.new("Unreachable")
687
+ Aerospike::ParticleType::BOOL
683
688
  end
684
689
 
685
690
  def get
@@ -687,7 +692,7 @@ module Aerospike
687
692
  end
688
693
 
689
694
  def to_bytes
690
- raise Exception.new("Unreachable")
695
+ @value.ord
691
696
  end
692
697
 
693
698
  def to_s
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Aerospike
3
- VERSION = "2.19.0"
3
+ VERSION = "2.21.0"
4
4
  end
data/lib/aerospike.rb CHANGED
@@ -62,6 +62,7 @@ require 'aerospike/command/touch_command'
62
62
  require 'aerospike/command/read_command'
63
63
  require 'aerospike/command/delete_command'
64
64
  require 'aerospike/command/admin_command'
65
+ require 'aerospike/command/login_command'
65
66
  require 'aerospike/command/unsupported_particle_type_validator'
66
67
  require 'aerospike/key'
67
68
  require 'aerospike/operation'
@@ -101,6 +102,7 @@ require 'aerospike/policy/query_policy'
101
102
  require 'aerospike/policy/consistency_level'
102
103
  require 'aerospike/policy/commit_level'
103
104
  require 'aerospike/policy/admin_policy'
105
+ require 'aerospike/policy/auth_mode'
104
106
 
105
107
  require 'aerospike/socket/base'
106
108
  require 'aerospike/socket/ssl'
@@ -141,6 +143,8 @@ require 'aerospike/udf'
141
143
  require 'aerospike/bin'
142
144
  require 'aerospike/aerospike_exception'
143
145
  require 'aerospike/user_role'
146
+ require 'aerospike/privilege'
147
+ require 'aerospike/role'
144
148
 
145
149
  require 'aerospike/task/index_task'
146
150
  require 'aerospike/task/execute_task'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aerospike
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.19.0
4
+ version: 2.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Khosrow Afroozeh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-02-09 00:00:00.000000000 Z
12
+ date: 2022-06-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack
@@ -97,11 +97,11 @@ files:
97
97
  - lib/aerospike/command/execute_command.rb
98
98
  - lib/aerospike/command/exists_command.rb
99
99
  - lib/aerospike/command/field_type.rb
100
+ - lib/aerospike/command/login_command.rb
100
101
  - lib/aerospike/command/multi_command.rb
101
102
  - lib/aerospike/command/operate_command.rb
102
103
  - lib/aerospike/command/read_command.rb
103
104
  - lib/aerospike/command/read_header_command.rb
104
- - lib/aerospike/command/roles.rb
105
105
  - lib/aerospike/command/single_command.rb
106
106
  - lib/aerospike/command/touch_command.rb
107
107
  - lib/aerospike/command/unsupported_particle_type_validator.rb
@@ -138,6 +138,7 @@ files:
138
138
  - lib/aerospike/peers/fetch.rb
139
139
  - lib/aerospike/peers/parse.rb
140
140
  - lib/aerospike/policy/admin_policy.rb
141
+ - lib/aerospike/policy/auth_mode.rb
141
142
  - lib/aerospike/policy/batch_policy.rb
142
143
  - lib/aerospike/policy/client_policy.rb
143
144
  - lib/aerospike/policy/commit_level.rb
@@ -152,6 +153,7 @@ files:
152
153
  - lib/aerospike/policy/replica.rb
153
154
  - lib/aerospike/policy/scan_policy.rb
154
155
  - lib/aerospike/policy/write_policy.rb
156
+ - lib/aerospike/privilege.rb
155
157
  - lib/aerospike/query/filter.rb
156
158
  - lib/aerospike/query/pred_exp.rb
157
159
  - lib/aerospike/query/pred_exp/and_or.rb
@@ -168,6 +170,7 @@ files:
168
170
  - lib/aerospike/query/stream_command.rb
169
171
  - lib/aerospike/record.rb
170
172
  - lib/aerospike/result_code.rb
173
+ - lib/aerospike/role.rb
171
174
  - lib/aerospike/socket/base.rb
172
175
  - lib/aerospike/socket/ssl.rb
173
176
  - lib/aerospike/socket/tcp.rb
@@ -209,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
212
  - !ruby/object:Gem::Version
210
213
  version: '0'
211
214
  requirements: []
212
- rubygems_version: 3.1.2
215
+ rubygems_version: 3.2.15
213
216
  signing_key:
214
217
  specification_version: 4
215
218
  summary: An Aerospike driver for Ruby.
@@ -1,39 +0,0 @@
1
- # encoding: utf-8
2
- # Copyright 2014-2020 Aerospike, Inc.
3
- #
4
- # Portions may be licensed to Aerospike, Inc. under one or more contributor
5
- # license agreements.
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License"); you may not
8
- # use this file except in compliance with the License. You may obtain a copy of
9
- # the License at http:#www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- # License for the specific language governing permissions and limitations under
15
- # the License.
16
-
17
- module Aerospike
18
-
19
- # Pre-defined user roles.
20
- module Role
21
-
22
- # Manage users and their roles.
23
- USER_ADMIN = 'user-admin'
24
-
25
- # Manage indicies, user-defined functions and server configuration.
26
- SYS_ADMIN = 'sys-admin'
27
-
28
- # Allow read, write and UDF transactions with the database.
29
- READ_WRITE_UDF = "read-write-udf"
30
-
31
- # Allow read and write transactions with the database.
32
- READ_WRITE = 'read-write'
33
-
34
- # Allow read transactions with the database.
35
- READ = 'read'
36
-
37
- end # module
38
-
39
- end # module