You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ne...@apache.org on 2017/05/31 18:41:58 UTC
[08/10] mesos git commit: Cleaned up master code to check for
PARTITION_AWARE capability.
Cleaned up master code to check for PARTITION_AWARE capability.
Review: https://reviews.apache.org/r/59259
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9529ebfe
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9529ebfe
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9529ebfe
Branch: refs/heads/master
Commit: 9529ebfed7d78ce859b5a4c4371bae8551e70a51
Parents: 207b619
Author: Neil Conway <ne...@gmail.com>
Authored: Sat May 13 12:51:59 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
Committed: Wed May 31 11:40:55 2017 -0700
----------------------------------------------------------------------
src/master/master.cpp | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/9529ebfe/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 7a4a420..72b7de4 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -3836,8 +3836,7 @@ void Master::accept(
"Task launched with invalid offers: " + error.get().message,
TaskStatus::REASON_INVALID_OFFERS);
- if (protobuf::frameworkHasCapability(
- framework->info, FrameworkInfo::Capability::PARTITION_AWARE)) {
+ if (framework->capabilities.partitionAware) {
metrics->tasks_dropped++;
} else {
metrics->tasks_lost++;
@@ -4063,8 +4062,7 @@ void Master::_accept(
slave == nullptr ? "Agent removed" : "Agent disconnected",
reason);
- if (protobuf::frameworkHasCapability(
- framework->info, FrameworkInfo::Capability::PARTITION_AWARE)) {
+ if (framework->capabilities.partitionAware) {
metrics->tasks_dropped++;
} else {
metrics->tasks_lost++;
@@ -6736,8 +6734,7 @@ void Master::_markUnreachable(
CHECK_NOTNULL(framework);
TaskState newTaskState = TASK_UNREACHABLE;
- if (!protobuf::frameworkHasCapability(
- framework->info, FrameworkInfo::Capability::PARTITION_AWARE)) {
+ if (!framework->capabilities.partitionAware) {
newTaskState = TASK_LOST;
}
@@ -7008,8 +7005,7 @@ void Master::_reconcileTasks(
// the framework does not have the PARTITION_AWARE capability,
// send TASK_LOST for backward compatibility.
TaskState taskState = TASK_UNKNOWN;
- if (!protobuf::frameworkHasCapability(
- framework->info, FrameworkInfo::Capability::PARTITION_AWARE)) {
+ if (!framework->capabilities.partitionAware) {
taskState = TASK_LOST;
}
@@ -7035,8 +7031,7 @@ void Master::_reconcileTasks(
const TimeInfo& unreachableTime = slaves.unreachable[slaveId.get()];
TaskState taskState = TASK_UNREACHABLE;
- if (!protobuf::frameworkHasCapability(
- framework->info, FrameworkInfo::Capability::PARTITION_AWARE)) {
+ if (!framework->capabilities.partitionAware) {
taskState = TASK_LOST;
}
@@ -7060,8 +7055,7 @@ void Master::_reconcileTasks(
// framework does not have the PARTITION_AWARE capability, send
// TASK_LOST for backward compatibility.
TaskState taskState = TASK_UNKNOWN;
- if (!protobuf::frameworkHasCapability(
- framework->info, FrameworkInfo::Capability::PARTITION_AWARE)) {
+ if (!framework->capabilities.partitionAware) {
taskState = TASK_LOST;
}