• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Task类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Task类属于org.apache.hadoop.hbase.master.SplitLogManager包,在下文中一共展示了Task类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: deleteNodeSuccess

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
private void deleteNodeSuccess(String path) {
  if (ignoreZKDeleteForTesting) {
    return;
  }
  Task task;
  task = details.getTasks().remove(path);
  if (task == null) {
    if (ZKSplitLog.isRescanNode(watcher, path)) {
      SplitLogCounters.tot_mgr_rescan_deleted.incrementAndGet();
    }
    SplitLogCounters.tot_mgr_missing_state_in_delete.incrementAndGet();
    LOG.debug("deleted task without in memory state " + path);
    return;
  }
  synchronized (task) {
    task.status = DELETED;
    task.notify();
  }
  SplitLogCounters.tot_mgr_task_deleted.incrementAndGet();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:21,代码来源:ZKSplitLogManagerCoordination.java


示例2: heartbeat

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
private void heartbeat(String path, int new_version, ServerName workerName) {
  Task task = findOrCreateOrphanTask(path);
  if (new_version != task.last_version) {
    if (task.isUnassigned()) {
      LOG.info("task " + path + " acquired by " + workerName);
    }
    task.heartbeat(EnvironmentEdgeManager.currentTime(), new_version, workerName);
    SplitLogCounters.tot_mgr_heartbeat.incrementAndGet();
  } else {
    // duplicate heartbeats - heartbeats w/o zk node version
    // changing - are possible. The timeout thread does
    // getDataSetWatch() just to check whether a node still
    // exists or not
  }
  return;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:ZKSplitLogManagerCoordination.java


示例3: testOrphanTaskAcquisition

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
@Test (timeout=180000)
public void testOrphanTaskAcquisition() throws Exception {
  LOG.info("TestOrphanTaskAcquisition");

  String tasknode = ZKSplitLog.getEncodedNodeName(zkw, "orphan/test/slash");
  SplitLogTask slt = new SplitLogTask.Owned(DUMMY_MASTER, this.mode);
  zkw.getRecoverableZooKeeper().create(tasknode, slt.toByteArray(), Ids.OPEN_ACL_UNSAFE,
      CreateMode.PERSISTENT);

  slm = new SplitLogManager(ds, conf, stopper, master, DUMMY_MASTER);
  waitForCounter(tot_mgr_orphan_task_acquired, 0, 1, to/2);
  Task task = slm.findOrCreateOrphanTask(tasknode);
  assertTrue(task.isOrphan());
  waitForCounter(tot_mgr_heartbeat, 0, 1, to/2);
  assertFalse(task.isUnassigned());
  long curt = System.currentTimeMillis();
  assertTrue((task.last_update <= curt) &&
      (task.last_update > (curt - 1000)));
  LOG.info("waiting for manager to resubmit the orphan task");
  waitForCounter(tot_mgr_resubmit, 0, 1, to + to/2);
  assertTrue(task.isUnassigned());
  waitForCounter(tot_mgr_rescan, 0, 1, to + to/2);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:24,代码来源:TestSplitLogManager.java


示例4: testOrphanTaskAcquisition

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
@Test
public void testOrphanTaskAcquisition() throws Exception {
  LOG.info("TestOrphanTaskAcquisition");

  String tasknode = ZKSplitLog.getEncodedNodeName(zkw, "orphan/test/slash");
  zkw.getRecoverableZooKeeper().create(tasknode,
      TaskState.TASK_OWNED.get("dummy-worker"), Ids.OPEN_ACL_UNSAFE,
      CreateMode.PERSISTENT);

  slm = new SplitLogManager(zkw, conf, stopper, master, "dummy-master", null);
  slm.finishInitialization();
  waitForCounter(tot_mgr_orphan_task_acquired, 0, 1, to/2);
  Task task = slm.findOrCreateOrphanTask(tasknode);
  assertTrue(task.isOrphan());
  waitForCounter(tot_mgr_heartbeat, 0, 1, to/2);
  assertFalse(task.isUnassigned());
  long curt = System.currentTimeMillis();
  assertTrue((task.last_update <= curt) &&
      (task.last_update > (curt - 1000)));
  LOG.info("waiting for manager to resubmit the orphan task");
  waitForCounter(tot_mgr_resubmit, 0, 1, to + to/2);
  assertTrue(task.isUnassigned());
  waitForCounter(tot_mgr_rescan, 0, 1, to + to/2);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:25,代码来源:TestSplitLogManager.java


示例5: testOrphanTaskAcquisition

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
@Test
public void testOrphanTaskAcquisition() throws Exception {
  LOG.info("TestOrphanTaskAcquisition");

  String tasknode = ZKSplitLog.getEncodedNodeName(zkw, "orphan/test/slash");
  SplitLogTask slt = new SplitLogTask.Owned(DUMMY_MASTER);
  zkw.getRecoverableZooKeeper().create(tasknode, slt.toByteArray(), Ids.OPEN_ACL_UNSAFE,
      CreateMode.PERSISTENT);

  slm = new SplitLogManager(zkw, conf, stopper, master, DUMMY_MASTER);
  waitForCounter(tot_mgr_orphan_task_acquired, 0, 1, to/2);
  Task task = slm.findOrCreateOrphanTask(tasknode);
  assertTrue(task.isOrphan());
  waitForCounter(tot_mgr_heartbeat, 0, 1, to/2);
  assertFalse(task.isUnassigned());
  long curt = System.currentTimeMillis();
  assertTrue((task.last_update <= curt) &&
      (task.last_update > (curt - 1000)));
  LOG.info("waiting for manager to resubmit the orphan task");
  waitForCounter(tot_mgr_resubmit, 0, 1, to + to/2);
  assertTrue(task.isUnassigned());
  waitForCounter(tot_mgr_rescan, 0, 1, to + to/2);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:24,代码来源:TestSplitLogManager.java


示例6: deleteNodeSuccess

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
private void deleteNodeSuccess(String path) {
  if (ignoreZKDeleteForTesting) {
    return;
  }
  Task task;
  task = details.getTasks().remove(path);
  if (task == null) {
    if (ZKSplitLog.isRescanNode(watcher, path)) {
      SplitLogCounters.tot_mgr_rescan_deleted.increment();
    }
    SplitLogCounters.tot_mgr_missing_state_in_delete.increment();
    LOG.debug("Deleted task without in memory state " + path);
    return;
  }
  synchronized (task) {
    task.status = DELETED;
    task.notify();
  }
  SplitLogCounters.tot_mgr_task_deleted.increment();
}
 
开发者ID:apache,项目名称:hbase,代码行数:21,代码来源:ZKSplitLogManagerCoordination.java


示例7: heartbeat

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
private void heartbeat(String path, int new_version, ServerName workerName) {
  Task task = findOrCreateOrphanTask(path);
  if (new_version != task.last_version) {
    if (task.isUnassigned()) {
      LOG.info("Task " + path + " acquired by " + workerName);
    }
    task.heartbeat(EnvironmentEdgeManager.currentTime(), new_version, workerName);
    SplitLogCounters.tot_mgr_heartbeat.increment();
  } else {
    // duplicate heartbeats - heartbeats w/o zk node version
    // changing - are possible. The timeout thread does
    // getDataSetWatch() just to check whether a node still
    // exists or not
  }
  return;
}
 
开发者ID:apache,项目名称:hbase,代码行数:17,代码来源:ZKSplitLogManagerCoordination.java


示例8: testOrphanTaskAcquisition

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
@Test (timeout=180000)
public void testOrphanTaskAcquisition() throws Exception {
  LOG.info("TestOrphanTaskAcquisition");

  String tasknode = ZKSplitLog.getEncodedNodeName(zkw, "orphan/test/slash");
  SplitLogTask slt = new SplitLogTask.Owned(master.getServerName());
  zkw.getRecoverableZooKeeper().create(tasknode, slt.toByteArray(), Ids.OPEN_ACL_UNSAFE,
      CreateMode.PERSISTENT);

  slm = new SplitLogManager(master, conf);
  waitForCounter(tot_mgr_orphan_task_acquired, 0, 1, to/2);
  Task task = findOrCreateOrphanTask(tasknode);
  assertTrue(task.isOrphan());
  waitForCounter(tot_mgr_heartbeat, 0, 1, to/2);
  assertFalse(task.isUnassigned());
  long curt = System.currentTimeMillis();
  assertTrue((task.last_update <= curt) &&
      (task.last_update > (curt - 1000)));
  LOG.info("waiting for manager to resubmit the orphan task");
  waitForCounter(tot_mgr_resubmit, 0, 1, to + to/2);
  assertTrue(task.isUnassigned());
  waitForCounter(tot_mgr_rescan, 0, 1, to + to/2);
}
 
开发者ID:apache,项目名称:hbase,代码行数:24,代码来源:TestSplitLogManager.java


示例9: testOrphanTaskAcquisition

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
@Test
public void testOrphanTaskAcquisition() throws Exception {
  LOG.info("TestOrphanTaskAcquisition");

  String tasknode = ZKSplitLog.getEncodedNodeName(zkw, "orphan/test/slash");
  SplitLogTask slt = new SplitLogTask.Owned(DUMMY_MASTER);
  zkw.getRecoverableZooKeeper().create(tasknode, slt.toByteArray(), Ids.OPEN_ACL_UNSAFE,
      CreateMode.PERSISTENT);

  slm = new SplitLogManager(zkw, conf, stopper, master, DUMMY_MASTER, null);
  slm.finishInitialization();
  waitForCounter(tot_mgr_orphan_task_acquired, 0, 1, to/2);
  Task task = slm.findOrCreateOrphanTask(tasknode);
  assertTrue(task.isOrphan());
  waitForCounter(tot_mgr_heartbeat, 0, 1, to/2);
  assertFalse(task.isUnassigned());
  long curt = System.currentTimeMillis();
  assertTrue((task.last_update <= curt) &&
      (task.last_update > (curt - 1000)));
  LOG.info("waiting for manager to resubmit the orphan task");
  waitForCounter(tot_mgr_resubmit, 0, 1, to + to/2);
  assertTrue(task.isUnassigned());
  waitForCounter(tot_mgr_rescan, 0, 1, to + to/2);
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:25,代码来源:TestSplitLogManager.java


示例10: SplitLogManagerDetails

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
public SplitLogManagerDetails(ConcurrentMap<String, Task> tasks, MasterServices master,
    Set<String> failedDeletions, ServerName serverName) {
  this.tasks = tasks;
  this.master = master;
  this.failedDeletions = failedDeletions;
  this.serverName = serverName;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:8,代码来源:SplitLogManagerCoordination.java


示例11: handleUnassignedTask

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
/**
 * It is possible for a task to stay in UNASSIGNED state indefinitely - say SplitLogManager wants
 * to resubmit a task. It forces the task to UNASSIGNED state but it dies before it could create
 * the RESCAN task node to signal the SplitLogWorkers to pick up the task. To prevent this
 * scenario the SplitLogManager resubmits all orphan and UNASSIGNED tasks at startup.
 * @param path
 */
private void handleUnassignedTask(String path) {
  if (ZKSplitLog.isRescanNode(watcher, path)) {
    return;
  }
  Task task = findOrCreateOrphanTask(path);
  if (task.isOrphan() && (task.incarnation.get() == 0)) {
    LOG.info("resubmitting unassigned orphan task " + path);
    // ignore failure to resubmit. The timeout-monitor will handle it later
    // albeit in a more crude fashion
    resubmitTask(path, task, FORCE);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:20,代码来源:ZKSplitLogManagerCoordination.java


示例12: setDone

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
private void setDone(String path, TerminationStatus status) {
  Task task = details.getTasks().get(path);
  if (task == null) {
    if (!ZKSplitLog.isRescanNode(watcher, path)) {
      SplitLogCounters.tot_mgr_unacquired_orphan_done.incrementAndGet();
      LOG.debug("unacquired orphan task is done " + path);
    }
  } else {
    synchronized (task) {
      if (task.status == IN_PROGRESS) {
        if (status == SUCCESS) {
          SplitLogCounters.tot_mgr_log_split_success.incrementAndGet();
          LOG.info("Done splitting " + path);
        } else {
          SplitLogCounters.tot_mgr_log_split_err.incrementAndGet();
          LOG.warn("Error splitting " + path);
        }
        task.status = status;
        if (task.batch != null) {
          synchronized (task.batch) {
            if (status == SUCCESS) {
              task.batch.done++;
            } else {
              task.batch.error++;
            }
            task.batch.notify();
          }
        }
      }
    }
  }
  // delete the task node in zk. It's an async
  // call and no one is blocked waiting for this node to be deleted. All
  // task names are unique (log.<timestamp>) there is no risk of deleting
  // a future task.
  // if a deletion fails, TimeoutMonitor will retry the same deletion later
  deleteNode(path, zkretries);
  return;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:40,代码来源:ZKSplitLogManagerCoordination.java


示例13: findOrCreateOrphanTask

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
Task findOrCreateOrphanTask(String path) {
  Task orphanTask = new Task();
  Task task;
  task = details.getTasks().putIfAbsent(path, orphanTask);
  if (task == null) {
    LOG.info("creating orphan task " + path);
    SplitLogCounters.tot_mgr_orphan_task_acquired.incrementAndGet();
    task = orphanTask;
  }
  return task;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:12,代码来源:ZKSplitLogManagerCoordination.java


示例14: 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


示例15: testUnassignedOrphan

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
@Test (timeout=180000)
public void testUnassignedOrphan() throws Exception {
  LOG.info("TestUnassignedOrphan - an unassigned task is resubmitted at" +
      " startup");
  String tasknode = ZKSplitLog.getEncodedNodeName(zkw, "orphan/test/slash");
  //create an unassigned orphan task
  SplitLogTask slt = new SplitLogTask.Unassigned(DUMMY_MASTER, this.mode);
  zkw.getRecoverableZooKeeper().create(tasknode, slt.toByteArray(), Ids.OPEN_ACL_UNSAFE,
      CreateMode.PERSISTENT);
  int version = ZKUtil.checkExists(zkw, tasknode);

  slm = new SplitLogManager(ds, conf, stopper, master, DUMMY_MASTER);
  waitForCounter(tot_mgr_orphan_task_acquired, 0, 1, to/2);
  Task task = slm.findOrCreateOrphanTask(tasknode);
  assertTrue(task.isOrphan());
  assertTrue(task.isUnassigned());
  // wait for RESCAN node to be created
  waitForCounter(tot_mgr_rescan, 0, 1, to/2);
  Task task2 = slm.findOrCreateOrphanTask(tasknode);
  assertTrue(task == task2);
  LOG.debug("task = " + task);
  assertEquals(1L, tot_mgr_resubmit.get());
  assertEquals(1, task.incarnation.get());
  assertEquals(0, task.unforcedResubmits.get());
  assertTrue(task.isOrphan());
  assertTrue(task.isUnassigned());
  assertTrue(ZKUtil.checkExists(zkw, tasknode) > version);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:29,代码来源:TestSplitLogManager.java


示例16: testUnassignedOrphan

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
@Test
public void testUnassignedOrphan() throws Exception {
  LOG.info("TestUnassignedOrphan - an unassigned task is resubmitted at" +
      " startup");
  String tasknode = ZKSplitLog.getEncodedNodeName(zkw, "orphan/test/slash");
  //create an unassigned orphan task
  zkw.getRecoverableZooKeeper().create(tasknode,
      TaskState.TASK_UNASSIGNED.get("dummy-worker"), Ids.OPEN_ACL_UNSAFE,
      CreateMode.PERSISTENT);
  int version = ZKUtil.checkExists(zkw, tasknode);

  slm = new SplitLogManager(zkw, conf, stopper, master, "dummy-master", null);
  slm.finishInitialization();
  waitForCounter(tot_mgr_orphan_task_acquired, 0, 1, to/2);
  Task task = slm.findOrCreateOrphanTask(tasknode);
  assertTrue(task.isOrphan());
  assertTrue(task.isUnassigned());
  // wait for RESCAN node to be created
  waitForCounter(tot_mgr_rescan, 0, 1, to/2);
  Task task2 = slm.findOrCreateOrphanTask(tasknode);
  assertTrue(task == task2);
  LOG.debug("task = " + task);
  assertEquals(1L, tot_mgr_resubmit.get());
  assertEquals(1, task.incarnation);
  assertEquals(0, task.unforcedResubmits);
  assertTrue(task.isOrphan());
  assertTrue(task.isUnassigned());
  assertTrue(ZKUtil.checkExists(zkw, tasknode) > version);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:30,代码来源:TestSplitLogManager.java


示例17: handleUnassignedTask

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
/**
 * It is possible for a task to stay in UNASSIGNED state indefinitely - say SplitLogManager wants
 * to resubmit a task. It forces the task to UNASSIGNED state but it dies before it could create
 * the RESCAN task node to signal the SplitLogWorkers to pick up the task. To prevent this
 * scenario the SplitLogManager resubmits all orphan and UNASSIGNED tasks at startup.
 * @param path
 */
private void handleUnassignedTask(String path) {
  if (ZKSplitLog.isRescanNode(watcher, path)) {
    return;
  }
  Task task = findOrCreateOrphanTask(path);
  if (task.isOrphan() && (task.incarnation == 0)) {
    LOG.info("resubmitting unassigned orphan task " + path);
    // ignore failure to resubmit. The timeout-monitor will handle it later
    // albeit in a more crude fashion
    resubmitTask(path, task, FORCE);
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:20,代码来源:ZKSplitLogManagerCoordination.java


示例18: testUnassignedOrphan

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
@Test (timeout=180000)
public void testUnassignedOrphan() throws Exception {
  LOG.info("TestUnassignedOrphan - an unassigned task is resubmitted at" +
      " startup");
  String tasknode = ZKSplitLog.getEncodedNodeName(zkw, "orphan/test/slash");
  //create an unassigned orphan task
  SplitLogTask slt = new SplitLogTask.Unassigned(DUMMY_MASTER, this.mode);
  zkw.getRecoverableZooKeeper().create(tasknode, slt.toByteArray(), Ids.OPEN_ACL_UNSAFE,
      CreateMode.PERSISTENT);
  int version = ZKUtil.checkExists(zkw, tasknode);

  slm = new SplitLogManager(ds, conf, stopper, master, DUMMY_MASTER);
  waitForCounter(tot_mgr_orphan_task_acquired, 0, 1, to/2);
  Task task = slm.findOrCreateOrphanTask(tasknode);
  assertTrue(task.isOrphan());
  assertTrue(task.isUnassigned());
  // wait for RESCAN node to be created
  waitForCounter(tot_mgr_rescan, 0, 1, to/2);
  Task task2 = slm.findOrCreateOrphanTask(tasknode);
  assertTrue(task == task2);
  LOG.debug("task = " + task);
  assertEquals(1L, tot_mgr_resubmit.get());
  assertEquals(1, task.incarnation);
  assertEquals(0, task.unforcedResubmits.get());
  assertTrue(task.isOrphan());
  assertTrue(task.isUnassigned());
  assertTrue(ZKUtil.checkExists(zkw, tasknode) > version);
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:29,代码来源:TestSplitLogManager.java


示例19: testUnassignedOrphan

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
@Test
public void testUnassignedOrphan() throws Exception {
  LOG.info("TestUnassignedOrphan - an unassigned task is resubmitted at" +
      " startup");
  String tasknode = ZKSplitLog.getEncodedNodeName(zkw, "orphan/test/slash");
  //create an unassigned orphan task
  SplitLogTask slt = new SplitLogTask.Unassigned(DUMMY_MASTER);
  zkw.getRecoverableZooKeeper().create(tasknode, slt.toByteArray(), Ids.OPEN_ACL_UNSAFE,
      CreateMode.PERSISTENT);
  int version = ZKUtil.checkExists(zkw, tasknode);

  slm = new SplitLogManager(zkw, conf, stopper, master, DUMMY_MASTER);
  waitForCounter(tot_mgr_orphan_task_acquired, 0, 1, to/2);
  Task task = slm.findOrCreateOrphanTask(tasknode);
  assertTrue(task.isOrphan());
  assertTrue(task.isUnassigned());
  // wait for RESCAN node to be created
  waitForCounter(tot_mgr_rescan, 0, 1, to/2);
  Task task2 = slm.findOrCreateOrphanTask(tasknode);
  assertTrue(task == task2);
  LOG.debug("task = " + task);
  assertEquals(1L, tot_mgr_resubmit.get());
  assertEquals(1, task.incarnation);
  assertEquals(0, task.unforcedResubmits.get());
  assertTrue(task.isOrphan());
  assertTrue(task.isUnassigned());
  assertTrue(ZKUtil.checkExists(zkw, tasknode) > version);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:29,代码来源:TestSplitLogManager.java


示例20: handleUnassignedTask

import org.apache.hadoop.hbase.master.SplitLogManager.Task; //导入依赖的package包/类
/**
 * It is possible for a task to stay in UNASSIGNED state indefinitely - say SplitLogManager wants
 * to resubmit a task. It forces the task to UNASSIGNED state but it dies before it could create
 * the RESCAN task node to signal the SplitLogWorkers to pick up the task. To prevent this
 * scenario the SplitLogManager resubmits all orphan and UNASSIGNED tasks at startup.
 * @param path
 */
private void handleUnassignedTask(String path) {
  if (ZKSplitLog.isRescanNode(watcher, path)) {
    return;
  }
  Task task = findOrCreateOrphanTask(path);
  if (task.isOrphan() && (task.incarnation.get() == 0)) {
    LOG.info("Resubmitting unassigned orphan task " + path);
    // ignore failure to resubmit. The timeout-monitor will handle it later
    // albeit in a more crude fashion
    resubmitTask(path, task, FORCE);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:20,代码来源:ZKSplitLogManagerCoordination.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VehicleMoveEvent类代码示例发布时间:2022-05-21
下一篇:
Java Dictionary类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap