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


C++ ExecutorID::value方法代码示例

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


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

示例1: frameworkMessage

  virtual void frameworkMessage(SchedulerDriver* driver,
                                const ExecutorID& executorId,
                                const SlaveID& slaveId,
                                const string& data)
  {
    vector<string> strVector = stringToVector(data);
    string taskId = strVector[0];
    string url = strVector[1];

    if (executorId.value() == crawler.executor_id().value()) {
      cout << "Crawler msg received: " << taskId << endl;

      for (size_t i = 2; i < strVector.size(); i++) {
        string& newURL = strVector[i];
        crawlResults[url].push_back(newURL);
        if (processed.find(newURL) == processed.end()) {
          processed[newURL] = nextUrlId++;
          if (newURL.substr(0, baseUrl.length()) == baseUrl) {
            crawlQueue.push(newURL);
          }
          renderQueue.push(newURL);
        }
      }
    } else {
      if (access(strVector[2].c_str(), R_OK) == 0) {
        renderResults[url] = strVector[2];
      }
    }
    frameworkMessagesReceived++;
  }
开发者ID:kaysoky,项目名称:RENDLER,代码行数:30,代码来源:rendler.cpp

示例2: LOG

void CephSchedulerAgent<T>::frameworkMessage(
      T* driver,
      const ExecutorID& executorId,
      const SlaveID& slaveId,
      const string& data)
{
  ceph::TaskState initialMon = stateMachine->getInitialMon();
  if (initialMon.executorId == executorId.value()) {
    LOG(INFO) << "Got osd id from inital MON: " << data;
    stateMachine->addPendingOSDID(lexical_cast<int>(data));
  }
}
开发者ID:nqn,项目名称:ceph-mesos,代码行数:12,代码来源:CephSchedulerAgent.hpp

示例3: frameworkMessage

void ChapelScheduler::frameworkMessage(SchedulerDriver* driver, 
                                       const ExecutorID& executorId, 
                                       const SlaveID& slaveId, 
                                       const string& data) 
{
   vector<string> strVector = stringToVector(data);
   string taskId = strVector[0];
   string url = strVector[1];

   if(executorId.value().size() > 0) {
      cout << "Framework message received: " << taskId << endl;
   }

   frameworkMessagesReceived+=1;
}
开发者ID:ct-clmsn,项目名称:mesos4chpl,代码行数:15,代码来源:ChapelScheduler.cpp

示例4:

inline bool operator==(const ExecutorID& left, const ExecutorID& right)
{
  return left.value() == right.value();
}
开发者ID:albertleecn,项目名称:mesos,代码行数:4,代码来源:mesos.hpp

示例5:

inline std::size_t hash_value(const ExecutorID& executorId)
{
  size_t seed = 0;
  boost::hash_combine(seed, executorId.value());
  return seed;
}
开发者ID:WuErPing,项目名称:mesos,代码行数:6,代码来源:type_utils.hpp

示例6: Error

Try<ExecutorState> ExecutorState::recover(
    const string& rootDir,
    const SlaveID& slaveId,
    const FrameworkID& frameworkId,
    const ExecutorID& executorId,
    bool strict,
    bool rebooted)
{
  ExecutorState state;
  state.id = executorId;
  string message;

  // Find the runs.
  Try<list<string>> runs = paths::getExecutorRunPaths(
      rootDir,
      slaveId,
      frameworkId,
      executorId);

  if (runs.isError()) {
    return Error("Failed to find runs for executor '" + executorId.value() +
                 "': " + runs.error());
  }

  // Recover the runs.
  foreach (const string& path, runs.get()) {
    if (Path(path).basename() == paths::LATEST_SYMLINK) {
      const Result<string>& latest = os::realpath(path);
      if (!latest.isSome()) {
        return Error(
            "Failed to find latest run of executor '" +
            executorId.value() + "': " +
            (latest.isError()
             ? latest.error()
             : "No such file or directory"));
      }

      // Store the ContainerID of the latest executor run.
      ContainerID containerId;
      containerId.set_value(Path(latest.get()).basename());
      state.latest = containerId;
    } else {
      ContainerID containerId;
      containerId.set_value(Path(path).basename());

      Try<RunState> run = RunState::recover(
          rootDir,
          slaveId,
          frameworkId,
          executorId,
          containerId,
          strict,
          rebooted);

      if (run.isError()) {
        return Error(
            "Failed to recover run " + containerId.value() +
            " of executor '" + executorId.value() +
            "': " + run.error());
      }

      state.runs[containerId] = run.get();
      state.errors += run->errors;
    }
  }

  // Find the latest executor.
  // It is possible that we cannot find the "latest" executor if the
  // slave died before it created the "latest" symlink.
  if (state.latest.isNone()) {
    LOG(WARNING) << "Failed to find the latest run of executor '"
                 << executorId << "' of framework " << frameworkId;
    return state;
  }

  // Read the executor info.
  const string& path =
    paths::getExecutorInfoPath(rootDir, slaveId, frameworkId, executorId);
  if (!os::exists(path)) {
    // This could happen if the slave died after creating the executor
    // directory but before it checkpointed the executor info.
    LOG(WARNING) << "Failed to find executor info file '" << path << "'";
    return state;
  }

  Result<ExecutorInfo> executorInfo = state::read<ExecutorInfo>(path);

  if (executorInfo.isError()) {
    message = "Failed to read executor info from '" + path + "': " +
              executorInfo.error();

    if (strict) {
      return Error(message);
    } else {
      LOG(WARNING) << message;
      state.errors++;
      return state;
    }
  }

//.........这里部分代码省略.........
开发者ID:jfrazelle,项目名称:mesos,代码行数:101,代码来源:state.cpp


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