libfoedus-core
FOEDUS Core Library
foedus::storage::CreateLogType Struct Referencefinal

Base type for CREATE STORAGE operation. More...

Detailed Description

Base type for CREATE STORAGE operation.

This is not an actual log type that is used. Individual storages have their own create-log type, which is compatible, not derived, to this. Just like Metadata and individual metadata types, this is just to provide a common view.

Definition at line 63 of file storage_log_types.hpp.

#include <storage_log_types.hpp>

Inheritance diagram for foedus::storage::CreateLogType:
Collaboration diagram for foedus::storage::CreateLogType:

Public Member Functions

 CreateLogType ()=delete
 
 CreateLogType (const CreateLogType &other)=delete
 
 ~CreateLogType ()=delete
 
void apply_storage (Engine *engine, StorageId storage_id)
 
void assert_valid ()
 
- Public Member Functions inherited from foedus::log::StorageLogType
bool is_engine_log () const
 
bool is_storage_log () const
 
bool is_record_log () const
 
void apply_engine (thread::Thread *)
 
void apply_record (thread::Thread *, storage::StorageId, xct::RwLockableXctId *, char *)
 
void assert_valid_generic () __attribute__((always_inline))
 Verifies the log contains essential fields set. More...
 

Public Attributes

Metadata metadata_
 
- Public Attributes inherited from foedus::log::BaseLogType
LogHeader header_
 

Friends

std::ostream & operator<< (std::ostream &o, const CreateLogType &v)
 

Constructor & Destructor Documentation

foedus::storage::CreateLogType::CreateLogType ( )
delete
foedus::storage::CreateLogType::CreateLogType ( const CreateLogType other)
delete
foedus::storage::CreateLogType::~CreateLogType ( )
delete

Member Function Documentation

void foedus::storage::CreateLogType::apply_storage ( Engine engine,
StorageId  storage_id 
)

Definition at line 68 of file storage_log_types.cpp.

References ASSERT_ND, foedus::storage::StorageManager::create_storage_apply(), foedus::Engine::get_storage_manager(), foedus::storage::Metadata::id_, and metadata_.

68  {
69  ASSERT_ND(metadata_.id_ == storage_id);
70  LOG(INFO) << "Applying CREATE STORAGE log: " << *this;
71  engine->get_storage_manager()->create_storage_apply(metadata_);
72  LOG(INFO) << "Applied CREATE STORAGE log: " << *this;
73 }
#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
StorageId id_
the unique ID of this storage.
Definition: metadata.hpp:103

Here is the call graph for this function:

void foedus::storage::CreateLogType::assert_valid ( )

Definition at line 63 of file storage_log_types.cpp.

References ASSERT_ND, foedus::log::StorageLogType::assert_valid_generic(), foedus::log::BaseLogType::header_, foedus::storage::Metadata::id_, metadata_, and foedus::log::LogHeader::storage_id_.

63  {
66 }
storage::StorageId storage_id_
The storage this loggable operation mainly affects.
#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
StorageId id_
the unique ID of this storage.
Definition: metadata.hpp:103
void assert_valid_generic() __attribute__((always_inline))
Verifies the log contains essential fields set.

Here is the call graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const CreateLogType v 
)
friend

Definition at line 75 of file storage_log_types.cpp.

75  {
76  switch (v.metadata_.type_) {
77  case kArrayStorage:
78  o << reinterpret_cast<const array::ArrayCreateLogType&>(v);
79  break;
80  case kHashStorage:
81  o << reinterpret_cast<const hash::HashCreateLogType&>(v);
82  break;
83  case kMasstreeStorage:
84  o << reinterpret_cast<const masstree::MasstreeCreateLogType&>(v);
85  break;
86  case kSequentialStorage:
87  o << reinterpret_cast<const sequential::SequentialCreateLogType&>(v);
88  break;
89  default:
90  o << "Unexpected metadata type:" << v.metadata_.type_;
91  }
92  return o;
93 }

Member Data Documentation

Metadata foedus::storage::CreateLogType::metadata_

Definition at line 65 of file storage_log_types.hpp.

Referenced by apply_storage(), assert_valid(), and foedus::storage::operator<<().


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