|
31 | 31 | #include "encoding.h" |
32 | 32 | #include "env_switching.h" |
33 | 33 | #include "eventlistener.h" |
| 34 | +#include "fmt.h" |
34 | 35 | #include "keys.h" |
35 | 36 | #include "protos/roachpb/data.pb.h" |
36 | 37 | #include "protos/roachpb/internal.pb.h" |
@@ -372,11 +373,11 @@ DBStatus ToDBStatus(const rocksdb::Status& status) { |
372 | 373 | return ToDBString(status.ToString()); |
373 | 374 | } |
374 | 375 |
|
375 | | -DBStatus FmtStatus(const char* fmt, ...) { |
| 376 | +DBStatus FmtStatus(const char* fmt_str, ...) { |
376 | 377 | va_list ap; |
377 | | - va_start(ap, fmt); |
| 378 | + va_start(ap, fmt_str); |
378 | 379 | std::string str; |
379 | | - google::protobuf::StringAppendV(&str, fmt, ap); |
| 380 | + fmt::StringAppendV(&str, fmt_str, ap); |
380 | 381 | va_end(ap); |
381 | 382 | return ToDBString(str); |
382 | 383 | } |
@@ -1342,17 +1343,17 @@ DBString DBEngine::GetUserProperties() { |
1342 | 1343 | auto ts_min = userprops.find("crdb.ts.min"); |
1343 | 1344 | if (ts_min != userprops.end() && !ts_min->second.empty()) { |
1344 | 1345 | if (!DecodeHLCTimestamp(rocksdb::Slice(ts_min->second), sst->mutable_ts_min())) { |
1345 | | - google::protobuf::SStringPrintf(all.mutable_error(), "unable to decode crdb.ts.min value '%s' in table %s", |
1346 | | - rocksdb::Slice(ts_min->second).ToString(true).c_str(), sst->path().c_str()); |
| 1346 | + fmt::SStringPrintf(all.mutable_error(), "unable to decode crdb.ts.min value '%s' in table %s", |
| 1347 | + rocksdb::Slice(ts_min->second).ToString(true).c_str(), sst->path().c_str()); |
1347 | 1348 | break; |
1348 | 1349 | } |
1349 | 1350 | } |
1350 | 1351 |
|
1351 | 1352 | auto ts_max = userprops.find("crdb.ts.max"); |
1352 | 1353 | if (ts_max != userprops.end() && !ts_max->second.empty()) { |
1353 | 1354 | if (!DecodeHLCTimestamp(rocksdb::Slice(ts_max->second), sst->mutable_ts_max())) { |
1354 | | - google::protobuf::SStringPrintf(all.mutable_error(), "unable to decode crdb.ts.max value '%s' in table %s", |
1355 | | - rocksdb::Slice(ts_max->second).ToString(true).c_str(), sst->path().c_str()); |
| 1355 | + fmt::SStringPrintf(all.mutable_error(), "unable to decode crdb.ts.max value '%s' in table %s", |
| 1356 | + rocksdb::Slice(ts_max->second).ToString(true).c_str(), sst->path().c_str()); |
1356 | 1357 | break; |
1357 | 1358 | } |
1358 | 1359 | } |
@@ -1744,7 +1745,7 @@ DBStatus DBCompact(DBEngine* db) { |
1744 | 1745 | return ToDBStatus(db->rep->CompactRange(options, NULL, NULL)); |
1745 | 1746 | } |
1746 | 1747 |
|
1747 | | -DBStatus DBApproximateDiskBytes(DBEngine* db, DBKey start, DBKey end, uint64_t *size) { |
| 1748 | +DBStatus DBApproximateDiskBytes(DBEngine* db, DBKey start, DBKey end, uint64_t* size) { |
1748 | 1749 | const std::string start_key(EncodeKey(start)); |
1749 | 1750 | const std::string end_key(EncodeKey(end)); |
1750 | 1751 | const rocksdb::Range r(start_key, end_key); |
|
0 commit comments