NCCLOUD
0.1
|
Abstract base class for storage modules. More...
#include <storage.h>
Public Member Functions | |
virtual int | init (std::map< std::string, std::string > &storage_param)=0 |
Initialize the Storage instance based on storage_param. | |
virtual int | store_chunk (std::string &srcdir, std::string &filename, int chunk_index)=0 |
Upload a locally-stored chunk to a destination repository. | |
virtual int | store_chunks (std::string &srcdir, std::string &filename, std::vector< int > &chunk_indices)=0 |
Batched version of store_chunk(). | |
virtual int | store_metadata (std::string &srcdir, std::string &filename)=0 |
Upload a locally-stored metadata file to a destination repository. | |
virtual int | store_metadata_and_chunks (std::string &srcdir, std::string &filename, std::vector< int > &chunk_indices)=0 |
Combined store_metadata() and store_chunks(). | |
virtual int | get_chunk (std::string &dstdir, std::string &filename, int chunk_index)=0 |
Download a chunk from a repository to a local destination. | |
virtual int | get_chunks (std::string &dstdir, std::string &filename, std::vector< int > &chunk_indices)=0 |
Batched version of get_chunk(). | |
virtual int | get_metadata (std::string &dstdir, std::string &filename)=0 |
Download a metadata file from a repository to a local destination. | |
virtual int | get_metadata_and_chunks (std::string &dstdir, std::string &filename, std::vector< int > &chunk_indices)=0 |
Combined get_metadata() and get_chunks(). | |
virtual int | delete_chunk (std::string &filename, int chunk_index)=0 |
Delete a chunk from a repository. | |
virtual int | delete_chunks (std::string &filename, std::vector< int > &chunk_indices)=0 |
Batched version of delete_chunk(). | |
virtual int | delete_metadata (std::string &filename)=0 |
Delete a metadata file from a repository. | |
virtual int | delete_metadata_and_chunks (std::string &filename, std::vector< int > &chunk_indices)=0 |
Combined delete_metadata() and delete_chunks(). | |
virtual int | list_files (void)=0 |
Print a list of all files stored on the repository. | |
virtual int | check_health (void)=0 |
Checks accessibility of repository. | |
Static Public Member Functions | |
static Storage * | use_storage (int type) |
Return an instance of a storage scheme, based on user's choice. |
Abstract base class for storage modules.
virtual int Storage::check_health | ( | void | ) | [pure virtual] |
Checks accessibility of repository.
virtual int Storage::delete_chunk | ( | std::string & | filename, |
int | chunk_index | ||
) | [pure virtual] |
Delete a chunk from a repository.
[in] | filename | name of file being deleted |
[in] | chunk_index | chunk index of chunk to be deleted |
virtual int Storage::delete_chunks | ( | std::string & | filename, |
std::vector< int > & | chunk_indices | ||
) | [pure virtual] |
Batched version of delete_chunk().
virtual int Storage::delete_metadata | ( | std::string & | filename | ) | [pure virtual] |
Delete a metadata file from a repository.
[in] | filename | name of file being deleted |
virtual int Storage::delete_metadata_and_chunks | ( | std::string & | filename, |
std::vector< int > & | chunk_indices | ||
) | [pure virtual] |
Combined delete_metadata() and delete_chunks().
virtual int Storage::get_chunk | ( | std::string & | dstdir, |
std::string & | filename, | ||
int | chunk_index | ||
) | [pure virtual] |
Download a chunk from a repository to a local destination.
[in] | dstdir | directory under which chunk is to be stored locally |
[in] | filename | name of file being decoded |
[in] | chunk_index | chunk index of chunk to be retrieved |
virtual int Storage::get_chunks | ( | std::string & | dstdir, |
std::string & | filename, | ||
std::vector< int > & | chunk_indices | ||
) | [pure virtual] |
Batched version of get_chunk().
virtual int Storage::get_metadata | ( | std::string & | dstdir, |
std::string & | filename | ||
) | [pure virtual] |
Download a metadata file from a repository to a local destination.
[in] | dstdir | directory under which metadata file is to be stored locally |
[in] | filename | name of file being decoded |
virtual int Storage::get_metadata_and_chunks | ( | std::string & | dstdir, |
std::string & | filename, | ||
std::vector< int > & | chunk_indices | ||
) | [pure virtual] |
Combined get_metadata() and get_chunks().
virtual int Storage::init | ( | std::map< std::string, std::string > & | storage_param | ) | [pure virtual] |
Initialize the Storage instance based on storage_param.
[in] | storage_param | dictionary of parameters for this repository |
virtual int Storage::list_files | ( | void | ) | [pure virtual] |
Print a list of all files stored on the repository.
virtual int Storage::store_chunk | ( | std::string & | srcdir, |
std::string & | filename, | ||
int | chunk_index | ||
) | [pure virtual] |
Upload a locally-stored chunk to a destination repository.
[in] | srcdir | directory under which chunk is stored locally |
[in] | filename | name of file being encoded |
[in] | chunk_index | chunk index of chunk to be stored |
virtual int Storage::store_chunks | ( | std::string & | srcdir, |
std::string & | filename, | ||
std::vector< int > & | chunk_indices | ||
) | [pure virtual] |
Batched version of store_chunk().
virtual int Storage::store_metadata | ( | std::string & | srcdir, |
std::string & | filename | ||
) | [pure virtual] |
Upload a locally-stored metadata file to a destination repository.
[in] | srcdir | directory under which metadata file is stored locally |
[in] | filename | name of file being encoded |
virtual int Storage::store_metadata_and_chunks | ( | std::string & | srcdir, |
std::string & | filename, | ||
std::vector< int > & | chunk_indices | ||
) | [pure virtual] |
Combined store_metadata() and store_chunks().
Storage * Storage::use_storage | ( | int | type | ) | [static] |
Return an instance of a storage scheme, based on user's choice.
[in] | type | choice of coding scheme (0 = FMSR code) |