Skip to content

Commit a52cecb

Browse files
committed
Fix Mac compile
1 parent 092f97e commit a52cecb

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

db/db_test.cc

+27-16
Original file line numberDiff line numberDiff line change
@@ -6142,8 +6142,8 @@ std::vector<std::uint64_t> ListTableFiles(Env* env, const std::string& path) {
61426142
return ListSpecificFiles(env, path, kTableFile);
61436143
}
61446144

6145-
std::uint64_t GetNumberOfSstFilesForColumnFamily(
6146-
DB* db, std::string column_family_name) {
6145+
uint64_t GetNumberOfSstFilesForColumnFamily(DB* db,
6146+
std::string column_family_name) {
61476147
std::vector<LiveFileMetaData> metadata;
61486148
db->GetLiveFilesMetaData(&metadata);
61496149
uint64_t result = 0;
@@ -6200,9 +6200,10 @@ TEST(DBTest, RecoverCheckFileAmountWithSmallWriteBuffer) {
62006200
dbfull()->TEST_WaitForFlushMemTable(handles_[2]);
62016201
{
62026202
auto tables = ListTableFiles(env_, dbname_);
6203-
ASSERT_EQ(tables.size(), 1);
6203+
ASSERT_EQ(tables.size(), static_cast<size_t>(1));
62046204
// Make sure 'dobrynia' was flushed: check sst files amount
6205-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "dobrynia"), 1);
6205+
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "dobrynia"),
6206+
static_cast<uint64_t>(1));
62066207
}
62076208
// New WAL file
62086209
ASSERT_OK(Put(1, Key(1), DummyString(1)));
@@ -6216,13 +6217,17 @@ TEST(DBTest, RecoverCheckFileAmountWithSmallWriteBuffer) {
62166217
&options);
62176218
{
62186219
// No inserts => default is empty
6219-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "default"), 0);
6220+
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "default"),
6221+
static_cast<uint64_t>(0));
62206222
// First 4 keys goes to separate SSTs + 1 more SST for 2 smaller keys
6221-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "pikachu"), 5);
6223+
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "pikachu"),
6224+
static_cast<uint64_t>(5));
62226225
// 1 SST for big key + 1 SST for small one
6223-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "dobrynia"), 2);
6226+
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "dobrynia"),
6227+
static_cast<uint64_t>(2));
62246228
// 1 SST for all keys
6225-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "nikitich"), 1);
6229+
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "nikitich"),
6230+
static_cast<uint64_t>(1));
62266231
}
62276232
}
62286233

@@ -6247,8 +6252,9 @@ TEST(DBTest, RecoverCheckFileAmount) {
62476252
// 4 memtable are not flushed, 1 sst file
62486253
{
62496254
auto tables = ListTableFiles(env_, dbname_);
6250-
ASSERT_EQ(tables.size(), 1);
6251-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "nikitich"), 1);
6255+
ASSERT_EQ(tables.size(), static_cast<size_t>(1));
6256+
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "nikitich"),
6257+
static_cast<uint64_t>(1));
62526258
}
62536259
// Memtable for 'nikitich' has flushed, new WAL file has opened
62546260
// 4 memtable still not flushed
@@ -6270,8 +6276,9 @@ TEST(DBTest, RecoverCheckFileAmount) {
62706276

62716277
{
62726278
auto tables = ListTableFiles(env_, dbname_);
6273-
ASSERT_EQ(tables.size(), 2);
6274-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "nikitich"), 2);
6279+
ASSERT_EQ(tables.size(), static_cast<size_t>(2));
6280+
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "nikitich"),
6281+
static_cast<uint64_t>(2));
62756282
}
62766283

62776284
ReopenWithColumnFamilies({"default", "pikachu", "dobrynia", "nikitich"},
@@ -6282,10 +6289,14 @@ TEST(DBTest, RecoverCheckFileAmount) {
62826289
// first, second and third WALs went to the same SST.
62836290
// So, there is 6 SSTs: three for 'nikitich', one for 'default', one for
62846291
// 'dobrynia', one for 'pikachu'
6285-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "default"), 1);
6286-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "nikitich"), 3);
6287-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "dobrynia"), 1);
6288-
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "pikachu"), 1);
6292+
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "default"),
6293+
static_cast<uint64_t>(1));
6294+
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "nikitich"),
6295+
static_cast<uint64_t>(3));
6296+
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "dobrynia"),
6297+
static_cast<uint64_t>(1));
6298+
ASSERT_EQ(GetNumberOfSstFilesForColumnFamily(db_, "pikachu"),
6299+
static_cast<uint64_t>(1));
62896300
}
62906301
}
62916302

utilities/backupable/backupable_db.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,9 @@ Status BackupEngineImpl::CreateNewBackup(DB* db, bool flush_before_backup) {
589589
double backup_speed = new_backup.GetSize() / (1.048576 * backup_time);
590590
Log(options_.info_log, "Backup number of files: %u",
591591
new_backup.GetNumberFiles());
592-
Log(options_.info_log, "Backup size: %lu bytes", new_backup.GetSize());
593-
Log(options_.info_log, "Backup time: %lu microseconds", backup_time);
592+
Log(options_.info_log, "Backup size: %" PRIu64 " bytes",
593+
new_backup.GetSize());
594+
Log(options_.info_log, "Backup time: %" PRIu64 " microseconds", backup_time);
594595
Log(options_.info_log, "Backup speed: %.3f MB/s", backup_speed);
595596
Log(options_.info_log, "Backup Statistics %s",
596597
backup_statistics_.ToString().c_str());

0 commit comments

Comments
 (0)