class sssd_engine::SmartSSDCache

#include "smart_ssd_cache.hpp"

Overview

class to handle a specific SSD device


Methods

getCardNum

int getCardNum ()

get number of cards

Returns:

number of cards

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

~SmartSSDCache

~SmartSSDCache ()

default deconstructor

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

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