Skip to content

Commit

Permalink
updated testrt, made commit_step a command line parameter
Browse files Browse the repository at this point in the history
git-svn-id: http://sphinxsearch.googlecode.com/svn/trunk@3192 8b96e2b9-35c5-2c16-bc47-5122d61876d4
  • Loading branch information
shodan committed Apr 18, 2012
1 parent c96891c commit 71747f3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/testrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#pragma message("Automatically linking with psapi.lib")
#endif

const int COMMIT_STEP = 1;
int COMMIT_STEP = 1;
float g_fTotalMB = 0.0f;

void SetupIndexing ( CSphSource_MySQL * pSrc, const CSphSourceParams_MySQL & tParams )
Expand Down Expand Up @@ -81,12 +81,14 @@ void DoIndexing ( CSphSource * pSrc, ISphRtIndex * pIndex )
{
if ( !pSrc->IterateDocument ( sError ) )
sphDie ( "iterate-document failed: %s", sError.cstr() );
ISphHits * pHitsNext = pSrc->IterateHits ( sError );
if ( !sError.IsEmpty() )
sphDie ( "iterate-hits failed: %s", sError.cstr() );

if ( pSrc->m_tDocInfo.m_iDocID )
{
ISphHits * pHitsNext = pSrc->IterateHits ( sError );
if ( !sError.IsEmpty() )
sphDie ( "iterate-hits failed: %s", sError.cstr() );
pIndex->AddDocument ( pHitsNext, pSrc->m_tDocInfo, NULL, dMvas, sError );
}

if ( ( pSrc->GetStats().m_iTotalDocuments % COMMIT_STEP )==0 || !pSrc->m_tDocInfo.m_iDocID )
{
Expand Down Expand Up @@ -170,8 +172,11 @@ void IndexingThread ( void * pArg )
}


int main ()
int main ( int argc, char ** argv )
{
if ( argc==2 )
COMMIT_STEP = atoi ( argv[1] );

// threads should be initialized before memory allocations
char cTopOfMainStack;
sphThreadInit();
Expand Down

0 comments on commit 71747f3

Please sign in to comment.