-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- restored immutability of the wsrep::view() class by moving index/ID
logic closer to where it belongs: protocol-specific part of the code, `wsrep_provider_v26.cpp` - added view object sanity checks to `on_connect()` method Refs #13
- Loading branch information
Showing
5 changed files
with
94 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (C) 2018 Codership Oy <info@codership.com> | ||
* | ||
* This file is part of wsrep-lib. | ||
* | ||
* Wsrep-lib is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Wsrep-lib is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with wsrep-lib. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "wsrep/view.hpp" | ||
|
||
void wsrep::view::print(std::ostream& os) const | ||
{ | ||
os << " id: " << state_id() << "\n" | ||
<< " status: " << status() << "\n" | ||
<< " prococol_version: " << protocol_version() << "\n" | ||
<< " final: " << final() << "\n" | ||
<< " own_index: " << own_index() << "\n" | ||
<< " members(" << members().size() << "):\n"; | ||
|
||
for (std::vector<wsrep::view::member>::const_iterator i(members().begin()); | ||
i != members().end(); ++i) | ||
{ | ||
os << "\t" << (i - members().begin()) /* ordinal index */ | ||
<< ") id: " << i->id() | ||
<< ", name: " << i->name() << "\n"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters