Ejemplo n.º 1
0
void CephSchedulerAgent<T>::registered(
      T* driver,
      const FrameworkID& frameworkId,
      const MasterInfo& masterInfo)
{
  LOG(INFO) << "Registered! FrameworkID=" << frameworkId.value();
}
Ejemplo n.º 2
0
// TODO(bmahler): Expose the executor name / source.
JSON::Object model(
    const TaskInfo& task,
    const FrameworkID& frameworkId,
    const TaskState& state,
    const vector<TaskStatus>& statuses)
{
  JSON::Object object;
  object.values["id"] = task.task_id().value();
  object.values["name"] = task.name();
  object.values["framework_id"] = frameworkId.value();

  if (task.has_executor()) {
    object.values["executor_id"] = task.executor().executor_id().value();
  } else {
    object.values["executor_id"] = "";
  }

  object.values["slave_id"] = task.slave_id().value();
  object.values["state"] = TaskState_Name(state);
  object.values["resources"] = model(task.resources());

  JSON::Array array;
  foreach (const TaskStatus& status, statuses) {
    array.values.push_back(model(status));
  }
Ejemplo n.º 3
0
inline bool operator==(const FrameworkID& left, const FrameworkID& right)
{
  return left.value() == right.value();
}
Ejemplo n.º 4
0
inline bool operator==(const FrameworkID& left, const std::string& right)
{
  return left.value() == right;
}
Ejemplo n.º 5
0
inline std::size_t hash_value(const FrameworkID& frameworkId)
{
  size_t seed = 0;
  boost::hash_combine(seed, frameworkId.value());
  return seed;
}