Revert "emergency fix so ppl can download large # objects in json"

This reverts commit c692b54bfd.
This commit is contained in:
Matt Wells 2014-12-08 07:36:31 -08:00
parent c692b54bfd
commit aaa5b34126
2 changed files with 6 additions and 10 deletions

View File

@ -72,10 +72,9 @@ bool TopTree::setNumNodes ( int32_t docsWanted , bool doSiteClustering ) {
//m_lastKickedOutDocId = -1LL;
// how many nodes to we need to accomodate "docsWanted" docids?
// we boost it up here for domain/host counting for site clustering.
m_ridiculousMax = (int64_t)docsWanted * 2;
m_ridiculousMax = docsWanted * 2;
if ( m_ridiculousMax < 50 ) m_ridiculousMax = 50;
int64_t numNodes = m_ridiculousMax * 256;
int32_t numNodes = m_ridiculousMax * 256;
// i would say limit it to 100,000 nodes regarless
if ( numNodes > MAXDOCIDSTOCOMPUTE ) numNodes = MAXDOCIDSTOCOMPUTE;
// craziness overflow?
@ -83,9 +82,6 @@ bool TopTree::setNumNodes ( int32_t docsWanted , bool doSiteClustering ) {
// amp it up last minute, after we set numNodes, if we need to
if ( ! m_doSiteClustering ) m_ridiculousMax = 0x7fffffff;
// if not doing siteclustering... don't use 5gb of ram!
if ( ! m_doSiteClustering ) numNodes = m_docsWanted;
// how many docids do we have, not FULLY counting docids from
// "dominating" domains? aka the "variety count"
m_vcount = 0.0;
@ -116,8 +112,8 @@ bool TopTree::setNumNodes ( int32_t docsWanted , bool doSiteClustering ) {
//if ( useSampleVectors ) vecSize = SAMPLE_VECTOR_SIZE ;
char *nn ;
int64_t oldsize = (m_numNodes+1) * ( sizeof(TopNode) );
int64_t newsize = ( numNodes+1) * ( sizeof(TopNode) );
int32_t oldsize = (m_numNodes+1) * ( sizeof(TopNode) );
int32_t newsize = ( numNodes+1) * ( sizeof(TopNode) );
// if they ask for to many, this can go negative
if ( newsize < 0 ) {
g_errno = ENOMEM;
@ -133,7 +129,7 @@ bool TopTree::setNumNodes ( int32_t docsWanted , bool doSiteClustering ) {
nn=(char *)mrealloc(m_nodes,oldsize,newsize,"TopTree");
updated = true;
}
if ( ! nn ) return log("query: Can not allocate %"INT64" bytes for "
if ( ! nn ) return log("query: Can not allocate %"INT32" bytes for "
"holding resulting docids.", newsize);
// save this for freeing
m_allocSize = newsize;

View File

@ -130,7 +130,7 @@ class TopTree {
bool m_doSiteClustering;
bool m_useIntScores;
int32_t m_docsWanted;
int64_t m_ridiculousMax;
int32_t m_ridiculousMax;
char m_kickedOutDocIds;
//int64_t m_lastKickedOutDocId;
int32_t m_domCount[256];