20 #include <glog/logging.h>
32 o << reinterpret_cast<const MasstreeBorderPage&>(v);
34 o << reinterpret_cast<const MasstreeIntermediatePage&>(v);
40 std::ostream& o = *o_ptr;
41 o << std::endl <<
"<addr>" <<
assorted::Hex(reinterpret_cast<uintptr_t>(&v), 16) <<
"</addr>";
42 o << std::endl << v.
header();
46 o << std::endl <<
"<foster_minor>";
48 o <<
"</foster_minor>";
49 o << std::endl <<
"<foster_major>";
51 o <<
"</foster_major>";
55 o <<
"<MasstreeIntermediatePage>";
58 o <<
"<EmptyRangePage />";
63 o << std::endl <<
" <Minipage index=\"" <<
static_cast<int>(i)
65 <<
"\" count=\"" <<
static_cast<int>(minipage.
key_count_)
67 for (uint16_t j = 0; j <= minipage.
key_count_; ++j) {
68 o << std::endl <<
" <Pointer index=\"" <<
static_cast<int>(j)
71 <<
"\">" << minipage.
pointers_[j] <<
"</Pointer>";
73 o << std::endl <<
" </Minipage>";
76 o <<
"</MasstreeIntermediatePage>";
81 o <<
"<MasstreeBorderPage>";
83 o <<
"<consecutive_inserts_>" << v.consecutive_inserts_ <<
"</consecutive_inserts_>";
84 o << std::endl <<
"<records>";
86 o << std::endl <<
" <record index=\"" << i
108 o << std::endl <<
"</records>";
109 o <<
"</MasstreeBorderPage>";
120 KeySlice left_slice = target_->get_slice(left);
121 KeySlice right_slice = target_->get_slice(right);
122 if (left_slice < right_slice) {
124 }
else if (left_slice == right_slice) {
125 return target_->get_remainder_length(left) < target_->get_remainder_length(right);
134 for (
SlotIndex i = 0; i < key_count; ++i) {
137 std::sort(order, order + key_count, Sorter(
this));
141 for (
SlotIndex i = 0; i < key_count; ++i) {
146 for (
SlotIndex i = 1; i < key_count; ++i) {
152 if (pre_slice == cur_slice) {
162 for (
SlotIndex i = 0; i < key_count; ++i) {
168 if (suffix_length > 0 && suffix_length != suffix_length_aligned) {
169 ASSERT_ND(suffix_length_aligned > suffix_length);
170 for (
KeyLength pos = suffix_length; pos < suffix_length_aligned; ++pos) {
177 if (payload_length > 0 && payload_length != payload_length_aligned) {
178 ASSERT_ND(payload_length_aligned > payload_length);
179 for (
PayloadLength pos = payload_length; pos < payload_length_aligned; ++pos) {
KeyLength get_remainder_length(SlotIndex index) const __attribute__((always_inline))
DataOffset physical_record_length_
Byte count this record occupies.
SlotIndex get_key_count() const __attribute__((always_inline))
physical key count (those keys might be deleted) in this page.
void describe_masstree_page_common(std::ostream *o_ptr, const MasstreePage &v)
DataOffset get_offset_in_bytes(SlotIndex index) const __attribute__((always_inline))
KeySlice get_slice(SlotIndex index) const __attribute__((always_inline))
T align8(T value)
8-alignment.
SlotLengthUnion lengthes_
Stores mutable length information of the record.
void describe_volatile_pointer(std::ostream *o, VolatilePagePointer pointer)
bool is_empty_range() const __attribute__((always_inline))
An empty-range page, either intermediate or border, never has any entries.
uint16_t PayloadLength
Represents a byte-length of a payload in this package.
uint16_t SlotIndex
Index of a record in a (border) page.
std::ostream & operator<<(std::ostream &o, const MasstreeComposeContext::PathLevel &v)
bool is_locked() const __attribute__((always_inline))
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
bool is_border() const __attribute__((always_inline))
MiniPage & get_minipage(uint8_t index) __attribute__((always_inline))
Represents one border page in Masstree Storage.
DualPagePointer * get_next_layer(SlotIndex index) __attribute__((always_inline))
uint64_t KeySlice
Each key slice is an 8-byte integer.
uint16_t KeyLength
Represents a byte-length of a key in this package.
Common base of MasstreeIntermediatePage and MasstreeBorderPage.
char * get_record(SlotIndex index) __attribute__((always_inline))
VolatilePagePointer get_foster_minor() const __attribute__((always_inline))
PayloadLength get_payload_length(SlotIndex index) const __attribute__((always_inline))
VolatilePagePointer get_foster_major() const __attribute__((always_inline))
SlotLengthPart components
KeySlice get_separator(uint8_t index) const __attribute__((always_inline))
KeyLength get_suffix_length(SlotIndex index) const __attribute__((always_inline))
DualPagePointer pointers_[kMaxIntermediateMiniSeparators+1]
void assert_entries_impl() const
defined in masstree_page_debug.cpp.
const Slot * get_slot(SlotIndex index) const __attribute__((always_inline))
const SlotIndex kBorderPageMaxSlots
Maximum number of slots in one MasstreeBorderPage.
KeySlice get_high_fence() const __attribute__((always_inline))
Equivalent to std::hex in case the stream doesn't support it.
KeySlice separators_[kMaxIntermediateMiniSeparators]
Same semantics as separators_ in enclosing class.
KeySlice get_low_fence() const __attribute__((always_inline))
KeySlice get_foster_fence() const __attribute__((always_inline))
char * get_record_payload(SlotIndex index) __attribute__((always_inline))
Convenient way of writing hex integers to stream.
KeyLength get_suffix_length_aligned(SlotIndex index) const __attribute__((always_inline))
xct::RwLockableXctId * get_owner_id(SlotIndex index) __attribute__((always_inline))
Represents one intermediate page in Masstree Storage.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
bool does_point_to_layer(SlotIndex index) const __attribute__((always_inline))