Remove some usages of PRId64 by using fmt library
This commit is contained in:
parent
e9567b1eeb
commit
ec64890ac1
|
@ -24,6 +24,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "flow/DeterministicRandom.h"
|
#include "flow/DeterministicRandom.h"
|
||||||
#include "flow/SystemMonitor.h"
|
#include "flow/SystemMonitor.h"
|
||||||
#include "flow/TLSConfig.actor.h"
|
#include "flow/TLSConfig.actor.h"
|
||||||
|
@ -44,7 +45,7 @@ ACTOR Future<Void> _test() {
|
||||||
// tr->setVersion(1);
|
// tr->setVersion(1);
|
||||||
|
|
||||||
Version ver = wait(tr->getReadVersion());
|
Version ver = wait(tr->getReadVersion());
|
||||||
printf("%" PRId64 "\n", ver);
|
fmt::print("{}\n", ver);
|
||||||
|
|
||||||
state std::vector<Future<Version>> versions;
|
state std::vector<Future<Version>> versions;
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbbackup/BackupTLSConfig.h"
|
#include "fdbbackup/BackupTLSConfig.h"
|
||||||
#include "fdbclient/JsonBuilder.h"
|
#include "fdbclient/JsonBuilder.h"
|
||||||
#include "flow/Arena.h"
|
#include "flow/Arena.h"
|
||||||
|
@ -2309,7 +2310,7 @@ ACTOR Future<Void> runRestore(Database db,
|
||||||
|
|
||||||
origDb = Database::createDatabase(originalClusterFile, Database::API_VERSION_LATEST);
|
origDb = Database::createDatabase(originalClusterFile, Database::API_VERSION_LATEST);
|
||||||
Version v = wait(timeKeeperVersionFromDatetime(targetTimestamp, origDb.get()));
|
Version v = wait(timeKeeperVersionFromDatetime(targetTimestamp, origDb.get()));
|
||||||
printf("Timestamp '%s' resolves to version %" PRId64 "\n", targetTimestamp.c_str(), v);
|
fmt::print("Timestamp '{0}' resolves to version {1}\n", targetTimestamp, v);
|
||||||
targetVersion = v;
|
targetVersion = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2336,8 +2337,9 @@ ACTOR Future<Void> runRestore(Database db,
|
||||||
throw restore_error();
|
throw restore_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose)
|
if (verbose) {
|
||||||
printf("Using target restore version %" PRId64 "\n", targetVersion);
|
fmt::print("Ussing target restore version {}\n", targetVersion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (performRestore) {
|
if (performRestore) {
|
||||||
|
@ -2359,19 +2361,19 @@ ACTOR Future<Void> runRestore(Database db,
|
||||||
|
|
||||||
if (waitForDone && verbose) {
|
if (waitForDone && verbose) {
|
||||||
// If restore is now complete then report version restored
|
// If restore is now complete then report version restored
|
||||||
printf("Restored to version %" PRId64 "\n", restoredVersion);
|
fmt::print("Restored to version {}\n", restoredVersion);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
state Optional<RestorableFileSet> rset = wait(bc->getRestoreSet(targetVersion, ranges));
|
state Optional<RestorableFileSet> rset = wait(bc->getRestoreSet(targetVersion, ranges));
|
||||||
|
|
||||||
if (!rset.present()) {
|
if (!rset.present()) {
|
||||||
fprintf(stderr,
|
fmt::print(stderr,
|
||||||
"Insufficient data to restore to version %" PRId64 ". Describe backup for more information.\n",
|
"Insufficient data to restore to version {}. Describe backup for more information.\n",
|
||||||
targetVersion);
|
targetVersion);
|
||||||
throw restore_invalid_version();
|
throw restore_invalid_version();
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Backup can be used to restore to version %" PRId64 "\n", targetVersion);
|
fmt::print("Backup can be used to restore to version {}\n", targetVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Error& e) {
|
} catch (Error& e) {
|
||||||
|
@ -2472,20 +2474,20 @@ ACTOR Future<Void> runFastRestoreTool(Database db,
|
||||||
|
|
||||||
state Optional<RestorableFileSet> rset = wait(bc->getRestoreSet(restoreVersion));
|
state Optional<RestorableFileSet> rset = wait(bc->getRestoreSet(restoreVersion));
|
||||||
if (!rset.present()) {
|
if (!rset.present()) {
|
||||||
fprintf(stderr, "Insufficient data to restore to version %" PRId64 "\n", restoreVersion);
|
fmt::print(stderr, "Insufficient data to restore to version {}\n", restoreVersion);
|
||||||
throw restore_invalid_version();
|
throw restore_invalid_version();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display the restore information, if requested
|
// Display the restore information, if requested
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
printf("[DRY RUN] Restoring backup to version: %" PRId64 "\n", restoreVersion);
|
fmt::print("[DRY RUN] Restoring backup to version: {}\n", restoreVersion);
|
||||||
printf("%s\n", description.toString().c_str());
|
fmt::print("{}\n", description.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (waitForDone && verbose) {
|
if (waitForDone && verbose) {
|
||||||
// If restore completed then report version restored
|
// If restore completed then report version restored
|
||||||
printf("Restored to version %" PRId64 "%s\n", restoreVersion, (performRestore) ? "" : " (DRY RUN)");
|
fmt::print("Restored to version {0}{1}\n", restoreVersion, (performRestore) ? "" : " (DRY RUN)");
|
||||||
}
|
}
|
||||||
} catch (Error& e) {
|
} catch (Error& e) {
|
||||||
if (e.code() == error_code_actor_cancelled)
|
if (e.code() == error_code_actor_cancelled)
|
||||||
|
@ -2520,7 +2522,7 @@ ACTOR Future<Void> dumpBackupData(const char* name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Scanning version range %" PRId64 " to %" PRId64 "\n", beginVersion, endVersion);
|
fmt::print("Scanning version range {0} to {1}\n", beginVersion, endVersion);
|
||||||
BackupFileList files = wait(c->dumpFileList(beginVersion, endVersion));
|
BackupFileList files = wait(c->dumpFileList(beginVersion, endVersion));
|
||||||
files.toStream(stdout);
|
files.toStream(stdout);
|
||||||
|
|
||||||
|
@ -2579,12 +2581,12 @@ ACTOR Future<Void> expireBackupData(const char* name,
|
||||||
printf("\r%s%s\n", p.c_str(), (spaces > 0 ? std::string(spaces, ' ').c_str() : ""));
|
printf("\r%s%s\n", p.c_str(), (spaces > 0 ? std::string(spaces, ' ').c_str() : ""));
|
||||||
|
|
||||||
if (endVersion < 0)
|
if (endVersion < 0)
|
||||||
printf("All data before %" PRId64 " versions (%" PRId64
|
fmt::print("All data before {0} versions ({1}"
|
||||||
" days) prior to latest backup log has been deleted.\n",
|
" days) prior to latest backup log has been deleted.\n",
|
||||||
-endVersion,
|
-endVersion,
|
||||||
-endVersion / ((int64_t)24 * 3600 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND));
|
-endVersion / ((int64_t)24 * 3600 * CLIENT_KNOBS->CORE_VERSIONSPERSECOND));
|
||||||
else
|
else
|
||||||
printf("All data before version %" PRId64 " has been deleted.\n", endVersion);
|
fmt::print("All data before version {} has been deleted.\n", endVersion);
|
||||||
} catch (Error& e) {
|
} catch (Error& e) {
|
||||||
if (e.code() == error_code_actor_cancelled)
|
if (e.code() == error_code_actor_cancelled)
|
||||||
throw;
|
throw;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
|
||||||
#include "boost/lexical_cast.hpp"
|
#include "boost/lexical_cast.hpp"
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
|
|
||||||
#include "fdbcli/fdbcli.actor.h"
|
#include "fdbcli/fdbcli.actor.h"
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@ ACTOR Future<Void> printHealthyZone(Reference<IDatabase> db) {
|
||||||
} else {
|
} else {
|
||||||
std::string zoneId = res[0].key.removePrefix(fdb_cli::maintenanceSpecialKeyRange.begin).toString();
|
std::string zoneId = res[0].key.removePrefix(fdb_cli::maintenanceSpecialKeyRange.begin).toString();
|
||||||
int64_t seconds = static_cast<int64_t>(boost::lexical_cast<double>(res[0].value.toString()));
|
int64_t seconds = static_cast<int64_t>(boost::lexical_cast<double>(res[0].value.toString()));
|
||||||
printf("Maintenance for zone %s will continue for %" PRId64 " seconds.\n", zoneId.c_str(), seconds);
|
fmt::print("Maintenance for zone {0} will continue for {1} seconds.\n", zoneId, seconds);
|
||||||
}
|
}
|
||||||
return Void();
|
return Void();
|
||||||
} catch (Error& e) {
|
} catch (Error& e) {
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "boost/lexical_cast.hpp"
|
#include "boost/lexical_cast.hpp"
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbclient/ClusterConnectionFile.h"
|
#include "fdbclient/ClusterConnectionFile.h"
|
||||||
#include "fdbclient/NativeAPI.actor.h"
|
#include "fdbclient/NativeAPI.actor.h"
|
||||||
#include "fdbclient/FDBTypes.h"
|
#include "fdbclient/FDBTypes.h"
|
||||||
|
@ -631,9 +632,9 @@ ACTOR Future<Void> commitTransaction(Reference<ITransaction> tr) {
|
||||||
wait(makeInterruptable(safeThreadFutureToFuture(tr->commit())));
|
wait(makeInterruptable(safeThreadFutureToFuture(tr->commit())));
|
||||||
auto ver = tr->getCommittedVersion();
|
auto ver = tr->getCommittedVersion();
|
||||||
if (ver != invalidVersion)
|
if (ver != invalidVersion)
|
||||||
printf("Committed (%" PRId64 ")\n", ver);
|
fmt::print("Committed ({})\n", ver);
|
||||||
else
|
else
|
||||||
printf("Nothing to commit\n");
|
fmt::print("Nothing to commit\n");
|
||||||
return Void();
|
return Void();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
// FIXME: Trim this down
|
// FIXME: Trim this down
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "flow/Platform.actor.h"
|
#include "flow/Platform.actor.h"
|
||||||
#include "fdbclient/AsyncTaskThread.h"
|
#include "fdbclient/AsyncTaskThread.h"
|
||||||
#include "fdbclient/BackupContainer.h"
|
#include "fdbclient/BackupContainer.h"
|
||||||
|
@ -75,13 +76,13 @@ std::string IBackupContainer::ExpireProgress::toString() const {
|
||||||
|
|
||||||
void BackupFileList::toStream(FILE* fout) const {
|
void BackupFileList::toStream(FILE* fout) const {
|
||||||
for (const RangeFile& f : ranges) {
|
for (const RangeFile& f : ranges) {
|
||||||
fprintf(fout, "range %" PRId64 " %s\n", f.fileSize, f.fileName.c_str());
|
fmt::print(fout, "range {0} {1}\n", f.fileSize, f.fileName);
|
||||||
}
|
}
|
||||||
for (const LogFile& f : logs) {
|
for (const LogFile& f : logs) {
|
||||||
fprintf(fout, "log %" PRId64 " %s\n", f.fileSize, f.fileName.c_str());
|
fmt::print(fout, "log {0} {1}\n", f.fileSize, f.fileName);
|
||||||
}
|
}
|
||||||
for (const KeyspaceSnapshotFile& f : snapshots) {
|
for (const KeyspaceSnapshotFile& f : snapshots) {
|
||||||
fprintf(fout, "snapshotManifest %" PRId64 " %s\n", f.totalSize, f.fileName.c_str());
|
fmt::print(fout, "snapshotManifest {0} {1}\n", f.totalSize, f.fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1757,7 +1757,7 @@ ACTOR Future<Void> testBackupContainer(std::string url, Optional<std::string> en
|
||||||
state Version expireVersion = listing.snapshots[i].endVersion;
|
state Version expireVersion = listing.snapshots[i].endVersion;
|
||||||
|
|
||||||
// Expire everything up to but not including the snapshot end version
|
// Expire everything up to but not including the snapshot end version
|
||||||
printf("EXPIRE TO %" PRId64 "\n", expireVersion);
|
fmt::print("EXPIRE TO {}\n", expireVersion);
|
||||||
state Future<Void> f = c->expireData(expireVersion);
|
state Future<Void> f = c->expireData(expireVersion);
|
||||||
wait(ready(f));
|
wait(ready(f));
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#define FDBCLIENT_BACKUP_CONTAINER_FILESYSTEM_H
|
#define FDBCLIENT_BACKUP_CONTAINER_FILESYSTEM_H
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbclient/BackupContainer.h"
|
#include "fdbclient/BackupContainer.h"
|
||||||
#include "fdbclient/FDBTypes.h"
|
#include "fdbclient/FDBTypes.h"
|
||||||
#include "flow/Trace.h"
|
#include "flow/Trace.h"
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbclient/BackupAgent.actor.h"
|
#include "fdbclient/BackupAgent.actor.h"
|
||||||
#include "fdbclient/BackupContainer.h"
|
#include "fdbclient/BackupContainer.h"
|
||||||
#include "fdbclient/DatabaseContext.h"
|
#include "fdbclient/DatabaseContext.h"
|
||||||
|
@ -5342,10 +5343,7 @@ public:
|
||||||
.detail("BackupContainer", bc->getURL())
|
.detail("BackupContainer", bc->getURL())
|
||||||
.detail("BeginVersion", beginVersion)
|
.detail("BeginVersion", beginVersion)
|
||||||
.detail("TargetVersion", targetVersion);
|
.detail("TargetVersion", targetVersion);
|
||||||
fprintf(stderr,
|
fmt::print(stderr, "ERROR: Restore version {0} is not possible from {1}\n", targetVersion, bc->getURL());
|
||||||
"ERROR: Restore version %" PRId64 " is not possible from %s\n",
|
|
||||||
targetVersion,
|
|
||||||
bc->getURL().c_str());
|
|
||||||
throw restore_invalid_version();
|
throw restore_invalid_version();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbclient/Knobs.h"
|
#include "fdbclient/Knobs.h"
|
||||||
#include "flow/Arena.h"
|
#include "flow/Arena.h"
|
||||||
#include "fdbclient/ClusterConnectionMemoryRecord.h"
|
#include "fdbclient/ClusterConnectionMemoryRecord.h"
|
||||||
|
@ -1677,9 +1678,9 @@ ACTOR Future<Void> printHealthyZone(Database cx) {
|
||||||
printf("No ongoing maintenance.\n");
|
printf("No ongoing maintenance.\n");
|
||||||
} else {
|
} else {
|
||||||
auto healthyZone = decodeHealthyZoneValue(val.get());
|
auto healthyZone = decodeHealthyZoneValue(val.get());
|
||||||
printf("Maintenance for zone %s will continue for %" PRId64 " seconds.\n",
|
fmt::print("Maintenance for zone {0} will continue for {1} seconds.\n",
|
||||||
healthyZone.first.toString().c_str(),
|
healthyZone.first.toString(),
|
||||||
(healthyZone.second - tr.getReadVersion().get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND);
|
(healthyZone.second - tr.getReadVersion().get()) / CLIENT_KNOBS->CORE_VERSIONSPERSECOND);
|
||||||
}
|
}
|
||||||
return Void();
|
return Void();
|
||||||
} catch (Error& e) {
|
} catch (Error& e) {
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbrpc/simulator.h"
|
#include "fdbrpc/simulator.h"
|
||||||
#define BOOST_SYSTEM_NO_LIB
|
#define BOOST_SYSTEM_NO_LIB
|
||||||
#define BOOST_DATE_TIME_NO_LIB
|
#define BOOST_DATE_TIME_NO_LIB
|
||||||
|
@ -589,13 +590,13 @@ private:
|
||||||
((uintptr_t)data % 4096 == 0 && length % 4096 == 0 && offset % 4096 == 0)); // Required by KAIO.
|
((uintptr_t)data % 4096 == 0 && length % 4096 == 0 && offset % 4096 == 0)); // Required by KAIO.
|
||||||
state UID opId = deterministicRandom()->randomUniqueID();
|
state UID opId = deterministicRandom()->randomUniqueID();
|
||||||
if (randLog)
|
if (randLog)
|
||||||
fprintf(randLog,
|
fmt::print(randLog,
|
||||||
"SFR1 %s %s %s %d %" PRId64 "\n",
|
"SFR1 {0} {1} {2} {3} {4}\n",
|
||||||
self->dbgId.shortString().c_str(),
|
self->dbgId.shortString(),
|
||||||
self->filename.c_str(),
|
self->filename,
|
||||||
opId.shortString().c_str(),
|
opId.shortString(),
|
||||||
length,
|
length,
|
||||||
offset);
|
offset);
|
||||||
|
|
||||||
wait(waitUntilDiskReady(self->diskParameters, length));
|
wait(waitUntilDiskReady(self->diskParameters, length));
|
||||||
|
|
||||||
|
@ -633,14 +634,14 @@ private:
|
||||||
state UID opId = deterministicRandom()->randomUniqueID();
|
state UID opId = deterministicRandom()->randomUniqueID();
|
||||||
if (randLog) {
|
if (randLog) {
|
||||||
uint32_t a = crc32c_append(0, data.begin(), data.size());
|
uint32_t a = crc32c_append(0, data.begin(), data.size());
|
||||||
fprintf(randLog,
|
fmt::print(randLog,
|
||||||
"SFW1 %s %s %s %d %d %" PRId64 "\n",
|
"SFW1 {0} {1} {2} {3} {4} {5}\n",
|
||||||
self->dbgId.shortString().c_str(),
|
self->dbgId.shortString(),
|
||||||
self->filename.c_str(),
|
self->filename,
|
||||||
opId.shortString().c_str(),
|
opId.shortString(),
|
||||||
a,
|
a,
|
||||||
data.size(),
|
data.size(),
|
||||||
offset);
|
offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->delayOnWrite)
|
if (self->delayOnWrite)
|
||||||
|
@ -681,12 +682,8 @@ private:
|
||||||
ACTOR static Future<Void> truncate_impl(SimpleFile* self, int64_t size) {
|
ACTOR static Future<Void> truncate_impl(SimpleFile* self, int64_t size) {
|
||||||
state UID opId = deterministicRandom()->randomUniqueID();
|
state UID opId = deterministicRandom()->randomUniqueID();
|
||||||
if (randLog)
|
if (randLog)
|
||||||
fprintf(randLog,
|
fmt::print(
|
||||||
"SFT1 %s %s %s %" PRId64 "\n",
|
randLog, "SFT1 {0} {1} {2} {3}\n", self->dbgId.shortString(), self->filename, opId.shortString(), size);
|
||||||
self->dbgId.shortString().c_str(),
|
|
||||||
self->filename.c_str(),
|
|
||||||
opId.shortString().c_str(),
|
|
||||||
size);
|
|
||||||
|
|
||||||
// KAIO will return EINVAL, as len==0 is an error.
|
// KAIO will return EINVAL, as len==0 is an error.
|
||||||
if ((self->flags & IAsyncFile::OPEN_NO_AIO) == 0 && size == 0) {
|
if ((self->flags & IAsyncFile::OPEN_NO_AIO) == 0 && size == 0) {
|
||||||
|
@ -782,12 +779,8 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (randLog)
|
if (randLog)
|
||||||
fprintf(randLog,
|
fmt::print(
|
||||||
"SFS2 %s %s %s %" PRId64 "\n",
|
randLog, "SFS2 {0} {1} {2} {3}\n", self->dbgId.shortString(), self->filename, opId.shortString(), pos);
|
||||||
self->dbgId.shortString().c_str(),
|
|
||||||
self->filename.c_str(),
|
|
||||||
opId.shortString().c_str(),
|
|
||||||
pos);
|
|
||||||
INJECT_FAULT(io_error, "SimpleFile::size"); // SimpleFile::size inject io_error
|
INJECT_FAULT(io_error, "SimpleFile::size"); // SimpleFile::size inject io_error
|
||||||
|
|
||||||
return pos;
|
return pos;
|
||||||
|
@ -2091,12 +2084,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (randLog)
|
if (randLog)
|
||||||
fprintf(randLog,
|
fmt::print(randLog,
|
||||||
"T %f %d %s %" PRId64 "\n",
|
"T {0} {1} {2} {3}\n",
|
||||||
this->time,
|
this->time,
|
||||||
int(deterministicRandom()->peek() % 10000),
|
int(deterministicRandom()->peek() % 10000),
|
||||||
t.machine ? t.machine->name : "none",
|
t.machine ? t.machine->name : "none",
|
||||||
t.stable);
|
t.stable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbclient/BlobWorkerInterface.h"
|
#include "fdbclient/BlobWorkerInterface.h"
|
||||||
#include "fdbserver/Status.h"
|
#include "fdbserver/Status.h"
|
||||||
#include "flow/Trace.h"
|
#include "flow/Trace.h"
|
||||||
|
@ -3361,16 +3362,16 @@ TEST_CASE("Lstatus/json/builderPerf") {
|
||||||
}
|
}
|
||||||
|
|
||||||
double elapsed = generated + serialized;
|
double elapsed = generated + serialized;
|
||||||
printf("RESULT: %" PRId64
|
fmt::print("RESULT: {0}"
|
||||||
" bytes %d elements %d levels %f seconds (%f gen, %f serialize) %f MB/s %f items/s\n",
|
" bytes {1} elements {2} levels {3} seconds ({4} gen, {5} serialize) {6} MB/s {7} items/s\n",
|
||||||
bytes,
|
bytes,
|
||||||
iterations * elements,
|
iterations * elements,
|
||||||
level,
|
level,
|
||||||
elapsed,
|
elapsed,
|
||||||
generated,
|
generated,
|
||||||
elapsed - generated,
|
elapsed - generated,
|
||||||
bytes / elapsed / 1e6,
|
bytes / elapsed / 1e6,
|
||||||
iterations * elements / elapsed);
|
iterations * elements / elapsed);
|
||||||
|
|
||||||
return Void();
|
return Void();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbserver/workloads/ApiWorkload.h"
|
#include "fdbserver/workloads/ApiWorkload.h"
|
||||||
#include "fdbclient/MultiVersionTransaction.h"
|
#include "fdbclient/MultiVersionTransaction.h"
|
||||||
#include "flow/actorcompiler.h" // This must be the last #include.
|
#include "flow/actorcompiler.h" // This must be the last #include.
|
||||||
|
@ -123,7 +124,7 @@ bool ApiWorkload::compareResults(VectorRef<KeyValueRef> dbResults,
|
||||||
for (int j = 0; j < storeResults.size(); j++)
|
for (int j = 0; j < storeResults.size(); j++)
|
||||||
printf("%d: %s %d\n", j, storeResults[j].key.toString().c_str(), storeResults[j].value.size());
|
printf("%d: %s %d\n", j, storeResults[j].key.toString().c_str(), storeResults[j].value.size());
|
||||||
|
|
||||||
printf("Read Version: %" PRId64 "\n", readVersion);
|
fmt::print("Read Version: {}\n", readVersion);
|
||||||
|
|
||||||
TraceEvent(SevError, format("%s_CompareSizeMismatch", description().c_str()).c_str())
|
TraceEvent(SevError, format("%s_CompareSizeMismatch", description().c_str()).c_str())
|
||||||
.detail("ReadVer", readVersion)
|
.detail("ReadVer", readVersion)
|
||||||
|
@ -144,7 +145,7 @@ bool ApiWorkload::compareResults(VectorRef<KeyValueRef> dbResults,
|
||||||
for (int j = 0; j < storeResults.size(); j++)
|
for (int j = 0; j < storeResults.size(); j++)
|
||||||
printf("%d: %s %d\n", j, storeResults[j].key.toString().c_str(), storeResults[j].value.size());
|
printf("%d: %s %d\n", j, storeResults[j].key.toString().c_str(), storeResults[j].value.size());
|
||||||
|
|
||||||
printf("Read Version: %" PRId64 "\n", readVersion);
|
fmt::print("Read Version: {}\n", readVersion);
|
||||||
|
|
||||||
TraceEvent(SevError, format("%s_CompareValueMismatch", description().c_str()).c_str())
|
TraceEvent(SevError, format("%s_CompareValueMismatch", description().c_str()).c_str())
|
||||||
.detail("ReadVer", readVersion)
|
.detail("ReadVer", readVersion)
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbserver/workloads/workloads.actor.h"
|
#include "fdbserver/workloads/workloads.actor.h"
|
||||||
#include "flow/ActorCollection.h"
|
#include "flow/ActorCollection.h"
|
||||||
#include "flow/IRandom.h"
|
#include "flow/IRandom.h"
|
||||||
|
@ -83,11 +84,12 @@ struct AsyncFileCorrectnessWorkload : public AsyncFileWorkload {
|
||||||
|
|
||||||
if (maxOperationSize * numSimultaneousOperations > targetFileSize * 0.25) {
|
if (maxOperationSize * numSimultaneousOperations > targetFileSize * 0.25) {
|
||||||
targetFileSize *= (int)ceil((maxOperationSize * numSimultaneousOperations * 4.0) / targetFileSize);
|
targetFileSize *= (int)ceil((maxOperationSize * numSimultaneousOperations * 4.0) / targetFileSize);
|
||||||
printf("Target file size is insufficient to support %d simultaneous operations of size %d; changing to "
|
fmt::print(
|
||||||
"%" PRId64 "\n",
|
"Target file size is insufficient to support {0} simultaneous operations of size {1}; changing to "
|
||||||
numSimultaneousOperations,
|
"{2}\n",
|
||||||
maxOperationSize,
|
numSimultaneousOperations,
|
||||||
targetFileSize);
|
maxOperationSize,
|
||||||
|
targetFileSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -396,12 +398,12 @@ struct AsyncFileCorrectnessWorkload : public AsyncFileWorkload {
|
||||||
int64_t fileSize = wait(self->fileHandle->file->size());
|
int64_t fileSize = wait(self->fileHandle->file->size());
|
||||||
int64_t fileSizeChange = fileSize - self->fileSize;
|
int64_t fileSizeChange = fileSize - self->fileSize;
|
||||||
if (fileSizeChange >= _PAGE_SIZE) {
|
if (fileSizeChange >= _PAGE_SIZE) {
|
||||||
printf("Reopened file increased in size by %" PRId64 " bytes (at most %d allowed)\n",
|
fmt::print("Reopened file increased in size by {0} bytes (at most {1} allowed)\n",
|
||||||
fileSizeChange,
|
fileSizeChange,
|
||||||
_PAGE_SIZE - 1);
|
_PAGE_SIZE - 1);
|
||||||
self->success = false;
|
self->success = false;
|
||||||
} else if (fileSizeChange < 0) {
|
} else if (fileSizeChange < 0) {
|
||||||
printf("Reopened file decreased in size by %" PRId64 " bytes\n", -fileSizeChange);
|
fmt::print("Reopened file decreased in size by {} bytes\n", -fileSizeChange);
|
||||||
self->success = false;
|
self->success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbserver/workloads/workloads.actor.h"
|
#include "fdbserver/workloads/workloads.actor.h"
|
||||||
#include "fdbrpc/IAsyncFile.h"
|
#include "fdbrpc/IAsyncFile.h"
|
||||||
#include "fdbclient/FDBTypes.h"
|
#include "fdbclient/FDBTypes.h"
|
||||||
|
@ -113,7 +114,7 @@ struct DiskDurabilityTest : TestWorkload {
|
||||||
if (failed)
|
if (failed)
|
||||||
throw operation_failed();
|
throw operation_failed();
|
||||||
|
|
||||||
printf("Verified %d/%" PRId64 " pages\n", verifyPages, size / 4096);
|
fmt::print("Verified {0}/{1} pages\n", verifyPages, size / 4096);
|
||||||
TraceEvent(SevInfo, "Verified").detail("Pages", verifyPages).detail("Of", size / 4096);
|
TraceEvent(SevInfo, "Verified").detail("Pages", verifyPages).detail("Of", size / 4096);
|
||||||
|
|
||||||
// Run
|
// Run
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbserver/workloads/workloads.actor.h"
|
#include "fdbserver/workloads/workloads.actor.h"
|
||||||
#include "fdbserver/IKeyValueStore.h"
|
#include "fdbserver/IKeyValueStore.h"
|
||||||
#include "flow/ActorCollection.h"
|
#include "flow/ActorCollection.h"
|
||||||
|
@ -278,7 +279,7 @@ ACTOR Future<Void> testKVStoreMain(KVStoreTestWorkload* workload, KVTest* ptest)
|
||||||
}
|
}
|
||||||
double elapsed = timer() - cst;
|
double elapsed = timer() - cst;
|
||||||
TraceEvent("KVStoreCount").detail("Count", count).detail("Took", elapsed);
|
TraceEvent("KVStoreCount").detail("Count", count).detail("Took", elapsed);
|
||||||
printf("Counted: %" PRId64 " in %0.1fs\n", count, elapsed);
|
fmt::print("Counted: {0} in {1:01.f}s\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workload->doSetup) {
|
if (workload->doSetup) {
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbrpc/simulator.h"
|
#include "fdbrpc/simulator.h"
|
||||||
#include "fdbclient/BackupAgent.actor.h"
|
#include "fdbclient/BackupAgent.actor.h"
|
||||||
#include "fdbclient/BackupContainer.h"
|
#include "fdbclient/BackupContainer.h"
|
||||||
|
@ -78,9 +79,9 @@ struct MutationLogReaderCorrectnessWorkload : TestWorkload {
|
||||||
state Transaction tr(cx);
|
state Transaction tr(cx);
|
||||||
state int iStart = 0;
|
state int iStart = 0;
|
||||||
state int batchSize = 1000;
|
state int batchSize = 1000;
|
||||||
printf("Records: %d\n", self->records);
|
fmt::print("Records: {}\n", self->records);
|
||||||
printf("BeginVersion: %" PRId64 "\n", self->beginVersion);
|
fmt::print("BeginVersion: {}\n", self->beginVersion);
|
||||||
printf("EndVersion: %" PRId64 "\n", self->endVersion);
|
fmt::print("EndVersion: {}\n", self->endVersion);
|
||||||
|
|
||||||
while (iStart < self->records) {
|
while (iStart < self->records) {
|
||||||
loop {
|
loop {
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "fdbserver/workloads/workloads.actor.h"
|
#include "fdbserver/workloads/workloads.actor.h"
|
||||||
#include "flow/SignalSafeUnwind.h"
|
#include "flow/SignalSafeUnwind.h"
|
||||||
#include "flow/actorcompiler.h" // This must be the last #include.
|
#include "flow/actorcompiler.h" // This must be the last #include.
|
||||||
|
@ -55,14 +56,14 @@ struct SlowTaskWorkload : TestWorkload {
|
||||||
do_slow_exception_thing(&exc);
|
do_slow_exception_thing(&exc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(stderr,
|
fmt::print(stderr,
|
||||||
"Slow task complete: %" PRId64 " exceptions; %" PRId64 " calls to dl_iterate_phdr, %" PRId64
|
"Slow task complete: {0} exceptions; {1} calls to dl_iterate_phdr, {2}"
|
||||||
" profiles deferred, %" PRId64 " profiles overflowed, %" PRId64 " profiles captured\n",
|
" profiles deferred, {3} profiles overflowed, {4} profiles captured\n",
|
||||||
exc,
|
exc,
|
||||||
dl_iterate_phdr_calls - phc,
|
dl_iterate_phdr_calls - phc,
|
||||||
getNumProfilesDeferred() - startProfilesDeferred,
|
getNumProfilesDeferred() - startProfilesDeferred,
|
||||||
getNumProfilesOverflowed() - startProfilesOverflowed,
|
getNumProfilesOverflowed() - startProfilesOverflowed,
|
||||||
getNumProfilesCaptured() - startProfilesCaptured);
|
getNumProfilesCaptured() - startProfilesCaptured);
|
||||||
|
|
||||||
return Void();
|
return Void();
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "flow/DeterministicRandom.h"
|
#include "flow/DeterministicRandom.h"
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
@ -78,7 +79,7 @@ int64_t DeterministicRandom::randomInt64(int64_t min, int64_t maxPlusOne) {
|
||||||
else
|
else
|
||||||
i = v + min;
|
i = v + min;
|
||||||
if (randLog && useRandLog)
|
if (randLog && useRandLog)
|
||||||
fprintf(randLog, "Rint64 %" PRId64 "\n", i);
|
fmt::print(randLog, "Rint64 {}\n", i);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +104,7 @@ UID DeterministicRandom::randomUniqueID() {
|
||||||
x = gen64();
|
x = gen64();
|
||||||
y = gen64();
|
y = gen64();
|
||||||
if (randLog && useRandLog)
|
if (randLog && useRandLog)
|
||||||
fprintf(randLog, "Ruid %" PRIx64 " %" PRIx64 "\n", x, y);
|
fmt::print(randLog, "Ruid {0} {1}\n", x, y);
|
||||||
return UID(x, y);
|
return UID(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
// At the moment, this file just contains tests. IndexedSet<> is a template
|
// At the moment, this file just contains tests. IndexedSet<> is a template
|
||||||
// and so all the important implementation is in the header file
|
// and so all the important implementation is in the header file
|
||||||
|
|
||||||
|
#include "contrib/fmt-8.0.1/include/fmt/format.h"
|
||||||
#include "flow/IndexedSet.h"
|
#include "flow/IndexedSet.h"
|
||||||
#include "flow/IRandom.h"
|
#include "flow/IRandom.h"
|
||||||
#include "flow/ThreadPrimitives.h"
|
#include "flow/ThreadPrimitives.h"
|
||||||
|
@ -495,8 +496,9 @@ TEST_CASE("/flow/IndexedSet/all numbers") {
|
||||||
auto ii = is.index(n);
|
auto ii = is.index(n);
|
||||||
int ib = ii != is.end() ? *ii : 1000000;
|
int ib = ii != is.end() ? *ii : 1000000;
|
||||||
ASSERT(ib == b);
|
ASSERT(ib == b);
|
||||||
if (ib != b)
|
if (ib != b) {
|
||||||
printf("%s %" PRId64 " %d %d %" PRId64 "\n", ib == b ? "OK" : "ERROR", n, b, ib, is.sumTo(ii));
|
fmt::print("{0} {1} {2} {3} {4} {5}\n", ib == b ? "OK" : "ERROR", n, b, ib, is.sumTo(ii));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 100000; i++) {
|
for (int i = 0; i < 100000; i++) {
|
||||||
|
@ -509,8 +511,9 @@ TEST_CASE("/flow/IndexedSet/all numbers") {
|
||||||
// int ntotal = int64_t(b)*(b-1)/2 - int64_t(a)*(a-1)/2;
|
// int ntotal = int64_t(b)*(b-1)/2 - int64_t(a)*(a-1)/2;
|
||||||
int64_t ntotal = int64_t(b - a) * (a + b - 1) / 2;
|
int64_t ntotal = int64_t(b - a) * (a + b - 1) / 2;
|
||||||
ASSERT(itotal == ntotal);
|
ASSERT(itotal == ntotal);
|
||||||
if (itotal != ntotal)
|
if (itotal != ntotal) {
|
||||||
printf("%s %" PRId64 " %" PRId64 "\n", itotal == ntotal ? "OK" : "ERROR", ntotal, itotal);
|
fmt::print("{0} {1} {2}\n", itotal == ntotal ? "OK" : "ERROR", ntotal, itotal);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// double a = timer();
|
// double a = timer();
|
||||||
|
|
|
@ -86,9 +86,9 @@ void* rte_memcpy_noinline(void* __restrict __dest, const void* __restrict __src,
|
||||||
}
|
}
|
||||||
#endif // (defined (__linux__) || defined (__FreeBSD__)) && defined(__AVX__) && !defined(MEMORY_SANITIZER)
|
#endif // (defined (__linux__) || defined (__FreeBSD__)) && defined(__AVX__) && !defined(MEMORY_SANITIZER)
|
||||||
|
|
||||||
INetwork* g_network = 0;
|
INetwork* g_network = nullptr;
|
||||||
|
|
||||||
FILE* randLog = 0;
|
FILE* randLog = nullptr;
|
||||||
thread_local Reference<IRandom> seededRandom;
|
thread_local Reference<IRandom> seededRandom;
|
||||||
Reference<IRandom> seededDebugRandom;
|
Reference<IRandom> seededDebugRandom;
|
||||||
uint64_t debug_lastLoadBalanceResultEndpointToken = 0;
|
uint64_t debug_lastLoadBalanceResultEndpointToken = 0;
|
||||||
|
|
Loading…
Reference in New Issue