forked from Mirrors/privacore-open-source-search-engine
Merge branch 'master' into nomerge2
This commit is contained in:
@ -2294,7 +2294,7 @@ int64_t RdbBase::estimateListSize(const char *startKey, const char *endKey, char
|
||||
//int32_t n=getTree()->getListSize (startKey, endKey, &minKey2, &maxKey2);
|
||||
int64_t n;
|
||||
if(m_tree)
|
||||
n = m_tree->getListSize(m_collnum, startKey, endKey, NULL, NULL);
|
||||
n = m_tree->estimateListSize(m_collnum, startKey, endKey, NULL, NULL);
|
||||
else
|
||||
n = m_buckets->getListSize(m_collnum, startKey, endKey, NULL, NULL);
|
||||
|
||||
|
@ -1744,7 +1744,7 @@ bool RdbTree::getList ( collnum_t collnum ,
|
||||
// in [startKey, endKey] in this tree
|
||||
// . if the count is < 200 it returns an EXACT count
|
||||
// . right now it only works for dataless nodes (keys only)
|
||||
int32_t RdbTree::getListSize(collnum_t collnum, const char *startKey, const char *endKey, char *minKey, char *maxKey) const {
|
||||
int32_t RdbTree::estimateListSize(collnum_t collnum, const char *startKey, const char *endKey, char *minKey, char *maxKey) const {
|
||||
// make these as benign as possible
|
||||
//if ( minKey ) *minKey = endKey;
|
||||
//if ( maxKey ) *maxKey = startKey;
|
||||
|
@ -127,7 +127,7 @@ public:
|
||||
int32_t *numPosRecs, int32_t *numNegRecs, bool useHalfKeys) const;
|
||||
|
||||
// estimate the size of the list defined by these keys
|
||||
int32_t getListSize(collnum_t collnum, const char *startKey, const char *endKey, char *minKey, char *maxKey) const;
|
||||
int32_t estimateListSize(collnum_t collnum, const char *startKey, const char *endKey, char *minKey, char *maxKey) const;
|
||||
|
||||
// . delete all records in this list from the tree
|
||||
// . call deleteNode()
|
||||
|
@ -45,7 +45,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
RdbIndex index;
|
||||
if (starts_with(filename, "posdb")) {
|
||||
index.set(dir, filename, Posdb::getFixedDataSize(), Posdb::getUseHalfKeys(), Posdb::getKeySize(), RDB_POSDB);
|
||||
index.set(dir, filename, Posdb::getFixedDataSize(), Posdb::getUseHalfKeys(), Posdb::getKeySize(), RDB_POSDB, true);
|
||||
if (!index.readIndex()) {
|
||||
fprintf(stdout, "Unable to load index\n");
|
||||
return 1;
|
||||
|
@ -50,13 +50,13 @@ int main(int argc, char **argv) {
|
||||
|
||||
RdbIndex index;
|
||||
if (starts_with(filename, "posdb")) {
|
||||
index.set(dir, indexFilename, Posdb::getFixedDataSize(), Posdb::getUseHalfKeys(), Posdb::getKeySize(), RDB_POSDB);
|
||||
index.set(dir, indexFilename, Posdb::getFixedDataSize(), Posdb::getUseHalfKeys(), Posdb::getKeySize(), RDB_POSDB, true);
|
||||
if (!index.generateIndex(&bigFile)) {
|
||||
fprintf(stdout, "Unable to generate index for %s\n", filename);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!index.writeIndex()) {
|
||||
if (!index.writeIndex(true)) {
|
||||
fprintf(stdout, "Unable to save index for %s\n", filename);
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user