Processamento de Dados Massivos/Projeto e implementação de aplicações Big Data/Processamento de streams de tweets: diferenças entre revisões
[edição não verificada] | [edição não verificada] |
Conteúdo apagado Conteúdo adicionado
Linha 116:
====Bolt Interface====
<syntaxhighlight lang="java">void prepare()</syntaxhighlight>This funcion is called before any tuple is transmited to a certain bolt.▼
▲This funcion is called before any tuple is transmited to a certain bolt.
<syntaxhighlight lang="java">int execute(Tuple tuple, BasicOutputCollector collector)</syntaxhighlight>
This funcion is called when a new tuple gets to the bolt. It should call other funcions important to processing. And it is done call collector.emit(Values) to send another tuple to the next bolt
<syntaxhighlight lang="java">void fail(Object id);
void ack(Object id);</syntaxhighlight>
Bolts may also add ack to be sure that a tuple was delivered to the next bolt.
<syntaxhighlight lang="java">void declareOutputFields(OutputFieldsDeclarer declarer)</syntaxhighlight>
Declare the Output Filed on the outgoing tuple.
<syntaxhighlight lang="java">Map<String, Object> getComponentConfiguration()</syntaxhighlight>
Get the
====
<syntaxhighlight lang="java">void open()</syntaxhighlight>
Communication process is completely abstracted from the developer. We only need to minimize the comsuption of this resourse since, as I said previously, Storm does not manage it well.▼
Execute before the first tuple is sent. It can be used, for instance, to establish connections to Twitter's sample API
<syntaxhighlight lang="java">void nextTuple() </syntaxhighlight>
Iterates over each tuple generated. Emiting it using emit function.
<syntaxhighlight lang="java">void close() </syntaxhighlight>
It is called when nextTuple() returns. Used for finishing connections
<syntaxhighlight lang="java">Map<String, Object> getComponentConfiguration()</syntaxhighlight>
Get the configuration of the spout set by the conf class.
<syntaxhighlight lang="java">void fail(Object id)
void ack(Object id)</syntaxhighlight>
Dealing with communication fails.
<syntaxhighlight lang="java">void declareOutputFields(OutputFieldsDeclarer declarer) </syntaxhighlight>
Declare the Output Filed on the outgoing tuple.
====Communication====
▲Communication process is completely abstracted from the developer. We only need to minimize the
====Python Bolts====
==Avaliation==
===Load on Bolts===
For simple Twitter jobs, Storm managed to distribute jobs quite good
===Nimbus Logs===
==Conclusion==
|