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
TransferServer Class Reference

Public Member Functions

 TransferServer (int port, std::shared_ptr< nativefs::NativeFS > &fs, std::shared_ptr< zkclient::ZkClientDn > &dn, int max_xmits=10)
 
 TransferServer (const TransferServer &other)
 
void serve (asio::io_service &io_service)
 
bool sendStats ()
 
bool replicate (uint64_t len, std::string ip, std::string xferport, ExtendedBlockProto blockToTarget)
 
bool remote_read (uint64_t len, std::string ip, std::string xferport, ExtendedBlockProto blockToTarget, std::string data, int &read_len)
 
bool rmBlock (uint64_t block_id)
 
bool writeBlock (uint64_t block_id, std::string data)
 
bool poll_replicate ()
 
bool poll_delete ()
 
bool poll_reconstruct ()
 

Member Function Documentation

bool TransferServer::remote_read ( uint64_t  len,
std::string  ip,
std::string  xferport,
ExtendedBlockProto  blockToTarget,
std::string  data,
int &  read_len 
)
Parameters
lenthe length of the block
ipthe ip of the datanode we are sending the read request to
xferportthe xfer port of the datandoe we are sending the read request to
blockToTargetthe block info of the block to replicate
datathe string to store the read data into
read_lenthe length of data read

Reads data from a remote block

bool TransferServer::replicate ( uint64_t  len,
std::string  ip,
std::string  xferport,
ExtendedBlockProto  blockToTarget 
)
Parameters
lenthe length of the block
ipthe ip of the datanode we are sending the read request to
xferportthe xfer port of the datandoe we are sending the read request to
blockToTargetthe block info of the block to replicate

Send a read request to anotehr datanode for a certain block, stream in the packets and write them to our disk

bool TransferServer::writeBlock ( uint64_t  block_id,
std::string  data 
)
Parameters
block_idthe id of the block to write
datato write

writes a block to the local DN


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