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 | List of all members
zkclient::ZkClientDn Class Reference

#include <zk_dn_client.h>

Inheritance diagram for zkclient::ZkClientDn:
zkclient::ZkClientCommon

Public Member Functions

 ZkClientDn (const std::string &ip, const std::string &zkIpAndAddress, uint64_t total_disk_space, const uint32_t ipcPort=50020, const uint32_t xferPort=50010)
 
 ZkClientDn (const std::string &ip, std::shared_ptr< ZKWrapper >, uint64_t total_disk_space, const uint32_t ipcPort=50020, const uint32_t xferPort=50010)
 
void registerDataNode (const std::string &ip, uint64_t total_disk_space, const uint32_t ipcPort, const uint32_t xferPort)
 
bool blockReceived (uint64_t uuid, uint64_t size_bytes)
 
bool blockSizeUpdated (uint64_t uuid, uint64_t size_bytes)
 
bool sendStats (uint64_t free_space, uint32_t xmits)
 
void setTransferServer (std::shared_ptr< TransferServer > &server)
 
bool push_dn_on_repq (std::string dn_name, uint64_t blockid)
 
bool poll_replication_queue ()
 
bool poll_delete_queue ()
 
bool poll_reconstruct_queue ()
 
std::string get_datanode_id ()
 
- Public Member Functions inherited from zkclient::ZkClientCommon
 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)
 

Additional Inherited Members

- Static Public Member Functions inherited from zkclient::ZkClientCommon
static bool is_ec_block (u_int64_t block_id)
 
- Public Attributes inherited from zkclient::ZkClientCommon
std::shared_ptr< ZKWrapperzk
 
- Static Public Attributes inherited from zkclient::ZkClientCommon
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"
 

Detailed Description

Class representing a Zookeeper-DataNode client. Allows a DataNode to update the state of ZK.

Constructor & Destructor Documentation

zkclient::ZkClientDn::ZkClientDn ( const std::string &  ip,
const std::string &  zkIpAndAddress,
uint64_t  total_disk_space,
const uint32_t  ipcPort = 50020,
const uint32_t  xferPort = 50010 
)

Initializes the Zookeeper-Datanode client.

Parameters
ipThe DataNode IP
hostnameThe DataNode hostname
zkIpAndAddressThe IP and hostname of ZK
ipcPortTODO
xferPortTODO

Member Function Documentation

bool zkclient::ZkClientDn::blockReceived ( uint64_t  uuid,
uint64_t  size_bytes 
)

Informs Zookeeper when the DataNode has received a block. Adds an acknowledgment and creates a node for the DN in the block's block_locations.

Parameters
uuidThe UUID of the block received by the DataNode.
size_bytesThe number of bytes in the block
Returns
True on success, false on error.
bool zkclient::ZkClientDn::poll_reconstruct_queue ( )

Checks the ec_recovery queue for jobs

bool zkclient::ZkClientDn::push_dn_on_repq ( std::string  dn_name,
uint64_t  blockid 
)

Push the blockid onto the replication queue belonging to dn_name

Parameters
dn_namethe queue to add onto
blockidthe id of the block to be replicated
Returns
true if success
void zkclient::ZkClientDn::registerDataNode ( const std::string &  ip,
uint64_t  total_disk_space,
const uint32_t  ipcPort,
const uint32_t  xferPort 
)

Registers this DataNode with Zookeeper.

void zkclient::ZkClientDn::setTransferServer ( std::shared_ptr< TransferServer > &  server)

Set the transfer server that this dn uses for read/writes


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