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


Java Task.heartbeatNoDetails方法代码示例

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


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

示例1: nodeDataChanged

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入方法依赖的package包/类
@Override
public void nodeDataChanged(String path) {
  Task task;
  task = details.getTasks().get(path);
  if (task != null || ZKSplitLog.isRescanNode(watcher, path)) {
    if (task != null) {
      task.heartbeatNoDetails(EnvironmentEdgeManager.currentTime());
    }
    getDataSetWatch(path, zkretries);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:12,代码来源:ZKSplitLogManagerCoordination.java

示例2: resubmitTask

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入方法依赖的package包/类
@Override
public boolean resubmitTask(String path, Task task, ResubmitDirective directive) {
  // its ok if this thread misses the update to task.deleted. It will fail later
  if (task.status != IN_PROGRESS) {
    return false;
  }
  int version;
  if (directive != FORCE) {
    // We're going to resubmit:
    // 1) immediately if the worker server is now marked as dead
    // 2) after a configurable timeout if the server is not marked as dead but has still not
    // finished the task. This allows to continue if the worker cannot actually handle it,
    // for any reason.
    final long time = EnvironmentEdgeManager.currentTime() - task.last_update;
    final boolean alive =
        details.getMaster().getServerManager() != null ? details.getMaster().getServerManager()
            .isServerOnline(task.cur_worker_name) : true;
    if (alive && time < timeout) {
      LOG.trace("Skipping the resubmit of " + task.toString() + "  because the server "
          + task.cur_worker_name + " is not marked as dead, we waited for " + time
          + " while the timeout is " + timeout);
      return false;
    }

    if (task.unforcedResubmits.get() >= resubmitThreshold) {
      if (!task.resubmitThresholdReached) {
        task.resubmitThresholdReached = true;
        SplitLogCounters.tot_mgr_resubmit_threshold_reached.incrementAndGet();
        LOG.info("Skipping resubmissions of task " + path + " because threshold "
            + resubmitThreshold + " reached");
      }
      return false;
    }
    // race with heartbeat() that might be changing last_version
    version = task.last_version;
  } else {
    SplitLogCounters.tot_mgr_resubmit_force.incrementAndGet();
    version = -1;
  }
  LOG.info("resubmitting task " + path);
  task.incarnation.incrementAndGet();
  boolean result = resubmit(this.details.getServerName(), path, version);
  if (!result) {
    task.heartbeatNoDetails(EnvironmentEdgeManager.currentTime());
    return false;
  }
  // don't count forced resubmits
  if (directive != FORCE) {
    task.unforcedResubmits.incrementAndGet();
  }
  task.setUnassigned();
  rescan(Long.MAX_VALUE);
  SplitLogCounters.tot_mgr_resubmit.incrementAndGet();
  return true;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:56,代码来源:ZKSplitLogManagerCoordination.java

示例3: resubmitTask

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入方法依赖的package包/类
@Override
public boolean resubmitTask(String path, Task task, ResubmitDirective directive) {
  // its ok if this thread misses the update to task.deleted. It will fail later
  if (task.status != IN_PROGRESS) {
    return false;
  }
  int version;
  if (directive != FORCE) {
    // We're going to resubmit:
    // 1) immediately if the worker server is now marked as dead
    // 2) after a configurable timeout if the server is not marked as dead but has still not
    // finished the task. This allows to continue if the worker cannot actually handle it,
    // for any reason.
    final long time = EnvironmentEdgeManager.currentTime() - task.last_update;
    final boolean alive =
        details.getMaster().getServerManager() != null ? details.getMaster().getServerManager()
            .isServerOnline(task.cur_worker_name) : true;
    if (alive && time < timeout) {
      LOG.trace("Skipping the resubmit of " + task.toString() + "  because the server "
          + task.cur_worker_name + " is not marked as dead, we waited for " + time
          + " while the timeout is " + timeout);
      return false;
    }

    if (task.unforcedResubmits.get() >= resubmitThreshold) {
      if (!task.resubmitThresholdReached) {
        task.resubmitThresholdReached = true;
        SplitLogCounters.tot_mgr_resubmit_threshold_reached.incrementAndGet();
        LOG.info("Skipping resubmissions of task " + path + " because threshold "
            + resubmitThreshold + " reached");
      }
      return false;
    }
    // race with heartbeat() that might be changing last_version
    version = task.last_version;
  } else {
    SplitLogCounters.tot_mgr_resubmit_force.incrementAndGet();
    version = -1;
  }
  LOG.info("resubmitting task " + path);
  task.incarnation++;
  boolean result = resubmit(this.details.getServerName(), path, version);
  if (!result) {
    task.heartbeatNoDetails(EnvironmentEdgeManager.currentTime());
    return false;
  }
  // don't count forced resubmits
  if (directive != FORCE) {
    task.unforcedResubmits.incrementAndGet();
  }
  task.setUnassigned();
  rescan(Long.MAX_VALUE);
  SplitLogCounters.tot_mgr_resubmit.incrementAndGet();
  return true;
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:56,代码来源:ZKSplitLogManagerCoordination.java

示例4: resubmitTask

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入方法依赖的package包/类
@Override
public boolean resubmitTask(String path, Task task, ResubmitDirective directive) {
  // its ok if this thread misses the update to task.deleted. It will fail later
  if (task.status != IN_PROGRESS) {
    return false;
  }
  int version;
  if (directive != FORCE) {
    // We're going to resubmit:
    // 1) immediately if the worker server is now marked as dead
    // 2) after a configurable timeout if the server is not marked as dead but has still not
    // finished the task. This allows to continue if the worker cannot actually handle it,
    // for any reason.
    final long time = EnvironmentEdgeManager.currentTime() - task.last_update;
    final boolean alive =
        details.getMaster().getServerManager() != null ? details.getMaster().getServerManager()
            .isServerOnline(task.cur_worker_name) : true;
    if (alive && time < timeout) {
      LOG.trace("Skipping the resubmit of " + task.toString() + "  because the server "
          + task.cur_worker_name + " is not marked as dead, we waited for " + time
          + " while the timeout is " + timeout);
      return false;
    }

    if (task.unforcedResubmits.get() >= resubmitThreshold) {
      if (!task.resubmitThresholdReached) {
        task.resubmitThresholdReached = true;
        SplitLogCounters.tot_mgr_resubmit_threshold_reached.increment();
        LOG.info("Skipping resubmissions of task " + path + " because threshold "
            + resubmitThreshold + " reached");
      }
      return false;
    }
    // race with heartbeat() that might be changing last_version
    version = task.last_version;
  } else {
    SplitLogCounters.tot_mgr_resubmit_force.increment();
    version = -1;
  }
  LOG.info("Resubmitting task " + path);
  task.incarnation.incrementAndGet();
  boolean result = resubmit(path, version);
  if (!result) {
    task.heartbeatNoDetails(EnvironmentEdgeManager.currentTime());
    return false;
  }
  // don't count forced resubmits
  if (directive != FORCE) {
    task.unforcedResubmits.incrementAndGet();
  }
  task.setUnassigned();
  rescan(Long.MAX_VALUE);
  SplitLogCounters.tot_mgr_resubmit.increment();
  return true;
}
 
开发者ID:apache,项目名称:hbase,代码行数:56,代码来源:ZKSplitLogManagerCoordination.java


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