Hermes  0.9.5-beta
Hierarchical Distributed I/O Buffering System
hermes Namespace Reference

Namespaces

 pubsub
 

Classes

struct  TargetInfo
 
union  BoArgs
 
struct  BoTask
 
struct  BufferInfo
 
struct  BufferOrganizer
 
struct  Device
 
struct  Target
 
union  BufferID
 
struct  BufferIdHash
 
struct  ShmemClientInfo
 
struct  BufferHeader
 
struct  BufferPool
 
struct  SharedMemoryContext
 
struct  Blob
 
struct  SwapBlob
 
struct  CommunicationContext
 
struct  MPIState
 
class  DPE
 
class  DPEFactory
 
struct  DebugHeapAllocation
 
struct  DebugState
 
struct  Array2DIdx
 
class  LinearProgram
 
class  MinimizeIoTime
 
class  Random
 
class  RoundRobin
 
struct  ChunkedIdList
 
union  TargetID
 
struct  Thresholds
 
struct  Config
 
union  BucketID
 
union  VBucketID
 
union  BlobID
 
struct  TicketMutex
 
struct  Ticket
 
struct  RwLock
 
struct  ArenaInfo
 
struct  Arena
 
struct  Heap
 
struct  FreeBlockHeader
 
struct  FreeBlock
 
struct  TemporaryMemory
 
struct  ScopedTemporaryMemory
 
struct  ShmemString
 
struct  ViolationInfo
 
struct  Stats
 
struct  IdList
 
struct  BufferIdArray
 
struct  BlobInfo
 
struct  BucketInfo
 
struct  VBucketInfo
 
struct  SystemViewState
 
struct  GlobalSystemViewState
 
struct  MetadataManager
 
struct  IdMap
 
struct  BlobInfoMap
 
struct  ClientRpcContext
 
struct  RpcContext
 
struct  ThalliumState
 
struct  ClientThalliumState
 
class  Singleton
 
class  ThreadPool
 

Typedefs

using BoMoveList = std::vector< std::pair< BufferID, std::vector< BufferID > >>
 
typedef void(* BarrierFunc) (void *)
 
typedef void(* FinalizeFunc) (void *)
 
typedef uint8_t u8
 
typedef uint16_t u16
 
typedef uint32_t u32
 
typedef uint64_t u64
 
typedef int8_t i8
 
typedef int16_t i16
 
typedef int32_t i32
 
typedef int64_t i64
 
typedef float f32
 
typedef double f64
 
typedef u16 DeviceID
 
using PlacementSchema = std::vector< std::pair< size_t, TargetID > >
 
typedef u64 TraitID
 
typedef void() ArenaErrorFunc()
 
typedef void(* StartFunc) (SharedMemoryContext *, RpcContext *, Arena *, const char *, int)
 

Enumerations

enum class  BoOperation { kMove , kCopy , kDelete , kCount }
 
enum class  BoPriority { kLow , kHigh , kCount }
 
enum  SwapBlobMembers {
  SwapBlobMembers_NodeId , SwapBlobMembers_Offset , SwapBlobMembers_Size , SwapBlobMembers_BucketId ,
  SwapBlobMembers_Count
}
 
enum  Topology { Topology_Local , Topology_Neighborhood , Topology_Global , Topology_Count }
 
enum  StatusCode {
  HERMES_OK_MAX = 2 , BLOB_IN_SWAP_PLACE = 1 , HERMES_SUCCESS = 0 , INVALID_BUCKET = -1 ,
  BUCKET_NAME_TOO_LONG = -2 , VBUCKET_NAME_TOO_LONG = -3 , BLOB_NAME_TOO_LONG = -4 , INVALID_BLOB = -5 ,
  BLOB_NOT_IN_BUCKET = -6 , BLOB_NOT_LINKED_TO_VBUCKET = -7 , TRAIT_NOT_VALID = -8 , TRAIT_EXISTS_ALREADY = -9 ,
  OFFSET_MAP_EMPTY = -10 , BLOB_NOT_LINKED_IN_MAP = -11 , BUCKET_IN_USE = -12 , DPE_RANDOM_FOUND_NO_TGT = -13 ,
  DPE_GET_INVALID_TGT = -14 , DPE_ORTOOLS_NO_SOLUTION = -15 , DPE_PLACEMENTSCHEMA_EMPTY = -16 , READ_BLOB_FAILED = -17 ,
  STDIO_OFFSET_ERROR = -18 , STDIO_FWRITE_FAILED = -19 , STDIO_FOPEN_FAILED = -20 , STDIO_FCLOSE_FAILED = -21 ,
  INVALID_FILE = -23 , PLACE_SWAP_BLOB_TO_BUF_FAILED = -24 , DPE_RR_FIND_TGT_FAILED = -25 , HERMES_ERROR_MAX = -26
}
 
enum class  ProcessKind { kApp , kHermes , kCount }
 
enum  ArenaType { kArenaType_BufferPool , kArenaType_MetaData , kArenaType_Transient , kArenaType_Count }
 
enum  MapType {
  kMapType_Bucket , kMapType_VBucket , kMapType_BlobId , kMapType_BlobInfo ,
  kMapType_Count
}
 
enum class  ThresholdViolation { kMin , kMax }
 

Functions

ArenaInfo GetArenaInfo (Config *config)
 
std::vector< std::string > GetHostsFromFile (const std::string &host_file)
 
void PushHostNames (Arena *arenas, RpcContext *rpc, const std::vector< std::string > &host_names, MetadataManager *mdm, u8 *shmem_base)
 
SharedMemoryContext InitHermesCore (Config *config, CommunicationContext *comm, ArenaInfo *arena_info, Arena *arenas, RpcContext *rpc)
 
SharedMemoryContext BootstrapSharedMemory (Arena *arenas, Config *config, CommunicationContext *comm, RpcContext *rpc, bool is_daemon, bool is_adapter)
 
std::shared_ptr< api::HermesInitHermes (Config *config, bool is_daemon, bool is_adapter)
 
std::shared_ptr< api::HermesInitHermesClient (const char *config_file=NULL)
 Initialize a Hermes instance as a client or adapter. More...
 
std::shared_ptr< api::HermesInitHermesDaemon (char *config_file=NULL)
 Initialize a Hermes instance as a daemon. More...
 
std::shared_ptr< api::HermesInitHermesDaemon (Config *config)
 
bool operator== (const BufferInfo &lhs, const BufferInfo &rhs)
 
BufferInfo LocalGetBufferInfo (SharedMemoryContext *context, BufferID buffer_id)
 
BufferInfo GetBufferInfo (SharedMemoryContext *context, RpcContext *rpc, BufferID buffer_id)
 
f32 NormalizeAccessScore (SharedMemoryContext *context, f32 raw_score, f32 size_mb)
 
static f32 BytesToMegabytes (size_t bytes)
 
std::vector< BufferInfoGetBufferInfo (SharedMemoryContext *context, RpcContext *rpc, const std::vector< BufferID > &buffer_ids)
 
f32 ComputeBlobAccessScore (SharedMemoryContext *context, const std::vector< BufferInfo > &buffer_info)
 
void SortBufferInfo (std::vector< BufferInfo > &buffer_info, bool increasing)
 
void SortTargetInfo (std::vector< TargetInfo > &target_info, bool increasing)
 
void EnqueueBoMove (RpcContext *rpc, const BoMoveList &moves, BlobID blob_id, BucketID bucket_id, const std::string &internal_name, BoPriority priority)
 
void LocalEnqueueBoMove (SharedMemoryContext *context, RpcContext *rpc, const BoMoveList &moves, BlobID blob_id, BucketID bucket_id, const std::string &internal_blob_name, BoPriority priority)
 
void BoMove (SharedMemoryContext *context, RpcContext *rpc, const BoMoveList &moves, BlobID blob_id, BucketID bucket_id, const std::string &internal_blob_name)
 
void LocalOrganizeBlob (SharedMemoryContext *context, RpcContext *rpc, const std::string &internal_blob_name, BucketID bucket_id, f32 epsilon, f32 explicit_importance_score)
 
void OrganizeBlob (SharedMemoryContext *context, RpcContext *rpc, BucketID bucket_id, const std::string &blob_name, f32 epsilon, f32 importance_score)
 
void EnforceCapacityThresholds (SharedMemoryContext *context, RpcContext *rpc, ViolationInfo info)
 
void LocalEnforceCapacityThresholds (SharedMemoryContext *context, RpcContext *rpc, ViolationInfo info)
 
void LocalShutdownBufferOrganizer (SharedMemoryContext *context)
 
void FlushBlob (SharedMemoryContext *context, RpcContext *rpc, BlobID blob_id, const std::string &filename, u64 offset, bool async)
 
bool EnqueueFlushingTask (RpcContext *rpc, BlobID blob_id, const std::string &filename, u64 offset)
 
bool LocalEnqueueFlushingTask (SharedMemoryContext *context, RpcContext *rpc, BlobID blob_id, const std::string &filename, u64 offset)
 
Status PlaceInHierarchy (SharedMemoryContext *context, RpcContext *rpc, SwapBlob swap_blob, const std::string &name, const api::Context &ctx)
 
void LocalAdjustFlushCount (SharedMemoryContext *context, const std::string &vbkt_name, int adjustment)
 
void LocalIncrementFlushCount (SharedMemoryContext *context, const std::string &vbkt_name)
 
void LocalDecrementFlushCount (SharedMemoryContext *context, const std::string &vbkt_name)
 
void IncrementFlushCount (SharedMemoryContext *context, RpcContext *rpc, const std::string &vbkt_name)
 
void DecrementFlushCount (SharedMemoryContext *context, RpcContext *rpc, const std::string &vbkt_name)
 
void AwaitAsyncFlushingTasks (SharedMemoryContext *context, RpcContext *rpc, VBucketID id)
 
void OrganizeDevice (SharedMemoryContext *context, RpcContext *rpc, DeviceID devices_id)
 
bool operator== (const BufferID &lhs, const BufferID &rhs)
 
void Finalize (SharedMemoryContext *context, CommunicationContext *comm, RpcContext *rpc, const char *shmem_name, Arena *trans_arena, bool is_application_core, bool force_rpc_shutdown)
 
void LockBuffer (BufferHeader *header)
 
void UnlockBuffer (BufferHeader *header)
 
BufferPoolGetBufferPoolFromContext (SharedMemoryContext *context)
 
DeviceGetDeviceFromHeader (SharedMemoryContext *context, BufferHeader *header)
 
TargetGetTarget (SharedMemoryContext *context, int index)
 
TargetGetTargetFromId (SharedMemoryContext *context, TargetID id)
 
std::vector< f32GetBandwidths (SharedMemoryContext *context, const std::vector< TargetID > &targets)
 
DeviceGetDeviceById (SharedMemoryContext *context, DeviceID device_id)
 
DeviceID GetDeviceIdFromTargetId (TargetID target_id)
 
BufferHeaderGetHeadersBase (SharedMemoryContext *context)
 
BufferHeaderGetHeaderByIndex (SharedMemoryContext *context, u32 index)
 
BufferHeaderGetHeaderByBufferId (SharedMemoryContext *context, BufferID id)
 
void ResetHeader (BufferHeader *header)
 
static void MakeHeaderDormant (BufferHeader *header)
 
bool HeaderIsDormant (BufferHeader *header)
 
i32 GetSlabUnitSize (SharedMemoryContext *context, DeviceID device_id, int slab_index)
 
i32 GetSlabBufferSize (SharedMemoryContext *context, DeviceID device_id, int slab_index)
 
BufferIDGetFreeListPtr (SharedMemoryContext *context, DeviceID device_id)
 
int GetSlabIndexFromHeader (SharedMemoryContext *context, BufferHeader *header)
 
bool BufferIsRemote (CommunicationContext *comm, BufferID buffer_id)
 
bool BufferIsRemote (RpcContext *rpc, BufferID buffer_id)
 
bool IsNullBufferId (BufferID id)
 
bool BufferIsByteAddressable (SharedMemoryContext *context, BufferID id)
 
BufferID PeekFirstFreeBufferId (SharedMemoryContext *context, DeviceID device_id, int slab_index)
 
void SetFirstFreeBufferId (SharedMemoryContext *context, DeviceID device_id, int slab_index, BufferID new_id)
 
std::atomic< u32 > * GetAvailableBuffersArray (SharedMemoryContext *context, DeviceID device_id)
 
static u32 GetNumBuffersAvailable (SharedMemoryContext *context, DeviceID device_id, int slab_index)
 
u32 GetNumBuffersAvailable (SharedMemoryContext *context, DeviceID device_id)
 
static void DecrementAvailableBuffers (SharedMemoryContext *context, DeviceID device_id, int slab_index)
 
static void IncrementAvailableBuffers (SharedMemoryContext *context, DeviceID device_id, int slab_index)
 
void UpdateBufferingCapacities (SharedMemoryContext *context, i64 adjustment, DeviceID device_id)
 
void LocalReleaseBuffer (SharedMemoryContext *context, BufferID buffer_id)
 
void ReleaseBuffer (SharedMemoryContext *context, RpcContext *rpc, BufferID buffer_id)
 
void ReleaseBuffers (SharedMemoryContext *context, RpcContext *rpc, const std::vector< BufferID > &buffer_ids)
 
void LocalReleaseBuffers (SharedMemoryContext *context, const std::vector< BufferID > &buffer_ids)
 
BufferID GetFreeBuffer (SharedMemoryContext *context, DeviceID device_id, int slab_index)
 
std::vector< BufferIDGetBuffers (SharedMemoryContext *context, const PlacementSchema &schema)
 
u32 LocalGetBufferSize (SharedMemoryContext *context, BufferID id)
 
u32 GetBufferSize (SharedMemoryContext *context, RpcContext *rpc, BufferID id)
 
size_t GetBlobSize (SharedMemoryContext *context, RpcContext *rpc, BufferIdArray *buffer_ids)
 
size_t GetBlobSizeById (SharedMemoryContext *context, RpcContext *rpc, Arena *arena, BlobID blob_id)
 
ptrdiff_t GetBufferOffset (SharedMemoryContext *context, BufferID id)
 
u8GetRamBufferPtr (SharedMemoryContext *context, BufferID buffer_id)
 
BufferID MakeBufferId (u32 node_id, u32 header_index)
 
void PartitionRamBuffers (Arena *arena, i32 buffer_size, i32 buffer_count, int block_size)
 
BufferID MakeBufferHeaders (Arena *arena, int buffer_size, u32 start_index, u32 end_index, int node_id, DeviceID device_id, ptrdiff_t initial_offset, u8 **header_begin)
 
DeviceInitDevices (Arena *arena, Config *config, f32 &min_bw, f32 &max_bw)
 
TargetInitTargets (Arena *arena, Config *config, Device *devices, int node_id)
 
void MergeRamBufferFreeList (SharedMemoryContext *context, int slab_index)
 
void SplitRamBufferFreeList (SharedMemoryContext *context, int slab_index)
 
ptrdiff_t InitBufferPool (u8 *shmem_base, Arena *buffer_pool_arena, Arena *scratch_arena, i32 node_id, Config *config)
 
void SerializeBufferPoolToFile (SharedMemoryContext *context, FILE *file)
 
void MakeFullShmemName (char *dest, const char *base)
 
FILE * FopenOrTerminate (const char *fname, const char *mode)
 
int OpenOrTerminate (const std::string &fname, int flags, mode_t mode=0)
 
void InitFilesForBuffering (SharedMemoryContext *context, CommunicationContext &comm)
 
u8InitSharedMemory (const char *shmem_name, size_t total_size)
 
SharedMemoryContext GetSharedMemoryContext (char *shmem_name)
 
void UnmapSharedMemory (SharedMemoryContext *context)
 
void CloseBufferingFiles (SharedMemoryContext *context)
 
void ReleaseSharedMemoryContext (SharedMemoryContext *context)
 
size_t LocalWriteBufferById (SharedMemoryContext *context, BufferID id, const Blob &blob, size_t offset)
 
void WriteBlobToBuffers (SharedMemoryContext *context, RpcContext *rpc, const Blob &blob, const std::vector< BufferID > &buffer_ids)
 
size_t LocalReadBufferById (SharedMemoryContext *context, BufferID id, Blob *blob, size_t read_offset)
 
size_t ReadBlobFromBuffers (SharedMemoryContext *context, RpcContext *rpc, Blob *blob, BufferIdArray *buffer_ids, u32 *buffer_sizes)
 
size_t ReadBlobById (SharedMemoryContext *context, RpcContext *rpc, Arena *arena, Blob blob, BlobID blob_id)
 
size_t ReadBlobById (SharedMemoryContext *context, RpcContext *rpc, Arena *arena, api::Blob &dest, BlobID blob_id)
 
void OpenSwapFile (SharedMemoryContext *context, u32 node_id)
 
SwapBlob WriteToSwap (SharedMemoryContext *context, Blob blob, u32 node_id, BucketID bucket_id)
 
SwapBlob PutToSwap (SharedMemoryContext *context, RpcContext *rpc, const std::string &name, BucketID bucket_id, const u8 *data, size_t size)
 
size_t ReadFromSwap (SharedMemoryContext *context, Blob blob, SwapBlob swap_blob)
 
api::Status PlaceBlob (SharedMemoryContext *context, RpcContext *rpc, PlacementSchema &schema, Blob blob, const std::string &name, BucketID bucket_id, const api::Context &ctx, bool called_from_buffer_organizer)
 
api::Status StdIoPersistBucket (SharedMemoryContext *context, RpcContext *rpc, Arena *arena, BucketID bucket_id, const std::string &file_name, const std::string &open_mode)
 
api::Status StdIoPersistBlob (SharedMemoryContext *context, RpcContext *rpc, Arena *arena, BlobID blob_id, int fd, const i32 &offset)
 
f32 GetBlobImportanceScore (SharedMemoryContext *context, RpcContext *rpc, BlobID blob_id)
 
void StartBufferPoolRpcServer (SharedMemoryContext *context, const char *addr, i32 num_rpc_threads)
 
template<typename T >
std::vector< SwapBlobPutToSwap (SharedMemoryContext *context, RpcContext *rpc, BucketID id, std::vector< std::vector< T >> &blobs, std::vector< std::string > &names)
 
SwapBlob WriteToSwap (SharedMemoryContext *context, Blob blob, BlobID blob_id, BucketID bucket_id)
 
void ParseConfig (Arena *arena, const char *path, Config *config)
 
size_t InitCommunication (CommunicationContext *comm, Arena *arena, size_t trans_arena_size_per_node, bool is_daemon=false, bool is_adapter=false)
 
void WorldBarrier (CommunicationContext *comm)
 
void SubBarrier (CommunicationContext *comm)
 
void * GetAppCommunicator (CommunicationContext *comm)
 
int MpiGetProcId (MPI_Comm comm)
 
int MpiGetWorldProcId (void *state)
 
int MpiGetSubProcId (void *state)
 
int MpiGetNumProcs (MPI_Comm comm)
 
int MpiGetNumWorldProcs (void *state)
 
void MpiBarrier (MPI_Comm comm)
 
void MpiWorldBarrier (void *state)
 
void MpiSubBarrier (void *state)
 
bool MpiFirstOnNode (MPI_Comm comm)
 
size_t MpiAssignIDsToNodes (CommunicationContext *comm, size_t trans_arena_size_per_node)
 
void MpiFinalize (void *state)
 
void PrintExpectedAndFail (const std::string &expected, u32 line_number=0)
 
void RequireNumDevices (Config *config)
 
void RequireNumSlabs (Config *config)
 
void RequireCapacitiesUnset (bool &already_specified)
 
void RequireBlockSizesUnset (bool &already_specified)
 
void ParseCapacities (Config *config, YAML::Node capacities, int unit_conversion, bool &already_specified)
 
void ParseBlockSizes (Config *config, YAML::Node block_sizes, int unit_conversion, bool &already_specified)
 
template<typename T >
void ParseArray (YAML::Node list_node, const std::string var, T *list, int max_list_len)
 
template<typename T >
void ParseVector (YAML::Node list_node, std::vector< T > &list)
 
template<typename T >
void ParseMatrix (YAML::Node matrix_node, const std::string var, T *matrix, int max_row_len, int max_col_len, int *col_len)
 
template<typename T >
void ParseMatrix (YAML::Node matrix_node, std::string var, T *matrix, int max_row_len, int max_col_len)
 
void ParseRangeList (YAML::Node list_node, std::string var, std::vector< std::string > &list)
 
void ParseHostNames (YAML::Node yaml_conf, hermes::Config *config)
 
void CheckConstraints (Config *config)
 
void ParseConfigYAML (YAML::Node &yaml_conf, Config *config)
 
void ParseConfigString (Arena *arena, const std::string &config_string, Config *config)
 
void InitConfig (hermes::Config *config, const char *config_file)
 
hermes::ConfigCreateConfig (const char *config_file)
 
PlacementSchema AggregateBlobSchema (PlacementSchema &schema)
 
Status CalculatePlacement (SharedMemoryContext *context, RpcContext *rpc, const std::vector< size_t > &blob_sizes, std::vector< PlacementSchema > &output, const api::Context &api_context)
 
bool IsPowerOfTwo (size_t val)
 
uintptr_t AlignForward (uintptr_t addr, size_t alignment)
 
uintptr_t AlignBackward (uintptr_t addr, size_t alignment)
 
void InitArena (Arena *arena, size_t bytes, u8 *base)
 
Arena InitArenaAndAllocate (size_t bytes)
 
void DestroyArena (Arena *arena)
 
size_t GetRemainingCapacity (Arena *arena)
 
void GrowArena (Arena *arena, size_t new_size)
 The maximum capacity of arena becomes new_size. More...
 
TemporaryMemory BeginTemporaryMemory (Arena *arena)
 
void EndTemporaryMemory (TemporaryMemory *temp_memory)
 
u8PushSize (Arena *arena, size_t size, size_t alignment)
 
u8PushSizeAndClear (Arena *arena, size_t size, size_t alignment)
 
u8GetHeapMemory (Heap *heap)
 
FreeBlockGetHeapFreeList (Heap *heap)
 
FreeBlockNextFreeBlock (Heap *heap, FreeBlock *block)
 
u8HeapOffsetToPtr (Heap *heap, u32 offset)
 
u32 GetHeapOffset (Heap *heap, u8 *ptr)
 
void HeapErrorHandler ()
 
u32 ComputeHeapExtent (Heap *heap, void *item, u32 size)
 
u8HeapExtentToPtr (Heap *heap)
 
HeapInitHeapInArena (Arena *arena, bool grows_up, u16 alignment)
 
FreeBlockFindFirstFit (Heap *heap, u32 desired_size)
 
u8HeapPushSize (Heap *heap, u32 size)
 
void HeapFree (Heap *heap, void *ptr)
 
void * HeapRealloc (Heap *heap, void *ptr, size_t size)
 
void CoalesceFreeBlocks (Heap *heap)
 
Ticket TryBeginTicketMutex (TicketMutex *mutex, Ticket *existing_ticket)
 
void BeginTicketMutex (TicketMutex *mutex)
 
void EndTicketMutex (TicketMutex *mutex)
 
bool BeginReaderLock (RwLock *lock)
 
void EndReaderLock (RwLock *lock)
 
void BeginWriterLock (RwLock *lock)
 
void EndWriterLock (RwLock *lock)
 
template<typename T >
T * PushStruct (Arena *arena, size_t alignment=8)
 
template<typename T >
T * PushClearedStruct (Arena *arena, size_t alignment=8)
 
template<typename T >
T * PushArray (Arena *arena, int count, size_t alignment=8)
 
template<typename T >
T * PushClearedArray (Arena *arena, int count, size_t alignment=8)
 
template<typename T >
T * HeapPushStruct (Heap *heap)
 
template<typename T >
T * HeapPushArray (Heap *heap, u32 count)
 
bool operator!= (const TargetID &lhs, const TargetID &rhs)
 
static bool IsNameTooLong (const std::string &name, size_t max)
 
bool IsBlobNameTooLong (const std::string &name)
 
bool IsBucketNameTooLong (const std::string &name)
 
bool IsVBucketNameTooLong (const std::string &name)
 
static bool IsNullId (u64 id)
 
bool IsNullBucketId (BucketID id)
 
bool IsNullVBucketId (VBucketID id)
 
bool IsNullBlobId (BlobID id)
 
bool IsNullTargetId (TargetID id)
 
static u32 GetBlobNodeId (BlobID id)
 
void LocalPut (MetadataManager *mdm, const char *key, u64 val, MapType map_type)
 
void LocalPut (MetadataManager *mdm, BlobID key, const BlobInfo &value)
 
u64 LocalGet (MetadataManager *mdm, const char *key, MapType map_type)
 
void LocalDelete (MetadataManager *mdm, BlobID key)
 
void LocalDelete (MetadataManager *mdm, const char *key, MapType map_type)
 
MetadataManagerGetMetadataManagerFromContext (SharedMemoryContext *context)
 
static void MetadataArenaErrorHandler ()
 
u32 HashString (MetadataManager *mdm, RpcContext *rpc, const char *str)
 
u64 GetId (SharedMemoryContext *context, RpcContext *rpc, const char *name, MapType map_type)
 
BucketID GetBucketId (SharedMemoryContext *context, RpcContext *rpc, const char *name)
 
BucketID LocalGetBucketId (SharedMemoryContext *context, const char *name)
 
VBucketID GetVBucketId (SharedMemoryContext *context, RpcContext *rpc, const char *name)
 
VBucketID LocalGetVBucketId (SharedMemoryContext *context, const char *name)
 
std::string MakeInternalBlobName (const std::string &name, BucketID id)
 
BlobID GetBlobId (SharedMemoryContext *context, RpcContext *rpc, const std::string &name, BucketID bucket_id, bool track_stats)
 
void PutId (MetadataManager *mdm, RpcContext *rpc, const std::string &name, u64 id, MapType map_type)
 
void PutBucketId (MetadataManager *mdm, RpcContext *rpc, const std::string &name, BucketID id)
 
void LocalPutBucketId (MetadataManager *mdm, const std::string &name, BucketID id)
 
void PutVBucketId (MetadataManager *mdm, RpcContext *rpc, const std::string &name, VBucketID id)
 
void LocalPutVBucketId (MetadataManager *mdm, const std::string &name, VBucketID id)
 
void PutBlobId (MetadataManager *mdm, RpcContext *rpc, const std::string &name, BlobID id, BucketID bucket_id)
 
void DeleteId (MetadataManager *mdm, RpcContext *rpc, const std::string &name, MapType map_type)
 
void DeleteBucketId (MetadataManager *mdm, RpcContext *rpc, const std::string &name)
 
void DeleteVBucketId (MetadataManager *mdm, RpcContext *rpc, const std::string &name)
 
void LocalDeleteBlobInfo (MetadataManager *mdm, BlobID blob_id)
 
void LocalDeleteBlobId (MetadataManager *mdm, const std::string &name, BucketID bucket_id)
 
void DeleteBlobId (MetadataManager *mdm, RpcContext *rpc, const std::string &name, BucketID bucket_id)
 
BucketInfoLocalGetBucketInfoByIndex (MetadataManager *mdm, u32 index)
 
std::string LocalGetBlobNameFromId (SharedMemoryContext *context, BlobID blob_id)
 
std::string GetBlobNameFromId (SharedMemoryContext *context, RpcContext *rpc, BlobID blob_id)
 
u64 HexStringToU64 (const std::string &s)
 
BucketID LocalGetBucketIdFromBlobId (SharedMemoryContext *context, BlobID id)
 
BucketID GetBucketIdFromBlobId (SharedMemoryContext *context, RpcContext *rpc, BlobID id)
 
BucketInfoLocalGetBucketInfoById (MetadataManager *mdm, BucketID id)
 
std::vector< BlobIDGetBlobIds (SharedMemoryContext *context, RpcContext *rpc, BucketID bucket_id)
 
VBucketInfoGetVBucketInfoByIndex (MetadataManager *mdm, u32 index)
 
BucketID LocalGetNextFreeBucketId (SharedMemoryContext *context, const std::string &name)
 
BucketID LocalGetOrCreateBucketId (SharedMemoryContext *context, const std::string &name)
 
BucketID GetOrCreateBucketId (SharedMemoryContext *context, RpcContext *rpc, const std::string &name)
 
VBucketID LocalGetNextFreeVBucketId (SharedMemoryContext *context, const std::string &name)
 
VBucketID LocalGetOrCreateVBucketId (SharedMemoryContext *context, const std::string &name)
 
VBucketID GetOrCreateVBucketId (SharedMemoryContext *context, RpcContext *rpc, const std::string &name)
 
void CopyIds (u64 *dest, u64 *src, u32 count)
 
void ReplaceBlobIdInBucket (SharedMemoryContext *context, RpcContext *rpc, BucketID bucket_id, BlobID old_blob_id, BlobID new_blob_id)
 
void AddBlobIdToBucket (MetadataManager *mdm, RpcContext *rpc, BlobID blob_id, BucketID bucket_id)
 
void AddBlobIdToVBucket (MetadataManager *mdm, RpcContext *rpc, BlobID blob_id, VBucketID vbucket_id)
 
u32 AllocateBufferIdList (SharedMemoryContext *context, RpcContext *rpc, u32 target_node, const std::vector< BufferID > &buffer_ids)
 
bool BlobIsInSwap (BlobID id)
 
void GetBufferIdList (Arena *arena, SharedMemoryContext *context, RpcContext *rpc, BlobID blob_id, BufferIdArray *buffer_ids)
 
std::vector< BufferIDGetBufferIdList (SharedMemoryContext *context, RpcContext *rpc, BlobID blob_id)
 
BufferIdArray GetBufferIdsFromBlobId (Arena *arena, SharedMemoryContext *context, RpcContext *rpc, BlobID blob_id, u32 **sizes)
 
void LocalCreateBlobMetadata (SharedMemoryContext *context, MetadataManager *mdm, const std::string &blob_name, BlobID blob_id, TargetID effective_target)
 
void CreateBlobMetadata (SharedMemoryContext *context, RpcContext *rpc, const std::string &blob_name, BlobID blob_id, TargetID effective_target)
 
void AttachBlobToBucket (SharedMemoryContext *context, RpcContext *rpc, const char *blob_name, BucketID bucket_id, const std::vector< BufferID > &buffer_ids, TargetID effective_target, bool is_swap_blob, bool called_from_buffer_organizer)
 
void FreeBufferIdList (SharedMemoryContext *context, RpcContext *rpc, BlobID blob_id)
 
void LocalDeleteBlobMetadata (MetadataManager *mdm, const char *blob_name, BlobID blob_id, BucketID bucket_id)
 
void WaitForOutstandingBlobOps (MetadataManager *mdm, BlobID blob_id)
 
void LocalDestroyBlobByName (SharedMemoryContext *context, RpcContext *rpc, const char *blob_name, BlobID blob_id, BucketID bucket_id)
 
void LocalDestroyBlobById (SharedMemoryContext *context, RpcContext *rpc, BlobID blob_id, BucketID bucket_id)
 
void RemoveBlobFromBucketInfo (SharedMemoryContext *context, RpcContext *rpc, BucketID bucket_id, BlobID blob_id)
 
void DestroyBlobByName (SharedMemoryContext *context, RpcContext *rpc, BucketID bucket_id, const std::string &blob_name)
 
void RenameBlob (SharedMemoryContext *context, RpcContext *rpc, const std::string &old_name, const std::string &new_name, BucketID bucket_id)
 
bool ContainsBlob (SharedMemoryContext *context, RpcContext *rpc, BucketID bucket_id, const std::string &blob_name)
 
void DestroyBlobById (SharedMemoryContext *context, RpcContext *rpc, BlobID id, BucketID bucket_id)
 
bool DestroyBucket (SharedMemoryContext *context, RpcContext *rpc, const char *name, BucketID bucket_id)
 
bool DestroyVBucket (SharedMemoryContext *context, RpcContext *rpc, const char *name, VBucketID vbucket_id)
 
void LocalRenameBucket (SharedMemoryContext *context, RpcContext *rpc, BucketID id, const std::string &old_name, const std::string &new_name)
 
void RenameBucket (SharedMemoryContext *context, RpcContext *rpc, BucketID id, const std::string &old_name, const std::string &new_name)
 
void LocalIncrementRefcount (SharedMemoryContext *context, BucketID id)
 
void LocalDecrementRefcount (SharedMemoryContext *context, BucketID id)
 
void DecrementRefcount (SharedMemoryContext *context, RpcContext *rpc, BucketID id)
 
u64 LocalGetRemainingTargetCapacity (SharedMemoryContext *context, TargetID id)
 
SystemViewStateGetLocalSystemViewState (MetadataManager *mdm)
 
SystemViewStateGetLocalSystemViewState (SharedMemoryContext *context)
 
std::vector< u64LocalGetGlobalDeviceCapacities (SharedMemoryContext *context)
 
std::vector< u64GetGlobalDeviceCapacities (SharedMemoryContext *context, RpcContext *rpc)
 
GlobalSystemViewStateGetGlobalSystemViewState (SharedMemoryContext *context)
 
std::vector< ViolationInfoLocalUpdateGlobalSystemViewState (SharedMemoryContext *context, u32 node_id, std::vector< i64 > adjustments)
 
void UpdateGlobalSystemViewState (SharedMemoryContext *context, RpcContext *rpc)
 
TargetID FindTargetIdFromDeviceId (const std::vector< TargetID > &targets, DeviceID device_id)
 
static ptrdiff_t GetOffsetFromMdm (MetadataManager *mdm, void *ptr)
 
SystemViewStateCreateSystemViewState (Arena *arena, Config *config)
 
GlobalSystemViewStateCreateGlobalSystemViewState (RpcContext *rpc, Arena *arena, Config *config)
 
std::string GetSwapFilename (MetadataManager *mdm, u32 node_id)
 
std::vector< BufferIDSwapBlobToVec (SwapBlob swap_blob)
 
SwapBlob VecToSwapBlob (std::vector< BufferID > &vec)
 
SwapBlob IdArrayToSwapBlob (BufferIdArray ids)
 
void InitMetadataManager (MetadataManager *mdm, RpcContext *rpc, Arena *arena, Config *config)
 
VBucketInfoLocalGetVBucketInfoByIndex (MetadataManager *mdm, u32 index)
 
VBucketInfoLocalGetVBucketInfoById (MetadataManager *mdm, VBucketID id)
 
void LocalIncrementRefcount (SharedMemoryContext *context, VBucketID id)
 
void LocalDecrementRefcount (SharedMemoryContext *context, VBucketID id)
 
void DecrementRefcount (SharedMemoryContext *context, RpcContext *rpc, VBucketID id)
 
u32 GetRelativeNodeId (RpcContext *rpc, int offset)
 
u32 GetNextNode (RpcContext *rpc)
 
u32 GetPreviousNode (RpcContext *rpc)
 
std::vector< TargetIDGetNodeTargets (SharedMemoryContext *context, RpcContext *rpc, u32 target_node)
 
std::vector< TargetIDGetNeighborhoodTargets (SharedMemoryContext *context, RpcContext *rpc)
 
u64 GetRemainingTargetCapacity (SharedMemoryContext *context, RpcContext *rpc, TargetID target_id)
 
std::vector< u64GetRemainingTargetCapacities (SharedMemoryContext *context, RpcContext *rpc, const std::vector< TargetID > &targets)
 
void AttachBlobToVBucket (SharedMemoryContext *context, RpcContext *rpc, const char *blob_name, const char *bucket_name, VBucketID vbucket_id)
 
std::string LocalGetBucketNameById (SharedMemoryContext *context, BucketID blob_id)
 
std::vector< BlobIDGetBlobsFromVBucketInfo (SharedMemoryContext *context, RpcContext *rpc, VBucketID vbucket_id)
 
void RemoveBlobFromVBucketInfo (SharedMemoryContext *context, RpcContext *rpc, VBucketID vbucket_id, const char *blob_name, const char *bucket_name)
 
std::string GetBucketNameById (SharedMemoryContext *context, RpcContext *rpc, BucketID id)
 
f32 ScoringFunction (MetadataManager *mdm, Stats *stats)
 
int LocalGetNumOutstandingFlushingTasks (SharedMemoryContext *context, VBucketID id)
 
int GetNumOutstandingFlushingTasks (SharedMemoryContext *context, RpcContext *rpc, VBucketID id)
 
bool LocalLockBlob (SharedMemoryContext *context, BlobID blob_id)
 
bool LocalUnlockBlob (SharedMemoryContext *context, BlobID blob_id)
 
void GetPidTid (u32 &pid, u32 &tid)
 
bool LockBlob (SharedMemoryContext *context, RpcContext *rpc, BlobID blob_id)
 
bool UnlockBlob (SharedMemoryContext *context, RpcContext *rpc, BlobID blob_id)
 
void MakeShmemString (ShmemString *sms, u8 *memory, const char *val, u32 size)
 
void MakeShmemString (ShmemString *sms, u8 *memory, const std::string &val)
 
std::string GetShmemString (ShmemString *sms)
 
void InitNeighborhoodTargets (SharedMemoryContext *context, RpcContext *rpc)
 
void BeginGlobalTicketMutex (SharedMemoryContext *context, RpcContext *rpc)
 
void EndGlobalTicketMutex (SharedMemoryContext *context, RpcContext *rpc)
 
void LocalBeginGlobalTicketMutex (MetadataManager *mdm)
 
void LocalEndGlobalTicketMutex (MetadataManager *mdm)
 
void IncrementBlobStats (SharedMemoryContext *context, RpcContext *rpc, BlobID blob_id)
 
void LocalIncrementBlobStats (MetadataManager *mdm, BlobID blob_id)
 
void LocalReplaceBlobIdInBucket (SharedMemoryContext *context, BucketID bucket_id, BlobID old_blob_id, BlobID new_blob_id)
 
TicketMutexGetMapMutex (MetadataManager *mdm, MapType map_type)
 
void LocalAddBlobIdToBucket (MetadataManager *mdm, BucketID bucket_id, BlobID blob_id, bool track_stats=true)
 
void LocalAddBlobIdToVBucket (MetadataManager *mdm, VBucketID vbucket_id, BlobID blob_id)
 
std::vector< BufferIDLocalGetBufferIdList (MetadataManager *mdm, BlobID blob_id)
 
void LocalGetBufferIdList (Arena *arena, MetadataManager *mdm, BlobID blob_id, BufferIdArray *buffer_ids)
 
void LocalFreeBufferIdList (SharedMemoryContext *context, BlobID blob_id)
 
bool LocalDestroyBucket (SharedMemoryContext *context, RpcContext *rpc, const char *bucket_name, BucketID bucket_id)
 
bool LocalDestroyVBucket (SharedMemoryContext *context, const char *vbucket_name, VBucketID vbucket_id)
 
u32 LocalAllocateBufferIdList (MetadataManager *mdm, const std::vector< BufferID > &buffer_ids)
 
bool LocalContainsBlob (SharedMemoryContext *context, BucketID bucket_id, BlobID blob_id)
 
void LocalRemoveBlobFromBucketInfo (SharedMemoryContext *context, BucketID bucket_id, BlobID blob_id)
 
void StartGlobalSystemViewStateUpdateThread (SharedMemoryContext *context, RpcContext *rpc, Arena *arena, double sleep_ms)
 
void InitMetadataStorage (SharedMemoryContext *context, MetadataManager *mdm, Arena *arena, Config *config)
 
std::vector< BlobIDLocalGetBlobIds (SharedMemoryContext *context, BucketID bucket_id)
 
std::vector< TargetIDLocalGetNodeTargets (SharedMemoryContext *context)
 
f32 LocalGetBlobImportanceScore (SharedMemoryContext *context, BlobID blob_id)
 
void LocalRemoveBlobFromVBucketInfo (SharedMemoryContext *context, VBucketID vbucket_id, BlobID blob_id)
 
std::vector< BlobIDLocalGetBlobsFromVBucketInfo (SharedMemoryContext *context, VBucketID vbucket_id)
 
HeapGetIdHeap (MetadataManager *mdm)
 
HeapGetMapHeap (MetadataManager *mdm)
 
IdList AllocateIdList (MetadataManager *mdm, u32 length)
 
void FreeIdList (MetadataManager *mdm, IdList id_list)
 
u32 AppendToChunkedIdList (MetadataManager *mdm, ChunkedIdList *id_list, u64 id)
 
void PutToStorage (MetadataManager *mdm, const char *key, u64 val, MapType map_type)
 
void PutToStorage (MetadataManager *mdm, BlobID key, const BlobInfo &val)
 
u64 GetFromStorage (MetadataManager *mdm, const char *key, MapType map_type)
 
std::string ReverseGetFromStorage (MetadataManager *mdm, u64 id, MapType map_type)
 
void DeleteFromStorage (MetadataManager *mdm, BlobID key, bool lock)
 
void DeleteFromStorage (MetadataManager *mdm, const char *key, MapType map_type)
 
u32 HashStringForStorage (MetadataManager *mdm, RpcContext *rpc, const char *str)
 
void SeedHashForStorage (size_t seed)
 
size_t GetStoredMapSize (MetadataManager *mdm, MapType map_type)
 
std::vector< TargetIDLocalGetNeighborhoodTargets (SharedMemoryContext *context)
 
BlobInfoGetBlobInfoPtr (MetadataManager *mdm, BlobID blob_id)
 
void ReleaseBlobInfoPtr (MetadataManager *mdm)
 
u64GetIdsPtr (MetadataManager *mdm, IdList id_list)
 
u64GetIdsPtr (MetadataManager *mdm, ChunkedIdList id_list)
 
void ReleaseIdsPtr (MetadataManager *mdm)
 
std::vector< u64GetChunkedIdList (MetadataManager *mdm, ChunkedIdList id_list)
 
static IdMapGetMapByOffset (MetadataManager *mdm, u32 offset)
 
static IdMapGetBucketMap (MetadataManager *mdm)
 
static IdMapGetVBucketMap (MetadataManager *mdm)
 
static IdMapGetBlobIdMap (MetadataManager *mdm)
 
void CheckHeapOverlap (MetadataManager *mdm)
 
IdMapGetMap (MetadataManager *mdm, MapType map_type)
 
BlobInfoMapGetBlobInfoMapNoLock (MetadataManager *mdm)
 
BlobInfoMapGetBlobInfoMap (MetadataManager *mdm)
 
void ReleaseMap (MetadataManager *mdm, MapType map_type)
 
Stats LocalGetBlobStats (SharedMemoryContext *context, BlobID blob_id)
 
IdList GetEmbeddedIdList (MetadataManager *mdm, u32 offset)
 
BufferIDGetBufferIdsPtrFromBlobId (MetadataManager *mdm, BlobID blob_id, size_t &length)
 
static char * GetKey (MetadataManager *mdm, IdMap *map, u32 index)
 
template<typename T >
void FreeIdList (MetadataManager *mdm, T id_list)
 
void FreeEmbeddedIdList (MetadataManager *mdm, u32 offset)
 
void AllocateOrGrowIdList (MetadataManager *mdm, ChunkedIdList *id_list)
 
u64 GetChunkedIdListElement (MetadataManager *mdm, ChunkedIdList *id_list, u32 index)
 
void SetChunkedIdListElement (MetadataManager *mdm, ChunkedIdList *id_list, u32 index, u64 value)
 
i64 GetIndexOfId (MetadataManager *mdm, ChunkedIdList *id_list, u64 id)
 
u32 AllocateEmbeddedIdList (MetadataManager *mdm, u32 length)
 
static bool HasAllocated (ChunkedIdList *list)
 
static bool HasAllocatedBlobs (VBucketInfo *info)
 
static bool HasAllocatedBlobs (BucketInfo *info)
 
std::vector< TargetIDLocalGetTargets (SharedMemoryContext *context, IdList target_list)
 
void InitSwapSpaceFilename (MetadataManager *mdm, Arena *arena, Config *config)
 
void InitRpcContext (RpcContext *rpc, u32 num_nodes, u32 node_id, Config *config)
 
void * CreateRpcState (Arena *arena)
 
void InitRpcClients (RpcContext *rpc)
 
void ShutdownRpcClients (RpcContext *rpc)
 
void RunDaemon (SharedMemoryContext *context, RpcContext *rpc, CommunicationContext *comm, Arena *trans_arena, const char *shmem_name)
 
void FinalizeClient (SharedMemoryContext *context, RpcContext *rpc, CommunicationContext *comm, Arena *trans_arena, bool stop_daemon)
 
void FinalizeRpcContext (RpcContext *rpc, bool is_daemon)
 
std::string GetServerName (RpcContext *rpc, u32 node_id, bool is_buffer_organizer=false)
 
std::string GetProtocol (RpcContext *rpc)
 
void StartBufferOrganizer (SharedMemoryContext *context, RpcContext *rpc, Arena *arena, const char *addr, int num_threads, int port)
 
void CopyStringToCharArray (const std::string &src, char *dest, size_t max)
 
void ThalliumStartRpcServer (SharedMemoryContext *context, RpcContext *rpc, Arena *arena, const char *addr, i32 num_rpc_threads)
 
void StopGlobalSystemViewStateUpdateThread (RpcContext *rpc)
 
std::string GetHostNameFromNodeId (RpcContext *rpc, u32 node_id)
 
std::string GetRpcAddress (RpcContext *rpc, Config *config, u32 node_id, int port)
 
size_t BulkRead (RpcContext *rpc, u32 node_id, const char *func_name, u8 *data, size_t max_size, BufferID id)
 
template<typename A >
void serialize (A &ar, BufferID &buffer_id)
 
template<typename A >
void serialize (A &ar, BucketID &bucket_id)
 
template<typename A >
void serialize (A &ar, VBucketID &vbucket_id)
 
template<typename A >
void serialize (A &ar, BlobID &blob_id)
 
template<typename A >
void serialize (A &ar, TargetID &target_id)
 
template<typename A >
void serialize (A &ar, SwapBlob &swap_blob)
 
template<typename A >
void serialize (A &ar, BufferInfo &info)
 
template<typename A >
void save (A &ar, MapType &map_type)
 
template<typename A >
void load (A &ar, MapType &map_type)
 
template<typename A >
void save (A &ar, BoPriority &priority)
 
template<typename A >
void load (A &ar, BoPriority &priority)
 
template<typename A >
void save (A &ar, ThresholdViolation &violation)
 
template<typename A >
void load (A &ar, ThresholdViolation &violation)
 
template<typename A >
void save (A &ar, BoOperation &op)
 
template<typename A >
void load (A &ar, BoOperation &op)
 
template<typename A >
void serialize (A &ar, BoArgs &bo_args)
 
template<typename A >
void serialize (A &ar, BoTask &bo_task)
 
template<typename A >
void serialize (A &ar, ViolationInfo &info)
 
static ThalliumStateGetThalliumState (RpcContext *rpc)
 
static ClientThalliumStateGetClientThalliumState (RpcContext *rpc)
 
static bool IsBoFunction (const char *func_name)
 
template<typename ReturnType , typename... Ts>
ReturnType RpcCall (RpcContext *rpc, u32 node_id, const char *func_name, Ts... args)
 
size_t RoundUpToMultiple (size_t val, size_t multiple)
 
size_t RoundDownToMultiple (size_t val, size_t multiple)
 
void InitDefaultConfig (Config *config)
 
void FailedLibraryCall (std::string func)
 

Variables

const int kGlobalDebugMaxAllocations = KILOBYTES(64)
 
DebugStateglobal_debug_id_state
 
DebugStateglobal_debug_map_state
 
char global_debug_map_name [] = "/hermes_debug_map_heap"
 
char global_debug_id_name [] = "/hermes_debug_id_heap"
 
const size_t kDefaultCoeffs = 1000 + 1
 
static constexpr int kMaxBufferPoolSlabs = 8
 
constexpr int kMaxPathLength = 256
 
constexpr int kMaxBufferPoolShmemNameLength = 64
 
constexpr int kMaxDevices = 8
 
constexpr int kMaxBucketNameSize = 256
 
constexpr int kMaxVBucketNameSize = 256
 
constexpr char kPlaceInHierarchy [] = "PlaceInHierarchy"
 
const TargetID kSwapTargetId = {{0, 0, 0}}
 
constexpr int kBucketIdStringSize = sizeof(BucketID) * 2
 
constexpr int kMaxBlobNameSize = 64 - kBucketIdStringSize
 
const int kAttemptsBeforeYield = 100
 
static const u64 hextable []
 
static const u32 kGlobalMutexNodeId = 1
 
const int kIdListChunkSize = 10
 
static constexpr int kMaxTraitsPerVBucket = 8
 
const int kMaxServerNameSize = 128
 
const int kMaxServerSuffixSize = 16
 
const int kMaxServerNamePrefix = 32
 
const int kMaxServerNamePostfix = 8
 
const char kBoPrefix [] = "BO::"
 
const int kBoPrefixLength = sizeof(kBoPrefix) - 1
 

Detailed Description

Make a class singleton when used with the class. format for class name T Singleton<T>::GetInstance()

Template Parameters
T

Typedef Documentation

◆ BoMoveList

using hermes::BoMoveList = typedef std::vector<std::pair<BufferID, std::vector<BufferID> >>

move list for buffer organizer

◆ BarrierFunc

typedef void(* hermes::BarrierFunc) (void *)

MPI barrier function pointer

◆ FinalizeFunc

typedef void(* hermes::FinalizeFunc) (void *)

MPI finalize function pointer

◆ u8

typedef uint8_t hermes::u8

8-bit unsigned integer

◆ u16

typedef uint16_t hermes::u16

16-bit unsigned integer

◆ u32

typedef uint32_t hermes::u32

32-bit unsigned integer

◆ u64

typedef uint64_t hermes::u64

64-bit unsigned integer

◆ i8

typedef int8_t hermes::i8

8-bit signed integer

◆ i16

typedef int16_t hermes::i16

16-bit signed integer

◆ i32

typedef int32_t hermes::i32

32-bit signed integer

◆ i64

typedef int64_t hermes::i64

64-bit signed integer

◆ f32

typedef float hermes::f32

32-bit float

◆ f64

typedef double hermes::f64

64-bit float

◆ DeviceID

device id in unsigned 16-bit integer

◆ PlacementSchema

using hermes::PlacementSchema = typedef std::vector<std::pair<size_t, TargetID> >

A PlacementSchema is a vector of (size, target) pairs where size is the number of bytes to buffer and target is the TargetID where to buffer those bytes.

◆ TraitID

Trait ID type

◆ ArenaErrorFunc

typedef void() hermes::ArenaErrorFunc()

Arena error function

◆ StartFunc

typedef void(* hermes::StartFunc) (SharedMemoryContext *, RpcContext *, Arena *, const char *, int)

start function for RPC server

Enumeration Type Documentation

◆ BoOperation

enum hermes::BoOperation
strong

buffer organizer operations

◆ BoPriority

enum hermes::BoPriority
strong

buffer organizer priorities

◆ SwapBlobMembers

An enum to represent swap BLOB members

Todo:
(chogan): metaprogramming - Generate this

◆ Topology

topology

◆ StatusCode

Hermes status codes.

◆ ProcessKind

enum hermes::ProcessKind
strong

Distinguishes whether the process (or rank) is part of the application cores or the Hermes core(s).

Enumerator
kApp 

Application process

kHermes 

Hermes core process

kCount 

Sentinel value

◆ ArenaType

Arena types

Enumerator
kArenaType_BufferPool 

Buffer pool: This must always be first!

kArenaType_MetaData 

Metadata

kArenaType_Transient 

Scratch space

kArenaType_Count 

Sentinel value

◆ MapType

map type

◆ ThresholdViolation

min/max threshold violation

Function Documentation

◆ GetArenaInfo()

ArenaInfo hermes::GetArenaInfo ( Config config)

get arena information from config configuration

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

◆ GetHostsFromFile()

std::vector<std::string> hermes::GetHostsFromFile ( const std::string &  host_file)

get hosts from host_file file

Here is the caller graph for this function:

◆ PushHostNames()

void hermes::PushHostNames ( Arena arenas,
RpcContext rpc,
const std::vector< std::string > &  host_names,
MetadataManager mdm,
u8 shmem_base 
)

push host names

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

◆ InitHermesCore()

SharedMemoryContext hermes::InitHermesCore ( Config config,
CommunicationContext comm,
ArenaInfo arena_info,
Arena arenas,
RpcContext rpc 
)

initialize Hermes core

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

◆ BootstrapSharedMemory()

SharedMemoryContext hermes::BootstrapSharedMemory ( Arena arenas,
Config config,
CommunicationContext comm,
RpcContext rpc,
bool  is_daemon,
bool  is_adapter 
)

boostrap shared memory

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

◆ InitHermes()

std::shared_ptr< api::Hermes > hermes::InitHermes ( Config config,
bool  is_daemon = false,
bool  is_adapter = false 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Allows programatically generating configurations.

Parameters
configa pointer to configuration
is_daemona flag to run Hermes as a daemon
is_adaptera flag to run Hermes in adapter mode
Returns
An initialized Hermes instance.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitHermesClient()

std::shared_ptr< api::Hermes > hermes::InitHermesClient ( const char *  config_file = NULL)

Initialize a Hermes instance as a client or adapter.

Parameters
config_fileThe (relative or absolute) path to a hermes configuration file
Precondition
An existing Hermes daemon must already be running.
Returns
An initialized Hermes instance.

◆ InitHermesDaemon() [1/2]

std::shared_ptr< api::Hermes > hermes::InitHermesDaemon ( char *  config_file = NULL)

Initialize a Hermes instance as a daemon.

A Hermes daemon is one or more processes (one per node) that handle all Hermes background services. This includes RPC servers, thread pools, buffer organization, and SystemViewState updates. A daemon is necessary in workflows that involve 2 or more applications sharing buffered data. Without a daemon, (i.e., co-deploying Hermes services with an application) the lifetime of Hermes is tied to the app.

Parameters
config_fileThe (relative or absolute) path to a hermes configuration file
Returns
An initialized Hermes instance.

◆ InitHermesDaemon() [2/2]

std::shared_ptr< api::Hermes > hermes::InitHermesDaemon ( Config config)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
configA valid Config.
Here is the call graph for this function:

◆ operator==() [1/2]

bool hermes::operator== ( const BufferInfo lhs,
const BufferInfo rhs 
)

comparison operator

◆ LocalGetBufferInfo()

BufferInfo hermes::LocalGetBufferInfo ( SharedMemoryContext context,
BufferID  buffer_id 
)

get buffer information locally

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

◆ GetBufferInfo() [1/2]

BufferInfo hermes::GetBufferInfo ( SharedMemoryContext context,
RpcContext rpc,
BufferID  buffer_id 
)

get buffer information

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

◆ NormalizeAccessScore()

f32 hermes::NormalizeAccessScore ( SharedMemoryContext context,
f32  raw_score,
f32  size_mb 
)

normalize access score from raw-score using size_mb

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

◆ BytesToMegabytes()

static f32 hermes::BytesToMegabytes ( size_t  bytes)
inlinestatic

< MB

Here is the caller graph for this function:

◆ GetBufferInfo() [2/2]

std::vector< BufferInfo > hermes::GetBufferInfo ( SharedMemoryContext context,
RpcContext rpc,
const std::vector< BufferID > &  buffer_ids 
)

get buffer information

Here is the call graph for this function:

◆ ComputeBlobAccessScore()

f32 hermes::ComputeBlobAccessScore ( SharedMemoryContext context,
const std::vector< BufferInfo > &  buffer_info 
)

compute BLOB access score

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

◆ SortBufferInfo()

void hermes::SortBufferInfo ( std::vector< BufferInfo > &  buffer_info,
bool  increasing 
)

sort buffer information

Here is the caller graph for this function:

◆ SortTargetInfo()

void hermes::SortTargetInfo ( std::vector< TargetInfo > &  target_info,
bool  increasing 
)

sort target information

Here is the caller graph for this function:

◆ EnqueueBoMove()

void hermes::EnqueueBoMove ( RpcContext rpc,
const BoMoveList moves,
BlobID  blob_id,
BucketID  bucket_id,
const std::string &  internal_name,
BoPriority  priority 
)

enqueue buffer organizer move list

Here is the caller graph for this function:

◆ LocalEnqueueBoMove()

void hermes::LocalEnqueueBoMove ( SharedMemoryContext context,
RpcContext rpc,
const BoMoveList moves,
BlobID  blob_id,
BucketID  bucket_id,
const std::string &  internal_blob_name,
BoPriority  priority 
)

enqueue buffer organizer move list locally

Here is the caller graph for this function:

◆ BoMove()

void hermes::BoMove ( SharedMemoryContext context,
RpcContext rpc,
const BoMoveList moves,
BlobID  blob_id,
BucketID  bucket_id,
const std::string &  internal_blob_name 
)

Assumes all BufferIDs in destinations are local

Here is the call graph for this function:

◆ LocalOrganizeBlob()

void hermes::LocalOrganizeBlob ( SharedMemoryContext context,
RpcContext rpc,
const std::string &  internal_blob_name,
BucketID  bucket_id,
f32  epsilon,
f32  explicit_importance_score 
)

organize BLOB locally

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

◆ OrganizeBlob()

void hermes::OrganizeBlob ( SharedMemoryContext context,
RpcContext rpc,
BucketID  bucket_id,
const std::string &  blob_name,
f32  epsilon,
f32  importance_score = -1 
)

organize BLOB

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

◆ EnforceCapacityThresholds()

void hermes::EnforceCapacityThresholds ( SharedMemoryContext context,
RpcContext rpc,
ViolationInfo  info 
)

enforce capacity threholds

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

◆ LocalEnforceCapacityThresholds()

void hermes::LocalEnforceCapacityThresholds ( SharedMemoryContext context,
RpcContext rpc,
ViolationInfo  info 
)

enforce capacity threholds locally

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

◆ LocalShutdownBufferOrganizer()

void hermes::LocalShutdownBufferOrganizer ( SharedMemoryContext context)

shut down buffer organizer locally

Here is the caller graph for this function:

◆ FlushBlob()

void hermes::FlushBlob ( SharedMemoryContext context,
RpcContext rpc,
BlobID  blob_id,
const std::string &  filename,
u64  offset,
bool  async 
)

< KB

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

◆ EnqueueFlushingTask()

bool hermes::EnqueueFlushingTask ( RpcContext rpc,
BlobID  blob_id,
const std::string &  filename,
u64  offset 
)

enqueue flushing task

Here is the caller graph for this function:

◆ LocalEnqueueFlushingTask()

bool hermes::LocalEnqueueFlushingTask ( SharedMemoryContext context,
RpcContext rpc,
BlobID  blob_id,
const std::string &  filename,
u64  offset 
)

enqueue flushing task locally

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

◆ PlaceInHierarchy()

api::Status hermes::PlaceInHierarchy ( SharedMemoryContext context,
RpcContext rpc,
SwapBlob  swap_blob,
const std::string &  name,
const api::Context ctx 
)

place BLOBs in hierarchy

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

◆ LocalAdjustFlushCount()

void hermes::LocalAdjustFlushCount ( SharedMemoryContext context,
const std::string &  vbkt_name,
int  adjustment 
)

adjust flush coun locally

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

◆ LocalIncrementFlushCount()

void hermes::LocalIncrementFlushCount ( SharedMemoryContext context,
const std::string &  vbkt_name 
)

increment flush count locally

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

◆ LocalDecrementFlushCount()

void hermes::LocalDecrementFlushCount ( SharedMemoryContext context,
const std::string &  vbkt_name 
)

decrement flush count locally

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

◆ IncrementFlushCount()

void hermes::IncrementFlushCount ( SharedMemoryContext context,
RpcContext rpc,
const std::string &  vbkt_name 
)

increment flush count

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

◆ DecrementFlushCount()

void hermes::DecrementFlushCount ( SharedMemoryContext context,
RpcContext rpc,
const std::string &  vbkt_name 
)

decrement flush count

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

◆ AwaitAsyncFlushingTasks()

void hermes::AwaitAsyncFlushingTasks ( SharedMemoryContext context,
RpcContext rpc,
VBucketID  id 
)

await asynchronous flushing tasks

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

◆ OrganizeDevice()

void hermes::OrganizeDevice ( SharedMemoryContext context,
RpcContext rpc,
DeviceID  devices_id 
)

organize device

◆ operator==() [2/2]

bool hermes::operator== ( const BufferID lhs,
const BufferID rhs 
)

comparison operator

◆ Finalize()

void hermes::Finalize ( SharedMemoryContext context,
CommunicationContext comm,
RpcContext rpc,
const char *  shmem_name,
Arena trans_arena,
bool  is_application_core,
bool  force_rpc_shutdown 
)

Free all resources held by Hermes.

Parameters
contextThe Hermes instance's shared memory context.
commThe Hermes instance's communication context.
rpcThe Hermes instance's RPC context.
shmem_nameThe name of the shared memory.
trans_arenaThe instance's transient arena.
is_application_coreWhether or not this rank is an app rank.
force_rpc_shutdownForce RPC shutdown when it is true.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LockBuffer()

void hermes::LockBuffer ( BufferHeader header)

Lock header buffer.

◆ UnlockBuffer()

void hermes::UnlockBuffer ( BufferHeader header)

Unlock header buffer.

◆ GetBufferPoolFromContext()

BufferPool * hermes::GetBufferPoolFromContext ( SharedMemoryContext context)

Obtains a pointer to the BufferPool constructed in shared memory.

Since the BufferPool lives in shared memory, this pointer should never be freed. It is only destroyed when the Hermes core closes the shared memory.

Parameters
contextThe shared memory context for accessing the BufferPool.
Returns
A pointer to the BufferPool constructed in the shared memory represented by context.
Here is the caller graph for this function:

◆ GetDeviceFromHeader()

Device * hermes::GetDeviceFromHeader ( SharedMemoryContext context,
BufferHeader header 
)

Get Device from context SharedMemoryContext and header BufferHeader

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

◆ GetTarget()

Target * hermes::GetTarget ( SharedMemoryContext context,
int  index 
)

Get Target from context SharedMemoryContext and index index.

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

◆ GetTargetFromId()

Target * hermes::GetTargetFromId ( SharedMemoryContext context,
TargetID  id 
)

Get Target from context SharedMemoryContext and id TargetID.

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

◆ GetBandwidths()

std::vector< f32 > hermes::GetBandwidths ( SharedMemoryContext context,
const std::vector< TargetID > &  targets 
)

Returns a vector of bandwidths in MiB per second for a given Target list.

Element n of the result is the bandwidth of the Device that backs the nth element of targets.

Parameters
contextThe shared memory context needed to access BufferPool info.
targetsThe list of targets for which to retrieve bandwidth info.
Returns
The list of bandwidths, one for each target in targets, in MiB/sec.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDeviceById()

Device * hermes::GetDeviceById ( SharedMemoryContext context,
DeviceID  device_id 
)

Returns a pointer to the Device with index device_id in the shared memory context.

This pointer should never be freed, since it lives in shared memory and is managed by the Hermes core.

Parameters
contextThe shared memory context where the Devices are stored.
device_idAn identifier for the desired Device. This is an index into an array of Devices.
Returns
A pointer to the Device with ID device_id.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDeviceIdFromTargetId()

DeviceID hermes::GetDeviceIdFromTargetId ( TargetID  target_id)

Get DeviceID from target_id TargetID.

Here is the caller graph for this function:

◆ GetHeadersBase()

BufferHeader * hermes::GetHeadersBase ( SharedMemoryContext context)

Returns a pointer to the first BufferHeader in the array of BufferHeaders constructed in the shared memory context.

This pointer should never be freed, as it is managed by the Hermes core. Indexing off this pointer, one can easily iterate through all BufferHeaders. When retrieving a specific header, use GetHeaderByBufferId.

Example:

BufferHeader *headers = GetHeadersBase(context);
for (u32 i = 0; i < pool->num_headers[device_id]; ++i) {
BufferHeader *header = headers + i;
// ...
}
BufferHeader * GetHeadersBase(SharedMemoryContext *context)
Definition: buffer_pool.cc:200
uint32_t u32
Definition: hermes_types.h:42
Parameters
contextThe shared memory context where the BufferHeaders live.
Returns
A pointer to the first BufferHeader in the array of BufferHeaders.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHeaderByIndex()

BufferHeader* hermes::GetHeaderByIndex ( SharedMemoryContext context,
u32  index 
)
inline

Get BufferHeader from context SharedMemoryContext and index index.

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

◆ GetHeaderByBufferId()

BufferHeader * hermes::GetHeaderByBufferId ( SharedMemoryContext context,
BufferID  id 
)

Retrieves the BufferHeader that corresponds to BufferID id.

This pointer should never be freed. The BufferHeaders are managed by the Hermes core.

Parameters
contextThe shared memory context for accessing the BufferHeaders.
idThe desired BufferID to retrieve.
Returns
A pointer to the BufferHeader that corresponds to id.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResetHeader()

void hermes::ResetHeader ( BufferHeader header)

Reset header BufferHeader.

Here is the caller graph for this function:

◆ MakeHeaderDormant()

static void hermes::MakeHeaderDormant ( BufferHeader header)
inlinestatic

Make header BufferHeader dormant by setting capacity to 0.

Here is the caller graph for this function:

◆ HeaderIsDormant()

bool hermes::HeaderIsDormant ( BufferHeader header)

Returns whether or not header is currently backed by physical storage.

A dormant header has no storage associated with it. It exists to facilitate the splitting and merging mechanisms. Splitting buffers into smaller buffers requires more headers. When that happens, dormant headers become associated with backing storage, and become "live."

Parameters
headerThe header to check.
Returns
true if header is not backed by physical storage, false otherwise.
Here is the caller graph for this function:

◆ GetSlabUnitSize()

i32 hermes::GetSlabUnitSize ( SharedMemoryContext context,
DeviceID  device_id,
int  slab_index 
)

Get slab unit size from context SharedMemoryContext, device_id Device ID, and slab_index slab index.

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

◆ GetSlabBufferSize()

i32 hermes::GetSlabBufferSize ( SharedMemoryContext context,
DeviceID  device_id,
int  slab_index 
)

Get slab buffer size from context SharedMemoryContext, device_id Device ID, and slab_index slab index.

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

◆ GetFreeListPtr()

BufferID* hermes::GetFreeListPtr ( SharedMemoryContext context,
DeviceID  device_id 
)

Get BufferID pointer to the free list offset of device_id Device ID from context SharedMemoryContext.

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

◆ GetSlabIndexFromHeader()

int hermes::GetSlabIndexFromHeader ( SharedMemoryContext context,
BufferHeader header 
)

Get slab index from context SharedMemoryContext and header BufferHeader.

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

◆ BufferIsRemote() [1/2]

bool hermes::BufferIsRemote ( CommunicationContext comm,
BufferID  buffer_id 
)

Check if node ID of buffer_id BufferID is same as node ID of comm CommunicationContext.

Here is the caller graph for this function:

◆ BufferIsRemote() [2/2]

bool hermes::BufferIsRemote ( RpcContext rpc,
BufferID  buffer_id 
)

Check if node ID of buffer_id BufferID is same as node ID of rpc RpcContext.

◆ IsNullBufferId()

bool hermes::IsNullBufferId ( BufferID  id)

Check if id BufferID is null.

Here is the caller graph for this function:

◆ BufferIsByteAddressable()

bool hermes::BufferIsByteAddressable ( SharedMemoryContext context,
BufferID  id 
)

Check if the device with context SharedMemoryContext and buffer_id BufferID is byte-addressable.

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

◆ PeekFirstFreeBufferId()

BufferID hermes::PeekFirstFreeBufferId ( SharedMemoryContext context,
DeviceID  device_id,
int  slab_index 
)

Get the first free BufferID from context SharedMemoryContext, device_id DeviceID, and slab_index slab index.

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

◆ SetFirstFreeBufferId()

void hermes::SetFirstFreeBufferId ( SharedMemoryContext context,
DeviceID  device_id,
int  slab_index,
BufferID  new_id 
)

Set the value at slab_index slab index of free list from context SharedMemoryContext and device_id DeviceID as new_id BufferID.

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

◆ GetAvailableBuffersArray()

std::atomic< u32 > * hermes::GetAvailableBuffersArray ( SharedMemoryContext context,
DeviceID  device_id 
)

Get the array of available buffer offsets from context SharedMemoryContext and device_id DeviceID.

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

◆ GetNumBuffersAvailable() [1/2]

static u32 hermes::GetNumBuffersAvailable ( SharedMemoryContext context,
DeviceID  device_id,
int  slab_index 
)
static

Get the number of available buffers from context SharedMemoryContext, and device_id DeviceID at slab_index slab index.

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

◆ GetNumBuffersAvailable() [2/2]

u32 hermes::GetNumBuffersAvailable ( SharedMemoryContext context,
DeviceID  device_id 
)

Get the number of available buffers from context SharedMemoryContext, and device_id DeviceID.

Here is the call graph for this function:

◆ DecrementAvailableBuffers()

static void hermes::DecrementAvailableBuffers ( SharedMemoryContext context,
DeviceID  device_id,
int  slab_index 
)
static

Decrement the number of available buffers at slab_index slab index from context SharedMemoryContext and device_id DeviceID.

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

◆ IncrementAvailableBuffers()

static void hermes::IncrementAvailableBuffers ( SharedMemoryContext context,
DeviceID  device_id,
int  slab_index 
)
static

Increment the number of available buffers at slab_index slab index from context SharedMemoryContext and device_id DeviceID.

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

◆ UpdateBufferingCapacities()

void hermes::UpdateBufferingCapacities ( SharedMemoryContext context,
i64  adjustment,
DeviceID  device_id 
)

Update buffering capacities of device_id DeviceID by adjustment from context SharedMemoryContext.

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

◆ LocalReleaseBuffer()

void hermes::LocalReleaseBuffer ( SharedMemoryContext context,
BufferID  buffer_id 
)

Release local buffer_id buffer from context SharedMemoryContext.

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

◆ ReleaseBuffer()

void hermes::ReleaseBuffer ( SharedMemoryContext context,
RpcContext rpc,
BufferID  buffer_id 
)

Release remote buffer_id buffer from context SharedMemoryContext and rpc RpcContext.

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

◆ ReleaseBuffers()

void hermes::ReleaseBuffers ( SharedMemoryContext context,
RpcContext rpc,
const std::vector< BufferID > &  buffer_ids 
)

Release remote buffer_ids buffers from context SharedMemoryContext and rpc RpcContext.

Returns buffer_ids to the BufferPool free lists so that they can be used again. Data in the buffers is considered abandonded, and can be overwritten.

Parameters
contextThe shared memory context where the BufferPool lives.
rpcThe RPC context to enable a remote call if necessary.
buffer_idsThe list of buffer_ids to return to the BufferPool.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LocalReleaseBuffers()

void hermes::LocalReleaseBuffers ( SharedMemoryContext context,
const std::vector< BufferID > &  buffer_ids 
)

Release local buffer_ids buffers from context SharedMemoryContext.

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

◆ GetFreeBuffer()

BufferID hermes::GetFreeBuffer ( SharedMemoryContext context,
DeviceID  device_id,
int  slab_index 
)

Get the BufferID of free buffer at slab_index slab index from context SharedMemoryContext and device_id DeviceID.

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

◆ GetBuffers()

std::vector< BufferID > hermes::GetBuffers ( SharedMemoryContext context,
const PlacementSchema schema 
)

Returns a vector of BufferIDs that satisfy the constrains of schema.

If a request cannot be fulfilled, an empty list is returned. GetBuffers will never partially satisfy a request. It is all or nothing. If schema includes a remote Device, this function will make an RPC call to get BufferIDs from a remote node.

Parameters
contextThe shared memory context for the BufferPool.
schemaA description of the amount and Device of storage requested.
Returns
A vector of BufferIDs that can be used for storage, and that satisfy schema, or an empty vector if the request could not be fulfilled.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LocalGetBufferSize()

u32 hermes::LocalGetBufferSize ( SharedMemoryContext context,
BufferID  id 
)

Get buffer size from context SharedMemoryContext and id BufferID.

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

◆ GetBufferSize()

u32 hermes::GetBufferSize ( SharedMemoryContext context,
RpcContext rpc,
BufferID  id 
)

Get remote buffer size from context SharedMemoryContext, rpc RpcContext, and id BufferID.

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

◆ GetBlobSize()

size_t hermes::GetBlobSize ( SharedMemoryContext context,
RpcContext rpc,
BufferIdArray buffer_ids 
)

Get remote BLOB size from context SharedMemoryContext, rpc RpcContext, and buffer_ids BufferIdArray.

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

◆ GetBlobSizeById()

size_t hermes::GetBlobSizeById ( SharedMemoryContext context,
RpcContext rpc,
Arena arena,
BlobID  blob_id 
)

Get remote BLOB size from context SharedMemoryContext, rpc RpcContext, arena Arena, and blob_id BlobID.

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

◆ GetBufferOffset()

ptrdiff_t hermes::GetBufferOffset ( SharedMemoryContext context,
BufferID  id 
)

Get buffer offset of id buffer from context SharedMemoryContext.

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

◆ GetRamBufferPtr()

u8 * hermes::GetRamBufferPtr ( SharedMemoryContext context,
BufferID  buffer_id 
)

Get RAM buffer pointer of id buffer from context SharedMemoryContext.

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

◆ MakeBufferId()

BufferID hermes::MakeBufferId ( u32  node_id,
u32  header_index 
)

Make BufferID using node_id and header_index.

Here is the caller graph for this function:

◆ PartitionRamBuffers()

void hermes::PartitionRamBuffers ( Arena arena,
i32  buffer_size,
i32  buffer_count,
int  block_size 
)

Partition RAM buffers by block_size for buffer_count buffers with buffer_size size in arena Arena.

Here is the caller graph for this function:

◆ MakeBufferHeaders()

BufferID hermes::MakeBufferHeaders ( Arena arena,
int  buffer_size,
u32  start_index,
u32  end_index,
int  node_id,
DeviceID  device_id,
ptrdiff_t  initial_offset,
u8 **  header_begin 
)

Make end_index - start_index amount of BufferHeaders.

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

◆ InitDevices()

Device* hermes::InitDevices ( Arena arena,
Config config,
f32 min_bw,
f32 max_bw 
)

Initialize devices.

Here is the caller graph for this function:

◆ InitTargets()

Target* hermes::InitTargets ( Arena arena,
Config config,
Device devices,
int  node_id 
)

Initialize targets.

Here is the caller graph for this function:

◆ MergeRamBufferFreeList()

void hermes::MergeRamBufferFreeList ( SharedMemoryContext context,
int  slab_index 
)

Merge RAM buffer free list.

Todo:
(chogan): needs more testing for the case when the free list has been jumbled for a while. Currently, we just test a nice linear free list.

TODO(chogan):

Parameters
contextThe shared memory context for accessing the BufferPool
slab_indexThe 0-based index of the slab to merge.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SplitRamBufferFreeList()

void hermes::SplitRamBufferFreeList ( SharedMemoryContext context,
int  slab_index 
)

Split RAM buffer free list.

Todo:
(chogan) Needs more testing for the case when the free list has been jumbled for a while. Currently we just test a nice linear free list.

TODO(chogan):

Parameters
contextThe shared memory context for accessing the BufferPool.
slab_indexThe 0-based index of the slab to split.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitBufferPool()

ptrdiff_t hermes::InitBufferPool ( u8 hermes_memory,
Arena buffer_pool_arena,
Arena scratch_arena,
i32  node_id,
Config config 
)

Initializes a BufferPool inside an existing shared memory segment.

Divides the shared memory segment pointed to by hermes_memory into 1) An array of RAM buffers. 2) An array of BufferHeaders. 3) An array of Devices. 4) The BufferPool struct, which contains pointers (really offsets) to the data above.

The sizes of each of these sections is controlled by the config parameter. Each BufferHeader is initialized to point to a specfic offset. In the case of a RAM buffer, this offset is from the beginning of the shared memory. In the case of a file buffer, the offset is from the beginning of a file. Free lists for each slab in each Device are also constructed.

Parameters
hermes_memoryThe base pointer to a shared memory segment.
buffer_pool_arenaAn Arena backed by the shared memory segment pointed to by hermes_shared_memory.
scratch_arenaAn arena for temporary allocations that are destroyed when this function exits.
node_idThe identifier of the node this function is running on.
configConfiguration that specifies how the BufferPool is constructed.
Returns
The offset of the beginning of the BufferPool from the beginning of shared memory.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SerializeBufferPoolToFile()

void hermes::SerializeBufferPoolToFile ( SharedMemoryContext context,
FILE *  file 
)

Write buffer pool to file file.

Here is the call graph for this function:

◆ MakeFullShmemName()

void hermes::MakeFullShmemName ( char *  dest,
const char *  base 
)

Constructs a unique (among users) shared memory name from a base name.

Copies the base name into the dest buffer and appends the value of the USER envioronment variable. The dest buffer should be large enough to hold the base name and the value of USER.

Parameters
[out]destA buffer for the full shared memory name.
[in]baseThe base shared memory name.
Here is the caller graph for this function:

◆ FopenOrTerminate()

FILE* hermes::FopenOrTerminate ( const char *  fname,
const char *  mode 
)

Terminate if fopen() call fails. Otherwise, return file pointer.

◆ OpenOrTerminate()

int hermes::OpenOrTerminate ( const std::string &  fname,
int  flags,
mode_t  mode = 0 
)

Terminate if open() call fails. Otherwise, return file pointer.

Here is the caller graph for this function:

◆ InitFilesForBuffering()

void hermes::InitFilesForBuffering ( SharedMemoryContext context,
CommunicationContext comm 
)
Todo:
Creates and opens all files that will be used for buffering. Stores open FILE pointers in the context. The file buffering paradaigm uses one file per slab for each Device. If posix_fallocate is available, and make_space is true, each file's capacity is reserved. Otherwise, the files will be initialized with 0 size.
Parameters
contextThe SharedMemoryContext in which to store the opened FILE pointers.
commcontext for communication
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitSharedMemory()

u8 * hermes::InitSharedMemory ( const char *  shmem_name,
size_t  total_size 
)

Initialize shared memory.

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

◆ GetSharedMemoryContext()

SharedMemoryContext hermes::GetSharedMemoryContext ( char *  shmem_name)

Retrieves information required for accessing the BufferPool shared memory.

Maps an existing shared memory segment into the calling process's address space. Application cores will call this function, and the Hermes core initialization will have already created the shared memory segment. Application cores can then use the context to access the BufferPool.

Parameters
shmem_nameThe name of the shared memory segment.
Returns
The shared memory context required to access the BufferPool.
Here is the caller graph for this function:

◆ UnmapSharedMemory()

void hermes::UnmapSharedMemory ( SharedMemoryContext context)

Unmap shared memory.

Here is the caller graph for this function:

◆ CloseBufferingFiles()

void hermes::CloseBufferingFiles ( SharedMemoryContext context)

Close buffering files.

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

◆ ReleaseSharedMemoryContext()

void hermes::ReleaseSharedMemoryContext ( SharedMemoryContext context)

Unmaps the shared memory represented by context and closes any open file descriptors

This isn't strictly necessary, since the segment will be unmapped when the process exits and the file descriptors will be closed, but is here for completeness.

Parameters
contextThe shared memory to unmap.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LocalWriteBufferById()

size_t hermes::LocalWriteBufferById ( SharedMemoryContext context,
BufferID  id,
const Blob blob,
size_t  offset 
)

Write buffer by id buffer locally.

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

◆ WriteBlobToBuffers()

void hermes::WriteBlobToBuffers ( SharedMemoryContext context,
RpcContext rpc,
const Blob blob,
const std::vector< BufferID > &  buffer_ids 
)

Sketch of how an I/O client might write.

Writes the blob to the collection of buffer_ids. The BufferIDs inform the call whether it is writing locally, remotely, to RAM (or a byte addressable Device) or to a file (block addressable Device).

Parameters
contextThe shared memory context needed to access BufferPool info
rpcThe Hermes instance's RPC context
blobThe data to write
buffer_idsThe collection of BufferIDs that should buffer the blob
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LocalReadBufferById()

size_t hermes::LocalReadBufferById ( SharedMemoryContext context,
BufferID  id,
Blob blob,
size_t  read_offset 
)

Read buffer by id buffer locally.

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

◆ ReadBlobFromBuffers()

size_t hermes::ReadBlobFromBuffers ( SharedMemoryContext context,
RpcContext rpc,
Blob blob,
BufferIdArray buffer_ids,
u32 buffer_sizes 
)

Sketch of how an I/O client might read.

Reads the collection of buffer_ids into blob. The BufferIDs inform the call whether it is reading locally, remotely, from RAM (or a byte addressable Device) or to a file (block addressable Device).

Parameters
contextThe shared memory context needed to access BufferPool info.
rpcThe RPC context needed to make a remote call if necessary.
blobA place to store the read data.
buffer_idsThe collection of BufferIDs that hold the buffered blob.
buffer_sizesA list of sizes that correspond to each buffer in buffer_ids. Its length is the length of buffer_ids
Returns
The total number of bytes read

< KB

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

◆ ReadBlobById() [1/2]

size_t hermes::ReadBlobById ( SharedMemoryContext context,
RpcContext rpc,
Arena arena,
Blob  blob,
BlobID  blob_id 
)

Read blob_id BLOB.

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

◆ ReadBlobById() [2/2]

size_t hermes::ReadBlobById ( SharedMemoryContext context,
RpcContext rpc,
Arena arena,
api::Blob dest,
BlobID  blob_id 
)

Read a remote blob_id BLOB.

Here is the call graph for this function:

◆ OpenSwapFile()

void hermes::OpenSwapFile ( SharedMemoryContext context,
u32  node_id 
)

Open swap file.

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

◆ WriteToSwap() [1/2]

SwapBlob hermes::WriteToSwap ( SharedMemoryContext context,
Blob  blob,
u32  node_id,
BucketID  bucket_id 
)

Write blob data to a swap file.

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

◆ PutToSwap() [1/2]

SwapBlob hermes::PutToSwap ( SharedMemoryContext context,
RpcContext rpc,
const std::string &  name,
BucketID  bucket_id,
const u8 data,
size_t  size 
)

Put data to a remote swap.

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

◆ ReadFromSwap()

size_t hermes::ReadFromSwap ( SharedMemoryContext context,
Blob  blob,
SwapBlob  swap_blob 
)

Read blob data from swap file.

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

◆ PlaceBlob()

api::Status hermes::PlaceBlob ( SharedMemoryContext context,
RpcContext rpc,
PlacementSchema schema,
Blob  blob,
const std::string &  name,
BucketID  bucket_id,
const api::Context ctx,
bool  called_from_buffer_organizer 
)

Place blob BLOB.

< end timing

< begin timing

< end timing

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

◆ StdIoPersistBucket()

api::Status hermes::StdIoPersistBucket ( SharedMemoryContext context,
RpcContext rpc,
Arena arena,
BucketID  bucket_id,
const std::string &  file_name,
const std::string &  open_mode 
)

Persist Bucket using stdio.

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

◆ StdIoPersistBlob()

api::Status hermes::StdIoPersistBlob ( SharedMemoryContext context,
RpcContext rpc,
Arena arena,
BlobID  blob_id,
int  fd,
const i32 offset 
)

Persist BLOB using stdio.

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

◆ GetBlobImportanceScore()

f32 hermes::GetBlobImportanceScore ( SharedMemoryContext context,
RpcContext rpc,
BlobID  blob_id 
)

Get the importance score of blob_id BLOB.

Here is the call graph for this function:

◆ StartBufferPoolRpcServer()

void hermes::StartBufferPoolRpcServer ( SharedMemoryContext context,
const char *  addr,
i32  num_rpc_threads 
)

Starts an RPC server that will listen for remote requests directed to the BufferPool.

Parameters
contextThe shared memory context where the BufferPool lives
addrThe address and port where the RPC server will listen This address must be a compatible with whatever the RPC implementation is.
num_rpc_threadsnumber of RPC threads

◆ PutToSwap() [2/2]

template<typename T >
std::vector<SwapBlob> hermes::PutToSwap ( SharedMemoryContext context,
RpcContext rpc,
BucketID  id,
std::vector< std::vector< T >> &  blobs,
std::vector< std::string > &  names 
)

A template function to put BLOBs into swap

Here is the call graph for this function:

◆ WriteToSwap() [2/2]

SwapBlob hermes::WriteToSwap ( SharedMemoryContext context,
Blob  blob,
BlobID  blob_id,
BucketID  bucket_id 
)

write BLOB to swap.

◆ ParseConfig()

void hermes::ParseConfig ( Arena arena,
const char *  path,
Config config 
)

parse YAML configuration file

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

◆ InitCommunication()

size_t hermes::InitCommunication ( CommunicationContext comm,
Arena arena,
size_t  trans_arena_size_per_node,
bool  is_daemon,
bool  is_adapter 
)

initialize MPI communication.

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

◆ WorldBarrier()

void hermes::WorldBarrier ( CommunicationContext comm)
inline

world communicator

Here is the caller graph for this function:

◆ SubBarrier()

void hermes::SubBarrier ( CommunicationContext comm)
inline

sub-communicator

Here is the caller graph for this function:

◆ GetAppCommunicator()

void * hermes::GetAppCommunicator ( CommunicationContext comm)

get the application's communicator

Here is the caller graph for this function:

◆ MpiGetProcId()

int hermes::MpiGetProcId ( MPI_Comm  comm)
inline

get the MPI process ID of comm MPI communicator.

Here is the caller graph for this function:

◆ MpiGetWorldProcId()

int hermes::MpiGetWorldProcId ( void *  state)
inline

get the MPI process ID of MPI world communicator from state MPIState.

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

◆ MpiGetSubProcId()

int hermes::MpiGetSubProcId ( void *  state)
inline

get the MPI process ID of MPI sub-communicator from state MPIState.

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

◆ MpiGetNumProcs()

int hermes::MpiGetNumProcs ( MPI_Comm  comm)
inline

get the number of MPI processes of comm MPI communicator.

Here is the caller graph for this function:

◆ MpiGetNumWorldProcs()

int hermes::MpiGetNumWorldProcs ( void *  state)
inline

get the number of MPI processes of MPI world communicator.

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

◆ MpiBarrier()

void hermes::MpiBarrier ( MPI_Comm  comm)
inline

a wrapper for MPI_Barrier() fucntion

Here is the caller graph for this function:

◆ MpiWorldBarrier()

void hermes::MpiWorldBarrier ( void *  state)
inline

a wrapper for MPI global communicator's MPI_Barrier() function

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

◆ MpiSubBarrier()

void hermes::MpiSubBarrier ( void *  state)
inline

a wrapper for MPI sub-communicator's MPI_Barrier() function

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

◆ MpiFirstOnNode()

bool hermes::MpiFirstOnNode ( MPI_Comm  comm)

Returns true if the calling rank is the lowest numbered rank on its node in communicator comm.

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

◆ MpiAssignIDsToNodes()

size_t hermes::MpiAssignIDsToNodes ( CommunicationContext comm,
size_t  trans_arena_size_per_node 
)

Assigns each node an ID and returns the size in bytes of the transient arena for the calling rank.

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

◆ MpiFinalize()

void hermes::MpiFinalize ( void *  state)

a wrapper for MPI_Finalize() function

Here is the caller graph for this function:

◆ PrintExpectedAndFail()

void hermes::PrintExpectedAndFail ( const std::string &  expected,
u32  line_number = 0 
)

print expected value and fail when an error occurs

Here is the caller graph for this function:

◆ RequireNumDevices()

void hermes::RequireNumDevices ( Config config)

log an error message when the number of devices is < 1 in config

Here is the caller graph for this function:

◆ RequireNumSlabs()

void hermes::RequireNumSlabs ( Config config)

log an error message when the number of any slab is < 1 in config

Here is the caller graph for this function:

◆ RequireCapacitiesUnset()

void hermes::RequireCapacitiesUnset ( bool &  already_specified)

log an error message when capacities are specified multiple times

Here is the caller graph for this function:

◆ RequireBlockSizesUnset()

void hermes::RequireBlockSizesUnset ( bool &  already_specified)

log an error message when block sizes are specified multiple times

Here is the caller graph for this function:

◆ ParseCapacities()

void hermes::ParseCapacities ( Config config,
YAML::Node  capacities,
int  unit_conversion,
bool &  already_specified 
)

parse capacities from configuration file in YAML

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

◆ ParseBlockSizes()

void hermes::ParseBlockSizes ( Config config,
YAML::Node  block_sizes,
int  unit_conversion,
bool &  already_specified 
)

parse block sizes from configuration file in YAML

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

◆ ParseArray()

template<typename T >
void hermes::ParseArray ( YAML::Node  list_node,
const std::string  var,
T *  list,
int  max_list_len 
)

parse var array from configuration file in YAML

◆ ParseVector()

template<typename T >
void hermes::ParseVector ( YAML::Node  list_node,
std::vector< T > &  list 
)

parse list_node vector from configuration file in YAML

◆ ParseMatrix() [1/2]

template<typename T >
void hermes::ParseMatrix ( YAML::Node  matrix_node,
const std::string  var,
T *  matrix,
int  max_row_len,
int  max_col_len,
int *  col_len 
)

parse matrix_node matrix using col_len column length

◆ ParseMatrix() [2/2]

template<typename T >
void hermes::ParseMatrix ( YAML::Node  matrix_node,
std::string  var,
T *  matrix,
int  max_row_len,
int  max_col_len 
)

parse matrix_node matrix from configuration file in YAML

◆ ParseRangeList()

void hermes::ParseRangeList ( YAML::Node  list_node,
std::string  var,
std::vector< std::string > &  list 
)

parse range list from configuration file in YAML

Here is the caller graph for this function:

◆ ParseHostNames()

void hermes::ParseHostNames ( YAML::Node  yaml_conf,
hermes::Config config 
)

parse host names from configuration file in YAML

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

◆ CheckConstraints()

void hermes::CheckConstraints ( Config config)

check constraints in config configuration

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

◆ ParseConfigYAML()

void hermes::ParseConfigYAML ( YAML::Node &  yaml_conf,
Config config 
)

< KB

< MB

< GB

< KB

< MB

< GB

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

◆ ParseConfigString()

void hermes::ParseConfigString ( Arena arena,
const std::string &  config_string,
Config config 
)

parse configuration string

Here is the call graph for this function:

◆ InitConfig()

void hermes::InitConfig ( hermes::Config config,
const char *  config_file 
)

< KB

Here is the call graph for this function:

◆ CreateConfig()

hermes::Config* hermes::CreateConfig ( const char *  config_file)

create configuration file

◆ AggregateBlobSchema()

PlacementSchema hermes::AggregateBlobSchema ( PlacementSchema schema)

aggregate BLOB schema

Here is the caller graph for this function:

◆ CalculatePlacement()

Status hermes::CalculatePlacement ( SharedMemoryContext context,
RpcContext rpc,
const std::vector< size_t > &  blob_sizes,
std::vector< PlacementSchema > &  output,
const api::Context api_context 
)

calculate data placement

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

◆ IsPowerOfTwo()

bool hermes::IsPowerOfTwo ( size_t  val)

Check if val number is a power of 2 or not. Use a bitwise operator instead of log_2(n) math function.

Here is the caller graph for this function:

◆ AlignForward()

uintptr_t hermes::AlignForward ( uintptr_t  addr,
size_t  alignment 
)

align addr forward by alignment.

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

◆ AlignBackward()

uintptr_t hermes::AlignBackward ( uintptr_t  addr,
size_t  alignment 
)

align addr backward by alignment.

Here is the call graph for this function:

◆ InitArena()

void hermes::InitArena ( Arena arena,
size_t  bytes,
u8 base 
)

initialize arena Arena with bytes capacity and base address

Initializes an Arena with a starting size and base pointer. The base parameter must point to a contiguous region of allocated memory of at least bytes bytes.

Parameters
[in,out]arenaThe Arena to initialize.
[in]bytesThe desired size in bytes of the Arena's backing memory.
[in]baseA pointer to the beginning of the Arena's backing memory.
Here is the caller graph for this function:

◆ InitArenaAndAllocate()

Arena hermes::InitArenaAndAllocate ( size_t  bytes)

initialize arena by allocating bytes memory

Initializes an Arena with a starting size. This function uses malloc to allocate a contiguous region of length bytes for the arena.

Parameters
[in]bytesThe desired size in bytes to allocate.
Returns
An arena with capacity bytes.
Here is the caller graph for this function:

◆ DestroyArena()

void hermes::DestroyArena ( Arena arena)

free arena Arena memory and reset its members to 0.

Frees the memory backing the Arena, and zeros out all its fields.

Only Arenas whose backing memory was created by malloc should be destroyed with this function. Arenas using shared memory as the backing store should not be destroyed. The backing memory is reclaimed when the shared memory is unlinked.

Parameters
[in,out]arenaThe Arena to destroy.
Here is the caller graph for this function:

◆ GetRemainingCapacity()

size_t hermes::GetRemainingCapacity ( Arena arena)

get the remaining capacity of arena Arena

Returns the amount of free space left in an Arena.

Parameters
[in]arenaThe Arena to query.
Returns
The number of free bytes remaining
Here is the caller graph for this function:

◆ GrowArena()

void hermes::GrowArena ( Arena arena,
size_t  new_size 
)

The maximum capacity of arena becomes new_size.

Expands the backing memory for an arena to be new_size bytes.

Becuase this function uses realloc, it will only work for Arenas whose backing store was created with malloc. It cannot be used with Arenas whose backing store is shared memory (e.g., the BufferPool arena).

Parameters
arenaThe arena to expand.
new_sizeThe new (larger) size that the Arena should occupy.
Here is the caller graph for this function:

◆ BeginTemporaryMemory()

TemporaryMemory hermes::BeginTemporaryMemory ( Arena arena)

return a temporary memory that points to arena Arena

◆ EndTemporaryMemory()

void hermes::EndTemporaryMemory ( TemporaryMemory temp_memory)

copy temp_memory usage information back to its arena.

◆ PushSize()

u8 * hermes::PushSize ( Arena arena,
size_t  size,
size_t  alignment = 8 
)

Returns a pointer to a raw region of size bytes.

This is the lower level Arena allocation function. The higher level PushStruct and PushArray should be used by clients.

Parameters
[in,out]arenaThe Arena to allocate from.
[in]sizeThe requested memory size in bytes.
[in]alignmentAlign the result to a desired multiple.
Returns
A pointer to the beginning of a contiguous region of size bytes.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PushSizeAndClear()

u8 * hermes::PushSizeAndClear ( Arena arena,
size_t  size,
size_t  alignment = 8 
)

Returns a pointer to a raw region of bytes that are cleared to zero.

Like PushSize, but clears the requested region to zero.

Parameters
[in,out]arenaThe Arena to allocate from.
[in]sizeThe requested memory size in bytes.
[in]alignmentAlign the result to a desired multiple.
Returns
A pointer to the beginning of a contiguous region of size zeros.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHeapMemory()

u8* hermes::GetHeapMemory ( Heap heap)

get heap memory address

Here is the caller graph for this function:

◆ GetHeapFreeList()

FreeBlock * hermes::GetHeapFreeList ( Heap heap)

get heap free block pointer

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

◆ NextFreeBlock()

FreeBlock * hermes::NextFreeBlock ( Heap heap,
FreeBlock block 
)

get heap's next free block from block.

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

◆ HeapOffsetToPtr()

u8 * hermes::HeapOffsetToPtr ( Heap heap,
u32  offset 
)

get pointer to heap's memory from offset.

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

◆ GetHeapOffset()

u32 hermes::GetHeapOffset ( Heap heap,
u8 ptr 
)

get pointer to heap's memory from offset.

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

◆ HeapErrorHandler()

void hermes::HeapErrorHandler ( )

print a fatal out-of-memory error message.

Here is the caller graph for this function:

◆ ComputeHeapExtent()

u32 hermes::ComputeHeapExtent ( Heap heap,
void *  item,
u32  size 
)

compute heap's extent

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

◆ HeapExtentToPtr()

u8 * hermes::HeapExtentToPtr ( Heap heap)

return a pointer to heap's extent

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

◆ InitHeapInArena()

Heap * hermes::InitHeapInArena ( Arena arena,
bool  grows_up,
u16  alignment 
)

initialize heap in arena with 4G capacity.

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

◆ FindFirstFit()

FreeBlock* hermes::FindFirstFit ( Heap heap,
u32  desired_size 
)

get the pointer to first free block from heap that has desired_size.

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

◆ HeapPushSize()

u8 * hermes::HeapPushSize ( Heap heap,
u32  size 
)

push size to heap

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

◆ HeapFree()

void hermes::HeapFree ( Heap heap,
void *  ptr 
)

free heap

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

◆ HeapRealloc()

void * hermes::HeapRealloc ( Heap heap,
void *  ptr,
size_t  size 
)

reallocate heap

Here is the call graph for this function:

◆ CoalesceFreeBlocks()

void hermes::CoalesceFreeBlocks ( Heap heap)

coalesce free blocks from heap

◆ TryBeginTicketMutex()

Ticket hermes::TryBeginTicketMutex ( TicketMutex mutex,
Ticket existing_ticket 
)

acquire ticket from existing_ticket or new one from mutex

Here is the caller graph for this function:

◆ BeginTicketMutex()

void hermes::BeginTicketMutex ( TicketMutex mutex)

begin ticket mutex

Here is the caller graph for this function:

◆ EndTicketMutex()

void hermes::EndTicketMutex ( TicketMutex mutex)

end ticket mutex

Here is the caller graph for this function:

◆ BeginReaderLock()

bool hermes::BeginReaderLock ( RwLock lock)

begin reader lock by incrementing lock's readers.

Here is the caller graph for this function:

◆ EndReaderLock()

void hermes::EndReaderLock ( RwLock lock)

end reader lock

Here is the caller graph for this function:

◆ BeginWriterLock()

void hermes::BeginWriterLock ( RwLock lock)

begin writer lock

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

◆ EndWriterLock()

void hermes::EndWriterLock ( RwLock lock)

end writer lock

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

◆ PushStruct()

template<typename T >
T* hermes::PushStruct ( Arena arena,
size_t  alignment = 8 
)
inline

Reserves space for and returns a pointer to a T instance.

Note that the T instance will be uninitialized. The caller is responsible for any initialization.

Parameters
[in,out]arenaThe backing Arena from which to reserve space.
[in]alignmentAlign the result to a desired multiple.
Returns
A pointer to an uninitialized T instance.
Here is the call graph for this function:

◆ PushClearedStruct()

template<typename T >
T* hermes::PushClearedStruct ( Arena arena,
size_t  alignment = 8 
)
inline

Reserves space for, clears to zero, and returns a pointer to a T instance.

Like PushStruct, but all the object's members are initialized to zero. Note: assumes 0/NULL is a valid value for all the object's members.

Parameters
[in,out]arenaThe backing Arena from which to reserve space.
[in]alignmentAlign the result to a desired multiple.
Returns
A pointer to a T instance with all members initialized to zero.
Here is the call graph for this function:

◆ PushArray()

template<typename T >
T* hermes::PushArray ( Arena arena,
int  count,
size_t  alignment = 8 
)
inline

Reserves space for count T objects and returns a pointer to the first one.

The objects will be uninitialized.

Parameters
[in,out]arenaThe backing Arena from which to reserve space.
[in]countThe number of objects to allocate.
[in]alignmentAlign the result to a desired multiple.
Returns
A pointer to the first T instance in the uninitialized array.
Here is the call graph for this function:

◆ PushClearedArray()

template<typename T >
T* hermes::PushClearedArray ( Arena arena,
int  count,
size_t  alignment = 8 
)
inline

Reserves space for count T objects, clears them to zero, and returns a pointer to the first one.

Parameters
[in,out]arenaThe backing Arena from which to reserve space.
[in]countThe number of objects to allocate.
[in]alignmentAlign the result to a desired multiple.
Returns
A pointer to the first T instance in the array.
Here is the call graph for this function:

◆ HeapPushStruct()

template<typename T >
T* hermes::HeapPushStruct ( Heap heap)
inline

A template for pushing structure to heap.

Here is the call graph for this function:

◆ HeapPushArray()

template<typename T >
T* hermes::HeapPushArray ( Heap heap,
u32  count 
)
inline

A template for pushing array of count size to heap.

Here is the call graph for this function:

◆ operator!=()

bool hermes::operator!= ( const TargetID lhs,
const TargetID rhs 
)

"not equal" comparision operator

◆ IsNameTooLong()

static bool hermes::IsNameTooLong ( const std::string &  name,
size_t  max 
)
static

is name too long for max?

Here is the caller graph for this function:

◆ IsBlobNameTooLong()

bool hermes::IsBlobNameTooLong ( const std::string &  name)

is BLOB's name too long for kMaxBlobNameSize?

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

◆ IsBucketNameTooLong()

bool hermes::IsBucketNameTooLong ( const std::string &  name)

is Bucket's name too long for kMaxBucketNameSize?

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

◆ IsVBucketNameTooLong()

bool hermes::IsVBucketNameTooLong ( const std::string &  name)

is vBucket's name too long for kMaxVBucketNameSize?

Here is the call graph for this function:

◆ IsNullId()

static bool hermes::IsNullId ( u64  id)
inlinestatic

is id null?

Here is the caller graph for this function:

◆ IsNullBucketId()

bool hermes::IsNullBucketId ( BucketID  id)

is Bucket id null?

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

◆ IsNullVBucketId()

bool hermes::IsNullVBucketId ( VBucketID  id)

is VBucket id null?

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

◆ IsNullBlobId()

bool hermes::IsNullBlobId ( BlobID  id)

is BLOB id null?

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

◆ IsNullTargetId()

bool hermes::IsNullTargetId ( TargetID  id)

is Target id null?

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

◆ GetBlobNodeId()

static u32 hermes::GetBlobNodeId ( BlobID  id)
static

get the node ID of id BLOB

Here is the caller graph for this function:

◆ LocalPut() [1/2]

void hermes::LocalPut ( MetadataManager mdm,
const char *  key,
u64  val,
MapType  map_type 
)

put key, value, and map_type locally

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

◆ LocalPut() [2/2]

void hermes::LocalPut ( MetadataManager mdm,
BlobID  key,
const BlobInfo value 
)

put key and value locally

Here is the call graph for this function:

◆ LocalGet()

u64 hermes::LocalGet ( MetadataManager mdm,
const char *  key,
MapType  map_type 
)

get the value of key and map_type locally

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

◆ LocalDelete() [1/2]

void hermes::LocalDelete ( MetadataManager mdm,
BlobID  key 
)

delete key locally

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

◆ LocalDelete() [2/2]

void hermes::LocalDelete ( MetadataManager mdm,
const char *  key,
MapType  map_type 
)

delete map_type locally

Here is the call graph for this function:

◆ GetMetadataManagerFromContext()

MetadataManager * hermes::GetMetadataManagerFromContext ( SharedMemoryContext context)

get metadata manager from context shared memory context

Here is the caller graph for this function:

◆ MetadataArenaErrorHandler()

static void hermes::MetadataArenaErrorHandler ( )
static

log error when metadata arena capacity is full

Here is the caller graph for this function:

◆ HashString()

u32 hermes::HashString ( MetadataManager mdm,
RpcContext rpc,
const char *  str 
)

get hash string for metadata storage

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

◆ GetId()

u64 hermes::GetId ( SharedMemoryContext context,
RpcContext rpc,
const char *  name,
MapType  map_type 
)

get id

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

◆ GetBucketId()

BucketID hermes::GetBucketId ( SharedMemoryContext context,
RpcContext rpc,
const char *  name 
)

get bucket id

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

◆ LocalGetBucketId()

BucketID hermes::LocalGetBucketId ( SharedMemoryContext context,
const char *  name 
)

get local bucket id

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

◆ GetVBucketId()

VBucketID hermes::GetVBucketId ( SharedMemoryContext context,
RpcContext rpc,
const char *  name 
)

get virtual bucket id

Here is the call graph for this function:

◆ LocalGetVBucketId()

VBucketID hermes::LocalGetVBucketId ( SharedMemoryContext context,
const char *  name 
)

get local virtual bucket id

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

◆ MakeInternalBlobName()

std::string hermes::MakeInternalBlobName ( const std::string &  name,
BucketID  id 
)

make an internal BLOB name

Here is the caller graph for this function:

◆ GetBlobId()

BlobID hermes::GetBlobId ( SharedMemoryContext context,
RpcContext rpc,
const std::string &  name,
BucketID  bucket_id,
bool  track_stats 
)

get BLOB id

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

◆ PutId()

void hermes::PutId ( MetadataManager mdm,
RpcContext rpc,
const std::string &  name,
u64  id,
MapType  map_type 
)

put BLOB id

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

◆ PutBucketId()

void hermes::PutBucketId ( MetadataManager mdm,
RpcContext rpc,
const std::string &  name,
BucketID  id 
)

put bucket id

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

◆ LocalPutBucketId()

void hermes::LocalPutBucketId ( MetadataManager mdm,
const std::string &  name,
BucketID  id 
)

put bucket id locally

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

◆ PutVBucketId()

void hermes::PutVBucketId ( MetadataManager mdm,
RpcContext rpc,
const std::string &  name,
VBucketID  id 
)

put virtual bucket id

Here is the call graph for this function:

◆ LocalPutVBucketId()

void hermes::LocalPutVBucketId ( MetadataManager mdm,
const std::string &  name,
VBucketID  id 
)

put virtual bucket id locally

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

◆ PutBlobId()

void hermes::PutBlobId ( MetadataManager mdm,
RpcContext rpc,
const std::string &  name,
BlobID  id,
BucketID  bucket_id 
)

put BLOB id

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

◆ DeleteId()

void hermes::DeleteId ( MetadataManager mdm,
RpcContext rpc,
const std::string &  name,
MapType  map_type 
)

delete id

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

◆ DeleteBucketId()

void hermes::DeleteBucketId ( MetadataManager mdm,
RpcContext rpc,
const std::string &  name 
)

delete bucket id

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

◆ DeleteVBucketId()

void hermes::DeleteVBucketId ( MetadataManager mdm,
RpcContext rpc,
const std::string &  name 
)

delete virtual bucket id

Here is the call graph for this function:

◆ LocalDeleteBlobInfo()

void hermes::LocalDeleteBlobInfo ( MetadataManager mdm,
BlobID  blob_id 
)

delete BLOB information locally

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

◆ LocalDeleteBlobId()

void hermes::LocalDeleteBlobId ( MetadataManager mdm,
const std::string &  name,
BucketID  bucket_id 
)

delete BLOB id locally

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

◆ DeleteBlobId()

void hermes::DeleteBlobId ( MetadataManager mdm,
RpcContext rpc,
const std::string &  name,
BucketID  bucket_id 
)

delete BLOB id

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

◆ LocalGetBucketInfoByIndex()

BucketInfo * hermes::LocalGetBucketInfoByIndex ( MetadataManager mdm,
u32  index 
)

get bucket information by index index locally

Here is the caller graph for this function:

◆ LocalGetBlobNameFromId()

std::string hermes::LocalGetBlobNameFromId ( SharedMemoryContext context,
BlobID  blob_id 
)

get BLOB name from blob_id locally

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

◆ GetBlobNameFromId()

std::string hermes::GetBlobNameFromId ( SharedMemoryContext context,
RpcContext rpc,
BlobID  blob_id 
)

get BLOB name from blob_id

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

◆ HexStringToU64()

u64 hermes::HexStringToU64 ( const std::string &  s)

Faster version of std::stoull.

This is 4.1x faster than std::stoull. Since we generate all the numbers that we use this function on, we can guarantee the following:

  • The size will always be kBucketIdStringSize.
  • The number will always be unsigned and within the range of a u64.
  • There will never be invalid characters passed in (only 0-9 and a-f).

Avoiding all this input sanitization and error checking is how we can get a 4.1x speedup.

Parameters
sA string with size at least kBucketIdStringSize, where the first kBucketIdStringSize characters consist only of 0-9 and a-f.
Returns
The u64 representation of the first kBucketIdStringSize characters of s.
Here is the caller graph for this function:

◆ LocalGetBucketIdFromBlobId()

BucketID hermes::LocalGetBucketIdFromBlobId ( SharedMemoryContext context,
BlobID  id 
)

get bucket ID from blob_id locally

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

◆ GetBucketIdFromBlobId()

BucketID hermes::GetBucketIdFromBlobId ( SharedMemoryContext context,
RpcContext rpc,
BlobID  id 
)

get bucket ID from blob_id

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

◆ LocalGetBucketInfoById()

BucketInfo* hermes::LocalGetBucketInfoById ( MetadataManager mdm,
BucketID  id 
)

get bucket information from bucket_id

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

◆ GetBlobIds()

std::vector< BlobID > hermes::GetBlobIds ( SharedMemoryContext context,
RpcContext rpc,
BucketID  bucket_id 
)

get BLOB IDs from bucket_id

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

◆ GetVBucketInfoByIndex()

VBucketInfo * hermes::GetVBucketInfoByIndex ( MetadataManager mdm,
u32  index 
)

get virtual bucket information by index

Here is the caller graph for this function:

◆ LocalGetNextFreeBucketId()

BucketID hermes::LocalGetNextFreeBucketId ( SharedMemoryContext context,
const std::string &  name 
)

Returns an available BucketID and marks it as in use in the MDM.

Assumes MetadataManager::bucket_mutex is already held by the caller.

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

◆ LocalGetOrCreateBucketId()

BucketID hermes::LocalGetOrCreateBucketId ( SharedMemoryContext context,
const std::string &  name 
)

get or create a bucket ID locally

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

◆ GetOrCreateBucketId()

BucketID hermes::GetOrCreateBucketId ( SharedMemoryContext context,
RpcContext rpc,
const std::string &  name 
)

get or create a bucket ID

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

◆ LocalGetNextFreeVBucketId()

VBucketID hermes::LocalGetNextFreeVBucketId ( SharedMemoryContext context,
const std::string &  name 
)

Returns an available VBucketID and marks it as in use in the MDM.

Assumes MetadataManager::vbucket_mutex is already held by the caller.

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

◆ LocalGetOrCreateVBucketId()

VBucketID hermes::LocalGetOrCreateVBucketId ( SharedMemoryContext context,
const std::string &  name 
)

get or create a virtual bucket ID locally

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

◆ GetOrCreateVBucketId()

VBucketID hermes::GetOrCreateVBucketId ( SharedMemoryContext context,
RpcContext rpc,
const std::string &  name 
)

get or create a virtual bucket ID

Here is the call graph for this function:

◆ CopyIds()

void hermes::CopyIds ( u64 dest,
u64 src,
u32  count 
)

copy IDs

Here is the caller graph for this function:

◆ ReplaceBlobIdInBucket()

void hermes::ReplaceBlobIdInBucket ( SharedMemoryContext context,
RpcContext rpc,
BucketID  bucket_id,
BlobID  old_blob_id,
BlobID  new_blob_id 
)

Deletes old_blob_id from bucket_id and adds new_blob_id. It combines the delete and the add into one call in order to avoid multiple RPCs.

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

◆ AddBlobIdToBucket()

void hermes::AddBlobIdToBucket ( MetadataManager mdm,
RpcContext rpc,
BlobID  blob_id,
BucketID  bucket_id 
)

add BLOB ID to bucket

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

◆ AddBlobIdToVBucket()

void hermes::AddBlobIdToVBucket ( MetadataManager mdm,
RpcContext rpc,
BlobID  blob_id,
VBucketID  vbucket_id 
)

add BLOB ID to virtual bucket

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

◆ AllocateBufferIdList()

u32 hermes::AllocateBufferIdList ( SharedMemoryContext context,
RpcContext rpc,
u32  target_node,
const std::vector< BufferID > &  buffer_ids 
)

allocate buffer ID list

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

◆ BlobIsInSwap()

bool hermes::BlobIsInSwap ( BlobID  id)

is BLOB in swap?

Here is the caller graph for this function:

◆ GetBufferIdList() [1/2]

void hermes::GetBufferIdList ( Arena arena,
SharedMemoryContext context,
RpcContext rpc,
BlobID  blob_id,
BufferIdArray buffer_ids 
)

get buffer ID list

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

◆ GetBufferIdList() [2/2]

std::vector< BufferID > hermes::GetBufferIdList ( SharedMemoryContext context,
RpcContext rpc,
BlobID  blob_id 
)

get buffer ID list as vector

Here is the call graph for this function:

◆ GetBufferIdsFromBlobId()

BufferIdArray hermes::GetBufferIdsFromBlobId ( Arena arena,
SharedMemoryContext context,
RpcContext rpc,
BlobID  blob_id,
u32 **  sizes 
)

get buffer IDs from BLOB id

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

◆ LocalCreateBlobMetadata()

void hermes::LocalCreateBlobMetadata ( SharedMemoryContext context,
MetadataManager mdm,
const std::string &  blob_name,
BlobID  blob_id,
TargetID  effective_target 
)

create BLOB metadata locally

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

◆ CreateBlobMetadata()

void hermes::CreateBlobMetadata ( SharedMemoryContext context,
RpcContext rpc,
const std::string &  blob_name,
BlobID  blob_id,
TargetID  effective_target 
)

create BLOB metadata

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

◆ AttachBlobToBucket()

void hermes::AttachBlobToBucket ( SharedMemoryContext context,
RpcContext rpc,
const char *  blob_name,
BucketID  bucket_id,
const std::vector< BufferID > &  buffer_ids,
TargetID  effective_target,
bool  is_swap_blob,
bool  called_from_buffer_organizer 
)

attach BLOB to bucket

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

◆ FreeBufferIdList()

void hermes::FreeBufferIdList ( SharedMemoryContext context,
RpcContext rpc,
BlobID  blob_id 
)

free buffer ID list

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

◆ LocalDeleteBlobMetadata()

void hermes::LocalDeleteBlobMetadata ( MetadataManager mdm,
const char *  blob_name,
BlobID  blob_id,
BucketID  bucket_id 
)

delete BLOB metadata locally

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

◆ WaitForOutstandingBlobOps()

void hermes::WaitForOutstandingBlobOps ( MetadataManager mdm,
BlobID  blob_id 
)

wait for outstanding BLOB operations

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

◆ LocalDestroyBlobByName()

void hermes::LocalDestroyBlobByName ( SharedMemoryContext context,
RpcContext rpc,
const char *  blob_name,
BlobID  blob_id,
BucketID  bucket_id 
)

destroy BLOB by name locally

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

◆ LocalDestroyBlobById()

void hermes::LocalDestroyBlobById ( SharedMemoryContext context,
RpcContext rpc,
BlobID  blob_id,
BucketID  bucket_id 
)

destroy BLOB by ID locally

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

◆ RemoveBlobFromBucketInfo()

void hermes::RemoveBlobFromBucketInfo ( SharedMemoryContext context,
RpcContext rpc,
BucketID  bucket_id,
BlobID  blob_id 
)

remove BLOB from Bucket

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

◆ DestroyBlobByName()

void hermes::DestroyBlobByName ( SharedMemoryContext context,
RpcContext rpc,
BucketID  bucket_id,
const std::string &  blob_name 
)

destroy BLOB by name

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

◆ RenameBlob()

void hermes::RenameBlob ( SharedMemoryContext context,
RpcContext rpc,
const std::string &  old_name,
const std::string &  new_name,
BucketID  bucket_id 
)

rename BLOB

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

◆ ContainsBlob()

bool hermes::ContainsBlob ( SharedMemoryContext context,
RpcContext rpc,
BucketID  bucket_id,
const std::string &  blob_name 
)

does bucket_id bucket contain blob_name BLOB?

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

◆ DestroyBlobById()

void hermes::DestroyBlobById ( SharedMemoryContext context,
RpcContext rpc,
BlobID  id,
BucketID  bucket_id 
)

destroy BLOB by ID

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

◆ DestroyBucket()

bool hermes::DestroyBucket ( SharedMemoryContext context,
RpcContext rpc,
const char *  name,
BucketID  bucket_id 
)

destroy bucket

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

◆ DestroyVBucket()

bool hermes::DestroyVBucket ( SharedMemoryContext context,
RpcContext rpc,
const char *  name,
VBucketID  vbucket_id 
)

destroy virtual bucket

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

◆ LocalRenameBucket()

void hermes::LocalRenameBucket ( SharedMemoryContext context,
RpcContext rpc,
BucketID  id,
const std::string &  old_name,
const std::string &  new_name 
)

rename bucket locally

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

◆ RenameBucket()

void hermes::RenameBucket ( SharedMemoryContext context,
RpcContext rpc,
BucketID  id,
const std::string &  old_name,
const std::string &  new_name 
)

rename bucket

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

◆ LocalIncrementRefcount() [1/2]

void hermes::LocalIncrementRefcount ( SharedMemoryContext context,
BucketID  id 
)

increment reference count locally

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

◆ LocalDecrementRefcount() [1/2]

void hermes::LocalDecrementRefcount ( SharedMemoryContext context,
BucketID  id 
)

decrement reference count locally

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

◆ DecrementRefcount() [1/2]

void hermes::DecrementRefcount ( SharedMemoryContext context,
RpcContext rpc,
BucketID  id 
)

decrement reference count

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

◆ LocalGetRemainingTargetCapacity()

u64 hermes::LocalGetRemainingTargetCapacity ( SharedMemoryContext context,
TargetID  id 
)

get remaning target capacity locally

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

◆ GetLocalSystemViewState() [1/2]

SystemViewState* hermes::GetLocalSystemViewState ( MetadataManager mdm)

get local system view state from mdm metadata mamanger

Here is the caller graph for this function:

◆ GetLocalSystemViewState() [2/2]

SystemViewState * hermes::GetLocalSystemViewState ( SharedMemoryContext context)

get local system view state from context

get local system view state

Here is the call graph for this function:

◆ LocalGetGlobalDeviceCapacities()

std::vector< u64 > hermes::LocalGetGlobalDeviceCapacities ( SharedMemoryContext context)

get global device capacities locally

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

◆ GetGlobalDeviceCapacities()

std::vector< u64 > hermes::GetGlobalDeviceCapacities ( SharedMemoryContext context,
RpcContext rpc 
)

get global device capacities

Here is the call graph for this function:

◆ GetGlobalSystemViewState()

GlobalSystemViewState * hermes::GetGlobalSystemViewState ( SharedMemoryContext context)

get global system view state from context

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

◆ LocalUpdateGlobalSystemViewState()

std::vector< ViolationInfo > hermes::LocalUpdateGlobalSystemViewState ( SharedMemoryContext context,
u32  node_id,
std::vector< i64 adjustments 
)

update global system view state locally

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

◆ UpdateGlobalSystemViewState()

void hermes::UpdateGlobalSystemViewState ( SharedMemoryContext context,
RpcContext rpc 
)

update global system view state

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

◆ FindTargetIdFromDeviceId()

TargetID hermes::FindTargetIdFromDeviceId ( const std::vector< TargetID > &  targets,
DeviceID  device_id 
)

find target ID from device ID

◆ GetOffsetFromMdm()

static ptrdiff_t hermes::GetOffsetFromMdm ( MetadataManager mdm,
void *  ptr 
)
static

get offset from metadata manager

Here is the caller graph for this function:

◆ CreateSystemViewState()

SystemViewState* hermes::CreateSystemViewState ( Arena arena,
Config config 
)

create system view state

Here is the caller graph for this function:

◆ CreateGlobalSystemViewState()

GlobalSystemViewState* hermes::CreateGlobalSystemViewState ( RpcContext rpc,
Arena arena,
Config config 
)

create global system view state

Here is the caller graph for this function:

◆ GetSwapFilename()

std::string hermes::GetSwapFilename ( MetadataManager mdm,
u32  node_id 
)

get swap file name

Here is the caller graph for this function:

◆ SwapBlobToVec()

std::vector< BufferID > hermes::SwapBlobToVec ( SwapBlob  swap_blob)

swap BLOB to vector

Here is the caller graph for this function:

◆ VecToSwapBlob()

SwapBlob hermes::VecToSwapBlob ( std::vector< BufferID > &  vec)

vector to swap BLOB

◆ IdArrayToSwapBlob()

SwapBlob hermes::IdArrayToSwapBlob ( BufferIdArray  ids)

ID array to swap BLOB

Here is the caller graph for this function:

◆ InitMetadataManager()

void hermes::InitMetadataManager ( MetadataManager mdm,
RpcContext rpc,
Arena arena,
Config config 
)

initialize metadata manager

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

◆ LocalGetVBucketInfoByIndex()

VBucketInfo* hermes::LocalGetVBucketInfoByIndex ( MetadataManager mdm,
u32  index 
)

get virtual bucket information by index locally

Here is the caller graph for this function:

◆ LocalGetVBucketInfoById()

VBucketInfo* hermes::LocalGetVBucketInfoById ( MetadataManager mdm,
VBucketID  id 
)

get virtual bucket information by id locally

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

◆ LocalIncrementRefcount() [2/2]

void hermes::LocalIncrementRefcount ( SharedMemoryContext context,
VBucketID  id 
)

increment reference counter locally

Here is the call graph for this function:

◆ LocalDecrementRefcount() [2/2]

void hermes::LocalDecrementRefcount ( SharedMemoryContext context,
VBucketID  id 
)

decrement reference counter locally

Here is the call graph for this function:

◆ DecrementRefcount() [2/2]

void hermes::DecrementRefcount ( SharedMemoryContext context,
RpcContext rpc,
VBucketID  id 
)

decrement reference counter

Here is the call graph for this function:

◆ GetRelativeNodeId()

u32 hermes::GetRelativeNodeId ( RpcContext rpc,
int  offset 
)

get relative node ID

Here is the caller graph for this function:

◆ GetNextNode()

u32 hermes::GetNextNode ( RpcContext rpc)

get next node

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

◆ GetPreviousNode()

u32 hermes::GetPreviousNode ( RpcContext rpc)

get previous node

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

◆ GetNodeTargets()

std::vector<TargetID> hermes::GetNodeTargets ( SharedMemoryContext context,
RpcContext rpc,
u32  target_node 
)

get node targets

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

◆ GetNeighborhoodTargets()

std::vector< TargetID > hermes::GetNeighborhoodTargets ( SharedMemoryContext context,
RpcContext rpc 
)

get neighborhood node targets

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

◆ GetRemainingTargetCapacity()

u64 hermes::GetRemainingTargetCapacity ( SharedMemoryContext context,
RpcContext rpc,
TargetID  target_id 
)

get remaining target capacity

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

◆ GetRemainingTargetCapacities()

std::vector< u64 > hermes::GetRemainingTargetCapacities ( SharedMemoryContext context,
RpcContext rpc,
const std::vector< TargetID > &  targets 
)

get remaining target capacities

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

◆ AttachBlobToVBucket()

void hermes::AttachBlobToVBucket ( SharedMemoryContext context,
RpcContext rpc,
const char *  blob_name,
const char *  bucket_name,
VBucketID  vbucket_id 
)

attach BLOB to VBucket

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

◆ LocalGetBucketNameById()

std::string hermes::LocalGetBucketNameById ( SharedMemoryContext context,
BucketID  blob_id 
)

get bucket name by ID locally

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

◆ GetBlobsFromVBucketInfo()

std::vector< BlobID > hermes::GetBlobsFromVBucketInfo ( SharedMemoryContext context,
RpcContext rpc,
VBucketID  vbucket_id 
)

get BLOB from VBucket

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

◆ RemoveBlobFromVBucketInfo()

void hermes::RemoveBlobFromVBucketInfo ( SharedMemoryContext context,
RpcContext rpc,
VBucketID  vbucket_id,
const char *  blob_name,
const char *  bucket_name 
)

remove BLOB from VBucket

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

◆ GetBucketNameById()

std::string hermes::GetBucketNameById ( SharedMemoryContext context,
RpcContext rpc,
BucketID  id 
)

get bucket name by bucket ID

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

◆ ScoringFunction()

f32 hermes::ScoringFunction ( MetadataManager mdm,
Stats stats 
)

Returns the score calculated from stats.

A high score indicates a "cold" Blob, or one that has not been accessed very recently or frequently.

Here is the caller graph for this function:

◆ LocalGetNumOutstandingFlushingTasks()

int hermes::LocalGetNumOutstandingFlushingTasks ( SharedMemoryContext context,
VBucketID  id 
)

get number of outstanding flushing tasks locally

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

◆ GetNumOutstandingFlushingTasks()

int hermes::GetNumOutstandingFlushingTasks ( SharedMemoryContext context,
RpcContext rpc,
VBucketID  id 
)

get number of outstanding flushing tasks

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

◆ LocalLockBlob()

bool hermes::LocalLockBlob ( SharedMemoryContext context,
BlobID  blob_id 
)

lock BLOB locally

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

◆ LocalUnlockBlob()

bool hermes::LocalUnlockBlob ( SharedMemoryContext context,
BlobID  blob_id 
)

unlock BLOB locally

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

◆ GetPidTid()

void hermes::GetPidTid ( u32 pid,
u32 tid 
)

get process ID and Argobots thread ID

◆ LockBlob()

bool hermes::LockBlob ( SharedMemoryContext context,
RpcContext rpc,
BlobID  blob_id 
)

lock BLOB

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

◆ UnlockBlob()

bool hermes::UnlockBlob ( SharedMemoryContext context,
RpcContext rpc,
BlobID  blob_id 
)

unlock BLOB

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

◆ MakeShmemString() [1/2]

void hermes::MakeShmemString ( ShmemString sms,
u8 memory,
const char *  val,
u32  size 
)

make shared memory string

Here is the caller graph for this function:

◆ MakeShmemString() [2/2]

void hermes::MakeShmemString ( ShmemString sms,
u8 memory,
const std::string &  val 
)

Creates a ShmemString with the value val at location memory.

Precondition
The address of sms must be lower than memory because the offset is from the beginning of the sms.
Parameters
[out]smsThe ShmemString instance to be filled out.
memoryThe location in shared memory to store the val.
valThe string to store.
Here is the call graph for this function:

◆ GetShmemString()

std::string hermes::GetShmemString ( ShmemString sms)

Retrieves a ShmemString into a std::string

Parameters
smsThe ShmemString that represents the internal string
Returns
A newly allocated std::string containing a copy of the string from shared memory, or an empty std::string if the ShmemString is invalid.
Here is the caller graph for this function:

◆ InitNeighborhoodTargets()

void hermes::InitNeighborhoodTargets ( SharedMemoryContext context,
RpcContext rpc 
)

initialize neighborhood targets

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

◆ BeginGlobalTicketMutex()

void hermes::BeginGlobalTicketMutex ( SharedMemoryContext context,
RpcContext rpc 
)

begin global ticket mutex

◆ EndGlobalTicketMutex()

void hermes::EndGlobalTicketMutex ( SharedMemoryContext context,
RpcContext rpc 
)

end global ticket mutex

◆ LocalBeginGlobalTicketMutex()

void hermes::LocalBeginGlobalTicketMutex ( MetadataManager mdm)

begin global ticket mutex locally

◆ LocalEndGlobalTicketMutex()

void hermes::LocalEndGlobalTicketMutex ( MetadataManager mdm)

end global ticket mutex locally

◆ IncrementBlobStats()

void hermes::IncrementBlobStats ( SharedMemoryContext context,
RpcContext rpc,
BlobID  blob_id 
)

increment BLOB stats

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

◆ LocalIncrementBlobStats()

void hermes::LocalIncrementBlobStats ( MetadataManager mdm,
BlobID  blob_id 
)

increment BLOB stats locally

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

◆ LocalReplaceBlobIdInBucket()

void hermes::LocalReplaceBlobIdInBucket ( SharedMemoryContext context,
BucketID  bucket_id,
BlobID  old_blob_id,
BlobID  new_blob_id 
)

replace BLOB ID in bucket locally

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

◆ GetMapMutex()

TicketMutex * hermes::GetMapMutex ( MetadataManager mdm,
MapType  map_type 
)

get ticket mutex based on map_type

Here is the caller graph for this function:

◆ LocalAddBlobIdToBucket()

void hermes::LocalAddBlobIdToBucket ( MetadataManager mdm,
BucketID  bucket_id,
BlobID  blob_id,
bool  track_stats 
)

add BLOB ID to bucket locally

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

◆ LocalAddBlobIdToVBucket()

void hermes::LocalAddBlobIdToVBucket ( MetadataManager mdm,
VBucketID  vbucket_id,
BlobID  blob_id 
)

add BLOB ID to virtual bucket locally

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

◆ LocalGetBufferIdList() [1/2]

std::vector< BufferID > hermes::LocalGetBufferIdList ( MetadataManager mdm,
BlobID  blob_id 
)

get buffer ID list locally

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

◆ LocalGetBufferIdList() [2/2]

void hermes::LocalGetBufferIdList ( Arena arena,
MetadataManager mdm,
BlobID  blob_id,
BufferIdArray buffer_ids 
)

get buffer ID list into buffer_ids locally

Here is the call graph for this function:

◆ LocalFreeBufferIdList()

void hermes::LocalFreeBufferIdList ( SharedMemoryContext context,
BlobID  blob_id 
)

free buffer ID list locally

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

◆ LocalDestroyBucket()

bool hermes::LocalDestroyBucket ( SharedMemoryContext context,
RpcContext rpc,
const char *  bucket_name,
BucketID  bucket_id 
)

destroy bucket locally

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

◆ LocalDestroyVBucket()

bool hermes::LocalDestroyVBucket ( SharedMemoryContext context,
const char *  vbucket_name,
VBucketID  vbucket_id 
)

destroy virtual bucket locally

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

◆ LocalAllocateBufferIdList()

u32 hermes::LocalAllocateBufferIdList ( MetadataManager mdm,
const std::vector< BufferID > &  buffer_ids 
)

allocate buffer ID list locally

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

◆ LocalContainsBlob()

bool hermes::LocalContainsBlob ( SharedMemoryContext context,
BucketID  bucket_id,
BlobID  blob_id 
)

does bucket_id contain blob_id BLOB locally?

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

◆ LocalRemoveBlobFromBucketInfo()

void hermes::LocalRemoveBlobFromBucketInfo ( SharedMemoryContext context,
BucketID  bucket_id,
BlobID  blob_id 
)

remove BLOB from bucket locally

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

◆ StartGlobalSystemViewStateUpdateThread()

void hermes::StartGlobalSystemViewStateUpdateThread ( SharedMemoryContext context,
RpcContext rpc,
Arena arena,
double  sleep_ms 
)

start global system view state update thread

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

◆ InitMetadataStorage()

void hermes::InitMetadataStorage ( SharedMemoryContext context,
MetadataManager mdm,
Arena arena,
Config config 
)

initialize metadata storage

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

◆ LocalGetBlobIds()

std::vector< BlobID > hermes::LocalGetBlobIds ( SharedMemoryContext context,
BucketID  bucket_id 
)

get BLOB IDs locally

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

◆ LocalGetNodeTargets()

std::vector< TargetID > hermes::LocalGetNodeTargets ( SharedMemoryContext context)

get node targets locally

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

◆ LocalGetBlobImportanceScore()

f32 hermes::LocalGetBlobImportanceScore ( SharedMemoryContext context,
BlobID  blob_id 
)

get BLOB's importance score locally

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

◆ LocalRemoveBlobFromVBucketInfo()

void hermes::LocalRemoveBlobFromVBucketInfo ( SharedMemoryContext context,
VBucketID  vbucket_id,
BlobID  blob_id 
)

remove BLOB from virtual bucket locally

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

◆ LocalGetBlobsFromVBucketInfo()

std::vector< BlobID > hermes::LocalGetBlobsFromVBucketInfo ( SharedMemoryContext context,
VBucketID  vbucket_id 
)

get BLOBs from virtual bucket information locally

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

◆ GetIdHeap()

Heap * hermes::GetIdHeap ( MetadataManager mdm)

get ID heap

Here is the caller graph for this function:

◆ GetMapHeap()

Heap * hermes::GetMapHeap ( MetadataManager mdm)

get map heap

Here is the caller graph for this function:

◆ AllocateIdList()

IdList hermes::AllocateIdList ( MetadataManager mdm,
u32  length 
)

allocate ID list

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

◆ FreeIdList() [1/2]

void hermes::FreeIdList ( MetadataManager mdm,
IdList  id_list 
)

free id_list ID list

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

◆ AppendToChunkedIdList()

u32 hermes::AppendToChunkedIdList ( MetadataManager mdm,
ChunkedIdList id_list,
u64  id 
)

Assumes the caller has protected id_list with a lock.

Returns
The index of the appended id.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PutToStorage() [1/2]

void hermes::PutToStorage ( MetadataManager mdm,
const char *  key,
u64  val,
MapType  map_type 
)

put map_type to storage

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

◆ PutToStorage() [2/2]

void hermes::PutToStorage ( MetadataManager mdm,
BlobID  key,
const BlobInfo val 
)

put to storage

Here is the call graph for this function:

◆ GetFromStorage()

u64 hermes::GetFromStorage ( MetadataManager mdm,
const char *  key,
MapType  map_type 
)

get from storage

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

◆ ReverseGetFromStorage()

std::string hermes::ReverseGetFromStorage ( MetadataManager mdm,
u64  id,
MapType  map_type 
)

reverse the get from storage operation

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

◆ DeleteFromStorage() [1/2]

void hermes::DeleteFromStorage ( MetadataManager mdm,
BlobID  key,
bool  lock 
)

delete from storage

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

◆ DeleteFromStorage() [2/2]

void hermes::DeleteFromStorage ( MetadataManager mdm,
const char *  key,
MapType  map_type 
)

delete map_type from storage

Here is the call graph for this function:

◆ HashStringForStorage()

u32 hermes::HashStringForStorage ( MetadataManager mdm,
RpcContext rpc,
const char *  str 
)

generate hash string for storage

Here is the caller graph for this function:

◆ SeedHashForStorage()

void hermes::SeedHashForStorage ( size_t  seed)

seed hash for storage

Here is the caller graph for this function:

◆ GetStoredMapSize()

size_t hermes::GetStoredMapSize ( MetadataManager mdm,
MapType  map_type 
)

get the size of stored map

Here is the call graph for this function:

◆ LocalGetNeighborhoodTargets()

std::vector< TargetID > hermes::LocalGetNeighborhoodTargets ( SharedMemoryContext context)

get neighborhood targets locally

Here is the call graph for this function:

◆ GetBlobInfoPtr()

BlobInfo * hermes::GetBlobInfoPtr ( MetadataManager mdm,
BlobID  blob_id 
)

Takes a lock on mdm->blob_info_map_mutex. Requires a corresponding ReleaseBlobInfoPtr call.

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

◆ ReleaseBlobInfoPtr()

void hermes::ReleaseBlobInfoPtr ( MetadataManager mdm)

release pointer to BLOB information

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

◆ GetIdsPtr() [1/2]

u64 * hermes::GetIdsPtr ( MetadataManager mdm,
IdList  id_list 
)

Return a pointer to the internal array of IDs that the id_list represents.

This call acquires a lock, and must be paired with a corresponding call to ReleaseIdsPtr to release the lock.

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

◆ GetIdsPtr() [2/2]

u64 * hermes::GetIdsPtr ( MetadataManager mdm,
ChunkedIdList  id_list 
)

get pointer to the internal array of IDs that the chucked id_list represents

Here is the call graph for this function:

◆ ReleaseIdsPtr()

void hermes::ReleaseIdsPtr ( MetadataManager mdm)

release IDs pointer

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

◆ GetChunkedIdList()

std::vector< u64 > hermes::GetChunkedIdList ( MetadataManager mdm,
ChunkedIdList  id_list 
)

Assumes the caller has protected id_list with a lock.

Returns
A vector of the IDs.
Here is the call graph for this function:

◆ GetMapByOffset()

static IdMap* hermes::GetMapByOffset ( MetadataManager mdm,
u32  offset 
)
static

get map by offset

Here is the caller graph for this function:

◆ GetBucketMap()

static IdMap* hermes::GetBucketMap ( MetadataManager mdm)
static

get bucket map

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

◆ GetVBucketMap()

static IdMap* hermes::GetVBucketMap ( MetadataManager mdm)
static

get virtual bucket map

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

◆ GetBlobIdMap()

static IdMap* hermes::GetBlobIdMap ( MetadataManager mdm)
static

get BLOB ID map

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

◆ CheckHeapOverlap()

void hermes::CheckHeapOverlap ( MetadataManager mdm)

check if heap overlaps

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

◆ GetMap()

IdMap* hermes::GetMap ( MetadataManager mdm,
MapType  map_type 
)

Get a pointer to an IdMap in shared memory.

This function acquires a lock because it's pointing to a shared data structure. Make sure to call ReleaseMap when you're finished with the IdMap.

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

◆ GetBlobInfoMapNoLock()

BlobInfoMap* hermes::GetBlobInfoMapNoLock ( MetadataManager mdm)

get BLOB information map without mutex locking

Here is the caller graph for this function:

◆ GetBlobInfoMap()

BlobInfoMap* hermes::GetBlobInfoMap ( MetadataManager mdm)

get BLOB information map

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

◆ ReleaseMap()

void hermes::ReleaseMap ( MetadataManager mdm,
MapType  map_type 
)

Releases the lock acquired by GetMap.

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

◆ LocalGetBlobStats()

Stats hermes::LocalGetBlobStats ( SharedMemoryContext context,
BlobID  blob_id 
)

get BLOB stats locally

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

◆ GetEmbeddedIdList()

IdList hermes::GetEmbeddedIdList ( MetadataManager mdm,
u32  offset 
)

Returns a copy of an embedded IdList.

An IdList that consists of BufferIDs contains an embedded IdList as the first element of the list. This is so the BlobID can find information about its buffers from a single offset. If you want a pointer to the BufferIDs in an IdList, then you have to first retrieve the embedded IdList using this function, and then use the resulting IdList in GetIdsPtr.

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

◆ GetBufferIdsPtrFromBlobId()

BufferID* hermes::GetBufferIdsPtrFromBlobId ( MetadataManager mdm,
BlobID  blob_id,
size_t &  length 
)

Return a pointer to the internal array of BufferIDs associated with the blob_id.

Acquires a lock, and must be paired with a call to ReleaseIdsPtr to release the lock. The length of the array is returned in the length parameter.

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

◆ GetKey()

static char* hermes::GetKey ( MetadataManager mdm,
IdMap map,
u32  index 
)
static

Convert a key offset into the pointer where the string is stored.

Even though our maps are char* -> u64, the keys are not actually pointers to strings, but rather offsets into the shared memory Heap where the strings are stored. This function converts the key at index from an offset to a char*. This produces the equivalent of: char *result = map[index].key;

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

◆ FreeIdList() [2/2]

template<typename T >
void hermes::FreeIdList ( MetadataManager mdm,
id_list 
)

free ID list

Here is the call graph for this function:

◆ FreeEmbeddedIdList()

void hermes::FreeEmbeddedIdList ( MetadataManager mdm,
u32  offset 
)

free embedded ID list

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

◆ AllocateOrGrowIdList()

void hermes::AllocateOrGrowIdList ( MetadataManager mdm,
ChunkedIdList id_list 
)

Assumes the caller has protected id_list with a lock.

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

◆ GetChunkedIdListElement()

u64 hermes::GetChunkedIdListElement ( MetadataManager mdm,
ChunkedIdList id_list,
u32  index 
)

get chuncked ID list element

Here is the call graph for this function:

◆ SetChunkedIdListElement()

void hermes::SetChunkedIdListElement ( MetadataManager mdm,
ChunkedIdList id_list,
u32  index,
u64  value 
)

set chuncked ID list element

Here is the call graph for this function:

◆ GetIndexOfId()

i64 hermes::GetIndexOfId ( MetadataManager mdm,
ChunkedIdList id_list,
u64  id 
)

get index of ID

Here is the call graph for this function:

◆ AllocateEmbeddedIdList()

u32 hermes::AllocateEmbeddedIdList ( MetadataManager mdm,
u32  length 
)

allocate embedded ID list

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

◆ HasAllocated()

static bool hermes::HasAllocated ( ChunkedIdList list)
inlinestatic

is list's capacity greater than 0?

Here is the caller graph for this function:

◆ HasAllocatedBlobs() [1/2]

static bool hermes::HasAllocatedBlobs ( VBucketInfo info)
inlinestatic

Has virtual bucket info allocated BLOBS?

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

◆ HasAllocatedBlobs() [2/2]

static bool hermes::HasAllocatedBlobs ( BucketInfo info)
inlinestatic

Has bucket info allocated BLOBS?

Here is the call graph for this function:

◆ LocalGetTargets()

std::vector<TargetID> hermes::LocalGetTargets ( SharedMemoryContext context,
IdList  target_list 
)

get targets locally

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

◆ InitSwapSpaceFilename()

void hermes::InitSwapSpaceFilename ( MetadataManager mdm,
Arena arena,
Config config 
)

initialize swap space file name

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

◆ InitRpcContext()

void hermes::InitRpcContext ( RpcContext rpc,
u32  num_nodes,
u32  node_id,
Config config 
)

initialize RPC context

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

◆ CreateRpcState()

void * hermes::CreateRpcState ( Arena arena)

create RPC state

Here is the caller graph for this function:

◆ InitRpcClients()

void hermes::InitRpcClients ( RpcContext rpc)

initialize RPC clients

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

◆ ShutdownRpcClients()

void hermes::ShutdownRpcClients ( RpcContext rpc)

shut down RPC clients

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

◆ RunDaemon()

void hermes::RunDaemon ( SharedMemoryContext context,
RpcContext rpc,
CommunicationContext comm,
Arena trans_arena,
const char *  shmem_name 
)

run daemon

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

◆ FinalizeClient()

void hermes::FinalizeClient ( SharedMemoryContext context,
RpcContext rpc,
CommunicationContext comm,
Arena trans_arena,
bool  stop_daemon 
)

finalize client

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

◆ FinalizeRpcContext()

void hermes::FinalizeRpcContext ( RpcContext rpc,
bool  is_daemon 
)

finalize RPC context

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

◆ GetServerName()

std::string hermes::GetServerName ( RpcContext rpc,
u32  node_id,
bool  is_buffer_organizer 
)

get server name

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

◆ GetProtocol()

std::string hermes::GetProtocol ( RpcContext rpc)

get protocol

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

◆ StartBufferOrganizer()

void hermes::StartBufferOrganizer ( SharedMemoryContext context,
RpcContext rpc,
Arena arena,
const char *  addr,
int  num_threads,
int  port 
)

start buffer organizer

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

◆ CopyStringToCharArray()

void hermes::CopyStringToCharArray ( const std::string &  src,
char *  dest,
size_t  max 
)

copy string to character array

Here is the caller graph for this function:

◆ ThalliumStartRpcServer()

void hermes::ThalliumStartRpcServer ( SharedMemoryContext context,
RpcContext rpc,
Arena arena,
const char *  addr,
i32  num_rpc_threads 
)

start Thallium RPC server

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

◆ StopGlobalSystemViewStateUpdateThread()

void hermes::StopGlobalSystemViewStateUpdateThread ( RpcContext rpc)

stop global system view state update thread

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

◆ GetHostNameFromNodeId()

std::string hermes::GetHostNameFromNodeId ( RpcContext rpc,
u32  node_id 
)

get host name from node ID

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

◆ GetRpcAddress()

std::string hermes::GetRpcAddress ( RpcContext rpc,
Config config,
u32  node_id,
int  port 
)

get RPC address

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

◆ BulkRead()

size_t hermes::BulkRead ( RpcContext rpc,
u32  node_id,
const char *  func_name,
u8 data,
size_t  max_size,
BufferID  id 
)

read bulk

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

◆ serialize() [1/10]

template<typename A >
void hermes::serialize ( A &  ar,
BufferID buffer_id 
)

Lets Thallium know how to serialize a BufferID.

This function is called implicitly by Thallium.

Parameters
arAn archive provided by Thallium.
buffer_idThe BufferID to serialize.

◆ serialize() [2/10]

template<typename A >
void hermes::serialize ( A &  ar,
BucketID bucket_id 
)

Lets Thallium know how to serialize a BucketID.

This function is called implicitly by Thallium.

Parameters
arAn archive provided by Thallium.
bucket_idThe BucketID to serialize.

◆ serialize() [3/10]

template<typename A >
void hermes::serialize ( A &  ar,
VBucketID vbucket_id 
)

Lets Thallium know how to serialize a VBucketID.

This function is called implicitly by Thallium.

Parameters
arAn archive provided by Thallium.
vbucket_idThe VBucketID to serialize.

◆ serialize() [4/10]

template<typename A >
void hermes::serialize ( A &  ar,
BlobID blob_id 
)

Lets Thallium know how to serialize a BlobID.

This function is called implicitly by Thallium.

Parameters
arAn archive provided by Thallium.
blob_idThe BlobID to serialize.

◆ serialize() [5/10]

template<typename A >
void hermes::serialize ( A &  ar,
TargetID target_id 
)

Lets Thallium know how to serialize a TargetID.

This function is called implicitly by Thallium.

Parameters
arAn archive provided by Thallium.
target_idThe TargetID to serialize.

◆ serialize() [6/10]

template<typename A >
void hermes::serialize ( A &  ar,
SwapBlob swap_blob 
)

serialize swap_blob

◆ serialize() [7/10]

template<typename A >
void hermes::serialize ( A &  ar,
BufferInfo info 
)

serialize info

◆ save() [1/4]

template<typename A >
void hermes::save ( A &  ar,
MapType map_type 
)

Lets Thallium know how to serialize a MapType.

This function is called implicitly by Thallium.

Parameters
arAn archive provided by Thallium.
map_typeThe MapType to serialize.

◆ load() [1/4]

template<typename A >
void hermes::load ( A &  ar,
MapType map_type 
)

Lets Thallium know how to serialize a MapType.

This function is called implicitly by Thallium.

Parameters
arAn archive provided by Thallium.
map_typeThe MapType to serialize.

◆ save() [2/4]

template<typename A >
void hermes::save ( A &  ar,
BoPriority priority 
)

save priority

◆ load() [2/4]

template<typename A >
void hermes::load ( A &  ar,
BoPriority priority 
)

load priority

◆ save() [3/4]

template<typename A >
void hermes::save ( A &  ar,
ThresholdViolation violation 
)

save violation

◆ load() [3/4]

template<typename A >
void hermes::load ( A &  ar,
ThresholdViolation violation 
)

load violation

◆ save() [4/4]

template<typename A >
void hermes::save ( A &  ar,
BoOperation op 
)

save buffer organizer op

◆ load() [4/4]

template<typename A >
void hermes::load ( A &  ar,
BoOperation op 
)

load buffer organizer op

◆ serialize() [8/10]

template<typename A >
void hermes::serialize ( A &  ar,
BoArgs bo_args 
)

serialize buffer organizer arguments

◆ serialize() [9/10]

template<typename A >
void hermes::serialize ( A &  ar,
BoTask bo_task 
)

serialize buffer organizer task

◆ serialize() [10/10]

template<typename A >
void hermes::serialize ( A &  ar,
ViolationInfo info 
)

serialize violation information

◆ GetThalliumState()

static ThalliumState* hermes::GetThalliumState ( RpcContext rpc)
inlinestatic

get Thallium state

Here is the caller graph for this function:

◆ GetClientThalliumState()

static ClientThalliumState* hermes::GetClientThalliumState ( RpcContext rpc)
inlinestatic

get Thallium client state

Here is the caller graph for this function:

◆ IsBoFunction()

static bool hermes::IsBoFunction ( const char *  func_name)
static

is func_name buffer organizer function?

Here is the caller graph for this function:

◆ RpcCall()

template<typename ReturnType , typename... Ts>
ReturnType hermes::RpcCall ( RpcContext rpc,
u32  node_id,
const char *  func_name,
Ts...  args 
)

RPC call

Here is the call graph for this function:

◆ RoundUpToMultiple()

size_t hermes::RoundUpToMultiple ( size_t  val,
size_t  multiple 
)

Rounds a value up to the next given multiple.

Returns the original value if it is already divisible by multiple.

Example:

size_t result = RoundUpToMultiple(2000, 4096);
assert(result == 4096);
size_t RoundUpToMultiple(size_t val, size_t multiple)
Definition: utils.cc:22
Parameters
valThe initial value to round.
multipleThe multiple to round up to.
Returns
The next multiple of multiple that is greater than or equal to val.
Here is the caller graph for this function:

◆ RoundDownToMultiple()

size_t hermes::RoundDownToMultiple ( size_t  val,
size_t  multiple 
)

Rounds a value down to the previous given multiple.

Returns the original value if it is already divisible by multiple.

Example:

size_t result = RoundDownToMultiple(4097, 4096);
assert(result == 4096);
size_t RoundDownToMultiple(size_t val, size_t multiple)
Definition: utils.cc:37
Parameters
valThe initial value to round.
multipleThe multiple to round down to.
Returns
The previous multiple of multiple that is less than or equal to val.
Here is the caller graph for this function:

◆ InitDefaultConfig()

void hermes::InitDefaultConfig ( Config config)

Fills out a Config struct with default values.

Parameters
configThe Config to populate.

< MB

< KB

Here is the caller graph for this function:

◆ FailedLibraryCall()

void hermes::FailedLibraryCall ( std::string  func)

print an error message for func function that failed

Here is the caller graph for this function:

Variable Documentation

◆ kGlobalDebugMaxAllocations

const int hermes::kGlobalDebugMaxAllocations = KILOBYTES(64)

global debug maxium allocations

◆ global_debug_id_state

DebugState* hermes::global_debug_id_state

global debug id state

◆ global_debug_map_state

DebugState* hermes::global_debug_map_state

global debug map state

◆ global_debug_map_name

char hermes::global_debug_map_name[] = "/hermes_debug_map_heap"

name for global debug map heap

◆ global_debug_id_name

char hermes::global_debug_id_name[] = "/hermes_debug_id_heap"

name for global debug id heap

◆ kDefaultCoeffs

const size_t hermes::kDefaultCoeffs = 1000 + 1

◆ kMaxBufferPoolSlabs

constexpr int hermes::kMaxBufferPoolSlabs = 8
staticconstexpr

max. buffer pool slabs

◆ kMaxPathLength

constexpr int hermes::kMaxPathLength = 256
constexpr

max. path length

◆ kMaxBufferPoolShmemNameLength

constexpr int hermes::kMaxBufferPoolShmemNameLength = 64
constexpr

max. buffer pool shared memory name length

◆ kMaxDevices

constexpr int hermes::kMaxDevices = 8
constexpr

max. devices

◆ kMaxBucketNameSize

constexpr int hermes::kMaxBucketNameSize = 256
constexpr

max. bucket name size

◆ kMaxVBucketNameSize

constexpr int hermes::kMaxVBucketNameSize = 256
constexpr

max. virtual bucket name size

◆ kPlaceInHierarchy

constexpr char hermes::kPlaceInHierarchy[] = "PlaceInHierarchy"
constexpr

a string to represent the place in hierarchy

◆ kSwapTargetId

const TargetID hermes::kSwapTargetId = {{0, 0, 0}}

A constant for swap target IDs

◆ kBucketIdStringSize

constexpr int hermes::kBucketIdStringSize = sizeof(BucketID) * 2
constexpr

A constant for bucket id string size

◆ kMaxBlobNameSize

constexpr int hermes::kMaxBlobNameSize = 64 - kBucketIdStringSize
constexpr

The maximum size in bytes allowed for Blob names.

◆ kAttemptsBeforeYield

const int hermes::kAttemptsBeforeYield = 100

A constant value for maximum attempts for ticket lock

◆ hextable

const u64 hermes::hextable[]
static
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12,
13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0
}
Note
(chogan): Lookup table for HexStringToU64()

◆ kGlobalMutexNodeId

const u32 hermes::kGlobalMutexNodeId = 1
static

global mutex node ID

◆ kIdListChunkSize

const int hermes::kIdListChunkSize = 10

chunk size of ID list

◆ kMaxTraitsPerVBucket

constexpr int hermes::kMaxTraitsPerVBucket = 8
staticconstexpr

maxinum number of traits per bucket

◆ kMaxServerNameSize

const int hermes::kMaxServerNameSize = 128

maximum size of server name

◆ kMaxServerSuffixSize

const int hermes::kMaxServerSuffixSize = 16

maximum size of server suffix

◆ kMaxServerNamePrefix

const int hermes::kMaxServerNamePrefix = 32

max. server name prefix

◆ kMaxServerNamePostfix

const int hermes::kMaxServerNamePostfix = 8

max. server name suffix

◆ kBoPrefix

const char hermes::kBoPrefix[] = "BO::"

buffer organizer prefix

◆ kBoPrefixLength

const int hermes::kBoPrefixLength = sizeof(kBoPrefix) - 1

buffer organizer prefix length