18 #ifndef FOEDUS_STORAGE_STORAGE_HPP_
19 #define FOEDUS_STORAGE_STORAGE_HPP_
115 template <
typename CONTROL_BLOCK>
120 :
Attachable<CONTROL_BLOCK>(engine, control_block) {}
122 :
Attachable<CONTROL_BLOCK>(engine, reinterpret_cast<CONTROL_BLOCK*>(control_block)) {}
196 CXX11_STATIC_ASSERT(
sizeof(StorageControlBlock) == 1 << 12,
"StorageControlBlock is not 4kb");
199 #endif // FOEDUS_STORAGE_STORAGE_HPP_
Metadata meta_
common part of the metadata.
Storage(Engine *engine, StorageId id)
Shorthand for engine->get_storage_manager()->get_storage(id)
Represents a pointer to another page (usually a child page).
The storage has been marked for drop and can't be used.
Definitions of IDs in this package and a few related constant values.
char padding_[ 4096-sizeof(soc::SharedMutex)-8-sizeof(DualPagePointer)-sizeof(Metadata)]
Just to make this exactly 4kb.
Forward declarations of classes in log manager package.
#define CXX11_NULLPTR
Used in public headers in place of "nullptr" of C++11.
Storage(Engine *engine, StorageControlBlock *control_block)
soc::SharedMutex status_mutex_
The mutext to protect changing the status.
StorageType get_type() const
Returns the type of this storage.
uint32_t StorageId
Unique ID for storage.
void initialize(bool recursive=false)
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Forward declarations of classes in transaction package.
Storage(Engine *engine, const StorageName &name)
Shorthand for engine->get_storage_manager()->get_storage(name)
Forward declarations of classes in root package.
Storage(Engine *engine, CONTROL_BLOCK *control_block)
DualPagePointer root_page_pointer_
Points to the root page (or something equivalent).
Engine * engine_
Most attachable object stores an engine pointer (local engine), so we define it here.
The storage has been created and ready for use.
const Metadata * get_metadata() const
Returns the metadata of this storage.
A mutex that can be placed in shared memory and used from multiple processes.
Represents one key-value store.
VolatilePagePointer volatile_pointer_
StorageControlBlock * get_storage_control_block(Engine *engine, StorageId id)
Forward declarations of classes in storage package.
CONTROL_BLOCK * control_block_
The shared data on shared memory that has been initialized in some SOC or master engine.
const StorageName & get_name() const
Returns the unique name of this storage.
bool exists() const
Returns whether this storage is already created.
#define CXX11_FINAL
Used in public headers in place of "final" of C++11.
Database engine object that holds all resources and provides APIs.
assorted::FixedString< 60 > StorageName
Represents a unique name of a storage.
SnapshotPagePointer snapshot_pointer_
StorageId get_id() const
Returns the unique ID of this storage.
#define CXX11_STATIC_ASSERT(expr, message)
Used in public headers in place of "static_assert" of C++11.
StorageControlBlock()=delete
~StorageControlBlock()=delete
Attachable Resources on Shared Memory.
Storage & operator=(const Storage &other)
StorageType
Type of the storage, such as hash.
#define CXX11_FUNC_DELETE
Used in public headers in place of " = delete" of C++11.
bool is_valid_status() const
Initial state, which means the storage has not been created yet.
StorageStatus status_
Status of the storage.
Forward declarations of classes in thread package.
A base layout of shared data for all storage types.
Storage(const Storage &other)
StorageStatus
Status of a storage.