RDFS
The Rice Comp413 2017 class' continuation on the work of the 2016 RDFS.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
zkclient::ZkClientCommon Class Reference
Inheritance diagram for zkclient::ZkClientCommon:
zkclient::ZkClientDn zkclient::ZkNnClient

Public Member Functions

 ZkClientCommon (std::string hostAndIp)
 
 ZkClientCommon (std::shared_ptr< ZKWrapper > zk)
 
void init ()
 
std::string get_block_metadata_path (u_int64_t block_or_block_group_id)
 
u_int64_t get_block_group_id (u_int64_t storage_block_id)
 
u_int64_t get_index_within_block_group (u_int64_t storage_block_id)
 

Static Public Member Functions

static bool is_ec_block (u_int64_t block_id)
 

Public Attributes

std::shared_ptr< ZKWrapperzk
 

Static Public Attributes

static const char NAMESPACE_PATH [] = "/fileSystem"
 
static const char BLOCKS_TREE [] = "/blocks"
 
static const char HEALTH [] = "/health"
 
static const char HEALTH_BACKSLASH [] = "/health/"
 
static const char STATS [] = "/stats"
 
static const char HEARTBEAT [] = "/heartbeat"
 
static const char WORK_QUEUES [] = "/work_queues/"
 
static const char REPLICATE_QUEUES [] = "/work_queues/replicate/"
 
static const char REPLICATE_QUEUES_NO_BACKSLASH []
 
static const char DELETE_QUEUES [] = "/work_queues/delete/"
 
static const char DELETE_QUEUES_NO_BACKSLASH [] = "/work_queues/delete"
 
static const char WAIT_FOR_ACK [] = "wait_for_acks"
 
static const char WAIT_FOR_ACK_BACKSLASH [] = "wait_for_acks/"
 
static const char REPLICATE_BACKSLASH [] = "replicate/"
 
static const char BLOCK_LOCATIONS [] = "/block_locations/"
 
static const char BLOCK_GROUP_LOCATIONS [] = "/block_group_locations/"
 
static const char BLOCKS [] = "/blocks"
 
static const char EC_RECOVER_QUEUES [] = "/work_queues/ec_recover/"
 
static const char EC_RECOVER_QUEUES_NO_BACKSLASH []
 
static const char LEASES [] = "/leases"
 
static const char CLIENTS [] = "/clients"
 

Member Function Documentation

u_int64_t zkclient::ZkClientCommon::get_block_group_id ( u_int64_t  storage_block_id)

Gets the block group id from the storage block id. i.e. bit 2 ~ bit 48.

Parameters
storage_block_idthe given storage block id.
Returns
the block group id.
std::string zkclient::ZkClientCommon::get_block_metadata_path ( u_int64_t  block_or_block_group_id)

Given a block or block group id, returns the path to the corresponding metadata. For a non EC block, it is BLOCK_LOCATIONS + ID For an EC block, it is BLOCK_GROUP_LOCATIONS + ID

Parameters
block_or_block_group_idthe id of a block or a block group.
Returns
the path to the corresponding metadata.
u_int64_t zkclient::ZkClientCommon::get_index_within_block_group ( u_int64_t  storage_block_id)

Gets the index within the block group.

Parameters
storage_block_idthe given storage block id.
Returns
the index within the block group.
bool zkclient::ZkClientCommon::is_ec_block ( u_int64_t  block_id)
static

true if the highest bit is set to 1. false otherwise.

Parameters
block_idthe id of a block (or a block group)
Returns
true or false.

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