当前位置: 首页>>代码示例>>Java>>正文


Java RPCCall.send_nack方法代码示例

本文整理汇总了Java中water.RPC.RPCCall.send_nack方法的典型用法代码示例。如果您正苦于以下问题:Java RPCCall.send_nack方法的具体用法?Java RPCCall.send_nack怎么用?Java RPCCall.send_nack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在water.RPC.RPCCall的用法示例。


在下文中一共展示了RPCCall.send_nack方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import water.RPC.RPCCall; //导入方法依赖的package包/类
@Override public void run() {
  Thread.currentThread().setPriority(Thread.MAX_PRIORITY-1);
  while( true ) {
    RPC.RPCCall r;
    long currenTime = System.currentTimeMillis();
    for(H2ONode h2o:H2O.CLOUD._memary) {
      if(h2o != H2O.SELF) {
        for(RPCCall rpc:h2o._work.values()) {
          if((rpc._started + rpc._retry) < currenTime) {
            // RPC from somebody who dropped out of cloud?
            if( (!H2O.CLOUD.contains(rpc._client) && !rpc._client._heartbeat._client) ||
              // Timedout client?
              (rpc._client._heartbeat._client && rpc._retry >= HeartBeatThread.CLIENT_TIMEOUT) ) {
              rpc._client.remove_task_tracking(rpc._tsknum);
            } else  {
              if (rpc._computed) {
                if (rpc._computedAndReplied) {
                  DTask dt = rpc._dt;
                  if(dt != null) {
                    if (++rpc._ackResendCnt % 5 == 0)
                      Log.warn("Got " + rpc._ackResendCnt + " resends on ack for task # " + rpc._tsknum + ", class = " + dt.getClass().getSimpleName());
                    rpc.resend_ack();
                  }
                }
              } else if(rpc._nackResendCnt == 0) { // else send nack
                ++rpc._nackResendCnt;
                rpc.send_nack();
              }
            }
          }
        }
      }
    }
    long timeElapsed = System.currentTimeMillis()-currenTime;
    if(timeElapsed < 1000)
      try {Thread.sleep(1000-timeElapsed);} catch (InterruptedException e) {}
  }
}
 
开发者ID:kyoren,项目名称:https-github.com-h2oai-h2o-3,代码行数:39,代码来源:H2ONode.java

示例2: run

import water.RPC.RPCCall; //导入方法依赖的package包/类
@Override public void run() {
  Thread.currentThread().setPriority(Thread.MAX_PRIORITY-1);
  while( true ) {
    long currenTime = System.currentTimeMillis();
    for(H2ONode h2o:H2O.CLOUD._memary) {
      if(h2o != H2O.SELF) {
        for(RPCCall rpc:h2o._work.values()) {
          if((rpc._started + rpc._retry) < currenTime) {
            // RPC from somebody who dropped out of cloud?
            if( (!H2O.CLOUD.contains(rpc._client) && !rpc._client._heartbeat._client) ||
              // Timedout client?
              (rpc._client._heartbeat._client && rpc._retry >= HeartBeatThread.CLIENT_TIMEOUT) ) {
              rpc._client.remove_task_tracking(rpc._tsknum);
            } else  {
              if (rpc._computed) {
                if (rpc._computedAndReplied) {
                  DTask dt = rpc._dt;
                  if(dt != null) {
                    if (++rpc._ackResendCnt % 5 == 0)
                      Log.warn("Got " + rpc._ackResendCnt + " resends on ack for task # " + rpc._tsknum + ", class = " + dt.getClass().getSimpleName());
                    rpc.resend_ack();
                  }
                }
              } else if(rpc._nackResendCnt == 0) { // else send nack
                ++rpc._nackResendCnt;
                rpc.send_nack();
              }
            }
          }
        }
      }
    }
    long timeElapsed = System.currentTimeMillis()-currenTime;
    if(timeElapsed < 1000)
      try {Thread.sleep(1000-timeElapsed);} catch (InterruptedException e) {/*comment to stop ideaj warning*/}
  }
}
 
开发者ID:h2oai,项目名称:h2o-3,代码行数:38,代码来源:H2ONode.java


注:本文中的water.RPC.RPCCall.send_nack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。