forked from readablesystems/sto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Print MvStatus - All MvHistories inherit from a shared base - That base can print a prev chain
- Loading branch information
Showing
3 changed files
with
88 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "MVCCStructs.hh" | ||
|
||
std::ostream& operator<<(std::ostream& w, MvStatus s) { | ||
switch (s) { | ||
case UNUSED: return w << "UNUSED"; | ||
case ABORTED: return w << "ABORTED"; | ||
case PENDING_DELETED: return w << "PENDING_DELETED"; | ||
case COMMITTED_DELETED: return w << "COMMITTED_DELETED"; | ||
case PENDING_DELTA: return w << "PENDING_DELTA"; | ||
case COMMITTED_DELTA: return w << "COMMITTED_DELTA"; | ||
case LOCKED_COMMITTED_DELTA: return w << "LOCKED_COMMITTED_DELTA"; | ||
case PENDING: return w << "PENDING"; | ||
case COMMITTED: return w << "COMMITTED"; | ||
default: return w << "MvStatus[" << (int) s << "]"; | ||
} | ||
} | ||
|
||
void MvHistoryBase::print_prevs(size_t max) const { | ||
auto h = this; | ||
for (size_t i = 0; | ||
h && i < max; | ||
++i, h = h->prev_.load(std::memory_order_relaxed)) { | ||
std::cerr << i << ". " << (void*) h << " " << h->status_.load(std::memory_order_relaxed) << " W" << h->wtid_ << " R" << h->rtid_.load(std::memory_order_relaxed) << "\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