0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
Hypertable::MemoryTracker Class Reference

Tracks range server memory used. More...

#include <MemoryTracker.h>

Collaboration diagram for Hypertable::MemoryTracker:
Collaboration graph
[legend]

Public Member Functions

 MemoryTracker (FileBlockCache *block_cache, QueryCachePtr query_cache)
 Constructor. More...
 
void add (int64_t amount)
 Add to memory used. More...
 
void subtract (int64_t amount)
 Subtract to memory used. More...
 
int64_t balance ()
 Return total range server memory used. More...
 

Private Attributes

std::mutex m_mutex
 Mutex to serialize concurrent access More...
 
int64_t m_memory_used {}
 Current range server memory used. More...
 
FileBlockCachem_block_cache
 Pointer to block cache. More...
 
QueryCachePtr m_query_cache
 Pointer to query cache. More...
 

Detailed Description

Tracks range server memory used.

Definition at line 42 of file MemoryTracker.h.

Constructor & Destructor Documentation

Hypertable::MemoryTracker::MemoryTracker ( FileBlockCache block_cache,
QueryCachePtr  query_cache 
)
inline

Constructor.

Parameters
block_cachePointer to block cache
query_cachePointer to query cache

Definition at line 48 of file MemoryTracker.h.

Member Function Documentation

void Hypertable::MemoryTracker::add ( int64_t  amount)
inline

Add to memory used.

Parameters
amountAmount of memory to add

Definition at line 53 of file MemoryTracker.h.

int64_t Hypertable::MemoryTracker::balance ( )
inline

Return total range server memory used.

This member function returns the total amount of memory used, computed as m_memory_used plus block cache memory used plus query cache memory used.

Returns
Total range server memory used

Definition at line 70 of file MemoryTracker.h.

void Hypertable::MemoryTracker::subtract ( int64_t  amount)
inline

Subtract to memory used.

Parameters
amountAmount of memory to subtract

Definition at line 60 of file MemoryTracker.h.

Member Data Documentation

FileBlockCache* Hypertable::MemoryTracker::m_block_cache
private

Pointer to block cache.

Definition at line 85 of file MemoryTracker.h.

int64_t Hypertable::MemoryTracker::m_memory_used {}
private

Current range server memory used.

Definition at line 82 of file MemoryTracker.h.

std::mutex Hypertable::MemoryTracker::m_mutex
private

Mutex to serialize concurrent access

Definition at line 79 of file MemoryTracker.h.

QueryCachePtr Hypertable::MemoryTracker::m_query_cache
private

Pointer to query cache.

Definition at line 88 of file MemoryTracker.h.


The documentation for this class was generated from the following file: