diff --git a/ddl/metadb.sql b/ddl/metadb.sql index 3c65839a..15898d3b 100644 --- a/ddl/metadb.sql +++ b/ddl/metadb.sql @@ -81,17 +81,27 @@ create table worker_has_partition worker_idworker INTEGER ); -create table operation_timebound +create table operation ( - idgraph INTEGER NOT NULL, - operation VARCHAR, - timebound INTEGER + idoperation INTEGER not null primary key, + operation VARCHAR +) + +create table graph_operation_time +( + idgraph INTEGER NOT NULL, + idoperation INTEGER NOT NULL, + time INTEGER ); -create index timebound_index - on operation_timebound (idgraph, operation); +create index graph_operation_time_index + on graph_operation_time (idgraph, idoperation); + +INSERT INTO graph_status (idgraph_status, description) +VALUES (1, 'LOADING'), + (2, 'OPERATIONAL'), + (3, 'DELETED'), + (4, 'NONOPERATIONAL'); -INSERT INTO graph_status (idgraph_status, description) VALUES (1, 'LOADING'); -INSERT INTO graph_status (idgraph_status, description) VALUES (2, 'OPERATIONAL'); -INSERT INTO graph_status (idgraph_status, description) VALUES (3, 'DELETED'); -INSERT INTO graph_status (idgraph_status, description) VALUES (4, 'NONOPERATIONAL'); \ No newline at end of file +INSERT INTO operation (idoperation, operation) +VALUES (1, 'trian'); \ No newline at end of file diff --git a/src/frontend/JasmineGraphFrontEnd.cpp b/src/frontend/JasmineGraphFrontEnd.cpp index 78c5d8f4..0c7d2b79 100644 --- a/src/frontend/JasmineGraphFrontEnd.cpp +++ b/src/frontend/JasmineGraphFrontEnd.cpp @@ -1400,7 +1400,7 @@ static void triangles_command(std::string masterIP, int connFd, SQLiteDBInterfac int threadPriority = std::atoi(priority.c_str()); - string timebound_query = "SELECT timebound FROM operation_timebound WHERE idgraph=" + graph_id + string timebound_query = "SELECT time FROM graph_operation_time NATURAL JOIN operation WHERE idgraph=" + graph_id + " AND operation='trian'"; vector>> result = sqlite->runSelect(timebound_query); @@ -1487,8 +1487,8 @@ static void triangles_command(std::string masterIP, int connFd, SQLiteDBInterfac if (result.empty()) { // TODO (Ishad-M-I-M): Insert the timebound with the overaheads added - string insert_timebound_query = "INSERT INTO operation_timebound VALUES (" + - graph_id + ", trian, " + to_string(msDuration)+ ")"; + string insert_timebound_query = "INSERT INTO graph_operation_time VALUES (" + + graph_id + ", 1, " + to_string(msDuration)+ ")"; sqlite->runInsert(insert_timebound_query); }