TensorFlow Serving C++ API Documentation
|
#include <aspired_version_policy.h>
Classes | |
struct | ServableAction |
Action and the id of the servable associated with it. More... | |
Public Types | |
enum class | Action : int { kLoad , kUnload } |
The different actions that could be recommended by a policy. More... | |
Public Member Functions | |
virtual absl::optional< ServableAction > | GetNextAction (const std::vector< AspiredServableStateSnapshot > &all_versions) const =0 |
Static Protected Member Functions | |
static absl::optional< ServableId > | GetHighestAspiredNewServableId (const std::vector< AspiredServableStateSnapshot > &all_versions) |
Friends | |
class | AspiredVersionPolicyTest |
An interface for the policy to be applied for transitioning servable versions in a servable stream.
Policies should be entirely stateless and idempotent. Asking the same policy multiple times for the next action, for an identical vector of AspiredServableStateSnapshots, should return the same result.
If additional state is required to implement a Policy, such state shall be shared via AspiredServableStateSnapshots. Depending on the kind of state, the most likely candidates for originating or tracking state are Sources or the Harness and Manager.
Definition at line 48 of file aspired_version_policy.h.
|
strong |
The different actions that could be recommended by a policy.
Enumerator | |
---|---|
kLoad | Call load on the servable. |
kUnload | Call unload on the servable. |
Definition at line 51 of file aspired_version_policy.h.
|
staticprotected |
Returns the aspired ServableId with the highest version that matches kNew state, if any exists.
Definition at line 23 of file aspired_version_policy.cc.
|
pure virtual |
Takes in a vector of state snapshots of all versions of a servable stream and returns an action to be performed for a particular servable version, depending only on the states of all the versions.
If no action is to be performed, we don't return an action, meaning that the servable stream is up to date.
Implemented in tensorflow::serving::ResourcePreservingPolicy, and tensorflow::serving::AvailabilityPreservingPolicy.