mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-15 02:18:39 +08:00
Added fdbcli getversion command
This commit is contained in:
parent
f92ef730a4
commit
bee6acb717
@ -162,6 +162,11 @@ The ``getrangekeys`` command fetches keys in a range. Its syntax is ``getrangeke
|
||||
|
||||
Note that :ref:`characters can be escaped <cli-escaping>` when specifying keys (or values) in ``fdbcli``.
|
||||
|
||||
getversion
|
||||
----------
|
||||
|
||||
The ``getversion`` command fetches the current read version of the cluster or currently running transaction.
|
||||
|
||||
help
|
||||
----
|
||||
|
||||
|
@ -522,6 +522,9 @@ void initHelp() {
|
||||
"getrangekeys <BEGINKEY> [ENDKEY] [LIMIT]",
|
||||
"fetch keys in a range of keys",
|
||||
"Displays up to LIMIT keys for keys between BEGINKEY (inclusive) and ENDKEY (exclusive). If ENDKEY is omitted, then the range will include all keys starting with BEGINKEY. LIMIT defaults to 25 if omitted." ESCAPINGK);
|
||||
helpMap["getversion"] =
|
||||
CommandHelp("getversion", "Fetch the current read version",
|
||||
"Displays the current read version of the database or currently running transaction.");
|
||||
helpMap["reset"] = CommandHelp(
|
||||
"reset",
|
||||
"reset the current transaction",
|
||||
@ -3065,6 +3068,17 @@ ACTOR Future<int> cli(CLIOptions opt, LineNoise* plinenoise) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tokencmp(tokens[0], "getversion")) {
|
||||
if (tokens.size() != 1) {
|
||||
printUsage(tokens[0]);
|
||||
is_error = true;
|
||||
} else {
|
||||
Version v = wait(makeInterruptable(getTransaction(db, tr, options, intrans)->getReadVersion()));
|
||||
printf("%ld\n", v);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tokencmp(tokens[0], "kill")) {
|
||||
getTransaction(db, tr, options, intrans);
|
||||
if (tokens.size() == 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user