From a1ed8863647f20c45565dd39160295b0375cbd37 Mon Sep 17 00:00:00 2001 From: bookug Date: Mon, 19 Jun 2017 14:10:11 +0800 Subject: [PATCH] refactor(small): change default port of ghttp from 8080 to 9000 change default port; add infos of structure to kvstore; by zengli --- KVstore/KVstore.h | 11 ++++++++++- Main/ghttp.cpp | 12 ++++++------ NOTES.md | 25 +++++++++++++++++++++++++ Server/client_http.hpp | 2 +- 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/KVstore/KVstore.h b/KVstore/KVstore.h index c972eb0..f1754c5 100644 --- a/KVstore/KVstore.h +++ b/KVstore/KVstore.h @@ -18,12 +18,21 @@ //add a \0 in tail: only add 1 char //QUERY: but to count the length each time maybe very costly? //No, because triple num is stored in char* now!!!! we do not need to save it again -//TODO: entity_border in s2values list is not needed!!! not waste memory here // //QUERY: but to implement vlist, we need a unsigned flag //What is more, we need to store the string in disk, how can we store it if without the length? //unsigned type stored as chars, maybe will have '\0' //In memory, we do not know when the oidlist ends if without the original length (butthe triple num will answer this!) +// +//TODO: entity_border in s2values list is not needed!!! not waste memory here + +//STRUCT: +//1. s2xx +//Triple Num Pre Num Entity Num p1 offset1 p2 offset2 ... pn offsetn (olist-p1) (olist-p2) ... (olist-pn) +//2. o2xx +//Triple Num Pre Num p1 offset1 p2 offset2 ... pn offsetn (slist-p1) (slist-p2) ... (slist-pn) +//3. p2xx +//Triple Num (sid list) (oid list) (not sorted, matched with sid one by one) class KVstore { diff --git a/Main/ghttp.cpp b/Main/ghttp.cpp index 2ede060..777ab26 100644 --- a/Main/ghttp.cpp +++ b/Main/ghttp.cpp @@ -39,21 +39,21 @@ int connection_num = 0; //NOTICE: no need to close connection here due to the usage of shared_ptr //http://www.tuicool.com/articles/3Ub2y2 // -//TODO: the URL format is terrible, i.e. 127.0.0.1:8080/build/lubm/data/LUBM_10.n3 +//TODO: the URL format is terrible, i.e. 127.0.0.1:9000/build/lubm/data/LUBM_10.n3 //we should define some keys like operation, database, dataset, query, path ... -//127.0.0.1:8080?operation=build&database=lubm&dataset=data/LUBM_10.n3 +//127.0.0.1:9000?operation=build&database=lubm&dataset=data/LUBM_10.n3 // //TODO: control the authority, check it if requesting for build/load/unload //for sparql endpoint, just load database when starting, and comment out all functions except for query() int main() { Util util; - //HTTP-server at port 8080 using 1 thread + //HTTP-server at port 9000 using 1 thread //Unless you do more heavy non-threaded processing in the resources, //1 thread is usually faster than several threads HttpServer server; - server.config.port=8080; - //server.config.port=9000; + //server.config.port=8080; + server.config.port=9000; //cout<<"after server built"<content.rdbuf() << endl; diff --git a/NOTES.md b/NOTES.md index 156f5eb..fbd11b9 100644 --- a/NOTES.md +++ b/NOTES.md @@ -1,3 +1,28 @@ +git commit: http://www.cnblogs.com/ctaodream/p/6066694.html +() : +<空行> + +<空行> +