Add Vlist's cache

Add functions to load Vlist's cache
This commit is contained in:
ZongyueQin 2017-07-15 10:53:25 +08:00 committed by GitHub
parent 35e61483df
commit 5080c46ebd
1 changed files with 30 additions and 0 deletions

View File

@ -2499,6 +2499,36 @@ KVstore::isEntity(TYPE_ENTITY_LITERAL_ID id)
return id < Util::LITERAL_FIRST_ID;
}
void
KVstore::AddIntoSubCache(TYPE_ENTITY_LITERAL_ID _entity_id)
{
this->subID2values->AddIntoCache(_entity_id);
}
void
KVstore::AddIntoObjCache(TYPE_ENTITY_LITERAL_ID _entity_literal_id)
{
this->objID2values->AddIntoCache(_entity_literal_id);
}
unsigned
KVstore::getSubListSize(TYPE_ENTITY_LITERAL_ID _sub_id)
{
unsigned* _tmp = NULL;
unsigned _ret;
this->getValueByKey(this->subID2values, _sub_id, (char*&) _tmp, _ret);
return _ret;
}
unsigned
KVstore::getObjListSize(TYPE_ENTITY_LITERAL_ID _obj_id)
{
unsigned* _tmp = NULL;
unsigned _ret;
this->getValueByKey(this->objID2values, _obj_id, (char*&) _tmp, _ret);
return _ret;
}
//TODO+BETTER: adjust the buffer size according to current memory usage(global memory manager)
//better to adjust these parameters according to memory usage and entity num
//need a memory manager first