Simplified dumpTagdb() in main.cpp

This commit is contained in:
Ivan Skytte Jørgensen
2016-11-03 12:30:15 +01:00
parent a00ff71117
commit 5b6c72c309

@ -91,8 +91,8 @@ static void dumpTitledb (const char *coll, int32_t sfn, int32_t numFiles, bool
static int32_t dumpSpiderdb ( const char *coll,int32_t sfn,int32_t numFiles,bool includeTree,
char printStats , int32_t firstIp );
static void dumpTagdb( const char *coll, int32_t sfn, int32_t numFiles, bool includeTree, char rec = 0,
int32_t rdbId = RDB_TAGDB, const char *site = NULL );
static void dumpTagdb(const char *coll, int32_t sfn, int32_t numFiles, bool includeTree, char req,
const char *site);
void dumpPosdb ( const char *coll,int32_t sfn,int32_t numFiles,bool includeTree,
int64_t termId , bool justVerify ) ;
@ -1630,19 +1630,19 @@ int main2 ( int argc , char *argv[] ) {
if ( cmdarg+6 < argc ) {
site = argv[ cmdarg + 6 ];
}
dumpTagdb( coll, startFileNum, numFiles, includeTree, 0, RDB_TAGDB, site );
dumpTagdb( coll, startFileNum, numFiles, includeTree, 0, site );
} else if ( argv[cmdarg+1][0] == 'z' ) {
char *site = NULL;
if ( cmdarg+6 < argc ) {
site = argv[ cmdarg + 6 ];
}
dumpTagdb( coll, startFileNum, numFiles, includeTree, 'z', RDB_TAGDB, site );
dumpTagdb( coll, startFileNum, numFiles, includeTree, 'z', site );
} else if ( argv[cmdarg+1][0] == 'A' ) {
dumpTagdb( coll, startFileNum, numFiles, includeTree, 'A' );
dumpTagdb( coll, startFileNum, numFiles, includeTree, 'A', NULL );
} else if ( argv[cmdarg+1][0] == 'G' ) {
dumpTagdb( coll, startFileNum, numFiles, includeTree, 'G' );
dumpTagdb( coll, startFileNum, numFiles, includeTree, 'G', NULL );
} else if ( argv[cmdarg+1][0] == 'W' ) {
dumpTagdb( coll, startFileNum, numFiles, includeTree );
dumpTagdb( coll, startFileNum, numFiles, includeTree, 0, NULL );
} else if ( argv[cmdarg+1][0] == 'l' )
dumpClusterdb (coll,startFileNum,numFiles,includeTree);
//else if ( argv[cmdarg+1][0] == 'z' )
@ -4122,13 +4122,11 @@ void startUp ( void *state ) {
}
}
void dumpTagdb( const char *coll, int32_t startFileNum, int32_t numFiles, bool includeTree, char req, int32_t rdbId,
const char *siteArg ) {
static void dumpTagdb(const char *coll, int32_t startFileNum, int32_t numFiles, bool includeTree, char req,
const char *siteArg) {
g_tagdb.init ();
if ( rdbId == RDB_TAGDB ) {
g_tagdb.getRdb()->addRdbBase1(coll );
}
g_tagdb.getRdb()->addRdbBase1(coll );
key128_t startKey ;
key128_t endKey ;
@ -4157,7 +4155,7 @@ void dumpTagdb( const char *coll, int32_t startFileNum, int32_t numFiles, bool i
loop:
// use msg5 to get the list, should ALWAYS block since no threads
if ( ! msg5.getList ( (rdbid_t)rdbId,
if ( ! msg5.getList ( RDB_TAGDB,
cr->m_collnum ,
&list ,
(char *)&startKey ,