Skip to content

Instantly share code, notes, and snippets.

@UsamaAshraf
Created May 14, 2018 11:46
Show Gist options
  • Select an option

  • Save UsamaAshraf/fda4deed9b82f6c9fd2ea80802c20a68 to your computer and use it in GitHub Desktop.

Select an option

Save UsamaAshraf/fda4deed9b82f6c9fd2ea80802c20a68 to your computer and use it in GitHub Desktop.
public class MultiplyByTenBolt extends BaseRichBolt 
{
  OutputCollector collector;
public void execute(Tuple tuple) 
  {
  // Get 'even-digit' from the tuple.
  int evenDigit = tuple.getInt(0);
collector.emit(new Values(evenDigit * 10));
  }
public void declareOutputFields(OutputFieldsDeclarer declarer) 
  {
declarer.declare(new Fields("even-digit-multiplied-by-ten"));
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment