Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
eclipse::BlockNode Class Reference

#include <block_node.hh>

Inheritance diagram for eclipse::BlockNode:
Inheritance graph
Collaboration diagram for eclipse::BlockNode:
Collaboration graph

Public Member Functions

 BlockNode (network::ClientHandler *)
 
 ~BlockNode ()
 
bool block_insert_local (Block &, bool replicate=true)
 Save to disk a block and replicate. More...
 
bool block_delete_local (Block &, bool replicate=true)
 Delete Local block. More...
 
bool block_update_local (Block &block, uint32_t pos, uint32_t len, bool replicate=true)
 Update the content of the block. More...
 
bool block_read_local (Block &block, uint64_t off=0, uint64_t len=0, bool ignore_params=true)
 Read block from the local node. 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_message (messages::IOoperation *)
 Compute the right and left node of the current node and send its replicas of the given block. More...
 

Protected Attributes

Local_io local_io
 
int network_size
 
- Protected Attributes inherited from eclipse::Node
network::ClientHandlernetwork
 
Loggerlogger
 
std::string ip_of_this
 
int port
 
- Protected Attributes inherited from eclipse::Machine
int id
 

Constructor & Destructor Documentation

eclipse::BlockNode::BlockNode ( network::ClientHandler net)
eclipse::BlockNode::~BlockNode ( )

Member Function Documentation

bool eclipse::BlockNode::block_delete_local ( Block block,
bool  replicate = true 
)

Delete Local block.

This method read the block locally.

bool eclipse::BlockNode::block_insert_local ( Block block,
bool  replicate = true 
)

Save to disk a block and replicate.

This method insert the block locally and replicated it.

bool eclipse::BlockNode::block_read_local ( Block block,
uint64_t  off = 0,
uint64_t  len = 0,
bool  ignore_params = true 
)

Read block from the local node.

This method read the block locally.

bool eclipse::BlockNode::block_update_local ( Block block,
uint32_t  pos,
uint32_t  len,
bool  replicate = true 
)

Update the content of the block.

void eclipse::BlockNode::replicate_message ( messages::IOoperation m)
protected

Compute the right and left node of the current node and send its replicas of the given block.

Member Data Documentation

Local_io eclipse::BlockNode::local_io
protected
int eclipse::BlockNode::network_size
protected

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