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


Java Status.DONE属性代码示例

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


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

示例1: SplitLogManager

/**
 * Wrapper around {@link #SplitLogManager(ZooKeeperWatcher, Configuration,
 * Stoppable, String, TaskFinisher)} that provides a task finisher for
 * copying recovered edits to their final destination. The task finisher
 * has to be robust because it can be arbitrarily restarted or called
 * multiple times.
 * 
 * @param zkw
 * @param conf
 * @param stopper
 * @param serverName
 */
public SplitLogManager(ZooKeeperWatcher zkw, final Configuration conf,
    Stoppable stopper, MasterServices master, String serverName) {
  this(zkw, conf, stopper, master, serverName, new TaskFinisher() {
    @Override
    public Status finish(String workerName, String logfile) {
      try {
        HLogSplitter.finishSplitLogFile(logfile, conf);
      } catch (IOException e) {
        LOG.warn("Could not finish splitting of log file " + logfile, e);
        return Status.ERR;
      }
      return Status.DONE;
    }
  });
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:27,代码来源:SplitLogManager.java

示例2: SplitLogManager

/**
 * Wrapper around {@link #SplitLogManager(ZooKeeperWatcher zkw, Configuration conf,
 *   Stoppable stopper, MasterServices master, ServerName serverName,
 *   boolean masterRecovery, TaskFinisher tf)}
 * that provides a task finisher for copying recovered edits to their final destination.
 * The task finisher has to be robust because it can be arbitrarily restarted or called
 * multiple times.
 *
 * @param zkw the ZK watcher
 * @param conf the HBase configuration
 * @param stopper the stoppable in case anything is wrong
 * @param master the master services
 * @param serverName the master server name
 * @param masterRecovery an indication if the master is in recovery
 */
public SplitLogManager(ZooKeeperWatcher zkw, final Configuration conf,
    Stoppable stopper, MasterServices master, ServerName serverName, boolean masterRecovery) {
  this(zkw, conf, stopper, master, serverName, masterRecovery, new TaskFinisher() {
    @Override
    public Status finish(ServerName workerName, String logfile) {
      try {
        HLogSplitter.finishSplitLogFile(logfile, conf);
      } catch (IOException e) {
        LOG.warn("Could not finish splitting of log file " + logfile, e);
        return Status.ERR;
      }
      return Status.DONE;
    }
  });
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:30,代码来源:SplitLogManager.java

示例3: SplitLogManager

/**
 * Wrapper around {@link #SplitLogManager(ZooKeeperWatcher, Configuration,
 * Stoppable, String, TaskFinisher)} that provides a task finisher for
 * copying recovered edits to their final destination. The task finisher
 * has to be robust because it can be arbitrarily restarted or called
 * multiple times.
 * 
 * @param zkw
 * @param conf
 * @param stopper
 * @param serverName
 */
public SplitLogManager(ZooKeeperWatcher zkw, final Configuration conf,
    Stoppable stopper, String serverName) {
  this(zkw, conf, stopper, serverName, new TaskFinisher() {
    @Override
    public Status finish(String workerName, String logfile) {
      String tmpname =
        ZKSplitLog.getSplitLogDirTmpComponent(workerName, logfile);
      try {
        HLogSplitter.moveRecoveredEditsFromTemp(tmpname, logfile, conf);
      } catch (IOException e) {
        LOG.warn("Could not finish splitting of log file " + logfile);
        return Status.ERR;
      }
      return Status.DONE;
    }
  });
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:29,代码来源:SplitLogManager.java

示例4: SplitLogManager

/**
 * Wrapper around {@link #SplitLogManager(ZooKeeperWatcher zkw, Configuration conf,
 *   Stoppable stopper, MasterServices master, ServerName serverName, TaskFinisher tf)}
 * that provides a task finisher for copying recovered edits to their final destination.
 * The task finisher has to be robust because it can be arbitrarily restarted or called
 * multiple times.
 *
 * @param zkw the ZK watcher
 * @param conf the HBase configuration
 * @param stopper the stoppable in case anything is wrong
 * @param master the master services
 * @param serverName the master server name
 */
public SplitLogManager(ZooKeeperWatcher zkw, final Configuration conf,
    Stoppable stopper, MasterServices master, ServerName serverName) {
  this(zkw, conf, stopper, master, serverName, new TaskFinisher() {
    @Override
    public Status finish(ServerName workerName, String logfile) {
      try {
        HLogSplitter.finishSplitLogFile(logfile, conf);
      } catch (IOException e) {
        LOG.warn("Could not finish splitting of log file " + logfile, e);
        return Status.ERR;
      }
      return Status.DONE;
    }
  });
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:28,代码来源:SplitLogManager.java

示例5: SplitLogManager

/**
 * Wrapper around {@link #SplitLogManager(ZooKeeperWatcher zkw, Configuration conf,
 *   Stoppable stopper, MasterServices master, ServerName serverName, TaskFinisher tf)}
 * that provides a task finisher for copying recovered edits to their final destination.
 * The task finisher has to be robust because it can be arbitrarily restarted or called
 * multiple times.
 * 
 * @param zkw
 * @param conf
 * @param stopper
 * @param serverName
 */
public SplitLogManager(ZooKeeperWatcher zkw, final Configuration conf,
     Stoppable stopper, MasterServices master, ServerName serverName) {
  this(zkw, conf, stopper,  master, serverName, new TaskFinisher() {
    @Override
    public Status finish(ServerName workerName, String logfile) {
      try {
        HLogSplitter.finishSplitLogFile(logfile, conf);
      } catch (IOException e) {
        LOG.warn("Could not finish splitting of log file " + logfile, e);
        return Status.ERR;
      }
      return Status.DONE;
    }
  });
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:27,代码来源:SplitLogManager.java

示例6: getDataSetWatchSuccess

private void getDataSetWatchSuccess(String path, byte[] data, int version) {
  if (data == null) {
    if (version == Integer.MIN_VALUE) {
      // assume all done. The task znode suddenly disappeared.
      setDone(path, SUCCESS);
      return;
    }
    tot_mgr_null_data.incrementAndGet();
    LOG.fatal("logic error - got null data " + path);
    setDone(path, FAILURE);
    return;
  }
  data = this.watcher.getRecoverableZooKeeper().removeMetaData(data);
  // LOG.debug("set watch on " + path + " got data " + new String(data));
  if (TaskState.TASK_UNASSIGNED.equals(data)) {
    LOG.debug("task not yet acquired " + path + " ver = " + version);
    handleUnassignedTask(path);
  } else if (TaskState.TASK_OWNED.equals(data)) {
    heartbeat(path, version,
        TaskState.TASK_OWNED.getWriterName(data));
  } else if (TaskState.TASK_RESIGNED.equals(data)) {
    LOG.info("task " + path + " entered state " + new String(data));
    resubmitOrFail(path, FORCE);
  } else if (TaskState.TASK_DONE.equals(data)) {
    LOG.info("task " + path + " entered state " + new String(data));
    if (taskFinisher != null && !ZKSplitLog.isRescanNode(watcher, path)) {
      if (taskFinisher.finish(TaskState.TASK_DONE.getWriterName(data),
          ZKSplitLog.getFileName(path)) == Status.DONE) {
        setDone(path, SUCCESS);
      } else {
        resubmitOrFail(path, CHECK);
      }
    } else {
      setDone(path, SUCCESS);
    }
  } else if (TaskState.TASK_ERR.equals(data)) {
    LOG.info("task " + path + " entered state " + new String(data));
    resubmitOrFail(path, CHECK);
  } else {
    LOG.fatal("logic error - unexpected zk state for path = " + path
        + " data = " + new String(data));
    setDone(path, FAILURE);
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:44,代码来源:SplitLogManager.java

示例7: getDataSetWatchSuccess

private void getDataSetWatchSuccess(String path, byte[] data, int version)
throws DeserializationException {
  if (data == null) {
    if (version == Integer.MIN_VALUE) {
      // assume all done. The task znode suddenly disappeared.
      setDone(path, SUCCESS);
      return;
    }
    SplitLogCounters.tot_mgr_null_data.incrementAndGet();
    LOG.fatal("logic error - got null data " + path);
    setDone(path, FAILURE);
    return;
  }
  data = this.watcher.getRecoverableZooKeeper().removeMetaData(data);
  SplitLogTask slt = SplitLogTask.parseFrom(data);
  if (slt.isUnassigned()) {
    LOG.debug("task not yet acquired " + path + " ver = " + version);
    handleUnassignedTask(path);
  } else if (slt.isOwned()) {
    heartbeat(path, version, slt.getServerName());
  } else if (slt.isResigned()) {
    LOG.info("task " + path + " entered state: " + slt.toString());
    resubmitOrFail(path, FORCE);
  } else if (slt.isDone()) {
    LOG.info("task " + path + " entered state: " + slt.toString());
    if (taskFinisher != null && !ZKSplitLog.isRescanNode(watcher, path)) {
      if (taskFinisher.finish(slt.getServerName(), ZKSplitLog.getFileName(path)) == Status.DONE) {
        setDone(path, SUCCESS);
      } else {
        resubmitOrFail(path, CHECK);
      }
    } else {
      setDone(path, SUCCESS);
    }
  } else if (slt.isErr()) {
    LOG.info("task " + path + " entered state: " + slt.toString());
    resubmitOrFail(path, CHECK);
  } else {
    LOG.fatal("logic error - unexpected zk state for path = " + path + " data = " + slt.toString());
    setDone(path, FAILURE);
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:42,代码来源:SplitLogManager.java


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