class sssd_engine::SmartSSDCache¶
#include "smart_ssd_cache.hpp"
Methods¶
SmartSSDCache¶
SmartSSDCache ( const char* xclbin_path, int card_num, sssd_info_t* disks, FILE* log )
default constructor, instantiate data engine
Parameters:
| xclbin_path | path of xclbin |
| card_num | number of availabe SmartSSD cards |
| disks | information of the SSDs |
| log | file handler for dumping the logs |
addFile¶
ErrorCode addFile ( std::unique_ptr <char[]> data, size_t size, const std::string& filename )
store file to managed SmartSSD cards. Copy data from CPU memory to SSD cards
Parameters:
| data | pointer to file content in memory. Before return, the block of storage will be released |
| size | file size |
| filename | file to store |
Returns:
success or fail status
scanFile¶
char* scanFile ( const char* fname, sssd_scandesc_t* sd, ErrorCode& err )
scan files from managed SmartSSD cards.
Parameters:
| fname | file name; |
| sd | pointer to configuration including schema, projection and filter conditions filenames. |
| err | return the status of exectution. |
Returns:
pointer the selected row. It is stored in format defined by data type in schema.
listFiles¶
ErrorCode listFiles ( const char* path_pattern, std::vector <std::string>& file_list )
list all the file name that matche the path_pattern
Parameters:
| path_pattern | specify the path_pattern for regex |
| file_list | store the file name that matched the path_pattern |
Returns:
fail/success
print_input¶
void print_input (const sssd_scandesc_t* sd)
print input information
Parameters:
| sd | the input schema |
print_output¶
void print_output ( const int64_t value [], const bool isnull [], int32_t hash, const sssd_scandesc_t* sd )
print output information
Parameters:
| value | values |
| isnull | is null flags |
| hash | hash value |
| sd | the schema |
release¶
void release ( const char* file_path, char* buf_ptr )
release specified buffer
Parameters:
| file_path | path to the file |
| buf_ptr | buffer to be released |