Skip to content

Commit b1866af

Browse files
committed
Fixed lint errors from previous commit
1 parent 9baedd6 commit b1866af

File tree

5 files changed

+20
-17
lines changed

5 files changed

+20
-17
lines changed

src/PlusOneBackupSelector.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ PlusOneBackupSelector::PlusOneBackupSelector(Context* context,
4444

4545

4646
/**
47-
* Select a node that's masterServerId+1 with wraparound, or if that fails,
48-
* keep moving forward one with wraparound until you either find a node or
47+
* Select a node that's masterServerId+1 with wraparound, or if that fails,
48+
* keep moving forward one with wraparound until you either find a node or
4949
* tried them all.
5050
* \param numBackups
5151
* The number of entries in the \a backupIds array.
@@ -62,7 +62,7 @@ PlusOneBackupSelector::selectSecondary(uint32_t numBackups,
6262
uint32_t totalAttempts = std::min(tracker.size(), maxAttempts);
6363
uint32_t attempts = 0;
6464
uint32_t index = serverId->indexNumber();
65-
65+
6666
for (attempts = 0; attempts < totalAttempts; attempts++) {
6767
applyTrackerChanges();
6868
index++;

src/PlusOneBackupSelectorTest.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ TEST_F(PlusOneBackupSelectorTest, selectSecondary_logThrottling) {
7979
TestLog::reset();
8080
ServerId id = selector->selectSecondary(0, NULL);
8181
EXPECT_EQ(ServerId(), id);
82-
EXPECT_EQ("selectSecondary: PlusOneBackupSelector could not find a suitable "
83-
"server in 1 attempts; may need to wait for additional "
84-
"servers to enlist",
82+
EXPECT_EQ("selectSecondary: PlusOneBackupSelector could not find a "
83+
"suitable server in 1 attempts; may need to wait for additional "
84+
"servers to enlist",
8585
TestLog::get());
8686
EXPECT_FALSE(selector->okToLogNextProblem);
8787

src/ServerConfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2012-2016 Stanford University
1+
/* Copyright (c) 2012-2019 Stanford University
22
*
33
* Permission to use, copy, modify, and distribute this software for any
44
* purpose with or without fee is hereby granted, provided that the above
@@ -349,7 +349,7 @@ struct ServerConfig {
349349
/// replication.
350350
bool useMinCopysets;
351351

352-
/// Specifies whether to use masterServerId plus one with wraparound
352+
/// Specifies whether to use masterServerId plus one with wraparound
353353
/// or random replication for backupServerId.
354354
bool usePlusOneBackup;
355355

src/ServerTracker.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2012-2016 Stanford University
1+
/* Copyright (c) 2012-2019 Stanford University
22
*
33
* Permission to use, copy, modify, and distribute this software for any
44
* purpose with or without fee is hereby granted, provided that the above
@@ -400,7 +400,7 @@ class ServerTracker : public ServerTrackerInterface {
400400
* Deterministically obtain the ServerId at serverList[index], but only
401401
* if index is valid, the serverId is valid, the server is up, and it
402402
* has the specified service. We return invalid id otherwise.
403-
*
403+
*
404404
* \param index
405405
* The index of serverList[] we want returned.
406406
* \param service
@@ -412,13 +412,16 @@ class ServerTracker : public ServerTrackerInterface {
412412
* criteria passes.
413413
*/
414414
ServerId
415-
getServerIdAtIndexWithService(uint32_t index, WireFormat::ServiceType service) {
415+
getServerIdAtIndexWithService(uint32_t index,
416+
WireFormat::ServiceType service)
417+
{
416418
if (serverList.size() > 0 &&
417419
index < serverList.size() &&
418420
index != lastRemovedIndex &&
419421
serverList[index].server.serverId.isValid() &&
420422
serverList[index].server.status == ServerStatus::UP &&
421-
serverList[index].server.services.has(service)) {
423+
serverList[index].server.services.has(service))
424+
{
422425
return serverList[index].server.serverId;
423426
}
424427
return ServerId(/* invalid id */);

src/ServerTrackerTest.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2011-2013 Stanford University
1+
/* Copyright (c) 2011-2019 Stanford University
22
*
33
* Permission to use, copy, modify, and distribute this software for any purpose
44
* with or without fee is hereby granted, provided that the above copyright
@@ -394,11 +394,11 @@ TEST_F(ServerTrackerTest, getServerIdAtIndexWithService) {
394394
1, WireFormat::BACKUP_SERVICE).isValid());
395395
EXPECT_TRUE(tr.getChange(server, event));
396396

397-
EXPECT_EQ(ServerId(1, 0),
398-
tr.getServerIdAtIndexWithService(1, WireFormat::BACKUP_SERVICE));
397+
EXPECT_EQ(ServerId(1, 0), tr.getServerIdAtIndexWithService(1,
398+
WireFormat::BACKUP_SERVICE));
399399
// No host available with this service bit set.
400-
EXPECT_EQ(ServerId(),
401-
tr.getServerIdAtIndexWithService(1, WireFormat::MASTER_SERVICE));
400+
EXPECT_EQ(ServerId(), tr.getServerIdAtIndexWithService(1,
401+
WireFormat::MASTER_SERVICE));
402402

403403
// Ensure looping over empty list terminates.
404404
removedEvent(ServerId(1, 0));

0 commit comments

Comments
 (0)