public void runQueries ( final List < Query > queries ) throws Exception { final long start_time = System . currentTimeMillis ( ) / 1000 ; // TODO - threadify it. We *could* have hundreds of queries and we don't // want to create that many threads. For now we'll just execute each one // serially final Thread reporter = new ProgressReporter ( ) ; reporter . start ( ) ; for ( final Query query : queries ) { final List < Scanner > scanners = Internal . getScanners ( query ) ; final List < Thread > threads = new ArrayList < Thread > ( scanners . size ( ) ) ; int i = 0 ; for ( final Scanner scanner : scanners ) { final FsckWorker worker = new FsckWorker ( scanner , i ++ , this . options ) ; worker . setName ( "Fsck #" + i ) ; worker . start ( ) ; threads . add ( worker ) ; } for ( final Thread thread : threads ) { thread . join ( ) ; LOG . info ( "Thread [" + thread + "] Finished" ) ; } } reporter . interrupt ( ) ; logResults ( ) ; final long duration = ( System . currentTimeMillis ( ) / 1000 ) - start_time ; LOG . info ( "Completed fsck in [" + duration + "] seconds" ) ; }
Scans the rows matching one or more standard queries . An aggregator is still required though it s ignored .