-
-
Save yuikns/dc050a202b6f005610ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std::string kVertexPrefix = "V:"; | |
const std::string kEdgePrefix = "E:"; | |
const std::string kIndexVertexPrefix = "IV:"; | |
const std::string kIndexEdgePrefix = "IE:"; | |
const std::string kPropGlue = "$"; | |
const std::string kInGlue = "IN:"; | |
const std::string kOutGlue = "OUT:"; | |
const std::string kPropVertexPrefix = kPropGlue + kVertexPrefix; | |
const std::string kPropEdgePrefix = kPropGlue + kEdgePrefix; | |
const std::string kIndexVertexInPrefix = kInGlue + kIndexVertexPrefix; // from to ... | |
const std::string kIndexVertexOutPrefix = kOutGlue + kIndexVertexPrefix; | |
std::set<string> Edge::drop_set() { | |
std::set<std::string> rm_keys; | |
rm_keys.insert(kEdgePrefix + ft_id); | |
rm_keys.insert(kIndexVertexOutPrefix + from_id ); // source out | |
rm_keys.insert(kIndexVertexInPrefix + to_id ); // dest in | |
std::map<std::string,std::string> pro_map; | |
ldb_map_scan(db, kPropEdgePrefix + ft_id , & pro_map); | |
for(std::map<std::string,std::string>::const_iterator it= pro_map.begin(); | |
it!=pro_map.end(); | |
it++ ) { | |
rm_keys.insert(kPropEdgePrefix + ft_id + it->first); | |
rm_keys.insert( kIndexEdgePrefix + it->second + kPropGlue + ft_id ); | |
} | |
for(std::set<std::string>::const_iterator it = rm_keys.begin(); | |
it != rm_keys.end(); | |
it++ ) { | |
printf("Edge::drop_set %s\n",it->c_str()); | |
} | |
return rm_keys; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment