Logo
Public Member Functions | Public Attributes | List of all members
velox::DFS Class Reference

#include <dfs.hh>

Collaboration diagram for velox::DFS:
Collaboration graph

Public Member Functions

 DFS (string _mr_job_id, int _tmb_id, bool initializer)
 
 ~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 upload_by_individual_block (std::string file_name, bool is_binary, uint64_t block_size=0)
 For the Experiment Upload a local file to the veloxdfs instance by individual file. 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 (char *buf, uint32_t buffer_offset)
 Read a chunk directly. More...
 
uint64_t write_chunk (std::string &file_name, const char *buf, uint64_t off, uint64_t len, uint64_t block_size, uint32_t sblock_seq)
 
int write_file (std::string file_name, bool, const std::string &buf, uint64_t len)
 

Public Attributes

int tmg_id
 
int shmid
 
void * shared_memory
 
std::string mr_job_id
 

Constructor & Destructor Documentation

◆ DFS()

velox::DFS::DFS ( string  _mr_job_id,
int  _tmb_id,
bool  initializer 
)

◆ ~DFS()

velox::DFS::~DFS ( )

Member Function Documentation

◆ append()

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
Todo:
fix implementation
Todo:
fix implementation
Todo:
fix implementation
Todo:
fix implementation

◆ download()

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

Does the file exists

No buffer

Does the file exists

No buffer

Does the file exists

No buffer

Does the file exists

No buffer

◆ dump_metadata()

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

Dump all the metadata for the give file.

◆ exists()

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

}}}

◆ file_metadata_append()

void velox::DFS::file_metadata_append ( std::string  name,
size_t  size,
model::metadata blocks 
)

◆ format()

int velox::DFS::format ( )

◆ get_metadata()

model::metadata velox::DFS::get_metadata ( std::string &  fname)

◆ get_metadata_all()

vector< model::metadata > velox::DFS::get_metadata_all ( )

◆ get_metadata_optimized()

model::metadata velox::DFS::get_metadata_optimized ( std::string &  fname,
int  type = 0 
)

◆ read()

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.

◆ read_all()

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.

◆ read_chunk()

uint64_t velox::DFS::read_chunk ( char *  buf,
uint32_t  buffer_offset 
)

Read a chunk directly.

◆ remove()

int velox::DFS::remove ( std::string  file_name)

◆ rename()

bool velox::DFS::rename ( std::string  src,
std::string  dst 
)

◆ touch()

bool velox::DFS::touch ( std::string  file_name)

Insert the file

Send file to be submitted;

Get information of where to send the file

Insert the file

Send file to be submitted;

Get information of where to send the file

Insert the file

Send file to be submitted;

Get information of where to send the file

Insert the file

Send file to be submitted;

Get information of where to send the file

Insert the file

Send file to be submitted;

Get information of where to send the file

◆ upload()

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

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

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

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

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

◆ upload_by_individual_block()

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

For the Experiment Upload a local file to the veloxdfs instance by individual file.

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

◆ write() [1/2]

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.

◆ write() [2/2]

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

Update Huge Block

Update Huge Block

Update Huge Block

Update Huge Block

Update Huge Block

Update Huge Block

Update Huge Block

Update Huge Block

Update Huge Block

Update Huge Block

◆ write_chunk()

uint64_t velox::DFS::write_chunk ( std::string &  file_name,
const char *  buf,
uint64_t  off,
uint64_t  len,
uint64_t  block_size,
uint32_t  sblock_seq 
)

Insert the blocks

Insert the blocks

Insert the blocks

Insert the blocks

Insert the blocks

◆ write_file()

int velox::DFS::write_file ( std::string  file_name,
bool  is_binary,
const std::string &  buf,
uint64_t  len 
)

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

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

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

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

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

Member Data Documentation

◆ mr_job_id

std::string velox::DFS::mr_job_id

◆ shared_memory

void* velox::DFS::shared_memory

◆ shmid

int velox::DFS::shmid

◆ tmg_id

int velox::DFS::tmg_id

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