|
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.
16 #ifndef __SERVER_CB_COMPUTE_GRAPH_HPP_
17 #define __SERVER_CB_COMPUTE_GRAPH_HPP_
25 #if defined(__unix__) && defined(__clang__)
29 #include <workflow/WFGraphTask.h>
30 #include <workflow/WFFacilities.h>
31 #include <workflow/WFTaskFactory.h>
230 static WFMySQLTask*
asSQLTask(
void* metaTask);
231 static WFGoTask*
asGoTask(
void* metaTask);
271 void addQuery(const std::
string& q);
298 WFRedisTask* _generateSetTask(const std::vector<std::
string>& params,
300 void* usrData =
nullptr, int32_t retryTimes = 3);
303 void setRedisDevice(
trivial::cbRedisDevice* device =
nullptr);
331 void overload(sol::function& funcPtr);
365 bool isSingleOutput();
447 cbOperatorNode* createCombineNode(
const std::vector<std::string>& keys,
const std::string& name);
456 cbOperatorNode* createFilterNode(
const sol::function& boolF,
const sol::function& exF);
485 WFGraphTask* generateGraphTask(
const graph_callback& func =
nullptr);
500 void execScriptFile(
const std::string& filePath);
507 void execScript(
const std::string& script);
528 std::vector<cbNode*> getNodes();
544 #endif //!__SERVER_CB_COMPUTE_GRAPH_HPP_
static WFMySQLTask * asSQLTask(void *metaTask)
nodeType
The node of compute graphs has 3 types: Leaf: the input, mostly the Sql device Output: the virtual ta...
std::vector< cbMySQLField * > m_fields
std::function< void(WFRedisTask *)> redis_callback
A operator node. Generate all go task. Then pass the output to the next node's inputs.
A copy move from workflow MySQLResult.h and .inl file.
std::function< void(WFGraphTask *)> graph_callback
_WIN32
cbOutputTableStruct * getOutStruct()
Get the Out Struct object.
virtual void * generateTask()=0
trivial::cbMySqlDevice * getDevice()
Get the Device object.
cbOutputTableStruct * m_outStruct
cbGraphSharedMem()=default
Construct a new cb Graph Shared Mem object.
This node include virtual device infomation and perform the final operation of how to get the data fr...
luaJitThread & get()
get the lua state.
friend cbVirtualDeviceNode
int32_t getCellNum()
Get the Cell Num object.
The input and output of one Operator.
~cbVirtualDeviceNode() override final
void addQuery(const std::string &q)
Add a String type sql sentence to this node. Waiting to be execute.
void setOutStruct(const cbShape< 2 > &shape, cbMySQLField **info)
Set the Out Struct object.
std::vector< std::string > m_queries
cbGraphSharedLuaStack operator=(const cbGraphSharedLuaStack &)=delete
operator of const = is deleted
std::vector< cbMySQLCell * > m_dataPool
cbVirtualSharedTable is a container of shared memory.
virtual ~cbNode()
Destroy the cb Node object Virtual function.
The operator of compute graph.
void execScript(const std::string &script)
execute the hard coded script.
abstract virtual device. Provide MySql/Redis/Kafka warper. All virtual device will handle the connect...
void push(cbVirtualSharedTable *v)
Push a virtual shared table to mem of graph.
void execScriptFile(const std::string &filePath)
execute the script file from disk directly.
~cbGraphSharedMem()
Destroy the cb Graph Shared Mem object.
void setMySQLDevice(trivial::cbMySqlDevice *device=nullptr)
trivial::cbMySqlDevice * m_device
void PointTo(cbNode *ptr)
cbGraphSharedLuaStack()=default
Construct a new cb Graph Shared Lua Stack object.
void * generateTask() override final
generate a SQL wf task for now.
static WFGoTask * asGoTask(void *metaTask)
cbNode(const nodeType &nt)
The shared memory of compute graph. Include 2 basic components.
std::vector< cbNode * > m_nodes
cbGraphSharedMem operator=(cbGraphSharedMem &rhs)=delete
operator of = is deleted
size_t getMemUsed()
Get the Mem Used object.
std::vector< cbVirtualSharedTable * > m_dataFromDevice
friend cbRedisCachingNode
A lua engine for execute all c++ embedding in struct. A warper of lua JIT engine.