libfoedus-core
FOEDUS Core Library
foedus::xct::McsMockNode< RW_BLOCK > Struct Template Reference

Analogous to one thread-group/socket/node. More...

Detailed Description

template<typename RW_BLOCK>
struct foedus::xct::McsMockNode< RW_BLOCK >

Analogous to one thread-group/socket/node.

Note
completely header-only

Definition at line 206 of file xct_mcs_adapter_impl.hpp.

#include <xct_mcs_adapter_impl.hpp>

Collaboration diagram for foedus::xct::McsMockNode< RW_BLOCK >:

Public Member Functions

void init (storage::StorageId dummy_storage_id, uint16_t node_id, uint32_t threads_per_node, uint32_t max_block_count, uint32_t pages_per_node)
 

Public Attributes

uint16_t node_id_
 
uint32_t max_block_count_
 
std::vector< McsMockThread< RW_BLOCK > > threads_
 
McsMockDataPagepages_
 Locks assigned to this node are stored in these memory. More...
 
memory::AlignedMemory page_memory_
 

Member Function Documentation

template<typename RW_BLOCK >
void foedus::xct::McsMockNode< RW_BLOCK >::init ( storage::StorageId  dummy_storage_id,
uint16_t  node_id,
uint32_t  threads_per_node,
uint32_t  max_block_count,
uint32_t  pages_per_node 
)
inline

Definition at line 207 of file xct_mcs_adapter_impl.hpp.

References foedus::memory::AlignedMemory::alloc_onnode(), ASSERT_ND, foedus::memory::AlignedMemory::get_block(), foedus::xct::McsMockDataPage::init(), foedus::memory::AlignedMemory::is_null(), foedus::xct::McsMockNode< RW_BLOCK >::max_block_count_, foedus::xct::McsMockNode< RW_BLOCK >::node_id_, foedus::xct::McsMockNode< RW_BLOCK >::page_memory_, foedus::xct::McsMockNode< RW_BLOCK >::pages_, and foedus::xct::McsMockNode< RW_BLOCK >::threads_.

212  {
213  node_id_ = node_id;
214  max_block_count_ = max_block_count;
215  threads_.resize(threads_per_node);
216  for (uint32_t t = 0; t < threads_per_node; ++t) {
217  threads_[t].init(max_block_count);
218  }
219 
221  sizeof(McsMockDataPage) * pages_per_node,
222  sizeof(McsMockDataPage),
223  node_id);
225  pages_ = reinterpret_cast<McsMockDataPage*>(page_memory_.get_block());
226  for (uint32_t i = 0; i < pages_per_node; ++i) {
227  pages_[i].init(dummy_storage_id, node_id, i);
228  }
229  }
memory::AlignedMemory page_memory_
void init(storage::StorageId dummy_storage_id, uint16_t node_id, uint32_t in_node_index)
void * get_block() const
Returns the memory block.
std::vector< McsMockThread< RW_BLOCK > > threads_
McsMockDataPage * pages_
Locks assigned to this node are stored in these memory.
#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
void alloc_onnode(uint64_t size, uint64_t alignment, int numa_node) noexcept
Short for alloc(kNumaAllocOnnode)
bool is_null() const
Returns if this object doesn't hold a valid memory block.

Here is the call graph for this function:

Member Data Documentation

template<typename RW_BLOCK >
uint32_t foedus::xct::McsMockNode< RW_BLOCK >::max_block_count_
template<typename RW_BLOCK >
uint16_t foedus::xct::McsMockNode< RW_BLOCK >::node_id_
template<typename RW_BLOCK >
memory::AlignedMemory foedus::xct::McsMockNode< RW_BLOCK >::page_memory_
template<typename RW_BLOCK >
McsMockDataPage* foedus::xct::McsMockNode< RW_BLOCK >::pages_

Locks assigned to this node are stored in these memory.

Definition at line 238 of file xct_mcs_adapter_impl.hpp.

Referenced by foedus::xct::McsMockNode< RW_BLOCK >::init().

template<typename RW_BLOCK >
std::vector< McsMockThread<RW_BLOCK> > foedus::xct::McsMockNode< RW_BLOCK >::threads_

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