fdb 6.0.18 → 6.1.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
  SHA1:
3
- metadata.gz: b26ce4545e9d2cde8a23339442af3dd6d91f7ba2
4
- data.tar.gz: 2b15c7edd0a026d91d85b5cd90971485a4905cd4
3
+ metadata.gz: 0b5f7ac7980ff069f49b6b71c72a8af83b2d8cec
4
+ data.tar.gz: 790d5cb6a75cb19715dc636569fa0717a336c9f2
5
5
  SHA512:
6
- metadata.gz: 188425cbcbd78b889757af3e444652b26fef095bc43f970e8d383e8c145dd70e5fad6e6cecb61378bdfa66f20d40b77c78c46d9b735cca9f8d7a239f23ac2c4d
7
- data.tar.gz: 20c1e52bd71d5cda5ef71e4f54feddae7580d77fdfc05149d9d0217388e6db9010108e10d14a7a176c5d06e4ddb5ee532afddd416f8ca679fe3e94a26bf3e16c
6
+ metadata.gz: 507559821410acba7e7743f6b6a77187262f19e42c366b98f823fe63549392b59c5b4226a577de2b8dafc09e90227d07d3a93b35ddda4857676666abe090f72c
7
+ data.tar.gz: 2d668205441ddcb9b08c03c1e8a75ff66ffb1530514e07fdd05c7814fafb5f61c4f36595031784d464115c329025335b9969ed0aee8c53f53aeeeebf12016008
data/lib/fdb.rb CHANGED
@@ -36,7 +36,7 @@ module FDB
36
36
  end
37
37
  end
38
38
  def self.api_version(version)
39
- header_version = 600
39
+ header_version = 610
40
40
  if self.is_api_version_selected?()
41
41
  if @@chosen_version != version
42
42
  raise "FDB API already loaded at version #{@@chosen_version}."
@@ -70,8 +70,15 @@ module FDB
70
70
  raise "FoundationDB API version error"
71
71
  end
72
72
 
73
+ FDBC.init_c_api()
74
+
73
75
  require_relative 'fdbtuple'
74
76
  require_relative 'fdbdirectory'
77
+
78
+ if version < 610
79
+ require_relative 'fdbimpl_v609'
80
+ end
81
+
75
82
  if version > 22
76
83
  require_relative 'fdblocality'
77
84
  end
data/lib/fdbimpl.rb CHANGED
@@ -64,64 +64,61 @@ module FDB
64
64
  typedef :int, :fdb_error
65
65
  typedef :int, :fdb_bool
66
66
 
67
- attach_function :fdb_get_error, [ :fdb_error ], :string
68
-
69
- attach_function :fdb_network_set_option, [ :int, :pointer, :int ], :fdb_error
70
- attach_function :fdb_setup_network, [ ], :fdb_error
71
- attach_function :fdb_run_network, [ ], :fdb_error, :blocking => true
72
- attach_function :fdb_stop_network, [ ], :fdb_error
73
-
74
- attach_function :fdb_future_cancel, [ :pointer ], :void
75
- attach_function :fdb_future_release_memory, [ :pointer ], :void
76
- attach_function :fdb_future_destroy, [ :pointer ], :void
77
- attach_function :fdb_future_block_until_ready, [ :pointer ], :fdb_error, :blocking => true
78
- attach_function :fdb_future_is_ready, [ :pointer ], :fdb_bool
79
-
80
- callback :fdb_future_callback, [ :pointer, :pointer ], :void
81
- attach_function :fdb_future_set_callback, [ :pointer, :fdb_future_callback, :pointer ], :fdb_error
82
-
83
- attach_function :fdb_future_get_error, [ :pointer ], :fdb_error
84
- attach_function :fdb_future_get_version, [ :pointer, :pointer ], :fdb_error
85
- attach_function :fdb_future_get_key, [ :pointer, :pointer, :pointer ], :fdb_error
86
- attach_function :fdb_future_get_cluster, [ :pointer, :pointer ], :fdb_error
87
- attach_function :fdb_future_get_database, [ :pointer, :pointer ], :fdb_error
88
- attach_function :fdb_future_get_value, [ :pointer, :pointer, :pointer, :pointer ], :fdb_error
89
- attach_function :fdb_future_get_keyvalue_array, [ :pointer, :pointer, :pointer, :pointer ], :fdb_error
90
- attach_function :fdb_future_get_string_array, [ :pointer, :pointer, :pointer ], :fdb_error
91
-
92
- attach_function :fdb_create_cluster, [ :string ], :pointer
93
- attach_function :fdb_cluster_destroy, [ :pointer ], :void
94
- attach_function :fdb_cluster_set_option, [ :pointer, :int, :pointer, :int ], :fdb_error
95
-
96
- attach_function :fdb_cluster_create_database, [ :pointer, :pointer, :int ], :pointer
97
- attach_function :fdb_database_destroy, [ :pointer ], :void
98
- attach_function :fdb_database_set_option, [ :pointer, :int, :pointer, :int ], :fdb_error
99
-
100
- attach_function :fdb_database_create_transaction, [ :pointer, :pointer ], :fdb_error
101
- attach_function :fdb_transaction_destroy, [ :pointer ], :void
102
- attach_function :fdb_transaction_cancel, [ :pointer ], :void
103
- attach_function :fdb_transaction_atomic_op, [ :pointer, :pointer, :int, :pointer, :int, :int ], :void
104
- attach_function :fdb_transaction_add_conflict_range, [ :pointer, :pointer, :int, :pointer, :int, :int ], :int
105
- attach_function :fdb_transaction_get_addresses_for_key, [ :pointer, :pointer, :int ], :pointer
106
- attach_function :fdb_transaction_set_option, [ :pointer, :int, :pointer, :int ], :fdb_error
107
- attach_function :fdb_transaction_set_read_version, [ :pointer, :int64 ], :void
108
- attach_function :fdb_transaction_get_read_version, [ :pointer ], :pointer
109
- attach_function :fdb_transaction_get, [ :pointer, :pointer, :int, :int ], :pointer
110
- attach_function :fdb_transaction_get_key, [ :pointer, :pointer, :int, :int, :int, :int ], :pointer
111
- attach_function :fdb_transaction_get_range, [ :pointer, :pointer, :int, :int, :int, :pointer, :int, :int, :int, :int, :int, :int, :int, :int, :int ], :pointer
112
- attach_function :fdb_transaction_set, [ :pointer, :pointer, :int, :pointer, :int ], :void
113
- attach_function :fdb_transaction_clear, [ :pointer, :pointer, :int ], :void
114
- attach_function :fdb_transaction_clear_range, [ :pointer, :pointer, :int, :pointer, :int ], :void
115
- attach_function :fdb_transaction_watch, [ :pointer, :pointer, :int ], :pointer
116
- attach_function :fdb_transaction_commit, [ :pointer ], :pointer
117
- attach_function :fdb_transaction_get_committed_version, [ :pointer, :pointer ], :fdb_error
118
- attach_function :fdb_transaction_get_versionstamp, [ :pointer ], :pointer
119
- attach_function :fdb_transaction_on_error, [ :pointer, :fdb_error ], :pointer
120
- attach_function :fdb_transaction_reset, [ :pointer ], :void
121
-
122
67
  attach_function :fdb_select_api_version_impl, [ :int, :int ], :fdb_error
123
68
  attach_function :fdb_get_max_api_version, [ ], :int
124
69
 
70
+ def self.init_c_api
71
+ attach_function :fdb_get_error, [ :fdb_error ], :string
72
+
73
+ attach_function :fdb_network_set_option, [ :int, :pointer, :int ], :fdb_error
74
+ attach_function :fdb_setup_network, [ ], :fdb_error
75
+ attach_function :fdb_run_network, [ ], :fdb_error, :blocking => true
76
+ attach_function :fdb_stop_network, [ ], :fdb_error
77
+
78
+ attach_function :fdb_future_cancel, [ :pointer ], :void
79
+ attach_function :fdb_future_release_memory, [ :pointer ], :void
80
+ attach_function :fdb_future_destroy, [ :pointer ], :void
81
+ attach_function :fdb_future_block_until_ready, [ :pointer ], :fdb_error, :blocking => true
82
+ attach_function :fdb_future_is_ready, [ :pointer ], :fdb_bool
83
+
84
+ callback :fdb_future_callback, [ :pointer, :pointer ], :void
85
+ attach_function :fdb_future_set_callback, [ :pointer, :fdb_future_callback, :pointer ], :fdb_error
86
+
87
+ attach_function :fdb_future_get_error, [ :pointer ], :fdb_error
88
+ attach_function :fdb_future_get_version, [ :pointer, :pointer ], :fdb_error
89
+ attach_function :fdb_future_get_key, [ :pointer, :pointer, :pointer ], :fdb_error
90
+ attach_function :fdb_future_get_value, [ :pointer, :pointer, :pointer, :pointer ], :fdb_error
91
+ attach_function :fdb_future_get_keyvalue_array, [ :pointer, :pointer, :pointer, :pointer ], :fdb_error
92
+ attach_function :fdb_future_get_string_array, [ :pointer, :pointer, :pointer ], :fdb_error
93
+
94
+ attach_function :fdb_create_database, [ :string, :pointer ], :fdb_error
95
+
96
+ attach_function :fdb_database_destroy, [ :pointer ], :void
97
+ attach_function :fdb_database_set_option, [ :pointer, :int, :pointer, :int ], :fdb_error
98
+
99
+ attach_function :fdb_database_create_transaction, [ :pointer, :pointer ], :fdb_error
100
+ attach_function :fdb_transaction_destroy, [ :pointer ], :void
101
+ attach_function :fdb_transaction_cancel, [ :pointer ], :void
102
+ attach_function :fdb_transaction_atomic_op, [ :pointer, :pointer, :int, :pointer, :int, :int ], :void
103
+ attach_function :fdb_transaction_add_conflict_range, [ :pointer, :pointer, :int, :pointer, :int, :int ], :int
104
+ attach_function :fdb_transaction_get_addresses_for_key, [ :pointer, :pointer, :int ], :pointer
105
+ attach_function :fdb_transaction_set_option, [ :pointer, :int, :pointer, :int ], :fdb_error
106
+ attach_function :fdb_transaction_set_read_version, [ :pointer, :int64 ], :void
107
+ attach_function :fdb_transaction_get_read_version, [ :pointer ], :pointer
108
+ attach_function :fdb_transaction_get, [ :pointer, :pointer, :int, :int ], :pointer
109
+ attach_function :fdb_transaction_get_key, [ :pointer, :pointer, :int, :int, :int, :int ], :pointer
110
+ attach_function :fdb_transaction_get_range, [ :pointer, :pointer, :int, :int, :int, :pointer, :int, :int, :int, :int, :int, :int, :int, :int, :int ], :pointer
111
+ attach_function :fdb_transaction_set, [ :pointer, :pointer, :int, :pointer, :int ], :void
112
+ attach_function :fdb_transaction_clear, [ :pointer, :pointer, :int ], :void
113
+ attach_function :fdb_transaction_clear_range, [ :pointer, :pointer, :int, :pointer, :int ], :void
114
+ attach_function :fdb_transaction_watch, [ :pointer, :pointer, :int ], :pointer
115
+ attach_function :fdb_transaction_commit, [ :pointer ], :pointer
116
+ attach_function :fdb_transaction_get_committed_version, [ :pointer, :pointer ], :fdb_error
117
+ attach_function :fdb_transaction_get_versionstamp, [ :pointer ], :pointer
118
+ attach_function :fdb_transaction_on_error, [ :pointer, :fdb_error ], :pointer
119
+ attach_function :fdb_transaction_reset, [ :pointer ], :void
120
+ end
121
+
125
122
  class KeyValueStruct < FFI::Struct
126
123
  pack 4
127
124
  layout :key, :pointer,
@@ -156,7 +153,7 @@ module FDB
156
153
  @@ffi_callbacks
157
154
  end
158
155
 
159
- [ "Network", "Cluster", "Database", "Transaction" ].each do |scope|
156
+ [ "Network", "Database", "Transaction" ].each do |scope|
160
157
  klass = FDB.const_set("#{scope}Options", Class.new)
161
158
  klass.class_eval do
162
159
  define_method(:initialize) do |setfunc|
@@ -242,6 +239,10 @@ module FDB
242
239
  nil
243
240
  end
244
241
 
242
+ class << self
243
+ private :init
244
+ end
245
+
245
246
  def self.stop()
246
247
  FDBC.check_error FDBC.fdb_stop_network
247
248
  end
@@ -254,11 +255,10 @@ module FDB
254
255
  end
255
256
  end
256
257
 
257
- @@open_clusters = {}
258
258
  @@open_databases = {}
259
259
  @@cache_lock = Mutex.new
260
260
 
261
- def self.open( cluster_file = nil, database_name = "DB" )
261
+ def self.open( cluster_file = nil )
262
262
  @@network_thread_monitor.synchronize do
263
263
  if ! @@network_thread
264
264
  init
@@ -266,15 +266,13 @@ module FDB
266
266
  end
267
267
 
268
268
  @@cache_lock.synchronize do
269
- if ! @@open_clusters.has_key? cluster_file
270
- @@open_clusters[cluster_file] = create_cluster( cluster_file )
269
+ if ! @@open_databases.has_key? [cluster_file]
270
+ dpointer = FFI::MemoryPointer.new :pointer
271
+ FDBC.check_error FDBC.fdb_create_database(cluster_file, dpointer)
272
+ @@open_databases[cluster_file] = Database.new dpointer.get_pointer(0)
271
273
  end
272
274
 
273
- if ! @@open_databases.has_key? [cluster_file, database_name]
274
- @@open_databases[[cluster_file, database_name]] = @@open_clusters[cluster_file].open_database(database_name)
275
- end
276
-
277
- @@open_databases[[cluster_file, database_name]]
275
+ @@open_databases[cluster_file]
278
276
  end
279
277
  end
280
278
 
@@ -503,41 +501,6 @@ module FDB
503
501
  end
504
502
  end
505
503
 
506
- def self.create_cluster(cluster=nil)
507
- f = FDBC.fdb_create_cluster(cluster)
508
- cpointer = FFI::MemoryPointer.new :pointer
509
- FDBC.check_error FDBC.fdb_future_block_until_ready(f)
510
- FDBC.check_error FDBC.fdb_future_get_cluster(f, cpointer)
511
- Cluster.new cpointer.get_pointer(0)
512
- end
513
-
514
- class Cluster < FormerFuture
515
- attr_reader :options
516
-
517
- def self.finalize(ptr)
518
- proc do
519
- # puts "Destroying cluster #{ptr}"
520
- FDBC.fdb_cluster_destroy(ptr)
521
- end
522
- end
523
-
524
- def initialize(cpointer)
525
- @cpointer = cpointer
526
- @options = ClusterOptions.new lambda { |code, param|
527
- FDBC.check_error FDBC.fdb_cluster_set_option(cpointer, code, param, param.nil? ? 0 : param.bytesize)
528
- }
529
- ObjectSpace.define_finalizer(self, self.class.finalize(@cpointer))
530
- end
531
-
532
- def open_database(name="DB")
533
- f = FDBC.fdb_cluster_create_database(@cpointer, name, name.bytesize)
534
- dpointer = FFI::MemoryPointer.new :pointer
535
- FDBC.check_error FDBC.fdb_future_block_until_ready(f)
536
- FDBC.check_error FDBC.fdb_future_get_database(f, dpointer)
537
- Database.new dpointer.get_pointer(0)
538
- end
539
- end
540
-
541
504
  class Database < FormerFuture
542
505
  attr_reader :options
543
506
 
@@ -0,0 +1,62 @@
1
+ #encoding: BINARY
2
+
3
+ #
4
+ # fdbimpl.rb
5
+ #
6
+ # This source file is part of the FoundationDB open source project
7
+ #
8
+ # Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
9
+ #
10
+ # Licensed under the Apache License, Version 2.0 (the "License");
11
+ # you may not use this file except in compliance with the License.
12
+ # You may obtain a copy of the License at
13
+ #
14
+ # http://www.apache.org/licenses/LICENSE-2.0
15
+ #
16
+ # Unless required by applicable law or agreed to in writing, software
17
+ # distributed under the License is distributed on an "AS IS" BASIS,
18
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ # See the License for the specific language governing permissions and
20
+ # limitations under the License.
21
+ #
22
+
23
+ # FoundationDB Ruby API
24
+
25
+ # Documentation for this API can be found at
26
+ # https://apple.github.io/foundationdb/api-ruby.html
27
+
28
+ module FDB
29
+ class << self
30
+ alias_method :open_impl, :open
31
+ def open( cluster_file = nil, database_name = "DB" )
32
+ if database_name != "DB"
33
+ raise Error.new(2013) # invalid_database_name
34
+ end
35
+
36
+ open_impl(cluster_file)
37
+ end
38
+
39
+ def create_cluster(cluster_file_path=nil)
40
+ Cluster.new cluster_file_path
41
+ end
42
+
43
+ public :init
44
+ end
45
+
46
+ class ClusterOptions
47
+ end
48
+
49
+ class Cluster < FormerFuture
50
+ attr_reader :options
51
+
52
+ def initialize(cluster_file_path)
53
+ @cluster_file_path = cluster_file_path
54
+ @options = ClusterOptions.new
55
+ end
56
+
57
+ def open_database(name="DB")
58
+ FDB.open(@cluster_file_path, name)
59
+ end
60
+ end
61
+
62
+ end
data/lib/fdboptions.rb CHANGED
@@ -30,6 +30,7 @@ module FDB
30
30
  "TRACE_ROLL_SIZE" => [31, "Sets the maximum size in bytes of a single trace output file. This value should be in the range ``[0, INT64_MAX]``. If the value is set to 0, there is no limit on individual file size. The default is a maximum size of 10,485,760 bytes.", 0, "max size of a single trace output file"],
31
31
  "TRACE_MAX_LOGS_SIZE" => [32, "Sets the maximum size of all the trace output files put together. This value should be in the range ``[0, INT64_MAX]``. If the value is set to 0, there is no limit on the total size of the files. The default is a maximum size of 104,857,600 bytes. If the default roll size is used, this means that a maximum of 10 trace files will be written at a time.", 0, "max total size of trace files"],
32
32
  "TRACE_LOG_GROUP" => [33, "Sets the 'LogGroup' attribute with the specified value for all events in the trace output files. The default log group is 'default'.", '', "value of the LogGroup attribute"],
33
+ "TRACE_FORMAT" => [34, "Select the format of the log files. xml (the default) and json are supported.", '', "Format of trace files"],
33
34
  "KNOB" => [40, "Set internal tuning or debugging knobs", '', "knob_name=knob_value"],
34
35
  "TLS_PLUGIN" => [41, "Deprecated", '', "file path or linker-resolved name"],
35
36
  "TLS_CERT_BYTES" => [42, "Set the certificate chain", '', "certificates"],
@@ -53,15 +54,16 @@ module FDB
53
54
  "ENABLE_SLOW_TASK_PROFILING" => [71, "Enables debugging feature to perform slow task profiling. Requires trace logging to be enabled. WARNING: this feature is not recommended for use in production.", nil, nil],
54
55
  }
55
56
 
56
- @@ClusterOption = {
57
-
58
- }
59
-
60
57
  @@DatabaseOption = {
61
58
  "LOCATION_CACHE_SIZE" => [10, "Set the size of the client location cache. Raising this value can boost performance in very large databases where clients access data in a near-random pattern. Defaults to 100000.", 0, "Max location cache entries"],
62
59
  "MAX_WATCHES" => [20, "Set the maximum number of watches allowed to be outstanding on a database connection. Increasing this number could result in increased resource usage. Reducing this number will not cancel any outstanding watches. Defaults to 10000 and cannot be larger than 1000000.", 0, "Max outstanding watches"],
63
60
  "MACHINE_ID" => [21, "Specify the machine ID that was passed to fdbserver processes running on the same machine as this client, for better location-aware load balancing.", '', "Hexadecimal ID"],
64
61
  "DATACENTER_ID" => [22, "Specify the datacenter ID that was passed to fdbserver processes running in the same datacenter as this client, for better location-aware load balancing.", '', "Hexadecimal ID"],
62
+ "TRANSACTION_TIMEOUT" => [500, "Set a timeout in milliseconds which, when elapsed, will cause each transaction automatically to be cancelled. This sets the ``timeout`` option of each transaction created by this database. See the transaction option description for more information. Using this option requires that the API version is 610 or higher.", 0, "value in milliseconds of timeout"],
63
+ "TRANSACTION_RETRY_LIMIT" => [501, "Set a timeout in milliseconds which, when elapsed, will cause a transaction automatically to be cancelled. This sets the ``retry_limit`` option of each transaction created by this database. See the transaction option description for more information.", 0, "number of times to retry"],
64
+ "TRANSACTION_MAX_RETRY_DELAY" => [502, "Set the maximum amount of backoff delay incurred in the call to ``onError`` if the error is retryable. This sets the ``max_retry_delay`` option of each transaction created by this database. See the transaction option description for more information.", 0, "value in milliseconds of maximum delay"],
65
+ "SNAPSHOT_RYW_ENABLE" => [26, "Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior.", nil, nil],
66
+ "SNAPSHOT_RYW_DISABLE" => [27, "Snapshot read operations will not see the results of writes done in the same transaction. This was the default behavior prior to API version 300.", nil, nil],
65
67
  }
66
68
 
67
69
  @@TransactionOption = {
@@ -75,20 +77,23 @@ module FDB
75
77
  "DURABILITY_RISKY" => [120, "", nil, nil],
76
78
  "DURABILITY_DEV_NULL_IS_WEB_SCALE" => [130, "Deprecated", nil, nil],
77
79
  "PRIORITY_SYSTEM_IMMEDIATE" => [200, "Specifies that this transaction should be treated as highest priority and that lower priority transactions should block behind this one. Use is discouraged outside of low-level tools", nil, nil],
78
- "PRIORITY_BATCH" => [201, "Specifies that this transaction should be treated as low priority and that default priority transactions should be processed first. Useful for doing batch work simultaneously with latency-sensitive work", nil, nil],
80
+ "PRIORITY_BATCH" => [201, "Specifies that this transaction should be treated as low priority and that default priority transactions will be processed first. Batch priority transactions will also be throttled at load levels smaller than for other types of transactions and may be fully cut off in the event of machine failures. Useful for doing batch work simultaneously with latency-sensitive work", nil, nil],
79
81
  "INITIALIZE_NEW_DATABASE" => [300, "This is a write-only transaction which sets the initial configuration. This option is designed for use by database system tools only.", nil, nil],
80
82
  "ACCESS_SYSTEM_KEYS" => [301, "Allows this transaction to read and modify system keys (those that start with the byte 0xFF)", nil, nil],
81
83
  "READ_SYSTEM_KEYS" => [302, "Allows this transaction to read system keys (those that start with the byte 0xFF)", nil, nil],
82
84
  "DEBUG_RETRY_LOGGING" => [401, "", '', "Optional transaction name"],
83
- "TRANSACTION_LOGGING_ENABLE" => [402, "Enables tracing for this transaction and logs results to the client trace logs. Client trace logging must be enabled to get log output.", '', "String identifier to be used in the logs when tracing this transaction. The identifier must not exceed 100 characters."],
84
- "TIMEOUT" => [500, "Set a timeout in milliseconds which, when elapsed, will cause the transaction automatically to be cancelled. Valid parameter values are ``[0, INT_MAX]``. If set to 0, will disable all timeouts. All pending and any future uses of the transaction will throw an exception. The transaction can be used again after it is reset. Like all transaction options, a timeout must be reset after a call to onError. This behavior allows the user to make the timeout dynamic.", 0, "value in milliseconds of timeout"],
85
- "RETRY_LIMIT" => [501, "Set a maximum number of retries after which additional calls to onError will throw the most recently seen error code. Valid parameter values are ``[-1, INT_MAX]``. If set to -1, will disable the retry limit. Like all transaction options, the retry limit must be reset after a call to onError. This behavior allows the user to make the retry limit dynamic.", 0, "number of times to retry"],
86
- "MAX_RETRY_DELAY" => [502, "Set the maximum amount of backoff delay incurred in the call to onError if the error is retryable. Defaults to 1000 ms. Valid parameter values are ``[0, INT_MAX]``. Like all transaction options, the maximum retry delay must be reset after a call to onError. If the maximum retry delay is less than the current retry delay of the transaction, then the current retry delay will be clamped to the maximum retry delay.", 0, "value in milliseconds of maximum delay"],
87
- "SNAPSHOT_RYW_ENABLE" => [600, "Snapshot read operations will see the results of writes done in the same transaction.", nil, nil],
88
- "SNAPSHOT_RYW_DISABLE" => [601, "Snapshot read operations will not see the results of writes done in the same transaction.", nil, nil],
85
+ "TRANSACTION_LOGGING_ENABLE" => [402, "Deprecated", '', "String identifier to be used in the logs when tracing this transaction. The identifier must not exceed 100 characters."],
86
+ "DEBUG_TRANSACTION_IDENTIFIER" => [403, "Sets a client provided identifier for the transaction that will be used in scenarios like tracing or profiling. Client trace logging or transaction profiling must be separately enabled.", '', "String identifier to be used when tracing or profiling this transaction. The identifier must not exceed 100 characters."],
87
+ "LOG_TRANSACTION" => [404, "Enables tracing for this transaction and logs results to the client trace logs. The DEBUG_TRANSACTION_IDENTIFIER option must be set before using this option, and client trace logging must be enabled and to get log output.", nil, nil],
88
+ "TIMEOUT" => [500, "Set a timeout in milliseconds which, when elapsed, will cause the transaction automatically to be cancelled. Valid parameter values are ``[0, INT_MAX]``. If set to 0, will disable all timeouts. All pending and any future uses of the transaction will throw an exception. The transaction can be used again after it is reset. Prior to API version 610, like all other transaction options, the timeout must be reset after a call to ``onError``. If the API version is 610 or greater, the timeout is not reset after an ``onError`` call. This allows the user to specify a longer timeout on specific transactions than the default timeout specified through the ``transaction_timeout`` database option without the shorter database timeout cancelling transactions that encounter a retryable error. Note that at all API versions, it is safe and legal to set the timeout each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option.", 0, "value in milliseconds of timeout"],
89
+ "RETRY_LIMIT" => [501, "Set a maximum number of retries after which additional calls to ``onError`` will throw the most recently seen error code. Valid parameter values are ``[-1, INT_MAX]``. If set to -1, will disable the retry limit. Prior to API version 610, like all other transaction options, the retry limit must be reset after a call to ``onError``. If the API version is 610 or greater, the retry limit is not reset after an ``onError`` call. Note that at all API versions, it is safe and legal to set the retry limit each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option.", 0, "number of times to retry"],
90
+ "MAX_RETRY_DELAY" => [502, "Set the maximum amount of backoff delay incurred in the call to ``onError`` if the error is retryable. Defaults to 1000 ms. Valid parameter values are ``[0, INT_MAX]``. If the maximum retry delay is less than the current retry delay of the transaction, then the current retry delay will be clamped to the maximum retry delay. Prior to API version 610, like all other transaction options, the maximum retry delay must be reset after a call to ``onError``. If the API version is 610 or greater, the retry limit is not reset after an ``onError`` call. Note that at all API versions, it is safe and legal to set the maximum retry delay each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option.", 0, "value in milliseconds of maximum delay"],
91
+ "SNAPSHOT_RYW_ENABLE" => [600, "Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior.", nil, nil],
92
+ "SNAPSHOT_RYW_DISABLE" => [601, "Snapshot read operations will not see the results of writes done in the same transaction. This was the default behavior prior to API version 300.", nil, nil],
89
93
  "LOCK_AWARE" => [700, "The transaction can read and write to locked databases, and is resposible for checking that it took the lock.", nil, nil],
90
94
  "USED_DURING_COMMIT_PROTECTION_DISABLE" => [701, "By default, operations that are performed on a transaction while it is being committed will not only fail themselves, but they will attempt to fail other in-flight operations (such as the commit) as well. This behavior is intended to help developers discover situations where operations could be unintentionally executed after the transaction has been reset. Setting this option removes that protection, causing only the offending operation to fail.", nil, nil],
91
95
  "READ_LOCK_AWARE" => [702, "The transaction can read from locked databases.", nil, nil],
96
+ "USE_PROVISIONAL_PROXIES" => [711, "This option should only be used by tools which change the database configuration.", nil, nil],
92
97
  }
93
98
 
94
99
  @@StreamingMode = {
@@ -112,10 +117,11 @@ module FDB
112
117
  "APPEND_IF_FITS" => [9, "Appends ``param`` to the end of the existing value already in the database at the given key (or creates the key and sets the value to ``param`` if the key is empty). This will only append the value if the final concatenated value size is less than or equal to the maximum value size (i.e., if it fits). WARNING: No error is surfaced back to the user if the final value is too large because the mutation will not be applied until after the transaction has been committed. Therefore, it is only safe to use this mutation type if one can guarantee that one will keep the total value size under the maximum size.", '', "value to append to the database value"],
113
118
  "MAX" => [12, "Performs a little-endian comparison of byte strings. If the existing value in the database is not present or shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. The larger of the two values is then stored in the database.", '', "value to check against database value"],
114
119
  "MIN" => [13, "Performs a little-endian comparison of byte strings. If the existing value in the database is not present, then ``param`` is stored in the database. If the existing value in the database is shorter than ``param``, it is first extended to the length of ``param`` with zero bytes. If ``param`` is shorter than the existing value in the database, the existing value is truncated to match the length of ``param``. The smaller of the two values is then stored in the database.", '', "value to check against database value"],
115
- "SET_VERSIONSTAMPED_KEY" => [14, "Transforms ``key`` using a versionstamp for the transaction. Sets the transformed key in the database to ``param``. The key is transformed by removing the final four bytes from the key and reading those as a little-Endian 32-bit integer to get a position ``pos``. The 10 bytes of the key from ``pos`` to ``pos + 10`` are replaced with the versionstamp of the transaction used. The first byte of the key is position 0. A versionstamp is a 10 byte, unique, monotonically (but not sequentially) increasing value for each committed transaction. The first 8 bytes are the committed version of the database (serialized in big-Endian order). The last 2 bytes are monotonic in the serialization order for transactions. WARNING: At this time, versionstamps are compatible with the Tuple layer only in the Java and Python bindings. Also, note that prior to API version 520, the offset was computed from only the final two bytes rather than the final four bytes.", '', "value to which to set the transformed key"],
116
- "SET_VERSIONSTAMPED_VALUE" => [15, "Transforms ``param`` using a versionstamp for the transaction. Sets the ``key`` given to the transformed ``param``. The parameter is transformed by removing the final four bytes from ``param`` and reading those as a little-Endian 32-bit integer to get a position ``pos``. The 10 bytes of the parameter from ``pos`` to ``pos + 10`` are replaced with the versionstamp of the transaction used. The first byte of the parameter is position 0. A versionstamp is a 10 byte, unique, monotonically (but not sequentially) increasing value for each committed transaction. The first 8 bytes are the committed version of the database (serialized in big-Endian order). The last 2 bytes are monotonic in the serialization order for transactions. WARNING: At this time, versionstamps are compatible with the Tuple layer only in the Java and Python bindings. Also, note that prior to API version 520, the versionstamp was always placed at the beginning of the parameter rather than computing an offset.", '', "value to versionstamp and set"],
120
+ "SET_VERSIONSTAMPED_KEY" => [14, "Transforms ``key`` using a versionstamp for the transaction. Sets the transformed key in the database to ``param``. The key is transformed by removing the final four bytes from the key and reading those as a little-Endian 32-bit integer to get a position ``pos``. The 10 bytes of the key from ``pos`` to ``pos + 10`` are replaced with the versionstamp of the transaction used. The first byte of the key is position 0. A versionstamp is a 10 byte, unique, monotonically (but not sequentially) increasing value for each committed transaction. The first 8 bytes are the committed version of the database (serialized in big-Endian order). The last 2 bytes are monotonic in the serialization order for transactions. WARNING: At this time, versionstamps are compatible with the Tuple layer only in the Java, Python, and Go bindings. Also, note that prior to API version 520, the offset was computed from only the final two bytes rather than the final four bytes.", '', "value to which to set the transformed key"],
121
+ "SET_VERSIONSTAMPED_VALUE" => [15, "Transforms ``param`` using a versionstamp for the transaction. Sets the ``key`` given to the transformed ``param``. The parameter is transformed by removing the final four bytes from ``param`` and reading those as a little-Endian 32-bit integer to get a position ``pos``. The 10 bytes of the parameter from ``pos`` to ``pos + 10`` are replaced with the versionstamp of the transaction used. The first byte of the parameter is position 0. A versionstamp is a 10 byte, unique, monotonically (but not sequentially) increasing value for each committed transaction. The first 8 bytes are the committed version of the database (serialized in big-Endian order). The last 2 bytes are monotonic in the serialization order for transactions. WARNING: At this time, versionstamps are compatible with the Tuple layer only in the Java, Python, and Go bindings. Also, note that prior to API version 520, the versionstamp was always placed at the beginning of the parameter rather than computing an offset.", '', "value to versionstamp and set"],
117
122
  "BYTE_MIN" => [16, "Performs lexicographic comparison of byte strings. If the existing value in the database is not present, then ``param`` is stored. Otherwise the smaller of the two values is then stored in the database.", '', "value to check against database value"],
118
123
  "BYTE_MAX" => [17, "Performs lexicographic comparison of byte strings. If the existing value in the database is not present, then ``param`` is stored. Otherwise the larger of the two values is then stored in the database.", '', "value to check against database value"],
124
+ "COMPARE_AND_CLEAR" => [20, "Performs an atomic ``compare and clear`` operation. If the existing value in the database is equal to the given value, then given key is cleared.", '', "Value to compare with"],
119
125
  }
120
126
 
121
127
  @@ConflictRangeType = {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.18
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - FoundationDB
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-09 00:00:00.000000000 Z
11
+ date: 2019-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -38,6 +38,7 @@ files:
38
38
  - lib/fdb.rb
39
39
  - lib/fdbdirectory.rb
40
40
  - lib/fdbimpl.rb
41
+ - lib/fdbimpl_v609.rb
41
42
  - lib/fdblocality.rb
42
43
  - lib/fdboptions.rb
43
44
  - lib/fdbsubspace.rb