committing change for index time count
This commit is contained in:
parent
b7357571dc
commit
9b36435061
1 changed files with 7 additions and 18 deletions
|
@ -288,8 +288,6 @@ public class IndexBuilder extends Thread {
|
||||||
*/
|
*/
|
||||||
private void indexForSource(Iterator<Individual> individuals , boolean newDocs) throws AbortIndexing{
|
private void indexForSource(Iterator<Individual> individuals , boolean newDocs) throws AbortIndexing{
|
||||||
|
|
||||||
|
|
||||||
// long starttime = System.currentTimeMillis();
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int numOfThreads = 10;
|
int numOfThreads = 10;
|
||||||
|
|
||||||
|
@ -297,6 +295,8 @@ public class IndexBuilder extends Thread {
|
||||||
List<IndexWorkerThread> workers = new ArrayList<IndexWorkerThread>();
|
List<IndexWorkerThread> workers = new ArrayList<IndexWorkerThread>();
|
||||||
boolean distributing = true;
|
boolean distributing = true;
|
||||||
|
|
||||||
|
IndexWorkerThread.setStartTime(System.currentTimeMillis());
|
||||||
|
|
||||||
for(int i = 0; i< numOfThreads ;i++){
|
for(int i = 0; i< numOfThreads ;i++){
|
||||||
workers.add(new IndexWorkerThread(indexer,i,distributing)); // made a pool of workers
|
workers.add(new IndexWorkerThread(indexer,i,distributing)); // made a pool of workers
|
||||||
}
|
}
|
||||||
|
@ -318,8 +318,6 @@ public class IndexBuilder extends Thread {
|
||||||
try{
|
try{
|
||||||
ind = individuals.next();
|
ind = individuals.next();
|
||||||
|
|
||||||
//indexer.index(ind);
|
|
||||||
|
|
||||||
workers.get(count%numOfThreads).addToQueue(ind); // adding individual to worker queue.
|
workers.get(count%numOfThreads).addToQueue(ind); // adding individual to worker queue.
|
||||||
|
|
||||||
}catch(Throwable ex){
|
}catch(Throwable ex){
|
||||||
|
@ -330,13 +328,6 @@ public class IndexBuilder extends Thread {
|
||||||
log.warn("Error indexing individual " + uri + " " + ex.getMessage());
|
log.warn("Error indexing individual " + uri + " " + ex.getMessage());
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
/* if( log.isDebugEnabled() ){
|
|
||||||
if( (count % 100 ) == 0 && count > 0 ){
|
|
||||||
long dt = (System.currentTimeMillis() - starttime);
|
|
||||||
log.debug("individuals indexed: " + count + " in " + dt + " msec " +
|
|
||||||
" time pre individual = " + (dt / count) + " msec" );
|
|
||||||
}
|
|
||||||
} */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i =0 ; i < numOfThreads; i ++){
|
for(int i =0 ; i < numOfThreads; i ++){
|
||||||
|
@ -350,10 +341,8 @@ public class IndexBuilder extends Thread {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* log.info(
|
IndexWorkerThread.resetCount();
|
||||||
"individuals indexed: " + count + " in " + (System.currentTimeMillis() - starttime) + " msec" +
|
|
||||||
(count!=0?(" time per individual = " + (System.currentTimeMillis() - starttime)/ count + " msec"):"")
|
|
||||||
);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue