|
Seismic Drive Client API
|
This class allows access to hierarchical datasets in cloud storage. More...
#include <SDHierarchicalDatasetAccessor.h>
Public Member Functions | |
| SDHierarchicalDatasetAccessor (const SDDatasetDisposition disposition, Storage *storage, const std::string &gcsUrl, const std::string tag) | |
| ~SDHierarchicalDatasetAccessor () | |
| SDHierarchicalDatasetAccessor (SDHierarchicalDatasetAccessor &&sdhd) noexcept | |
| Move Constructor. More... | |
| SDHierarchicalDatasetAccessor & | operator= (SDHierarchicalDatasetAccessor &&sdhd) noexcept |
| Move Assignment Operator. More... | |
| SDHierarchicalDatasetAccessor (const SDHierarchicalDatasetAccessor &op) | |
| Copy Constructor. More... | |
| SDHierarchicalDatasetAccessor & | operator= (const SDHierarchicalDatasetAccessor &op) |
| Copy Assignment Operator. More... | |
| std::string | get_tag () const |
| Return accessor tag. More... | |
| uint64_t | node_add (const std::string &nodeName) |
| Adds a new Node. More... | |
| uint64_t | node_get (const std::string &nodeName) const |
| Gets a Node. More... | |
| std::size_t | object_write (const uint64_t nodeID, const std::string &objectName, const char *buffer, const std::size_t size) |
| Write an object (block of data/bytes) to gcs. More... | |
| void | object_read (const uint64_t nodeID, const std::string &objectName, char *buffer, size_t size) |
| Read an object (block of data/bytes) from gcs. More... | |
| void | object_delete (const uint64_t nodeID, const std::string &objectName) |
| Delete an object (block of data/bytes) from gcs. More... | |
| uint64_t | node_count () const |
| gets the node count. More... | |
| std::size_t | tot_byte_size () const |
| gets the total size of the dataset in bytes. More... | |
| std::vector< SDHierarchicalMetaData > | metadata_get () const |
| gets the metadatas for all stored object. More... | |
| void | metadata_set (const std::vector< SDHierarchicalMetaData > *meta) |
| Add new metadata. More... | |
| std::vector< std::string > | node_names () const |
| gets the names of all the nodes More... | |
| std::vector< std::size_t > | node_sizes () const |
| gets the size of all the nodes More... | |
| std::string | node_name (const uint64_t nodeID) const |
| gets the node name. More... | |
| std::size_t | node_size (const uint64_t nodeID) const |
| gets the node size in bytes. More... | |
| uint64_t | object_count (const uint64_t nodeID) const |
| gets the objects count. More... | |
| std::vector< std::string > | object_names (const uint64_t nodeID) const |
| gets the objects names. More... | |
| std::vector< std::size_t > | object_sizes (const uint64_t nodeID) const |
| gets the objects sizes. More... | |
| std::size_t | object_size (const uint64_t nodeID, const std::string &object_name) const |
| gets the objects sizes. More... | |
| void | objects_info (const uint64_t nodeID, std::vector< std::string > &names, std::vector< std::size_t > &sizes) |
| gets the objects' names and sizes. More... | |
Friends | |
| class | SDHierarchicalDatasetAcsTest |
This class allows access to hierarchical datasets in cloud storage.
This class provide basics methods to read/write blocks of data to cloud storage
| seismicdrive::SDHierarchicalDatasetAccessor::SDHierarchicalDatasetAccessor | ( | const SDDatasetDisposition | disposition, |
| Storage * | storage, | ||
| const std::string & | gcsUrl, | ||
| const std::string | tag | ||
| ) |
Constructor.
| disposition | is the disposition mode |
| storage | is a cloud provider specific Storage object, e.g. an AzureStorage instance |
| gcsUrl | is the url of the root node in gcs (gs://bucket_name/root_folder) |
| tag | is an optional tag that can be assigned to the class for debugging purpose |
| seismicdrive::SDHierarchicalDatasetAccessor::~SDHierarchicalDatasetAccessor | ( | ) |
Destructor.
If the file is opened for writing (not READ_ONLY), it will be closed.
|
noexcept |
Move Constructor.
This contructor moves the SDHierarchicalDatasetAccessor object from the source to the new object and destroy the source object.
| seismicdrive::SDHierarchicalDatasetAccessor::SDHierarchicalDatasetAccessor | ( | const SDHierarchicalDatasetAccessor & | op | ) |
Copy Constructor.
This contructor makes a copy of the SDHierarchicalDatasetAccessor object from the source to the new object without modifying the source object.
| std::string seismicdrive::SDHierarchicalDatasetAccessor::get_tag | ( | ) | const |
Return accessor tag.
This method returns the hierarchical dataset accessor's tag.
| std::vector<SDHierarchicalMetaData> seismicdrive::SDHierarchicalDatasetAccessor::metadata_get | ( | ) | const |
gets the metadatas for all stored object.
This method is used to get the metadata of all objects in the current hierarchical dataset in bytes.
| void seismicdrive::SDHierarchicalDatasetAccessor::metadata_set | ( | const std::vector< SDHierarchicalMetaData > * | meta | ) |
Add new metadata.
Adds new user-defined metadata into the hierarchical dataset
| meta | is the metadata to add |
| uint64_t seismicdrive::SDHierarchicalDatasetAccessor::node_add | ( | const std::string & | nodeName | ) |
Adds a new Node.
This method add a new node to the hierarchical structure.
| nodeName | is the name of the new node. |
| uint64_t seismicdrive::SDHierarchicalDatasetAccessor::node_count | ( | ) | const |
gets the node count.
This method is used to get the number of nodes in the current dataset.
| uint64_t seismicdrive::SDHierarchicalDatasetAccessor::node_get | ( | const std::string & | nodeName | ) | const |
Gets a Node.
This method gets a node from the hierarchical structure.
| nodeName | is the name of the new node. |
| std::string seismicdrive::SDHierarchicalDatasetAccessor::node_name | ( | const uint64_t | nodeID | ) | const |
gets the node name.
This method gets the node name given its ID.
| nodeID | is the ID of the node. |
| std::vector<std::string> seismicdrive::SDHierarchicalDatasetAccessor::node_names | ( | ) | const |
gets the names of all the nodes
This method gets a list of the names of all nodes in the hierarchical dataset.
| std::size_t seismicdrive::SDHierarchicalDatasetAccessor::node_size | ( | const uint64_t | nodeID | ) | const |
gets the node size in bytes.
This method gets the node size given its ID.
| nodeID | is the ID of the node. |
| std::vector<std::size_t> seismicdrive::SDHierarchicalDatasetAccessor::node_sizes | ( | ) | const |
gets the size of all the nodes
This method gets a list of the sizes of all nodes in the hierarchical dataset in bytes.
| uint64_t seismicdrive::SDHierarchicalDatasetAccessor::object_count | ( | const uint64_t | nodeID | ) | const |
gets the objects count.
This method gets the number of objects in a node given its ID.
| nodeID | is the ID of the node. |
| void seismicdrive::SDHierarchicalDatasetAccessor::object_delete | ( | const uint64_t | nodeID, |
| const std::string & | objectName | ||
| ) |
Delete an object (block of data/bytes) from gcs.
This method deletes an object from GCS given its name and node index.
| nodeID | is the index of the node. |
| objectName | is the name of the object. |
| std::vector<std::string> seismicdrive::SDHierarchicalDatasetAccessor::object_names | ( | const uint64_t | nodeID | ) | const |
gets the objects names.
This method gets the names of objects in a node given its ID.
| nodeID | is the ID of the node. |
| void seismicdrive::SDHierarchicalDatasetAccessor::object_read | ( | const uint64_t | nodeID, |
| const std::string & | objectName, | ||
| char * | buffer, | ||
| size_t | size | ||
| ) |
Read an object (block of data/bytes) from gcs.
This method reads a block of data (specified with a index of the node) with a specified length.
| nodeID | is the index of the node. |
| objectName | is the name of the object. |
| buffer | is the buffer where read data will be stored. |
| size | is the number of byte to read. |
| std::size_t seismicdrive::SDHierarchicalDatasetAccessor::object_size | ( | const uint64_t | nodeID, |
| const std::string & | object_name | ||
| ) | const |
gets the objects sizes.
This method gets the size in byes of an object in a node given the object name and the node ID.
| nodeID | is the ID of the node. |
| object_name | is the name of the object. |
| std::vector<std::size_t> seismicdrive::SDHierarchicalDatasetAccessor::object_sizes | ( | const uint64_t | nodeID | ) | const |
gets the objects sizes.
This method gets the size in byes of all objects in a node given its ID.
| nodeID | is the ID of the node. |
| std::size_t seismicdrive::SDHierarchicalDatasetAccessor::object_write | ( | const uint64_t | nodeID, |
| const std::string & | objectName, | ||
| const char * | buffer, | ||
| const std::size_t | size | ||
| ) |
Write an object (block of data/bytes) to gcs.
This method writes a block of data (specified with a index of the node) with a specified length.
| nodeID | is the index of the node. |
| objectName | is the name of the object. |
| buffer | is the data to write. |
| size | is the number of byte to write (buffer size). |
| void seismicdrive::SDHierarchicalDatasetAccessor::objects_info | ( | const uint64_t | nodeID, |
| std::vector< std::string > & | names, | ||
| std::vector< std::size_t > & | sizes | ||
| ) |
gets the objects' names and sizes.
This method gets the names and sizes of all objects stored in a node given its ID.
| nodeID | is the ID of the node. |
| names | is the vector where the names will be stored. |
| sizes | is the vector where the sizes will be stored. |
|
noexcept |
Move Assignment Operator.
Same functionality as the move constructor.
| SDHierarchicalDatasetAccessor& seismicdrive::SDHierarchicalDatasetAccessor::operator= | ( | const SDHierarchicalDatasetAccessor & | op | ) |
Copy Assignment Operator.
Same functionality as the copy constructor.
| std::size_t seismicdrive::SDHierarchicalDatasetAccessor::tot_byte_size | ( | ) | const |
gets the total size of the dataset in bytes.
This method is used to get the total size of the current hierarchical dataset in bytes.
|
friend |
1.8.14