|
Covalent Bond
0.0.1-alpha
'covalent bond' is a data middle office. As a 2022-2023 Fall SWE final project.
|
Go to the documentation of this file.
2 #include <workflow/WFOperator.h>
6 const std::string& _userName,
const std::string& _passWord,
7 const std::string& _charSet,
8 const std::string& _dataBaseName) {
22 ss <<
"?character_set=" <<
charSet <<
"&character_set_results=" <<
charSet;
32 return m_conn->create_query_task(q, callback_func);
36 const std::vector<std::string>& q,
const std::vector<mysql_callback>& callback_func) {
37 if (q.size() != callback_func.size()) {
38 fmt::print(fg(fmt::color::crimson) | fmt::emphasis::bold,
39 "[ Error ] sequential task's vector size is not same. Get query size={}, but "
40 "callback_func size={}",
41 q.size(), callback_func.size());
43 size_t len_size = q.size();
44 std::vector<WFMySQLTask*> ans;
45 for (
size_t i = 0; i < len_size; ++i) {
46 ans.push_back(
m_conn->create_query_task(q[i], callback_func[i]));
54 auto& generalTask = (*t[0]) > t[1];
55 size_t len_size = t.size();
56 for (
size_t i = 2; i < len_size; ++i) { generalTask.push_back(t[i]); }
77 WFRedisTask* task = WFTaskFactory::create_redis_task(
Url, retryTimes, callback_func);
78 protocol::RedisRequest* req = task->get_req();
79 req->set_request(
"SET", params);
80 task->user_data = usrData;
87 WFRedisTask* task = WFTaskFactory::create_redis_task(
Url, retryTimes, callback_func);
88 protocol::RedisRequest* req = task->get_req();
89 req->set_request(
"GET", params);
90 task->user_data = usrData;
97 WFRedisTask* task = WFTaskFactory::create_redis_task(
Url, retryTimes, callback_func);
98 protocol::RedisRequest* req = task->get_req();
99 req->set_request(
"EXISTS", params);
100 task->user_data = usrData;
std::function< void(WFMySQLTask *)> mysql_callback
_WIN32
std::map< int32_t, std::pair< cbKafkaDevice *, bool > > m_kafkaPool
! index, {pointer, visibility}
void updateUrl() override final
static int32_t m_numsKafka
static void execMain(WFRedisTask *task)
User should not use this function. All task should be added to graph node in order to execute all tas...
WFRedisTask * get(const std::vector< std::string > ¶ms, const redis_callback &callback_func=nullptr, void *usrData=nullptr, int32_t retryTimes=3)
std::function< void(WFRedisTask *)> redis_callback
cbKafkaDevice * getKafkaDevice(int32_t idx)
cbRedisDevice * getRedisDevice(int32_t idx)
void updateUrl() override final
std::map< int32_t, std::pair< cbMySqlDevice *, bool > > m_mySqlPool
WFMySQLConnection * m_conn
WFRedisTask * exists(const std::vector< std::string > ¶ms, const redis_callback &callback_func=nullptr, void *usrData=nullptr, int32_t retryTimes=3)
void addRedisDevice(cbRedisDevice *vd)
void removeMySqlDevice(int32_t idx)
void updateUrl() override final
static void execMain(WFMySQLTask *t)
User should not use this function. All task should be added to graph node in order to execute all tas...
cbMySqlDevice * getMySqlDevice(int32_t idx)
abstract virtual device. Provide MySql/Redis/Kafka warper. All virtual device will handle the connect...
void removeRedisDevice(int32_t idx)
void addKafkaDevice(cbKafkaDevice *vd)
void removeKafkaDevice(int32_t idx)
void reloadConnection(const std::string &_port, const std::string &_host, const std::string &_userName, const std::string &_passWord, const std::string &_charSet, const std::string &_dataBaseName)
std::vector< WFMySQLTask * > sequentialQuery(const std::vector< std::string > &q, const std::vector< mysql_callback > &callback_func)
WFRedisTask * set(const std::vector< std::string > ¶ms, const redis_callback &callback_func=nullptr, void *usrData=nullptr, int32_t retryTimes=3)
void addMySqlDevice(cbMySqlDevice *vd)
int32_t getIdx()
Get the Idx object.
static int32_t m_numsRedis
std::map< int32_t, std::pair< cbRedisDevice *, bool > > m_redisPool
! index, {pointer, visibility}
WFMySQLTask * query(const std::string &q, const mysql_callback &callback_func=nullptr)
static int32_t m_numsMySql