我已经为MapReduce算法实现编写了伪代码
这里事件1。成功2。失败
问题陈述: 1)查找事件明智的交易计数 2)查找银行交易计数
Pseudo Code:
Map(key, value)
record[] = split(value, "/t")
Event = record[5]
Bank = ""
Transaction_status = ""
if(Event == 1)
Transaction_status = "Success"
Bank = record[3]
else
Transaction_status = "failed"
Bank = record[3]
write(Transaction_status, 1)
write(Bank, 1)
End map function
我的问题在这里,我可以在映射器函数中使用多个 Write 语句吗?
如果不是,什么是正确的方法?