Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | List of all members
velox::DFS Class Reference

#include <dfs.hh>

Collaboration diagram for velox::DFS:
Collaboration graph

Public Member Functions

 DFS ()
 
uint64_t write (std::string &file_name, const char *buf, uint64_t off, uint64_t len)
 Write the contents into a remote file. More...
 
uint64_t write (std::string &file_name, const char *buf, uint64_t off, uint64_t len, uint64_t block_size)
 
uint64_t read (std::string &file_name, char *buf, uint64_t off, uint64_t len)
 Download a remote file's section into a buffer. More...
 
std::string read_all (std::string file_name)
 Read remote logical blocks into a buffer. More...
 
int append (std::string file_name, std::string buf)
 Append a string to the end of a remote file. More...
 
int upload (std::string file_name, bool is_binary, uint64_t block_size=0)
 Upload a local file to a the veloxdfs intance. More...
 
int download (std::string file_name)
 Download a remote file to your current local directory. More...
 
bool exists (std::string)
 }}} More...
 
bool touch (std::string)
 
int remove (std::string)
 
bool rename (std::string, std::string)
 
int format ()
 
model::metadata get_metadata (std::string &fname)
 
model::metadata get_metadata_optimized (std::string &fname, int type=0)
 
std::vector< model::metadataget_metadata_all ()
 
void file_metadata_append (std::string, size_t, model::metadata &)
 
std::string dump_metadata (std::string &fname)
 Dump all the metadata for the give file. More...
 
uint64_t read_chunk (std::string &fname, std::string host, char *buf, uint64_t buffer_offset, uint64_t off, uint64_t len)
 Read a chunk directly. More...
 

Constructor & Destructor Documentation

velox::DFS::DFS ( )

Member Function Documentation

int velox::DFS::append ( std::string  file_name,
std::string  buf 
)

Append a string to the end of a remote file.

Attention
It is currently not working due to changes in the internal API.
Todo:
fix implementation
int velox::DFS::download ( std::string  file_name)

Download a remote file to your current local directory.

Parameters
file_nameFile to peform the operation.
Return values
0SUCCESS
1FAILURE

Does the file exists

No buffer

std::string velox::DFS::dump_metadata ( std::string &  fname)

Dump all the metadata for the give file.

bool velox::DFS::exists ( std::string  name)

}}}

void velox::DFS::file_metadata_append ( std::string  name,
size_t  size,
model::metadata blocks 
)
int velox::DFS::format ( )
model::metadata velox::DFS::get_metadata ( std::string &  fname)
vector< model::metadata > velox::DFS::get_metadata_all ( )
model::metadata velox::DFS::get_metadata_optimized ( std::string &  fname,
int  type = 0 
)
uint64_t velox::DFS::read ( std::string &  file_name,
char *  buf,
uint64_t  off,
uint64_t  len 
)

Download a remote file's section into a buffer.

Precondition
The file must exist.
Parameters
file_nameFile to peform the operation.
[out]bufferDestination buffer.
offoffset from where to read.
lensize of segment to read.
Return values
>0bytes successfully uploaded.
0The operation failed.
std::string velox::DFS::read_all ( std::string  file_name)

Read remote logical blocks into a buffer.

Precondition
The file must exist.
Parameters
file_nameFile to peform the operation.
[out]bufferDestination buffer.
offoffset from where to read.
lensize of segment to read.
Return values
>0bytes successfully uploaded.
0The operation failed. Load all the file into a string.
Parameters
file_nameFile to peform the operation.
Return values
""The file did not exists.
uint64_t velox::DFS::read_chunk ( std::string &  fname,
std::string  host,
char *  buf,
uint64_t  buffer_offset,
uint64_t  off,
uint64_t  len 
)

Read a chunk directly.

int velox::DFS::remove ( std::string  file_name)
bool velox::DFS::rename ( std::string  src,
std::string  dst 
)
bool velox::DFS::touch ( std::string  file_name)

Insert the file

Send file to be submitted;

Get information of where to send the file

int velox::DFS::upload ( std::string  file_name,
bool  is_binary,
uint64_t  block_size = 0 
)

Upload a local file to a the veloxdfs intance.

Parameters
file_nameFile to peform the operation.
is_binaryWhether to broadcast the file to all the nodes.
block_sizeIntended block size (Overrides .eclipse.json blocksize)
Return values
0SUCCESS
1FAILURE

Does the file exists

Insert the file

Send file to be submitted;

Get information of where to send the file

Insert the blocks

Load block metadata info

uint64_t velox::DFS::write ( std::string &  file_name,
const char *  buf,
uint64_t  off,
uint64_t  len 
)

Write the contents into a remote file.

Parameters
file_nameFile to peform the operation if the file does not exists it will create it.
bufcontents to be copied.
offoffset to append the buffer.
lensize of the content.
block_sizesize of block size to write. (default: by configuration)
Return values
>0bytes successfully uploaded.
0The operation failed.
uint64_t velox::DFS::write ( std::string &  file_name,
const char *  buf,
uint64_t  off,
uint64_t  len,
uint64_t  block_size 
)

Insert the blocks

Load block metadata info


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