diff --git a/bindings/c/test/mako/mako.c b/bindings/c/test/mako/mako.c index bfccdb9594..49b1f399da 100755 --- a/bindings/c/test/mako/mako.c +++ b/bindings/c/test/mako/mako.c @@ -290,13 +290,13 @@ int64_t run_op_getreadversion(FDBTransaction *transaction) { } while (err && retry--); if (err) { - fprintf(stderr, "ERROR: fdb_transaction_get_version: %s\n", fdb_get_error(err)); + fprintf(stderr, "ERROR: fdb_transaction_get_read_version: %s\n", fdb_get_error(err)); return -1; } - err = fdb_future_get_version(f, &rv); + err = fdb_future_get_int64(f, &rv); if (err) { - fprintf(stderr, "ERROR: fdb_future_get_version: %s\n", fdb_get_error(err)); + fprintf(stderr, "ERROR: fdb_future_get_int64: %s\n", fdb_get_error(err)); } fdb_future_destroy(f); return rv; diff --git a/bindings/c/test/ryw_benchmark.c b/bindings/c/test/ryw_benchmark.c index 55d62b1d50..7511b1eaf1 100644 --- a/bindings/c/test/ryw_benchmark.c +++ b/bindings/c/test/ryw_benchmark.c @@ -224,7 +224,7 @@ void runTests(struct ResultSet *rs) { checkError(fdb_future_block_until_ready(f), "block for read version", rs); int64_t version; - checkError(fdb_future_get_version(f, &version), "get version", rs); + checkError(fdb_future_get_int64(f, &version), "get version", rs); fdb_future_destroy(f); insertData(tr); diff --git a/bindings/python/fdb/impl.py b/bindings/python/fdb/impl.py index a0704fc5b5..c7d33f0fe9 100644 --- a/bindings/python/fdb/impl.py +++ b/bindings/python/fdb/impl.py @@ -405,7 +405,7 @@ class TransactionRead(_FDBBase): def get_read_version(self): """Get the read version of the transaction.""" - return FutureVersion(self.capi.fdb_transaction_get_read_version(self.tpointer)) + return FutureInt64(self.capi.fdb_transaction_get_read_version(self.tpointer)) def get(self, key): key = keyToBytes(key) @@ -691,14 +691,6 @@ class FutureVoid(Future): return None -class FutureVersion(Future): - def wait(self): - self.block_until_ready() - version = ctypes.c_int64() - self.capi.fdb_future_get_int64(self.fpointer, ctypes.byref(version)) - return version.value - - class FutureInt64(Future): def wait(self): self.block_until_ready() diff --git a/documentation/sphinx/source/api-c.rst b/documentation/sphinx/source/api-c.rst index ea3331ae28..9fc8149116 100644 --- a/documentation/sphinx/source/api-c.rst +++ b/documentation/sphinx/source/api-c.rst @@ -289,12 +289,6 @@ See :ref:`developer-guide-programming-with-futures` for further (language-indepe |future-get-return1|. -.. function:: fdb_error_t fdb_future_get_version(FDBFuture* future, int64_t* out_version) - - Extracts a version from an :type:`FDBFuture` into a caller-provided variable of type ``int64_t``. |future-warning| - - |future-get-return1| |future-get-return2|. - .. function:: fdb_error_t fdb_future_get_int64(FDBFuture* future, int64_t* out) Extracts a 64-bit integer from an :type:`FDBFuture*` into a caller-provided variable of type ``int64_t``. |future-warning| @@ -451,7 +445,7 @@ Applications must provide error handling and an appropriate retry loop around th .. function:: FDBFuture* fdb_transaction_get_read_version(FDBTransaction* transaction) - |future-return0| the transaction snapshot read version. |future-return1| call :func:`fdb_future_get_version()` to extract the version into an int64_t that you provide, |future-return2| + |future-return0| the transaction snapshot read version. |future-return1| call :func:`fdb_future_get_int64()` to extract the version into an int64_t that you provide, |future-return2| The transaction obtains a snapshot read version automatically at the time of the first call to :func:`fdb_transaction_get_*()` (including this one) and (unless causal consistency has been deliberately compromised by transaction options) is guaranteed to represent all transactions which were reported committed before that call. diff --git a/fdbclient/MultiVersionTransaction.actor.cpp b/fdbclient/MultiVersionTransaction.actor.cpp index 80c47d402b..fbf7663aa2 100644 --- a/fdbclient/MultiVersionTransaction.actor.cpp +++ b/fdbclient/MultiVersionTransaction.actor.cpp @@ -47,7 +47,7 @@ ThreadFuture DLTransaction::getReadVersion() { return toThreadFuture(api, f, [](FdbCApi::FDBFuture *f, FdbCApi *api) { int64_t version; - FdbCApi::fdb_error_t error = api->futureGetVersion(f, &version); + FdbCApi::fdb_error_t error = api->futureGetInt64(f, &version); ASSERT(!error); return version; }); @@ -309,8 +309,7 @@ void DLApi::init() { loadClientFunction(&api->transactionAddConflictRange, lib, fdbCPath, "fdb_transaction_add_conflict_range"); loadClientFunction(&api->futureGetDatabase, lib, fdbCPath, "fdb_future_get_database"); - loadClientFunction(&api->futureGetVersion, lib, fdbCPath, "fdb_future_get_version", headerVersion < 620); - loadClientFunction(&api->futureGetInt64, lib, fdbCPath, "fdb_future_get_int64", headerVersion >= 620); + loadClientFunction(&api->futureGetInt64, lib, fdbCPath, headerVersion >= 620 ? "fdb_future_get_int64" : "fdb_future_get_version"); loadClientFunction(&api->futureGetError, lib, fdbCPath, "fdb_future_get_error"); loadClientFunction(&api->futureGetKey, lib, fdbCPath, "fdb_future_get_key"); loadClientFunction(&api->futureGetValue, lib, fdbCPath, "fdb_future_get_value"); diff --git a/fdbclient/MultiVersionTransaction.h b/fdbclient/MultiVersionTransaction.h index 94cd6462e5..e71f6e895f 100644 --- a/fdbclient/MultiVersionTransaction.h +++ b/fdbclient/MultiVersionTransaction.h @@ -95,7 +95,6 @@ struct FdbCApi : public ThreadSafeReferenceCounted { //Future fdb_error_t (*futureGetDatabase)(FDBFuture *f, FDBDatabase **outDb); - fdb_error_t (*futureGetVersion)(FDBFuture *f, int64_t *outVersion); fdb_error_t (*futureGetInt64)(FDBFuture *f, int64_t *outValue); fdb_error_t (*futureGetError)(FDBFuture *f); fdb_error_t (*futureGetKey)(FDBFuture *f, uint8_t const **outKey, int *outKeyLength);