3 #include "../nodes/node.hh"
5 #include "../blocknode/local_io.hh"
6 #include "../messages/fileinfo.hh"
7 #include "../messages/fileupdate.hh"
8 #include "../messages/filerequest.hh"
9 #include "../messages/filelist.hh"
10 #include "../messages/filedel.hh"
11 #include "../messages/fileexist.hh"
12 #include "../messages/filedescription.hh"
13 #include "../messages/metadata.hh"
14 #include "../common/histogram.hh"
20 using vec_str = std::vector<std::string>;
bool file_insert_confirm(messages::FileInfo *)
Confirm that all the blocks has been uploaded.
Definition: file_leader.cc:56
Definition: fileinfo.hh:10
Definition: directory.hh:12
std::map< std::string, std::shared_ptr< messages::FileDescription > > current_file_arrangements
Definition: file_leader.hh:56
std::vector< std::string > vec_str
Definition: cli_driver.cc:9
bool file_update(messages::FileUpdate *)
Update the file with the new size and blocks.
Definition: file_leader.cc:63
Represents the local disk.
Definition: local_io.hh:11
Definition: file_leader.hh:22
void replicate_metadata()
This function replicates to its right and left neighbor node the metadata db.
Definition: file_leader.cc:190
Definition: filedescription.hh:10
Definition: fileupdate.hh:10
Definition: filerequest.hh:9
Definition: filelist.hh:12
unique_ptr< messages::Message > file_insert(messages::FileInfo *)
Insert file metadata and compute block metadata.
Definition: file_leader.cc:38
bool list(messages::FileList *)
Fill the param with the list of files.
Definition: file_leader.cc:176
Local_io local_io
Definition: file_leader.hh:54
Definition: client_handler.hh:12
int network_size
Definition: file_leader.hh:57
void metadata_save(messages::MetaData *)
Definition: file_leader.cc:203
bool format()
Remove everything and create tables.
Definition: file_leader.cc:209
std::unique_ptr< Histogram > boundaries
Definition: file_leader.hh:55
Directory directory
Definition: file_leader.hh:53
std::shared_ptr< messages::Message > file_request(messages::FileRequest *)
Return a description of the blocks containing the file.
Definition: file_leader.cc:119
~FileLeader()
Definition: file_leader.cc:31
bool file_exist(std::string)
Definition: file_leader.cc:182
FileLeader(network::ClientHandler *)
Definition: file_leader.cc:21
bool file_delete(messages::FileDel *)
Definition: file_leader.cc:101
void find_best_arrangement(messages::FileDescription *file_desc)
Definition: file_leader.cc:217