redis.publish();
方法在以下模块中执行了哪些操作。
redis.publish("WordCountTopology", exclamatedWord.toString() + "|" + Long.toString(count));
public void execute(Tuple tuple)
{
String word = tuple.getString(0);
StringBuilder exclamatedWord = new StringBuilder();
exclamatedWord.append(word).append("!!!");
_collector.emit(tuple, new Values(exclamatedWord.toString()));
long count = 30;
redis.publish("WordCountTopology", exclamatedWord.toString() + "|" + Long.toString(count));
}
答案 0 :(得分:6)
它将字符串(ExclamatedWord +“| 30”)发布到名为WordCountTopology
的Redis频道 - 该频道的订阅者将在redis.publish
执行后收到该消息。
有关Redis'Pub / Sub的详细信息,请参阅:http://redis.io/topics/pubsub