libfoedus-core
FOEDUS Core Library
foedus::storage::Composer::DropVolatilesArguments Struct Reference

Arguments for drop_volatiles() More...

Detailed Description

Arguments for drop_volatiles()

Definition at line 148 of file composer.hpp.

#include <composer.hpp>

Collaboration diagram for foedus::storage::Composer::DropVolatilesArguments:

Public Member Functions

void drop (Engine *engine, VolatilePagePointer pointer) const
 Returns (might cache) the given pointer to volatile pool. More...
 

Public Attributes

snapshot::Snapshot snapshot_
 The new snapshot. More...
 
uint16_t my_partition_
 if partitioned_drop_ is true, the partition this thread should drop volatile pages from More...
 
bool partitioned_drop_
 if true, one thread for each partition will invoke drop_volatiles() More...
 
memory::PagePoolOffsetChunkdropped_chunks_
 Caches dropped pages to avoid returning every single page. More...
 
uint64_t * dropped_count_
 [OUT] Number of volatile pages that were dropped More...
 

Member Function Documentation

void foedus::storage::Composer::DropVolatilesArguments::drop ( Engine engine,
VolatilePagePointer  pointer 
) const

Returns (might cache) the given pointer to volatile pool.

Definition at line 114 of file composer.cpp.

References ASSERT_ND, dropped_chunks_, foedus::memory::PagePoolOffsetChunk::empty(), foedus::memory::PagePoolOffsetChunk::full(), foedus::memory::EngineMemory::get_global_volatile_page_resolver(), foedus::Engine::get_memory_manager(), foedus::memory::EngineMemory::get_node_memory(), foedus::storage::VolatilePagePointer::get_numa_node(), foedus::storage::VolatilePagePointer::get_offset(), foedus::memory::NumaNodeMemoryRef::get_volatile_pool(), foedus::storage::VolatilePagePointer::is_null(), foedus::memory::PagePoolOffsetChunk::push_back(), foedus::memory::PagePool::release(), foedus::memory::GlobalVolatilePageResolver::resolve_offset(), and foedus::memory::PagePoolOffsetChunk::size().

Referenced by foedus::storage::sequential::SequentialComposer::drop_volatiles().

116  {
117  uint16_t node = pointer.get_numa_node();
118  ASSERT_ND(node < engine->get_soc_count());
119  ASSERT_ND(!pointer.is_null());
120 #ifndef NDEBUG
121  // let's fill the page with garbage to help debugging
122  std::memset(
123  engine->get_memory_manager()->get_global_volatile_page_resolver().resolve_offset(pointer),
124  0xDA,
125  sizeof(Page));
126 #endif // NDEBUG
127 
128  memory::PagePoolOffsetChunk* chunk = dropped_chunks_ + node;
129  if (chunk->full()) {
130  memory::PagePool* pool
131  = engine->get_memory_manager()->get_node_memory(node)->get_volatile_pool();
132  pool->release(chunk->size(), chunk);
133  ASSERT_ND(chunk->empty());
134  }
135  ASSERT_ND(!chunk->full());
136  chunk->push_back(pointer.get_offset());
137  ++(*dropped_count_);
138 }
memory::PagePoolOffsetChunk * dropped_chunks_
Caches dropped pages to avoid returning every single page.
Definition: composer.hpp:161
#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:

Member Data Documentation

memory::PagePoolOffsetChunk* foedus::storage::Composer::DropVolatilesArguments::dropped_chunks_

Caches dropped pages to avoid returning every single page.

This is an array of PagePoolOffsetChunk whose index is node ID. For each dropped page, we add it to this chunk and batch-return them to the volatile pool when it becomes full or after processing all storages.

Definition at line 161 of file composer.hpp.

Referenced by drop().

uint64_t* foedus::storage::Composer::DropVolatilesArguments::dropped_count_

[OUT] Number of volatile pages that were dropped

Definition at line 163 of file composer.hpp.

uint16_t foedus::storage::Composer::DropVolatilesArguments::my_partition_
bool foedus::storage::Composer::DropVolatilesArguments::partitioned_drop_
snapshot::Snapshot foedus::storage::Composer::DropVolatilesArguments::snapshot_

The new snapshot.

All newly created snapshot pages are of this snapshot

Definition at line 150 of file composer.hpp.

Referenced by foedus::storage::array::ArrayComposer::drop_root_volatile(), foedus::storage::sequential::SequentialComposer::drop_volatiles(), and foedus::storage::Composer::DropResult::DropResult().


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