TensorFlow Serving C++ API Documentation
Classes | Public Types | Public Member Functions | Static Protected Member Functions | Friends | List of all members
tensorflow::serving::AspiredVersionPolicy Class Referenceabstract

#include <aspired_version_policy.h>

Inheritance diagram for tensorflow::serving::AspiredVersionPolicy:
Inheritance graph
[legend]

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< ServableActionGetNextAction (const std::vector< AspiredServableStateSnapshot > &all_versions) const =0
 

Static Protected Member Functions

static absl::optional< ServableIdGetHighestAspiredNewServableId (const std::vector< AspiredServableStateSnapshot > &all_versions)
 

Friends

class AspiredVersionPolicyTest
 

Detailed Description

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.

Member Enumeration Documentation

◆ Action

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.

Member Function Documentation

◆ GetHighestAspiredNewServableId()

absl::optional< ServableId > tensorflow::serving::AspiredVersionPolicy::GetHighestAspiredNewServableId ( const std::vector< AspiredServableStateSnapshot > &  all_versions)
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.

◆ GetNextAction()

virtual absl::optional<ServableAction> tensorflow::serving::AspiredVersionPolicy::GetNextAction ( const std::vector< AspiredServableStateSnapshot > &  all_versions) const
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.


The documentation for this class was generated from the following files: