Remove niceness arg from RdbList::constrain

This commit is contained in:
Ai Lin Chia
2016-08-01 18:18:15 +02:00
parent 4e4e3371e6
commit af676bfc60
5 changed files with 9 additions and 39 deletions

@ -178,13 +178,7 @@ bool Msg2::getLists ( ) {
18); //keysize
char ek2_copy[18];
memcpy(ek2_copy, ek2, sizeof(ek2_copy)); //RdbList::constrain() modifies endkey, so give it a copy
m_lists[m_i].constrain(sk2, //startKey
ek2_copy, //endKey
-1, //minRecSizes
0, //hintOffset
NULL, //hintKey
"", //filename
0); //niceness
m_lists[m_i].constrain(sk2, ek2_copy, -1, 0, NULL, "highfrequencyterm");
continue;
}

@ -1024,21 +1024,10 @@ bool Msg3::doneScanning ( ) {
QUICKPOLL(m_niceness);
// if from our 'page' cache, no need to constrain
if ( ! m_lists[i].constrain ( m_startKey ,
m_constrainKey , // m_endKey
mrs , // m_minRecSizes
m_hintOffsets[i] ,
//m_hintKeys [i] ,
&m_hintKeys [i*m_ks] ,
filename,//ff->getFilename() ,
m_niceness ) ) {
log("net: Had error while constraining list read from "
"%s: %s/%s. vfd=%" PRId32" parts=%" PRId32". "
"This is likely caused by corrupted "
"data on disk.",
mstrerror(g_errno), ff->getDir(),
ff->getFilename(), ff->getVfd(),
(int32_t)ff->m_numParts );
if (!m_lists[i].constrain(m_startKey, m_constrainKey, mrs, m_hintOffsets[i], &m_hintKeys[i * m_ks], filename)) {
log(LOG_WARN, "net: Had error while constraining list read from %s: %s/%s. vfd=%" PRId32" parts=%" PRId32". "
"This is likely caused by corrupted data on disk.",
mstrerror(g_errno), ff->getDir(), ff->getFilename(), ff->getVfd(), (int32_t)ff->m_numParts );
continue;
}
}

@ -721,13 +721,7 @@ bool Msg5::gotList2 ( ) {
if ( n > 0 ) {
char k[MAX_KEY_BYTES];
m_treeList.getCurrentKey(k);
m_treeList.constrain ( m_startKey ,
m_minEndKey ,
-1 , // min rec sizes
0 , // hint offset
k,
"tree" ,
m_niceness );
m_treeList.constrain(m_startKey, m_minEndKey, -1, 0, k, "tree");
}
m_listPtrs [ n++ ] = &m_treeList;
}

@ -1227,7 +1227,7 @@ int RdbList::printList ( int32_t logtype ) {
// . mincRecSizes is really only important when we read just 1 list
// . it's a really good idea to keep it as -1 otherwise
bool RdbList::constrain(const char *startKey, char *endKey, int32_t minRecSizes,
int32_t hintOffset, const char *hintKey, const char *filename, int32_t niceness) {
int32_t hintOffset, const char *hintKey, const char *filename) {
// return false if we don't own the data
if ( ! m_ownData ) {
g_errno = EBADLIST;
@ -1285,7 +1285,6 @@ bool RdbList::constrain(const char *startKey, char *endKey, int32_t minRecSizes,
char k[MAX_KEY_BYTES];
//while ( p < m_listEnd && getKey(p) < startKey ) {
while ( p < m_listEnd ) {
QUICKPOLL(niceness);
getKey(p,k);
#ifdef GBSANITYCHECK
// check key order!
@ -1423,7 +1422,6 @@ bool RdbList::constrain(const char *startKey, char *endKey, int32_t minRecSizes,
// advance until endKey or minRecSizes kicks us out
//while ( p < m_listEnd && getKey(p) <= endKey && p < maxPtr ) {
while ( p < m_listEnd ) {
QUICKPOLL(niceness);
getKey(p,k);
if ( KEYCMP(k,endKey,m_ks)>0 ) break;
if ( p >= maxPtr ) break;

@ -185,13 +185,8 @@ class RdbList {
// . only called by Msg3.cpp for 1 list reads to avoid memmov()'ing
// and malloc()'ing
// . may change m_list and/or m_listSize
bool constrain ( const char *startKey ,
char *endKey ,
int32_t minRecSizes ,
int32_t hintOffset ,
const char *hintKey ,
const char *filename ,
int32_t niceness ) ;
bool constrain(const char *startKey, char *endKey, int32_t minRecSizes,
int32_t hintOffset, const char *hintKey, const char *filename);
// . this MUST be called before calling merge_r()
// . will alloc enough space for m_listSize + sizes of "lists"