#include <file_leader.hh>
Public Member Functions | |
FileLeader (network::ClientHandler *) | |
~FileLeader () | |
unique_ptr< messages::Message > | file_insert (messages::FileInfo *) |
Insert file metadata and compute block metadata. More... | |
bool | file_insert_confirm (messages::FileInfo *) |
Confirm that all the blocks has been uploaded. More... | |
std::shared_ptr < messages::Message > | file_request (messages::FileRequest *) |
Return a description of the blocks containing the file. More... | |
bool | file_delete (messages::FileDel *) |
bool | list (messages::FileList *) |
Fill the param with the list of files. More... | |
bool | file_exist (std::string) |
bool | file_update (messages::FileUpdate *) |
Update the file with the new size and blocks. More... | |
void | metadata_save (messages::MetaData *) |
bool | format () |
Remove everything and create tables. More... | |
Public Member Functions inherited from eclipse::Node | |
Node () | |
~Node () | |
std::string | get_ip () const override |
Public Member Functions inherited from eclipse::Machine | |
Machine ()=default | |
Machine (int) | |
virtual | ~Machine () |
int | get_id () const |
Protected Member Functions | |
void | replicate_metadata () |
This function replicates to its right and left neighbor node the metadata db. More... | |
void | find_best_arrangement (messages::FileDescription *file_desc) |
Protected Attributes | |
Directory | directory |
Local_io | local_io |
std::unique_ptr< Histogram > | boundaries |
std::map< std::string, std::shared_ptr < messages::FileDescription > > | current_file_arrangements |
int | network_size |
Protected Attributes inherited from eclipse::Node | |
network::ClientHandler * | network |
Logger * | logger |
std::string | ip_of_this |
int | port |
Protected Attributes inherited from eclipse::Machine | |
int | id |
FileLeader::FileLeader | ( | network::ClientHandler * | net | ) |
FileLeader::~FileLeader | ( | ) |
bool FileLeader::file_delete | ( | messages::FileDel * | f | ) |
bool FileLeader::file_exist | ( | std::string | file_name | ) |
unique_ptr< Message > FileLeader::file_insert | ( | messages::FileInfo * | f | ) |
Insert file metadata and compute block metadata.
fix block shortage in client
strategy pattern for scheduling the blocks
bool FileLeader::file_insert_confirm | ( | messages::FileInfo * | f | ) |
Confirm that all the blocks has been uploaded.
shared_ptr< Message > FileLeader::file_request | ( | messages::FileRequest * | m | ) |
Return a description of the blocks containing the file.
Cancel if file is being uploading
bool FileLeader::file_update | ( | messages::FileUpdate * | f | ) |
Update the file with the new size and blocks.
|
protected |
bool FileLeader::format | ( | ) |
Remove everything and create tables.
bool FileLeader::list | ( | messages::FileList * | m | ) |
Fill the param with the list of files.
void FileLeader::metadata_save | ( | messages::MetaData * | m | ) |
|
protected |
This function replicates to its right and left neighbor node the metadata db.
This function is intended to be invoked whenever the metadata db is modified.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |