客户机代理代码的使用非常简单。
最好是代理代码中已经设置了断点。
It is a good idea to already have your break point set in the agent code.
接下来让我们看看服务器端代理代码。
代理代码很简单。
代理方法在每个分区上运行(在reduce代理代码中)。
Agent methods are run on each partition (in reduce agent code).
注意:此处的代理代码片段仅展示了ToggleStatus活动。
Note: the agent code fragment here only shows the ToggleStatus action.
再次对客户机执行聚合(也是在reduce代理代码中)。
Aggregation is performed back on the client again (also in reduce agent code).
在客户端代码中,您现在需要获得该客户端代理的实例。
In your client code, you now need to obtain an instance of the client proxy.
将之前复制的代码粘贴到这个新代理中。
我们将在本文后面部分讲述此代理的代码。
示例代码实现一个单独的代理。
该代理的代码如下所示。
增值代理逻辑通常是编写的代码。
Value-added agent logic is typically the code that we write.
清单1显示了来自样例应用程序任务代理的相关源代码。
The relevant source code from the sample application task agent is shown in Listing 1.
清单1显示了来自样例应用程序任务代理的相关源代码。
The relevant source code from the sample application task agent is shown in Listing 1.
应用推荐