Skip to content

Instantly share code, notes, and snippets.

@forcemax
Created July 21, 2015 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forcemax/653032f56072f0000289 to your computer and use it in GitHub Desktop.
Save forcemax/653032f56072f0000289 to your computer and use it in GitHub Desktop.
public void execute(Tuple input) {
Object obj = input.getValueByField("rankings");
try {
Rankings ranking = (Rankings) obj;
LOGGER.debug("input ranking : {}", ranking);
int count = 1;
for(Rankable rank : ranking.getRankings()) {
LOGGER.info("RANK : {}, HashTag : {}, Count : {}", count++, rank.getObject(), rank.getCount());
}
} catch (Exception e) {
LOGGER.error("Exception occurred. {}", e);
}
collector.ack(input);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment