Hermes  0.9.5-beta
Hierarchical Distributed I/O Buffering System
hermes::api::PersistTrait Struct Reference

Engable persisting a VBucket's linked Blobs to permanent storage. More...

#include <traits.h>

Inheritance diagram for hermes::api::PersistTrait:
Collaboration diagram for hermes::api::PersistTrait:

Public Types

using OffsetMap = std::unordered_map< std::string, u64 >
 

Public Member Functions

 PersistTrait (bool synchronous)
 
 PersistTrait (const std::string &filename, const OffsetMap &offset_map, bool synchronous=false)
 
void onAttach (HermesPtr hermes, VBucketID id, Trait *trait)
 
void onDetach (HermesPtr hermes, VBucketID id, Trait *trait)
 Currently a no-op.
 
void onLink (HermesPtr hermes, TraitInput &input, Trait *trait)
 
void onUnlink (HermesPtr hermes, TraitInput &input, Trait *trait)
 Currently a no-op.
 
- Public Member Functions inherited from hermes::api::Trait
 Trait ()
 Default constructor.
 
 Trait (TraitID id, const std::vector< TraitID > &conflict_traits, TraitType type)
 Construct a Trait. More...
 

Public Attributes

std::string filename
 
std::unordered_map< std::string, u64offset_map
 
bool synchronous
 
- Public Attributes inherited from hermes::api::Trait
TraitID id
 
std::vector< TraitIDconflict_traits
 
TraitType type
 
OnAttachCallback onAttachFn
 
OnAttachCallback onDetachFn
 
OnLinkCallback onLinkFn
 
OnLinkCallback onUnlinkFn
 
OnLinkCallback onGetFn
 

Detailed Description

Engable persisting a VBucket's linked Blobs to permanent storage.

Member Typedef Documentation

◆ OffsetMap

using hermes::api::PersistTrait::OffsetMap = std::unordered_map<std::string, u64>

offset map

Constructor & Destructor Documentation

◆ PersistTrait() [1/2]

hermes::api::PersistTrait::PersistTrait ( bool  synchronous)
explicit

Constructor

◆ PersistTrait() [2/2]

hermes::api::PersistTrait::PersistTrait ( const std::string &  filename,
const OffsetMap offset_map,
bool  synchronous = false 
)
explicit

Constructor with file name and offset map

Here is the call graph for this function:

Member Function Documentation

◆ onAttach()

void hermes::api::PersistTrait::onAttach ( HermesPtr  hermes,
VBucketID  id,
Trait trait 
)

a binding function to run on attchment event

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onLink()

void hermes::api::PersistTrait::onLink ( HermesPtr  hermes,
TraitInput input,
Trait trait 
)

a binding function to run on link event

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ filename

std::string hermes::api::PersistTrait::filename

The name of the file to flush the Blobs to.

◆ offset_map

std::unordered_map<std::string, u64> hermes::api::PersistTrait::offset_map

Maps Blob names to offsets within a file.

◆ synchronous

bool hermes::api::PersistTrait::synchronous

true if flushing data should block until finished, otherwise false.


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