libfoedus-core
FOEDUS Core Library
foedus::storage::sequential::SequentialRecordBatch Struct Referencefinal

A chunk of records returned by SequentialCursor. More...

Detailed Description

A chunk of records returned by SequentialCursor.

SequentialCursor tends to return a huge number of records. For better performance, we return a page-full of records at a time.

For now, as an optimization, this struct has the exact same format as SequentialPage, which is an internal implementation detail. On the other hand, this struct is an API. We keep them separate as the internal page representation might change in future.

Definition at line 339 of file sequential_cursor.hpp.

#include <sequential_cursor.hpp>

Collaboration diagram for foedus::storage::sequential::SequentialRecordBatch:

Public Member Functions

uint16_t get_record_count () const
 
uint16_t get_record_length (uint16_t index) const
 
const xct::RwLockableXctIdget_owner_id_from_offset (uint16_t offset) const
 
const char * get_payload_from_offset (uint16_t offset) const
 
Epoch get_epoch_from_offset (uint16_t offset) const
 

Public Attributes

PageHeader header_
 
uint16_t record_count_
 
uint16_t used_data_bytes_
 
uint32_t filler_
 
DualPagePointer next_page_
 Pointer to next page. More...
 
char data_ [kDataSize]
 Dynamic data part in this page, which consist of 1) record part growing forward, 2) unused part, and 3) payload lengthes part growing backward. More...
 

Member Function Documentation

Epoch foedus::storage::sequential::SequentialRecordBatch::get_epoch_from_offset ( uint16_t  offset) const
inline

Definition at line 372 of file sequential_cursor.hpp.

References foedus::xct::XctId::get_epoch(), get_owner_id_from_offset(), and foedus::xct::RwLockableXctId::xct_id_.

Referenced by foedus::storage::sequential::SequentialRecordIterator::next(), and foedus::storage::sequential::SequentialRecordIterator::SequentialRecordIterator().

372  {
373  return get_owner_id_from_offset(offset)->xct_id_.get_epoch();
374  }
const xct::RwLockableXctId * get_owner_id_from_offset(uint16_t offset) const
XctId xct_id_
the second 64bit: Persistent status part of TID.
Definition: xct_id.hpp:1137
Epoch get_epoch() const __attribute__((always_inline))
Definition: xct_id.hpp:964

Here is the call graph for this function:

Here is the caller graph for this function:

const xct::RwLockableXctId* foedus::storage::sequential::SequentialRecordBatch::get_owner_id_from_offset ( uint16_t  offset) const
inline

Definition at line 364 of file sequential_cursor.hpp.

References ASSERT_ND, and foedus::storage::sequential::kDataSize.

Referenced by foedus::storage::sequential::SequentialRecordIterator::get_cur_record_owner_id(), and get_epoch_from_offset().

364  {
365  ASSERT_ND(offset + record_count_ * sizeof(uint16_t) <= kDataSize);
366  return reinterpret_cast<const xct::RwLockableXctId*>(data_ + offset);
367  }
char data_[kDataSize]
Dynamic data part in this page, which consist of 1) record part growing forward, 2) unused part...
const uint16_t kDataSize
Byte size of data region in each data page of sequential storage.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72

Here is the caller graph for this function:

const char* foedus::storage::sequential::SequentialRecordBatch::get_payload_from_offset ( uint16_t  offset) const
inline

Definition at line 368 of file sequential_cursor.hpp.

References ASSERT_ND, and foedus::storage::sequential::kDataSize.

Referenced by foedus::storage::sequential::SequentialRecordIterator::get_cur_record_raw().

368  {
369  ASSERT_ND(offset + record_count_ * sizeof(uint16_t) <= kDataSize);
370  return data_ + offset + sizeof(xct::RwLockableXctId);
371  }
char data_[kDataSize]
Dynamic data part in this page, which consist of 1) record part growing forward, 2) unused part...
const uint16_t kDataSize
Byte size of data region in each data page of sequential storage.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72

Here is the caller graph for this function:

uint16_t foedus::storage::sequential::SequentialRecordBatch::get_record_count ( ) const
inline

Definition at line 359 of file sequential_cursor.hpp.

References record_count_.

uint16_t foedus::storage::sequential::SequentialRecordBatch::get_record_length ( uint16_t  index) const
inline

Definition at line 360 of file sequential_cursor.hpp.

References ASSERT_ND, and data_.

Referenced by foedus::storage::sequential::SequentialRecordIterator::next(), and foedus::storage::sequential::SequentialRecordIterator::SequentialRecordIterator().

360  {
361  ASSERT_ND(index < record_count_);
362  return reinterpret_cast<const uint16_t*>(data_ + sizeof(data_))[-index - 1];
363  }
char data_[kDataSize]
Dynamic data part in this page, which consist of 1) record part growing forward, 2) unused part...
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
Definition: assert_nd.hpp:72

Here is the caller graph for this function:

Member Data Documentation

char foedus::storage::sequential::SequentialRecordBatch::data_[kDataSize]

Dynamic data part in this page, which consist of 1) record part growing forward, 2) unused part, and 3) payload lengthes part growing backward.

Definition at line 356 of file sequential_cursor.hpp.

Referenced by get_record_length().

uint32_t foedus::storage::sequential::SequentialRecordBatch::filler_

Definition at line 344 of file sequential_cursor.hpp.

PageHeader foedus::storage::sequential::SequentialRecordBatch::header_

Definition at line 340 of file sequential_cursor.hpp.

DualPagePointer foedus::storage::sequential::SequentialRecordBatch::next_page_

Pointer to next page.

Once it is set, the pointer and the pointed page will never be changed.

Definition at line 350 of file sequential_cursor.hpp.

uint16_t foedus::storage::sequential::SequentialRecordBatch::record_count_

Definition at line 342 of file sequential_cursor.hpp.

Referenced by get_record_count().

uint16_t foedus::storage::sequential::SequentialRecordBatch::used_data_bytes_

Definition at line 343 of file sequential_cursor.hpp.


The documentation for this struct was generated from the following file: