Skip to content

Commit

Permalink
Alphabetized 'evolve' and 'devolve' files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlvanre committed Oct 21, 2016
1 parent f6b0185 commit 7e93d9d
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 184 deletions.
58 changes: 29 additions & 29 deletions src/internal/devolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,21 @@ static T devolve(const google::protobuf::Message& message)
}


SlaveID devolve(const v1::AgentID& agentId)
CommandInfo devolve(const v1::CommandInfo& command)
{
// NOTE: Not using 'devolve<v1::AgentID, SlaveID>(agentId)' since
// this will be a common 'devolve' call and we wanted to speed up
// performance.

SlaveID id;
id.set_value(agentId.value());
return id;
return devolve<CommandInfo>(command);
}


SlaveInfo devolve(const v1::AgentInfo& agentInfo)
Credential devolve(const v1::Credential& credential)
{
SlaveInfo info = devolve<SlaveInfo>(agentInfo);
return devolve<Credential>(credential);
}

// We set 'checkpoint' to 'true' since the v1::AgentInfo doesn't
// have 'checkpoint' but all "agents" were checkpointing by default
// when v1::AgentInfo was introduced. See MESOS-2317.
info.set_checkpoint(true);

return info;
ExecutorID devolve(const v1::ExecutorID& executorId)
{
return devolve<ExecutorID>(executorId);
}


Expand All @@ -85,15 +78,15 @@ FrameworkInfo devolve(const v1::FrameworkInfo& frameworkInfo)
}


ExecutorID devolve(const v1::ExecutorID& executorId)
HealthCheck devolve(const v1::HealthCheck& check)
{
return devolve<ExecutorID>(executorId);
return devolve<HealthCheck>(check);
}


HealthCheck devolve(const v1::HealthCheck& check)
InverseOffer devolve(const v1::InverseOffer& inverseOffer)
{
return devolve<HealthCheck>(check);
return devolve<InverseOffer>(inverseOffer);
}


Expand All @@ -103,15 +96,28 @@ Offer devolve(const v1::Offer& offer)
}


InverseOffer devolve(const v1::InverseOffer& inverseOffer)
SlaveID devolve(const v1::AgentID& agentId)
{
return devolve<InverseOffer>(inverseOffer);
// NOTE: Not using 'devolve<v1::AgentID, SlaveID>(agentId)' since
// this will be a common 'devolve' call and we wanted to speed up
// performance.

SlaveID id;
id.set_value(agentId.value());
return id;
}


Credential devolve(const v1::Credential& credential)
SlaveInfo devolve(const v1::AgentInfo& agentInfo)
{
return devolve<Credential>(credential);
SlaveInfo info = devolve<SlaveInfo>(agentInfo);

// We set 'checkpoint' to 'true' since the v1::AgentInfo doesn't
// have 'checkpoint' but all "agents" were checkpointing by default
// when v1::AgentInfo was introduced. See MESOS-2317.
info.set_checkpoint(true);

return info;
}


Expand All @@ -127,12 +133,6 @@ TaskStatus devolve(const v1::TaskStatus& status)
}


CommandInfo devolve(const v1::CommandInfo& command)
{
return devolve<CommandInfo>(command);
}


executor::Call devolve(const v1::executor::Call& call)
{
return devolve<executor::Call>(call);
Expand Down
12 changes: 6 additions & 6 deletions src/internal/devolve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ namespace mesos {
namespace internal {

// Helpers for devolving types between versions. Please add as necessary!
SlaveID devolve(const v1::AgentID& agentId);
SlaveInfo devolve(const v1::AgentInfo& agentInfo);
CommandInfo devolve(const v1::CommandInfo& command);
Credential devolve(const v1::Credential& credential);
ExecutorID devolve(const v1::ExecutorID& executorId);
FrameworkID devolve(const v1::FrameworkID& frameworkId);
FrameworkInfo devolve(const v1::FrameworkInfo& frameworkInfo);
ExecutorID devolve(const v1::ExecutorID& executorId);
HealthCheck devolve(const v1::HealthCheck& check);
Offer devolve(const v1::Offer& offer);
InverseOffer devolve(const v1::InverseOffer& inverseOffer);
Credential devolve(const v1::Credential& credential);
Offer devolve(const v1::Offer& offer);
SlaveID devolve(const v1::AgentID& agentId);
SlaveInfo devolve(const v1::AgentInfo& agentInfo);
TaskID devolve(const v1::TaskID& taskId);
TaskStatus devolve(const v1::TaskStatus& status);
CommandInfo devolve(const v1::CommandInfo& command);

scheduler::Call devolve(const v1::scheduler::Call& call);
scheduler::Event devolve(const v1::scheduler::Event& event);
Expand Down
Loading

0 comments on commit 7e93d9d

Please sign in to comment.