libfoedus-core
FOEDUS Core Library
foedus::storage::array Namespace Reference

Array Storage, a dense and regular array. More...

Detailed Description

Array Storage, a dense and regular array.

Basic Structure

Our array-storage is an extremely simple data structure at the cost of limited applicability (fix-sized, regular, dense arrays). The page layout has little per-page information that is dynamic, meaning that most data never changes after the array storage is created. Further, as everything is pre-allocated, no phantoms, no insertion/splits, nor anything complex. Thus, little synchronization hassles.

Supported Operations

Array storage allows very few data operations.

  • Reads a record or a range of records.
  • Overwrites a record.
  • Reads a range of records in batched fashion. (Not implemented so far, just loop over it. This might be useful for a big array of really small records to avoid function call overheads.)

In other words, the following operations are NOT supported.

  • Inserts or Deletes a record because all records always exist in an array storage (dense array). Client programs can achieve the same thing by storing one-bit in payload as a deletion-flag and overwrites it.
  • Resize individual records or the entire array. All records are fix-sized and pre-allocated when the array storage is initialized.

If these limitations do not cause an issue, array storage is a best choice as it's extremely efficient and scalable thanks to the simplicity.

Page Hierarchy

Despite the name of this storage type, we do have a page hierarchy, which is required to handle switches between volatile/snapshot pages. Hence, a more precise description of this storage type is a fix-sized pre-allocated tree that has only integer-keys from 0 to array_size-1.

All data (payload) are stored in leaf pages and interior pages contain only pointers to its children. There is only one root page per array, which may or may not be a leaf page. Just like B-trees in many sense.

Page Layout

Header and Data
Fix-Sized HEADER (kHeaderSize bytes)DATA
Interior Node Data
InteriorRecordInteriorRecord...
See foedus::storage::array::ArrayPage::InteriorRecord.
Leaf Node Data
RecordPaddingRecordPadding...
We simply puts foedus::storage::Record contiguously, but with a padding (0-7 bytes). to make sure Record are 8-byte aligned because we do atomic operations on Record's owner_id_.

Concurrency Control

We do a bit special concurrency control for this storage type. Because everything is pre-allocated and no split/physical-delete/merge whatsoever, we can do the ModCount concurrency control per Record, not per page. We store ModCount for each record, instead stores no ModCount in page header. Thus, individual transactions that update records in same page have no contention except they update the exact same record. We even don't track node-set; only record-set is checked at commit.

This simplifies and increases concurrency for most data accesses, but we have to be careful when the page eviction thread drops the volatile page. We need to know the largest Epoch of records in the page at the point, but concurrent transactions might be modifying records at the same time. Thus, we do two-path optimistic concurrency control similar to our commit protocol for Masstree Storage.

  • The eviction thread takes a look at all Epoch in the page, remembering the largest one.
  • Fence
  • Then, it puts a mark on the pointer from the parent page to the evicted page to announce that the volatile page is about to be evicted.
  • Fence
  • Finally, it takes a look at all Epoch in the page again and completes the eviction only if it sees the same largest Epoch. If not, gives up (because the volatile page is now newer, no chance to drop it with the latest snapshot version).

References

  • [SCIDB] Cudre-Mauroux, P. and Kimura, H. and Lim, K.-T. and Rogers, J. and Simakov, R. and Soroush, E. and Velikhov, P. and Wang, D. L. and Balazinska, M. and Becla, J. and DeWitt, D. and Heath, B. and Maier, D. and Madden, S. and Patel, J. and Stonebraker, M. and Zdonik, S. "A demonstration of SciDB: a science-oriented DBMS.", VLDB, 2009.

Classes

struct  ArrayCommonUpdateLogType
 A base class for ArrayOverwriteLogType/ArrayIncrementLogType. More...
 
class  ArrayComposeContext
 ArrayComposer's compose() implementation separated from the class itself. More...
 
class  ArrayComposer
 Composer for an array storage. More...
 
struct  ArrayCreateLogType
 Log type of CREATE ARRAY STORAGE operation. More...
 
struct  ArrayIncrementLogType
 Log type of array-storage's increment operation. More...
 
struct  ArrayMetadata
 Metadata of an array storage. More...
 
struct  ArrayMetadataSerializer
 
struct  ArrayOverwriteLogType
 Log type of array-storage's overwrite operation. More...
 
class  ArrayPage
 Represents one data page in Array Storage. More...
 
class  ArrayPartitioner
 Partitioner for an array storage. More...
 
struct  ArrayPartitionerData
 
struct  ArrayRange
 Represents an offset range in an array storage. More...
 
struct  ArrayRootInfoPage
 Output of one compose() call, which are then combined in construct_root(). More...
 
class  ArrayStorage
 Represents a key-value store based on a dense and regular array. More...
 
struct  ArrayStorageControlBlock
 Shared data of this storage type. More...
 
class  ArrayStoragePimpl
 Pimpl object of ArrayStorage. More...
 
union  LookupRoute
 Compactly represents the route to reach the given offset. More...
 
class  LookupRouteFinder
 Packages logic and required properties to calculate LookupRoute in array storage from offset. More...
 
struct  SortEntry
 Used in sort_batch(). More...
 

Typedefs

typedef uint64_t ArrayOffset
 The only key type in array storage. More...
 

Enumerations

enum  ValueType {
  kUnknown = 0, kI8 = 1, kI16, kI32,
  kU8, kU16, kU32, kFloat,
  kBool, kI64, kU64, kDouble
}
 Used in ArrayIncrementLogType. More...
 

Functions

template<typename T >
ValueType to_value_type ()
 
template<>
ValueType to_value_type< bool > ()
 
template<>
ValueType to_value_type< int8_t > ()
 
template<>
ValueType to_value_type< int16_t > ()
 
template<>
ValueType to_value_type< int32_t > ()
 
template<>
ValueType to_value_type< int64_t > ()
 
template<>
ValueType to_value_type< uint8_t > ()
 
template<>
ValueType to_value_type< uint16_t > ()
 
template<>
ValueType to_value_type< uint32_t > ()
 
template<>
ValueType to_value_type< uint64_t > ()
 
template<>
ValueType to_value_type< float > ()
 
template<>
ValueType to_value_type< double > ()
 
template<typename T >
void increment (T *payload, const T *addendum)
 
template<typename T >
void add_to (void *destination, const void *added)
 
void array_volatile_page_init (const VolatilePageInitArguments &args)
 volatile page initialize callback for ArrayPage. More...
 
uint16_t to_records_in_leaf (uint16_t payload_size)
 
std::ostream & operator<< (std::ostream &o, const ArrayCreateLogType &v)
 
std::ostream & operator<< (std::ostream &o, const ArrayOverwriteLogType &v)
 
template<typename T >
as (const void *address)
 
std::ostream & operator<< (std::ostream &o, const ArrayIncrementLogType &v)
 
std::ostream & operator<< (std::ostream &o, const ArrayMetadata &v)
 
void prepare_sort_entries (const Partitioner::SortBatchArguments &args, SortEntry *entries)
 subroutine of sort_batch More...
 
uint32_t compact_logs (const Partitioner::SortBatchArguments &args, SortEntry *entries)
 subroutine of sort_batch More...
 
std::ostream & operator<< (std::ostream &o, const ArrayPartitioner &v)
 
std::ostream & operator<< (std::ostream &o, const ArrayStorage &v)
 
uint8_t calculate_levels (const ArrayMetadata &metadata)
 

Variables

const ArrayOffset kMaxArrayOffset = (1ULL << 48) - 1ULL
 The maximum value allowed for ArrayOffset. More...
 
const uint16_t kHeaderSize = 64
 Byte size of header in each page of array storage. More...
 
const uint16_t kDataSize = foedus::storage::kPageSize - kHeaderSize
 Byte size of data region in each page of array storage. More...
 
const uint16_t kInteriorSize = 16
 Byte size of an entry in interior page of array storage. More...
 
const uint16_t kInteriorFanout = (foedus::storage::kPageSize - kHeaderSize) / kInteriorSize
 Max number of entries in an interior page of array storage. More...
 
const uint8_t kMaxLevels = 8
 Code in array storage assumes this number as the maximum number of levels. More...
 

Class Documentation

struct foedus::storage::array::ArrayRootInfoPage

Output of one compose() call, which are then combined in construct_root().

If the root page is leaf page (single-page array), this contains just one pointer to the root. If not, this contains pointers to direct children of root.

Definition at line 92 of file array_composer_impl.hpp.

Collaboration diagram for foedus::storage::array::ArrayRootInfoPage:
Class Members
char filler_[ kPageSize -sizeof(PageHeader) -kInteriorFanout *sizeof(SnapshotPagePointer)]
PageHeader header_
SnapshotPagePointer pointers_[kInteriorFanout] Pointers to direct children of root.

0 if not set in this compose()

Enumeration Type Documentation

Function Documentation

template<typename T >
void foedus::storage::array::add_to ( void *  destination,
const void *  added 
)
inline

Definition at line 370 of file array_log_types.hpp.

370  {
371  *(reinterpret_cast< T* >(destination)) += *(reinterpret_cast< const T* >(added));
372 }
template<typename T >
T foedus::storage::array::as ( const void *  address)
inline

Definition at line 70 of file array_log_types.cpp.

70  {
71  const T* casted = reinterpret_cast<const T*>(address);
72  return *casted;
73 }
uint8_t foedus::storage::array::calculate_levels ( const ArrayMetadata metadata)

Definition at line 194 of file array_storage_pimpl.cpp.

References foedus::assorted::align8(), foedus::storage::array::ArrayMetadata::array_size_, foedus::assorted::int_div_ceil(), kDataSize, kInteriorFanout, foedus::storage::kRecordOverhead, and foedus::storage::array::ArrayMetadata::payload_size_.

Referenced by foedus::storage::array::ArrayStoragePimpl::load(), and foedus::storage::array::ArrayStoragePimpl::load_empty().

194  {
195  uint64_t array_size = metadata.array_size_;
196  uint16_t payload = assorted::align8(metadata.payload_size_);
197  uint64_t records_per_page = kDataSize / (payload + kRecordOverhead);
198  uint8_t levels = 1;
199  for (uint64_t pages = assorted::int_div_ceil(array_size, records_per_page);
200  pages != 1;
201  pages = assorted::int_div_ceil(pages, kInteriorFanout)) {
202  ++levels;
203  }
204  return levels;
205 }
T align8(T value)
8-alignment.
const uint16_t kRecordOverhead
Byte size of system-managed region per each record.
Definition: record.hpp:56
const uint16_t kDataSize
Byte size of data region in each page of array storage.
Definition: array_id.hpp:100
int64_t int_div_ceil(int64_t dividee, int64_t dividor)
Efficient ceil(dividee/dividor) for integer.
const uint16_t kInteriorFanout
Max number of entries in an interior page of array storage.
Definition: array_id.hpp:110

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t foedus::storage::array::compact_logs ( const Partitioner::SortBatchArguments args,
SortEntry entries 
)

subroutine of sort_batch

Definition at line 249 of file array_partitioner_impl.cpp.

References ASSERT_ND, foedus::storage::array::SortEntry::get_offset(), foedus::storage::array::SortEntry::get_position(), foedus::log::LogHeader::get_type(), foedus::log::BaseLogType::header_, foedus::log::kLogCodeArrayIncrement, foedus::log::kLogCodeArrayOverwrite, foedus::storage::Partitioner::SortBatchArguments::log_buffer_, foedus::log::LogHeader::log_type_code_, foedus::storage::Partitioner::SortBatchArguments::logs_count_, foedus::storage::array::ArrayIncrementLogType::merge(), foedus::storage::Partitioner::SortBatchArguments::output_buffer_, foedus::storage::array::ArrayOverwriteLogType::payload_count_, foedus::storage::array::ArrayOverwriteLogType::payload_offset_, foedus::storage::array::ArrayIncrementLogType::payload_offset_, foedus::snapshot::LogBuffer::resolve(), UNLIKELY, and foedus::storage::array::ArrayIncrementLogType::value_type_.

Referenced by foedus::storage::array::ArrayPartitioner::sort_batch().

249  {
250  // CPU profile of partition_array_perf: 30-35%.
251  // Yeah, this is not cheap... but it can dramatically compact the logs.
252  uint32_t result_count = 1;
253  args.output_buffer_[0] = entries[0].get_position();
254  ArrayOffset prev_offset = entries[0].get_offset();
255  for (uint32_t i = 1; i < args.logs_count_; ++i) {
256  // compact the logs if the same offset appears in a row, and covers the same data region.
257  // because we sorted it by offset and then ordinal, later logs can overwrite the earlier one.
258  ArrayOffset cur_offset = entries[i].get_offset();
259  // wow, adding this UNLIKELY changed the CPU cost of this function from 35% to 13%,
260  // throughput of entire partition_array_perf 5M to 8.5M. because in this experiment
261  // there are few entries with same offset. I haven't seen this much difference with
262  // gcc's unlikely hint before! umm, compiler is not that smart, after all.
263  // this will penalize the case where we have many compaction, but in that case
264  // the following code has more cost anyways.
265  if (UNLIKELY(cur_offset == prev_offset)) {
266  const log::RecordLogType* prev_p = args.log_buffer_.resolve(entries[i - 1].get_position());
267  log::RecordLogType* next_p = args.log_buffer_.resolve(entries[i].get_position());
268  if (prev_p->header_.log_type_code_ != next_p->header_.log_type_code_) {
269  // increment log can be superseded by overwrite log,
270  // overwrite log can be merged with increment log.
271  // however, these usecases are probably much less frequent than the following.
272  // so, we don't compact this case so far.
273  } else if (prev_p->header_.get_type() == log::kLogCodeArrayOverwrite) {
274  // two overwrite logs might be compacted
275  const ArrayOverwriteLogType* prev = reinterpret_cast<const ArrayOverwriteLogType*>(prev_p);
276  const ArrayOverwriteLogType* next = reinterpret_cast<const ArrayOverwriteLogType*>(next_p);
277  // is the data region same or superseded?
278  uint16_t prev_begin = prev->payload_offset_;
279  uint16_t prev_end = prev_begin + prev->payload_count_;
280  uint16_t next_begin = next->payload_offset_;
281  uint16_t next_end = next_begin + next->payload_count_;
282  if (next_begin <= prev_begin && next_end >= prev_end) {
283  --result_count;
284  }
285 
286  // the logic checks data range against only the previous entry.
287  // we might have a situation where 3 or more log entries have the same array offset
288  // and the data regions are like following
289  // Log 1: [4, 8) bytes, Log 2: [8, 12) bytes, Log 3: [4, 8) bytes
290  // If we check further, Log 3 can eliminate Log 1. However, the check is expensive..
291  } else {
292  // two increment logs of same type/offset can be merged into one.
293  ASSERT_ND(prev_p->header_.get_type() == log::kLogCodeArrayIncrement);
294  const ArrayIncrementLogType* prev = reinterpret_cast<const ArrayIncrementLogType*>(prev_p);
295  ArrayIncrementLogType* next = reinterpret_cast<ArrayIncrementLogType*>(next_p);
296  if (prev->value_type_ == next->value_type_
297  && prev->payload_offset_ == next->payload_offset_) {
298  // add up the prev's addendum to next, then delete prev.
299  next->merge(*prev);
300  --result_count;
301  }
302  }
303  } else {
304  prev_offset = cur_offset;
305  }
306  args.output_buffer_[result_count] = entries[i].get_position();
307  ++result_count;
308  }
309  return result_count;
310 }
uint64_t ArrayOffset
The only key type in array storage.
Definition: array_id.hpp:48
0x0023 : foedus::storage::array::ArrayIncrementLogType .
Definition: log_type.hpp:116
0x0022 : foedus::storage::array::ArrayOverwriteLogType .
Definition: log_type.hpp:115
#define UNLIKELY(x)
Hints that x is highly likely false.
Definition: compiler.hpp:104
#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 call graph for this function:

Here is the caller graph for this function:

template<typename T >
void foedus::storage::array::increment ( T *  payload,
const T *  addendum 
)
inline

Definition at line 299 of file array_log_types.hpp.

299  {
300  *payload += *addendum;
301 }
std::ostream& foedus::storage::array::operator<< ( std::ostream &  o,
const ArrayMetadata v 
)

Definition at line 33 of file array_metadata.cpp.

33  {
34  o << ArrayMetadataSerializer(const_cast<ArrayMetadata*>(&v));
35  return o;
36 }
std::ostream& foedus::storage::array::operator<< ( std::ostream &  o,
const ArrayCreateLogType v 
)

Definition at line 48 of file array_log_types.cpp.

References foedus::storage::array::ArrayCreateLogType::metadata_.

48  {
49  o << "<ArrayCreateLog>" << v.metadata_ << "</ArrayCreateLog>";
50  return o;
51 }
std::ostream& foedus::storage::array::operator<< ( std::ostream &  o,
const ArrayOverwriteLogType v 
)

Definition at line 53 of file array_log_types.cpp.

References foedus::storage::array::ArrayCommonUpdateLogType::offset_, foedus::storage::array::ArrayOverwriteLogType::payload_, foedus::storage::array::ArrayOverwriteLogType::payload_count_, and foedus::storage::array::ArrayOverwriteLogType::payload_offset_.

53  {
54  o << "<ArrayOverwriteLog>"
55  << "<offset_>" << v.offset_ << "</offset_>"
56  << "<payload_offset_>" << v.payload_offset_ << "</payload_offset_>"
57  << "<payload_count_>" << v.payload_count_ << "</payload_count_>";
58  // show first few bytes
59  o << "<data_>";
60  for (uint16_t i = 0; i < std::min<uint16_t>(8, v.payload_count_); ++i) {
61  o << i << ":" << static_cast<int>(v.payload_[i]) << " ";
62  }
63  o << "...</data_>";
64  o << "</ArrayOverwriteLog>";
65  return o;
66 }
std::ostream& foedus::storage::array::operator<< ( std::ostream &  o,
const ArrayStorage v 
)

Definition at line 60 of file array_storage.cpp.

References foedus::storage::array::ArrayStorage::get_array_size(), foedus::storage::Storage< CONTROL_BLOCK >::get_id(), foedus::storage::Storage< CONTROL_BLOCK >::get_name(), and foedus::storage::array::ArrayStorage::get_payload_size().

60  {
61  o << "<ArrayStorage>"
62  << "<id>" << v.get_id() << "</id>"
63  << "<name>" << v.get_name() << "</name>"
64  << "<payload_size>" << v.get_payload_size() << "</payload_size>"
65  << "<array_size>" << v.get_array_size() << "</array_size>"
66  << "</ArrayStorage>";
67  return o;
68 }

Here is the call graph for this function:

std::ostream& foedus::storage::array::operator<< ( std::ostream &  o,
const ArrayIncrementLogType v 
)

Definition at line 75 of file array_log_types.cpp.

References foedus::storage::array::ArrayIncrementLogType::addendum_, ASSERT_ND, foedus::storage::array::ArrayIncrementLogType::get_value_type(), kBool, kDouble, kFloat, kI16, kI32, kI64, kI8, kU16, kU32, kU64, kU8, foedus::storage::array::ArrayCommonUpdateLogType::offset_, and foedus::storage::array::ArrayIncrementLogType::payload_offset_.

75  {
76  o << "<ArrayIncrementLog>"
77  << "<offset_>" << v.offset_ << "</offset_>"
78  << "<payload_offset_>" << v.payload_offset_ << "</payload_offset_>"
79  << "<type_>";
80  switch (v.get_value_type()) {
81  // 32 bit data types
82  case kI8:
83  o << "int8_t</type><addendum_>" << static_cast<int16_t>(as<int8_t>(v.addendum_));
84  break;
85  case kI16:
86  o << "int16_t</type><addendum_>" << as<int16_t>(v.addendum_);
87  break;
88  case kI32:
89  o << "int32_t</type><addendum_>" << as<int32_t>(v.addendum_);
90  break;
91  case kBool:
92  case kU8:
93  o << "uint8_t</type><addendum_>" << static_cast<uint16_t>(as<uint8_t>(v.addendum_));
94  break;
95  case kU16:
96  o << "uint16_t</type><addendum_>" << as<uint16_t>(v.addendum_);
97  break;
98  case kU32:
99  o << "uint32_t</type><addendum_>" << as<uint32_t>(v.addendum_);
100  break;
101  case kFloat:
102  o << "float</type><addendum_>" << as<float>(v.addendum_);
103  break;
104 
105  // 64 bit data types
106  case kI64:
107  o << "int64_t</type><addendum_>" << as<int64_t>(v.addendum_ + 4);
108  break;
109  case kU64:
110  o << "uint64_t</type><addendum_>" << as<uint64_t>(v.addendum_ + 4);
111  break;
112  case kDouble:
113  o << "double</type><addendum_>" << as<double>(v.addendum_ + 4);
114  break;
115  default:
116  o << "UNKNOWN(" << v.get_value_type() << ")</type><addendum_>";
117  ASSERT_ND(false);
118  break;
119  }
120  o << "</addendum_>";
121  o << "</ArrayIncrementLog>";
122  return o;
123 }
#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 call graph for this function:

std::ostream& foedus::storage::array::operator<< ( std::ostream &  o,
const ArrayPartitioner v 
)

Definition at line 347 of file array_partitioner_impl.cpp.

References foedus::storage::array::ArrayPartitionerData::array_size_, foedus::storage::array::ArrayPartitionerData::bucket_owners_, foedus::storage::array::ArrayPartitionerData::bucket_size_, and kInteriorFanout.

347  {
348  o << "<ArrayPartitioner>";
349  if (v.data_) {
350  o << "<array_size_>" << v.data_->array_size_ << "</array_size_>"
351  << "<bucket_size_>" << v.data_->bucket_size_ << "</bucket_size_>";
352  for (uint16_t i = 0; i < kInteriorFanout; ++i) {
353  o << "<range bucket=\"" << i << "\" partition=\"" << v.data_->bucket_owners_[i] << "\" />";
354  }
355  } else {
356  o << "Not yet designed";
357  }
358  o << "</ArrayPartitioner>";
359  return o;
360 }
const uint16_t kInteriorFanout
Max number of entries in an interior page of array storage.
Definition: array_id.hpp:110
void foedus::storage::array::prepare_sort_entries ( const Partitioner::SortBatchArguments args,
SortEntry entries 
)

subroutine of sort_batch

Definition at line 228 of file array_partitioner_impl.cpp.

References ASSERT_ND, foedus::storage::Partitioner::SortBatchArguments::base_epoch_, foedus::xct::XctId::get_epoch(), foedus::xct::XctId::get_ordinal(), foedus::log::BaseLogType::header_, foedus::log::kLogCodeArrayIncrement, foedus::log::kLogCodeArrayOverwrite, foedus::storage::Partitioner::SortBatchArguments::log_buffer_, foedus::storage::Partitioner::SortBatchArguments::log_positions_, foedus::log::LogHeader::log_type_code_, foedus::storage::Partitioner::SortBatchArguments::logs_count_, foedus::storage::array::ArrayCommonUpdateLogType::offset_, foedus::snapshot::LogBuffer::resolve(), foedus::storage::array::SortEntry::set(), foedus::Epoch::subtract(), and foedus::log::LogHeader::xct_id_.

Referenced by foedus::storage::array::ArrayPartitioner::sort_batch().

228  {
229  // CPU profile of partition_array_perf: 6-10%.
230  const Epoch base_epoch = args.base_epoch_;
231  for (uint32_t i = 0; i < args.logs_count_; ++i) {
232  const ArrayCommonUpdateLogType* log_entry = reinterpret_cast<const ArrayCommonUpdateLogType*>(
233  args.log_buffer_.resolve(args.log_positions_[i]));
234  ASSERT_ND(log_entry->header_.log_type_code_ == log::kLogCodeArrayOverwrite
235  || log_entry->header_.log_type_code_ == log::kLogCodeArrayIncrement);
236  Epoch epoch = log_entry->header_.xct_id_.get_epoch();
237  ASSERT_ND(epoch.subtract(base_epoch) < (1U << 16));
238  uint16_t compressed_epoch = epoch.subtract(base_epoch);
239  entries[i].set(
240  log_entry->offset_,
241  compressed_epoch,
242  log_entry->header_.xct_id_.get_ordinal(),
243  args.log_positions_[i]);
244  }
245 }
0x0023 : foedus::storage::array::ArrayIncrementLogType .
Definition: log_type.hpp:116
0x0022 : foedus::storage::array::ArrayOverwriteLogType .
Definition: log_type.hpp:115
#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 call graph for this function:

Here is the caller graph for this function:

uint16_t foedus::storage::array::to_records_in_leaf ( uint16_t  payload_size)
inline

Definition at line 71 of file array_route.hpp.

References foedus::assorted::align8(), kDataSize, and foedus::storage::kRecordOverhead.

Referenced by foedus::storage::array::LookupRoute::calculate_page_range().

71  {
72  return kDataSize / (assorted::align8(payload_size) + kRecordOverhead);
73 }
T align8(T value)
8-alignment.
const uint16_t kRecordOverhead
Byte size of system-managed region per each record.
Definition: record.hpp:56
const uint16_t kDataSize
Byte size of data region in each page of array storage.
Definition: array_id.hpp:100

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
ValueType foedus::storage::array::to_value_type ( )
template<>
ValueType foedus::storage::array::to_value_type< bool > ( )
inline

Definition at line 163 of file array_log_types.hpp.

References kBool.

template<>
ValueType foedus::storage::array::to_value_type< double > ( )
inline

Definition at line 173 of file array_log_types.hpp.

References kDouble.

template<>
ValueType foedus::storage::array::to_value_type< float > ( )
inline

Definition at line 172 of file array_log_types.hpp.

References kFloat.

template<>
ValueType foedus::storage::array::to_value_type< int16_t > ( )
inline

Definition at line 165 of file array_log_types.hpp.

References kI16.

template<>
ValueType foedus::storage::array::to_value_type< int32_t > ( )
inline

Definition at line 166 of file array_log_types.hpp.

References kI32.

template<>
ValueType foedus::storage::array::to_value_type< int64_t > ( )
inline

Definition at line 167 of file array_log_types.hpp.

References kI64.

template<>
ValueType foedus::storage::array::to_value_type< int8_t > ( )
inline

Definition at line 164 of file array_log_types.hpp.

References kI8.

template<>
ValueType foedus::storage::array::to_value_type< uint16_t > ( )
inline

Definition at line 169 of file array_log_types.hpp.

References kU16.

template<>
ValueType foedus::storage::array::to_value_type< uint32_t > ( )
inline

Definition at line 170 of file array_log_types.hpp.

References kU32.

template<>
ValueType foedus::storage::array::to_value_type< uint64_t > ( )
inline

Definition at line 171 of file array_log_types.hpp.

References kU64.

template<>
ValueType foedus::storage::array::to_value_type< uint8_t > ( )
inline

Definition at line 168 of file array_log_types.hpp.

References kU8.