16 #ifndef TENSORFLOW_SERVING_CORE_ASPIRED_VERSION_POLICY_H_
17 #define TENSORFLOW_SERVING_CORE_ASPIRED_VERSION_POLICY_H_
22 #include "absl/types/optional.h"
23 #include "tensorflow/core/lib/strings/strcat.h"
24 #include "tensorflow/core/platform/types.h"
25 #include "tensorflow_serving/core/loader_harness.h"
26 #include "tensorflow_serving/core/servable_id.h"
27 namespace tensorflow {
65 string DebugString()
const {
66 return strings::StrCat(
"{ action: ",
static_cast<int>(action),
67 " id: ",
id.DebugString(),
" }");
78 const std::vector<AspiredServableStateSnapshot>& all_versions)
const = 0;
84 const std::vector<AspiredServableStateSnapshot>& all_versions);
92 return lhs.action == rhs.action && lhs.id == rhs.id;
Action
The different actions that could be recommended by a policy.
@ kUnload
Call unload on the servable.
@ kLoad
Call load on the servable.
static absl::optional< ServableId > GetHighestAspiredNewServableId(const std::vector< AspiredServableStateSnapshot > &all_versions)
virtual absl::optional< ServableAction > GetNextAction(const std::vector< AspiredServableStateSnapshot > &all_versions) const =0
A snapshot of a servable's state and aspiredness.
Action and the id of the servable associated with it.