refactor: add comments

This commit is contained in:
bookug 2017-05-18 22:08:06 +08:00
parent 405bb21a9a
commit 3f2375dd85
3 changed files with 6 additions and 1 deletions

View File

@ -2462,7 +2462,7 @@ KVstore::binarySearch(unsigned _key, const unsigned* _list, unsigned _list_len,
long long _mid; long long _mid;
while (_left <= _right) { while (_left <= _right) {
_mid = (_right - _left) / 2 + _left; _mid = (_right - _left) / 2 + _left;
cout<<"check "<<_step<<" "<<_mid<<" "<<_step*_mid<<" "<<_list_len<<endl; //cout<<"check "<<_step<<" "<<_mid<<" "<<_step*_mid<<" "<<_list_len<<endl;
if (_key == _list[_step * _mid]) { if (_key == _list[_step * _mid]) {
return _mid; return _mid;
} }

View File

@ -619,6 +619,8 @@ http://www.hprd.org/download/
## GIT USAGE ## GIT USAGE
http://www.ruanyifeng.com/blog/2014/06/git_remote.html
https://git-scm.com/book/zh/v1/%E8%B5%B7%E6%AD%A5-%E5%88%9D%E6%AC%A1%E8%BF%90%E8%A1%8C-Git-%E5%89%8D%E7%9A%84%E9%85%8D%E7%BD%AE https://git-scm.com/book/zh/v1/%E8%B5%B7%E6%AD%A5-%E5%88%9D%E6%AC%A1%E8%BF%90%E8%A1%8C-Git-%E5%89%8D%E7%9A%84%E9%85%8D%E7%BD%AE
#### how to commit a message #### how to commit a message

View File

@ -35,6 +35,9 @@ class VList
{ {
public: public:
//NOTICE:the border is 10^6, but the block is larger, 1M //NOTICE:the border is 10^6, but the block is larger, 1M
//this is not choosed intuitively, we make sure that using vlist is better: transferring time>random seek time(x/40M>0.006)
//Also notice that if no modification on data, read a node is almost sequentially in normal IVTree
//In VList, case is the same and using VList may bring another seek cost!(it is not easy to setup cache for IVTree due to data struct)
static const unsigned LENGTH_BORDER = 1000000; static const unsigned LENGTH_BORDER = 1000000;
//static const unsigned LENGTH_BORDER = 100; //static const unsigned LENGTH_BORDER = 100;
static const unsigned BLOCK_SIZE = 1 << 20; //fixed size of disk-block static const unsigned BLOCK_SIZE = 1 << 20; //fixed size of disk-block