fdb 6.1.13 → 6.2.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: 8b05824e2668aa4eb37a31a62db1618620d303fb
4
- data.tar.gz: e7006cb4e9793e06ee32218d5495509542c748b2
3
+ metadata.gz: 47992c364264d8f965cf613fca1d6c810cff9434
4
+ data.tar.gz: '076328f3d2bac06bcfbcfade01fdcc84f3a6c670'
5
5
  SHA512:
6
- metadata.gz: 60e3efa1edc1130b1de13d56174e94fe70b03099de89f09d693583275e59617edba9e1e3f841ce03cd624fcbbce3a184b92aeb0d540c3f41d866c6482d557562
7
- data.tar.gz: 53e0ea83a4545022a8954e7b53073abd2ab45bf55776a852cf71ee2b7dd83062cf4a718f4e493372546250774e1e8ce0ab015c90026b8d453c0389ec03de0274
6
+ metadata.gz: 1fa711743166c035dcfd073e687fbd1fad55da60e1be13f2195d1850f190079fc8b8e44bacebb34e1e7f2de9330e5204dfb5fb956f14a9731015416e05f66cbd
7
+ data.tar.gz: 1b1cff2b3a35bb8d59a7c6a2798c62a8c7e7aa2f201af83dd4b9eaec3ccf0715210c6025a25dc03f61ba3df7965f719e763f87d199efd58ec461a60b4ae4bed3
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 = 610
39
+ header_version = 620
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}."
data/lib/fdbimpl.rb CHANGED
@@ -85,7 +85,7 @@ module FDB
85
85
  attach_function :fdb_future_set_callback, [ :pointer, :fdb_future_callback, :pointer ], :fdb_error
86
86
 
87
87
  attach_function :fdb_future_get_error, [ :pointer ], :fdb_error
88
- attach_function :fdb_future_get_version, [ :pointer, :pointer ], :fdb_error
88
+ attach_function :fdb_future_get_int64, [ :pointer, :pointer ], :fdb_error
89
89
  attach_function :fdb_future_get_key, [ :pointer, :pointer, :pointer ], :fdb_error
90
90
  attach_function :fdb_future_get_value, [ :pointer, :pointer, :pointer, :pointer ], :fdb_error
91
91
  attach_function :fdb_future_get_keyvalue_array, [ :pointer, :pointer, :pointer, :pointer ], :fdb_error
@@ -114,6 +114,7 @@ module FDB
114
114
  attach_function :fdb_transaction_watch, [ :pointer, :pointer, :int ], :pointer
115
115
  attach_function :fdb_transaction_commit, [ :pointer ], :pointer
116
116
  attach_function :fdb_transaction_get_committed_version, [ :pointer, :pointer ], :fdb_error
117
+ attach_function :fdb_transaction_get_approximate_size, [ :pointer ], :pointer
117
118
  attach_function :fdb_transaction_get_versionstamp, [ :pointer ], :pointer
118
119
  attach_function :fdb_transaction_on_error, [ :pointer, :fdb_error ], :pointer
119
120
  attach_function :fdb_transaction_reset, [ :pointer ], :void
@@ -443,11 +444,11 @@ module FDB
443
444
  end
444
445
  end
445
446
 
446
- class Version < LazyFuture
447
+ class Int64Future < LazyFuture
447
448
  def getter
448
- version = FFI::MemoryPointer.new :int64
449
- FDBC.check_error FDBC.fdb_future_get_version(@fpointer, version)
450
- @value = version.read_long_long
449
+ val = FFI::MemoryPointer.new :int64
450
+ FDBC.check_error FDBC.fdb_future_get_int64(@fpointer, val)
451
+ @value = val.read_long_long
451
452
  end
452
453
  private :getter
453
454
  end
@@ -687,7 +688,7 @@ module FDB
687
688
  end
688
689
 
689
690
  def get_read_version
690
- Version.new(FDBC.fdb_transaction_get_read_version @tpointer)
691
+ Int64Future.new(FDBC.fdb_transaction_get_read_version @tpointer)
691
692
  end
692
693
 
693
694
  def get(key)
@@ -904,6 +905,10 @@ module FDB
904
905
  version.read_long_long
905
906
  end
906
907
 
908
+ def get_approximate_size
909
+ Int64Future.new(FDBC.fdb_transaction_get_approximate_size @tpointer)
910
+ end
911
+
907
912
  def get_versionstamp
908
913
  Key.new(FDBC.fdb_transaction_get_versionstamp(@tpointer))
909
914
  end
data/lib/fdblocality.rb CHANGED
@@ -64,7 +64,7 @@ module FDB
64
64
  end
65
65
  _bkey = _ekey
66
66
  rescue FDB::Error => e
67
- if e.code == 1007 and _bkey != _lastbkey # if we get a past_version and *something* has happened, then we are no longer transactional
67
+ if e.code == 1007 and _bkey != _lastbkey # if we get a transaction_too_old and *something* has happened, then we are no longer transactional
68
68
  _tr = _tr.db.create_transaction
69
69
  else
70
70
  _tr.on_error(e).wait
data/lib/fdboptions.rb CHANGED
@@ -52,6 +52,10 @@ module FDB
52
52
  "DISABLE_LOCAL_CLIENT" => [64, "Prevents connections through the local client, allowing only connections through externally loaded client libraries. Intended primarily for testing.", nil, nil],
53
53
  "DISABLE_CLIENT_STATISTICS_LOGGING" => [70, "Disables logging of client statistics, such as sampled transaction activity.", nil, nil],
54
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],
55
+ "CLIENT_BUGGIFY_ENABLE" => [80, "Enable client buggify - will make requests randomly fail (intended for client testing)", nil, nil],
56
+ "CLIENT_BUGGIFY_DISABLE" => [81, "Disable client buggify", nil, nil],
57
+ "CLIENT_BUGGIFY_SECTION_ACTIVATED_PROBABILITY" => [82, "Set the probability of a CLIENT_BUGGIFY section being active for the current execution.", 0, "probability expressed as a percentage between 0 and 100"],
58
+ "CLIENT_BUGGIFY_SECTION_FIRED_PROBABILITY" => [83, "Set the probability of an active CLIENT_BUGGIFY section being fired. A section will only fire if it was activated", 0, "probability expressed as a percentage between 0 and 100"],
55
59
  }
56
60
 
57
61
  @@DatabaseOption = {
@@ -59,16 +63,19 @@ module FDB
59
63
  "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"],
60
64
  "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"],
61
65
  "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"],
66
+ "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],
67
+ "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],
68
+ "TRANSACTION_LOGGING_MAX_FIELD_LENGTH" => [405, "Sets the maximum escaped length of key and value fields to be logged to the trace file via the LOG_TRANSACTION option. This sets the ``transaction_logging_max_field_length`` option of each transaction created by this database. See the transaction option description for more information.", 0, "Maximum length of escaped key and value fields."],
62
69
  "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
70
  "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
71
  "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],
72
+ "TRANSACTION_SIZE_LIMIT" => [503, "Set the maximum transaction size in bytes. This sets the ``size_limit`` option on each transaction created by this database. See the transaction option description for more information.", 0, "value in bytes"],
73
+ "TRANSACTION_CAUSAL_READ_RISKY" => [504, "The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock.", nil, nil],
67
74
  }
68
75
 
69
76
  @@TransactionOption = {
70
77
  "CAUSAL_WRITE_RISKY" => [10, "The transaction, if not self-conflicting, may be committed a second time after commit succeeds, in the event of a fault", nil, nil],
71
- "CAUSAL_READ_RISKY" => [20, "The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a fault or partition", nil, nil],
78
+ "CAUSAL_READ_RISKY" => [20, "The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock.", nil, nil],
72
79
  "CAUSAL_READ_DISABLE" => [21, "", nil, nil],
73
80
  "NEXT_WRITE_NO_WRITE_CONFLICT_RANGE" => [30, "The next write performed on this transaction will not generate a write conflict range. As a result, other transactions which read the key(s) being modified by the next write will not conflict with this transaction. Care needs to be taken when using this option on a transaction that is shared between multiple threads. When setting this option, write conflict ranges will be disabled on the next write operation, regardless of what thread it is on.", nil, nil],
74
81
  "READ_YOUR_WRITES_DISABLE" => [51, "Reads performed by a transaction will not see any prior mutations that occured in that transaction, instead seeing the value which was in the database at the transaction's read version. This option may provide a small performance benefit for the client, but also disables a number of client-side optimizations which are beneficial for transactions which tend to read and write the same keys within a single transaction.", nil, nil],
@@ -85,9 +92,11 @@ module FDB
85
92
  "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
93
  "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
94
  "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],
95
+ "TRANSACTION_LOGGING_MAX_FIELD_LENGTH" => [405, "Sets the maximum escaped length of key and value fields to be logged to the trace file via the LOG_TRANSACTION option, after which the field will be truncated. A negative value disables truncation.", 0, "Maximum length of escaped key and value fields."],
88
96
  "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
97
  "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
98
  "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"],
99
+ "SIZE_LIMIT" => [503, "Set the transaction size limit in bytes. The size is calculated by combining the sizes of all keys and values written or mutated, all key ranges cleared, and all read and write conflict ranges. (In other words, it includes the total size of all data included in the request to the cluster to commit the transaction.) Large transactions can cause performance problems on FoundationDB clusters, so setting this limit to a smaller value than the default can help prevent the client from accidentally degrading the cluster's performance. This value must be at least 32 and cannot be set to higher than 10,000,000, the default transaction size limit.", 0, "value in bytes"],
91
100
  "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
101
  "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],
93
102
  "LOCK_AWARE" => [700, "The transaction can read and write to locked databases, and is resposible for checking that it took the lock.", nil, nil],
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.1.13
4
+ version: 6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - FoundationDB
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-24 00:00:00.000000000 Z
11
+ date: 2019-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -65,7 +65,7 @@ requirements:
65
65
  - These bindings require the FoundationDB client. The client can be obtained from
66
66
  https://www.foundationdb.org/download/.
67
67
  rubyforge_project:
68
- rubygems_version: 2.2.2
68
+ rubygems_version: 2.6.14.3
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: Ruby bindings for the FoundationDB database