}
@Override
public void run() {
log.info("...start iterating over Entity data");
EntityDataIterator dataIterator = dataIterable.entityDataIterator();
while(dataIterator.hasNext()){
Long start = Long.valueOf(System.currentTimeMillis());
String id = dataIterator.next();
Representation rep = null;
Float score;
if(!scoreProvider.needsData()){
score = scoreProvider.process(id);
} else {
rep = dataIterator.getRepresentation();
score = scoreProvider.process(rep);
}
//normalise the score
if(normaliser != null){
score = normaliser.normalise(score);
}
if(indexAllEntitiesState || //all entities are indexed anyway
score == null || //no score available
score.compareTo(ScoreNormaliser.ZERO) >= 0){ //score >= 0
if(rep == null){
rep = dataIterator.getRepresentation();
}
produce(rep,score,start);
} // else ignore this entity
}
setFinished();