protected bool SendResult(object result) {
object old_res = Interlocked.CompareExchange(ref _result, result, State.DEFAULT_OBJ);
if( old_res == State.DEFAULT_OBJ ) {
if (LogEnabled) {
ProtocolLog.Write(ProtocolLog.MapReduce,
String.Format("MapReduce: {0}, sending back result: {1}.", _node.Address, result));
}
_rpc.SendResult(_mr_request_state, result);
return true;
}
else {
return false;
}
}
}