MCPcopy Create free account
hub / github.com/apache/mesos / evolve

Function evolve

src/internal/evolve.cpp:47–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45// have not changed across versions.
46template <typename T>
47static T evolve(const google::protobuf::Message& message)
48{
49 T t;
50
51 string data;
52
53 // NOTE: We need to use 'SerializePartialToString' instead of
54 // 'SerializeToString' because some required fields might not be set
55 // and we don't want an exception to get thrown.
56 CHECK(message.SerializePartialToString(&data))
57 << "Failed to serialize " << message.GetTypeName()
58 << " while evolving to " << t.GetTypeName();
59
60 // NOTE: We need to use 'ParsePartialFromString' instead of
61 // 'ParseFromString' because some required fields might not
62 // be set and we don't want an exception to get thrown.
63 CHECK(t.ParsePartialFromString(data))
64 << "Failed to parse " << t.GetTypeName()
65 << " while evolving from " << message.GetTypeName();
66
67 return t;
68}
69
70
71v1::AgentID evolve(const SlaveID& slaveId)

Callers

nothing calls this directly

Calls 9

dataMethod · 0.80
UPIDClass · 0.50
valueMethod · 0.45
statusMethod · 0.45
messageMethod · 0.45
secsMethod · 0.45
offersMethod · 0.45
updateMethod · 0.45
pidMethod · 0.45

Tested by

no test coverage detected