本文整理汇总了C++中TaskInfo::slave_id方法的典型用法代码示例。如果您正苦于以下问题:C++ TaskInfo::slave_id方法的具体用法?C++ TaskInfo::slave_id怎么用?C++ TaskInfo::slave_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskInfo
的用法示例。
在下文中一共展示了TaskInfo::slave_id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: model
// 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));
}
示例2: createTask
Task createTask(
const TaskInfo& task,
const TaskState& state,
const FrameworkID& frameworkId)
{
Task t;
t.mutable_framework_id()->MergeFrom(frameworkId);
t.set_state(state);
t.set_name(task.name());
t.mutable_task_id()->MergeFrom(task.task_id());
t.mutable_slave_id()->MergeFrom(task.slave_id());
t.mutable_resources()->MergeFrom(task.resources());
if (task.has_executor()) {
t.mutable_executor_id()->CopyFrom(task.executor().executor_id());
}
t.mutable_labels()->MergeFrom(task.labels());
if (task.has_discovery()) {
t.mutable_discovery()->MergeFrom(task.discovery());
}
return t;
}
示例3: createTask
inline Task createTask(const TaskInfo& task,
const TaskState& state,
const ExecutorID& executorId,
const FrameworkID& frameworkId)
{
Task t;
t.mutable_framework_id()->MergeFrom(frameworkId);
t.set_state(state);
t.set_name(task.name());
t.mutable_task_id()->MergeFrom(task.task_id());
t.mutable_slave_id()->MergeFrom(task.slave_id());
t.mutable_resources()->MergeFrom(task.resources());
if (!task.has_command()) {
t.mutable_executor_id()->MergeFrom(executorId);
}
return t;
}
示例4: createTask
Task createTask(
const TaskInfo& task,
const TaskState& state,
const FrameworkID& frameworkId)
{
Task t;
t.mutable_framework_id()->CopyFrom(frameworkId);
t.set_state(state);
t.set_name(task.name());
t.mutable_task_id()->CopyFrom(task.task_id());
t.mutable_slave_id()->CopyFrom(task.slave_id());
t.mutable_resources()->CopyFrom(task.resources());
if (task.has_executor()) {
t.mutable_executor_id()->CopyFrom(task.executor().executor_id());
}
if (task.has_labels()) {
t.mutable_labels()->CopyFrom(task.labels());
}
if (task.has_discovery()) {
t.mutable_discovery()->CopyFrom(task.discovery());
}
if (task.has_container()) {
t.mutable_container()->CopyFrom(task.container());
}
// Copy `user` if set.
if (task.has_command() && task.command().has_user()) {
t.set_user(task.command().user());
} else if (task.has_executor() && task.executor().command().has_user()) {
t.set_user(task.executor().command().user());
}
return t;
}