// concatenate strings
if (field.startsWith("s:")) {
String sSum = "";
while (values.hasNext())
sSum += ((UTF8) values.next()).toString() + ";";
output.collect(key, new UTF8(sSum));
reporter.setStatus("finished " + field + " ::host = " + hostName);
return;
}
// sum long values
if (field.startsWith("f:")) {
float fSum = 0;
while (values.hasNext())
fSum += Float.parseFloat(((UTF8) values.next()).toString());
output.collect(key, new UTF8(String.valueOf(fSum)));
reporter.setStatus("finished " + field + " ::host = " + hostName);
return;
}
// sum long values
if (field.startsWith("l:")) {
long lSum = 0;
while (values.hasNext()) {
lSum += Long.parseLong(((UTF8) values.next()).toString());
}
output.collect(key, new UTF8(String.valueOf(lSum)));
}
reporter.setStatus("finished " + field + " ::host = " + hostName);
}