fix bug in DEBUG macros;
change int type to unsigned type but Query/* may not be fully changed
This commit is contained in:
parent
1b939b3a51
commit
8e74a29f07
|
@ -289,7 +289,7 @@ Database::writeIDinfo()
|
|||
}
|
||||
|
||||
//ID alloc garbage error(LITERAL_FIRST_ID or double) add base for literal
|
||||
int
|
||||
TYPE_ENTITY_LITERAL_ID
|
||||
Database::allocEntityID()
|
||||
{
|
||||
//int t;
|
||||
|
@ -301,7 +301,8 @@ Database::allocEntityID()
|
|||
if (this->limitID_entity >= Util::LITERAL_FIRST_ID)
|
||||
{
|
||||
cout << "fail to alloc id for entity" << endl;
|
||||
return -1;
|
||||
//return -1;
|
||||
return INVALID;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -332,7 +333,7 @@ Database::freeEntityID(TYPE_ENTITY_LITERAL_ID _id)
|
|||
this->entity_num--;
|
||||
}
|
||||
|
||||
int
|
||||
TYPE_ENTITY_LITERAL_ID
|
||||
Database::allocLiteralID()
|
||||
{
|
||||
//int t;
|
||||
|
@ -344,7 +345,8 @@ Database::allocLiteralID()
|
|||
if (this->limitID_literal >= Util::LITERAL_FIRST_ID)
|
||||
{
|
||||
cout << "fail to alloc id for literal" << endl;
|
||||
return -1;
|
||||
//return -1;
|
||||
return INVALID;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -377,7 +379,7 @@ Database::freeLiteralID(TYPE_ENTITY_LITERAL_ID _id)
|
|||
this->literal_num--;
|
||||
}
|
||||
|
||||
int
|
||||
TYPE_PREDICATE_ID
|
||||
Database::allocPredicateID()
|
||||
{
|
||||
//int t;
|
||||
|
@ -389,6 +391,7 @@ Database::allocPredicateID()
|
|||
if (this->limitID_predicate >= Util::LITERAL_FIRST_ID)
|
||||
{
|
||||
cout << "fail to alloc id for predicate" << endl;
|
||||
//WARN:if pid is changed to unsigned type, this must be changed
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -1361,6 +1364,7 @@ Database::sub2id_pre2id_obj2id_RDFintoSignature(const string _rdf_file, TYPE_ENT
|
|||
cout << "finish initial sub2id_pre2id_obj2id" << endl;
|
||||
|
||||
//BETTER?:close the stdio buffer sync??
|
||||
|
||||
ifstream _fin(_rdf_file.c_str());
|
||||
if (!_fin)
|
||||
{
|
||||
|
@ -1420,8 +1424,9 @@ Database::sub2id_pre2id_obj2id_RDFintoSignature(const string _rdf_file, TYPE_ENT
|
|||
//Process the Triple one by one
|
||||
for (int i = 0; i < parse_triple_num; i++)
|
||||
{
|
||||
//TODO+BETTER: assume that no duplicate triples in RDF for building
|
||||
//should judge first??
|
||||
//BETTER: assume that no duplicate triples in RDF for building
|
||||
//should judge first? using exist_triple()
|
||||
//or sub triples_num in build_subID2values(judge if two neighbor triples are same)
|
||||
this->triples_num++;
|
||||
|
||||
//if the _id_tuples exceeds, double the space
|
||||
|
|
|
@ -1815,6 +1815,8 @@ Join::preFilter(int _var)
|
|||
continue;
|
||||
}
|
||||
|
||||
//TODO+BETTER: is any pre really used? do we need to losen the restrictions?
|
||||
|
||||
//size:m<n; time:mlgn < n-m
|
||||
//The former time is computed because the m should be small if we select this p, tending to use binary-search
|
||||
//when doing intersectList operation(mlgn < m+n).
|
||||
|
|
|
@ -7,9 +7,9 @@ int
|
|||
main(int argc, char * argv[])
|
||||
{
|
||||
//chdir(dirname(argv[0]));
|
||||
#ifdef DEBUG
|
||||
//#ifdef DEBUG
|
||||
Util util;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
cout << "argc: " << argc << "\t";
|
||||
cout << "DB_store:" << argv[1] << "\t";
|
||||
|
|
|
@ -17,9 +17,9 @@ int
|
|||
main(int argc, char * argv[])
|
||||
{
|
||||
//chdir(dirname(argv[0]));
|
||||
#ifdef DEBUG
|
||||
//#ifdef DEBUG
|
||||
Util util;
|
||||
#endif
|
||||
//#endif
|
||||
if(argc < 3) //./gbuild
|
||||
{
|
||||
//output help info here
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
int main(int argc, char * argv[])
|
||||
{
|
||||
//chdir(dirname(argv[0]));
|
||||
#ifdef DEBUG
|
||||
//#ifdef DEBUG
|
||||
Util util;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
std::string ip = Socket::DEFAULT_SERVER_IP;
|
||||
unsigned short port = Socket::DEFAULT_CONNECT_PORT;
|
||||
|
@ -38,4 +38,4 @@ int main(int argc, char * argv[])
|
|||
client.run();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,9 +122,9 @@ main(int argc, char **argv)
|
|||
//NOTICE:this is needed to ensure the file path is the work path
|
||||
//chdir(dirname(argv[0]));
|
||||
//NOTICE:this is needed to set several debug files
|
||||
#ifdef DEBUG
|
||||
//#ifdef DEBUG
|
||||
Util util;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
db_home = Util::global_config["db_home"];
|
||||
|
||||
|
|
|
@ -38,9 +38,9 @@ int
|
|||
main(int argc, char * argv[])
|
||||
{
|
||||
//chdir(dirname(argv[0]));
|
||||
#ifdef DEBUG
|
||||
//#ifdef DEBUG
|
||||
Util util;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
if (argc == 1 || strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0)
|
||||
{
|
||||
|
|
|
@ -22,9 +22,9 @@ bool stopServer();
|
|||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
#ifdef DEBUG
|
||||
//#ifdef DEBUG
|
||||
Util util;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
string mode;
|
||||
if (argc == 1) {
|
||||
|
|
|
@ -12,9 +12,9 @@ int
|
|||
main(int argc, char * argv[])
|
||||
{
|
||||
//chdir(dirname(argv[0]));
|
||||
#ifdef DEBUG
|
||||
//#ifdef DEBUG
|
||||
Util util;
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
cout << "argc: " << argc << "\t";
|
||||
cout << "DB_store:" << argv[1] << "\t";
|
||||
|
|
|
@ -2552,7 +2552,7 @@ void GeneralEvaluation::releaseResultStack()
|
|||
delete results_id;
|
||||
}
|
||||
|
||||
void GeneralEvaluation::prepareUpdateTriple(QueryTree::GroupPattern &update_pattern, TripleWithObjType *&update_triple, int &update_triple_num)
|
||||
void GeneralEvaluation::prepareUpdateTriple(QueryTree::GroupPattern &update_pattern, TripleWithObjType *&update_triple, unsigned &update_triple_num)
|
||||
{
|
||||
update_pattern.getVarset();
|
||||
|
||||
|
@ -2613,3 +2613,4 @@ void GeneralEvaluation::prepareUpdateTriple(QueryTree::GroupPattern &update_patt
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -239,7 +239,7 @@ class GeneralEvaluation
|
|||
void getFinalResult(ResultSet &result_str);
|
||||
void releaseResultStack();
|
||||
|
||||
void prepareUpdateTriple(QueryTree::GroupPattern &update_pattern, TripleWithObjType *&update_triple, int &update_triple_num);
|
||||
void prepareUpdateTriple(QueryTree::GroupPattern &update_pattern, TripleWithObjType *&update_triple, unsigned &update_triple_num);
|
||||
};
|
||||
|
||||
#endif // _QUERY_GENERALEVALUATION_H
|
||||
|
|
|
@ -87,7 +87,7 @@ in the sparql query can point to the same node in data graph)
|
|||
//#define DEBUG_STREAM
|
||||
//#define DEBUG_PRECISE 1 all information
|
||||
//#define DEBUG_KVSTORE 1 //in KVstore
|
||||
#define DEBUG_VSTREE 1 //in Database
|
||||
//#define DEBUG_VSTREE 1 //in Database
|
||||
//#define DEBUG_LRUCACHE 1
|
||||
//#define DEBUG_DATABASE 1 //in Database
|
||||
//
|
||||
|
@ -280,6 +280,9 @@ public:
|
|||
Util();
|
||||
~Util();
|
||||
static std::string profile;
|
||||
//NOTICE: this function must be called out of any Database to config the basic settings
|
||||
//You can call it by Util util in the first of your main program
|
||||
//Another way is to build a GstoreApplication program, and do this configure in the initialization of the application
|
||||
static bool configure(); //read init.conf and set the parameters for this system
|
||||
static bool config_setting();
|
||||
static bool config_advanced();
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,5 @@
|
|||
INSERT DATA
|
||||
{
|
||||
<http://www.founder/102> <http://www.founder.20.link:52> <http://www.founder/106> .
|
||||
<http://www.founder/102> <http://www.founder> <http://www.founder/73> .
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
DELETE DATA { <http://www.founder/102> <http://www.founder.20.link:52> <http://www.founder/106> . }
|
|
@ -0,0 +1 @@
|
|||
select ?subject ?predict ?object WHERE { ?subject <http://www.founder.20.link:52> ?object; ?predict ?object . }
|
|
@ -0,0 +1 @@
|
|||
DELETE WHERE { <http://www.founder/101> ?predict ?object . }
|
|
@ -0,0 +1 @@
|
|||
select ?predict where {<http://www.founder/102> ?predict <http://www.founder/73> .}
|
|
@ -0,0 +1,5 @@
|
|||
select ?subject ?predict ?object where
|
||||
{
|
||||
<http://www.founder/102> <http://www.founder.20.link:52> ?object.
|
||||
?subject ?predict ?object.
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
select ?subject ?predict ?object where {?subject <http://www.founder.20.link:52> <http://www.founder/106>; ?predict ?object . }
|
|
@ -0,0 +1 @@
|
|||
DELETE WHERE { ?subject <http://www.founder.20.link:52> ?objcet. }
|
|
@ -0,0 +1 @@
|
|||
select ?a WHERE { <a> <http://www.founder.20.link:52> <b> . }
|
|
@ -0,0 +1 @@
|
|||
select ?s where { <http://www.founder/100> <http://www.founder.20.attr:dmID> "22". }
|
|
@ -0,0 +1 @@
|
|||
select ?a WHERE { <a> <http://www.founder.20.link:52> <b> . }
|
|
@ -1,4 +0,0 @@
|
|||
select ?p where
|
||||
{
|
||||
<s0> ?p <o0> .
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
select ?s ?o where
|
||||
{
|
||||
?s <p0> ?o .
|
||||
?s <p1> ?o .
|
||||
}
|
Loading…
Reference in New Issue