Derecho  0.9
Distributed systems toolkit for RDMA
Classes | Typedefs | Enumerations | Functions
persistent Namespace Reference

This file include all common types internal to derecho and not necessarily being known by a client program. More...

Classes

class  _NameMaker
 
class  FilePersistLog
 
struct  hlc_index_entry
 
struct  hlc_index_entry_comp
 
class  IDeltaObjectFactory
 
class  IDeltaSupport
 
class  ITemporalQueryFrontierProvider
 
union  log_entry
 
struct  log_entry.fields
 
union  meta_header
 
struct  meta_header.fields
 
class  Persistent
 
class  PersistentRegistry
 PersistentRegistry is a book for all the Persistent<T> or Volatile<T> variables. More...
 
class  PersistLog
 
class  Volatile
 

Typedefs

typedef union persistent::meta_header MetaHeader
 
typedef union persistent::log_entry LogEntry
 
using DeltaFinalizer = std::function< void(char const *const, std::size_t)>
 
using version_t = int64_t
 
using VersionFunc = std::function< void(const version_t &, const HLC &)>
 
using PersistFunc = std::function< const version_t(void)>
 
using TrimFunc = std::function< void(const version_t &)>
 
using LatestPersistedGetterFunc = std::function< const version_t(void)>
 
using TruncateFunc = std::function< void(const int64_t &)>
 

Enumerations

enum  StorageType { ST_FILE = 0, ST_MEM, ST_3DXP }
 

Functions

template<typename TKey , typename KeyGetter >
int64_t binarySearch (const KeyGetter &, const TKey &, const int64_t &, const int64_t &)
 
template<typename int_type >
version_t combine_int32s (const int_type high_bits, const int_type low_bits)
 Helper function for creating Persistent version numbers out of MulticastGroup sequence numbers and View IDs. More...
 
template<typename int_type >
std::pair< int_type, int_type > unpack_version (const version_t packed_int)
 Helper function for unpacking a Persistent version number into two signed or unsigned int32 values. More...
 
template<typename ObjectType , StorageType storageType>
void saveObject (ObjectType &obj, const char *object_name=nullptr) noexcept(false)
 saveObject() saves a serializable object More...
 
template<typename ObjectType , StorageType storageType>
std::unique_ptr< ObjectType > loadObject (const char *object_name=nullptr) noexcept(false)
 loadObject() loads a serializable object from a persistent store More...
 
template<StorageType storageType>
const std::enable_if<(storageType==ST_FILE||storageType==ST_MEM), version_t >::type getMinimumLatestPersistedVersion (const std::type_index &subgroup_type, uint32_t subgroup_index, uint32_t shard_num)
 get the minmum latest persisted version for a Replicated<T> identified by More...
 
template<typename ObjectType , StorageType storageType>
void saveNoLogObjectInFile (ObjectType &obj, const char *object_name) noexcept(false)
 save object in file More...
 
template<typename ObjectType , StorageType storageType>
std::unique_ptr< ObjectType > loadNoLogObjectFromFile (const char *object_name, mutils::DeserializationManager *dm=nullptr) noexcept(false)
 load data from file More...
 
template<typename ObjectType >
void saveNoLogObjectInMem (ObjectType &obj, const char *object_name) noexcept(false)
 
template<typename ObjectType >
std::unique_ptr< ObjectType > loadNoLogObjectFromMem (const char *object_name, mutils::DeserializationManager *dm=nullptr) noexcept(false)
 

Detailed Description

This file include all common types internal to derecho and not necessarily being known by a client program.

Compilation Macros: _PERFORMANCE_DEBUG.


Class Documentation

◆ persistent::log_entry

union persistent::log_entry

Definition at line 33 of file FilePersistLog.hpp.

Class Members
uint8_t bytes[64]
struct log_entry fields

◆ persistent::log_entry.fields

struct persistent::log_entry.fields

Definition at line 34 of file FilePersistLog.hpp.

Class Members
uint64_t dlen
uint64_t hlc_l
uint64_t hlc_r
uint64_t ofst
int64_t ver

◆ persistent::meta_header.fields

struct persistent::meta_header.fields

Definition at line 19 of file FilePersistLog.hpp.

Class Members
int64_t head
int64_t tail
int64_t ver

Typedef Documentation

◆ DeltaFinalizer

using persistent::DeltaFinalizer = typedef std::function<void(char const* const, std::size_t)>

Definition at line 255 of file Persistent.hpp.

◆ LatestPersistedGetterFunc

using persistent::LatestPersistedGetterFunc = typedef std::function<const version_t(void)>

Definition at line 22 of file PersistentTypenames.hpp.

◆ LogEntry

◆ MetaHeader

◆ PersistFunc

using persistent::PersistFunc = typedef std::function<const version_t(void)>

Definition at line 20 of file PersistentTypenames.hpp.

◆ TrimFunc

using persistent::TrimFunc = typedef std::function<void(const version_t &)>

Definition at line 21 of file PersistentTypenames.hpp.

◆ TruncateFunc

using persistent::TruncateFunc = typedef std::function<void(const int64_t &)>

Definition at line 23 of file PersistentTypenames.hpp.

◆ version_t

using persistent::version_t = typedef int64_t

Definition at line 15 of file PersistentTypenames.hpp.

◆ VersionFunc

using persistent::VersionFunc = typedef std::function<void(const version_t &,const HLC &)>

Definition at line 19 of file PersistentTypenames.hpp.

Enumeration Type Documentation

◆ StorageType

Enumerator
ST_FILE 
ST_MEM 
ST_3DXP 

Definition at line 21 of file PersistLog.hpp.

Function Documentation

◆ binarySearch()

template<typename TKey , typename KeyGetter >
int64_t persistent::binarySearch ( const KeyGetter &  ,
const TKey &  ,
const int64_t &  ,
const int64_t &   
)

◆ combine_int32s()

template<typename int_type >
version_t persistent::combine_int32s ( const int_type  high_bits,
const int_type  low_bits 
)

Helper function for creating Persistent version numbers out of MulticastGroup sequence numbers and View IDs.

Packs two 32-bit integer types into an unsigned 64-bit int; the template allows them to be signed or unsigned.

Parameters
high_bitsThe integer that should become the high order bits of the version number.
low_bitsThe integer that should become the low order bits of the version number
Returns
The concatenation of the two integers as a 64-bit version number.

Definition at line 7 of file Persistent_impl.hpp.

◆ getMinimumLatestPersistedVersion()

template<StorageType storageType>
const std::enable_if<(storageType==ST_FILE||storageType==ST_MEM), version_t >::type persistent::getMinimumLatestPersistedVersion ( const std::type_index &  subgroup_type,
uint32_t  subgroup_index,
uint32_t  shard_num 
)

get the minmum latest persisted version for a Replicated<T> identified by

Parameters
subgroup_type
subgroup_index
shard_num
Returns
The minimum latest persisted version across the Replicated's Persistent<T> fields, as a version number

Definition at line 611 of file Persistent_impl.hpp.

◆ loadNoLogObjectFromFile()

template<typename ObjectType , StorageType storageType>
std::unique_ptr< ObjectType > persistent::loadNoLogObjectFromFile ( const char *  object_name,
mutils::DeserializationManager dm = nullptr 
)
noexcept

load data from file

Parameters
object_name

Definition at line 44 of file PersistNoLog_impl.hpp.

◆ loadNoLogObjectFromMem()

template<typename ObjectType >
std::unique_ptr<ObjectType> persistent::loadNoLogObjectFromMem ( const char *  object_name,
mutils::DeserializationManager dm = nullptr 
)
noexcept

Definition at line 54 of file PersistNoLog.hpp.

◆ loadObject()

template<typename ObjectType , StorageType storageType>
std::unique_ptr< ObjectType > persistent::loadObject ( const char *  object_name = nullptr)
noexcept

loadObject() loads a serializable object from a persistent store

Returns
If there is no such object in the persistent store, just return a nullptr.

Definition at line 597 of file Persistent_impl.hpp.

◆ saveNoLogObjectInFile()

template<typename ObjectType , StorageType storageType>
void persistent::saveNoLogObjectInFile ( ObjectType &  obj,
const char *  object_name 
)
noexcept

save object in file

Parameters
objReference to the object to be persistent
object_namename of the object

Definition at line 10 of file PersistNoLog_impl.hpp.

◆ saveNoLogObjectInMem()

template<typename ObjectType >
void persistent::saveNoLogObjectInMem ( ObjectType &  obj,
const char *  object_name 
)
noexcept

Definition at line 38 of file PersistNoLog.hpp.

◆ saveObject()

template<typename ObjectType , StorageType storageType>
void persistent::saveObject ( ObjectType &  obj,
const char *  object_name = nullptr 
)
noexcept

saveObject() saves a serializable object

Parameters
objThe object to be persisted.
object_nameOptional object name. If not given, the object_name is <storage type>="">-<object type="" name>="">-nolog. NOTE: please provide an object name if you trying to persist two objects of the same type. NOTE: the object has to be ByteRepresentable.
Returns

Definition at line 579 of file Persistent_impl.hpp.

◆ unpack_version()

template<typename int_type >
std::pair< int_type, int_type > persistent::unpack_version ( const version_t  packed_int)

Helper function for unpacking a Persistent version number into two signed or unsigned int32 values.

The template parameter determines whether each 32-bit half of the version number will be intepreted as a signed int or an unsigned int.

Parameters
packed_intThe version number to unpack
Returns
A std::pair in which the first element is the high-order bits of the version number, and the second element is the low-order bits of the version number.

Definition at line 12 of file Persistent_impl.hpp.