hadoop map reduce线程中整个reducer步骤是否安全?
Is the entire reducer step in hadoop map reduce thread safe?
如果我在 reducer class 中有成员变量,并且让 reduce 函数改变成员变量,我是否必须格外小心以使其成为线程安全的?
If I have member variable in the reducer class, and have the reduce function mutate the member variable, do I have to take extra caution to make it thread safe?
不,您不必特别小心 - 成员变量将在当前 Reducer
内发生变化,但会与同一减速器的任何其他实例隔离 class .
如果我在 reducer class 中有成员变量,并且让 reduce 函数改变成员变量,我是否必须格外小心以使其成为线程安全的?
If I have member variable in the reducer class, and have the reduce function mutate the member variable, do I have to take extra caution to make it thread safe?
不,您不必特别小心 - 成员变量将在当前 Reducer
内发生变化,但会与同一减速器的任何其他实例隔离 class .