float linkScore = 0;
String url = null;
while (iter.hasNext()) {
TupleEntry entry = iter.next();
boolean isCrawlDatum = entry.getString(CRAWLDBDATUM_URL_FIELD) != null;
boolean isStatus = entry.getString(STATUSDATUM_URL_FIELD) != null;
boolean isAnalyzed = entry.getString(ANALYZEDDATUM_URL_FIELD) != null;
if (isCrawlDatum) {
Tuple crawlDbTuple = TupleEntry.select(CrawlDbDatum.FIELDS, entry);
crawlDbDatum = new CrawlDbDatum(crawlDbTuple);
url = crawlDbDatum.getUrl();
}
if (isStatus) {
statusDatum = new StatusDatum(entry);
url = statusDatum.getUrl();
}
if (isAnalyzed) {
Tuple analyzedTuple = TupleEntry.select(AnalyzedDatum.FIELDS, entry);
analyzedDatum = new AnalyzedDatum(analyzedTuple);
url = analyzedDatum.getUrl();
}
// we could have either status + link or just link tuple entry
if (entry.getString(new Fields(LinkDatum.URL_FN)) != null) {
LinkDatum linkDatum = new LinkDatum(TupleEntry.select(LinkDatum.FIELDS, entry));
pageScore = linkDatum.getPageScore();
// Add up the link scores
linkScore += linkDatum.getLinkScore();