tensorflow::serving::FileSystemStoragePathSource

#include <file_system_storage_path_source.h>

A storage path source that aspires versions for a given set of servables.

Summary

For each servable, it monitors a given file-system base path. It identifies base-path children whose name is a number (e.g. 123) and emits the path corresponding to the largest number as the servable's single aspired version. (To do the file-system monitoring, it uses a background thread that polls the file system periodically.)

For example, if a configured servable's base path is /foo/bar, and a file- system poll reveals child paths /foo/bar/baz, /foo/bar/123 and /foo/bar/456, the aspired-versions callback is called with {456, "/foo/bar/456"}. If, at any time, the base path is found to contain no numerical children, the aspired-versions callback is called with an empty versions list.

The configured set of servables to monitor can be updated at any time by calling UpdateConfig(). If any servables were present in the old config but not in the new one, the source will immediately aspire zero versions for that servable (causing it to be unloaded in the Manager that ultimately consumes the aspired-versions calls).

Inheritance

Inherits from: tensorflow::serving::Source< StoragePath >

Constructors and Destructors

~FileSystemStoragePathSource()

Friend classes

internal::FileSystemStoragePathSourceTestAccess
friend class

Public static functions

Create(const FileSystemStoragePathSourceConfig & config, std::unique_ptr< FileSystemStoragePathSource > *result)
Status

Public functions

SetAspiredVersionsCallback(AspiredVersionsCallback callback) override
virtual void
Supplies an AspiredVersionsCallback to use. Can be called at most once.
UpdateConfig(const FileSystemStoragePathSourceConfig & config)
Status
Supplies a new config to use.
config() const
FileSystemStoragePathSourceConfig

Friend classes

internal::FileSystemStoragePathSourceTestAccess

friend class internal::FileSystemStoragePathSourceTestAccess

Public static functions

Create

Status Create(
  const FileSystemStoragePathSourceConfig & config,
  std::unique_ptr< FileSystemStoragePathSource > *result
)

Public functions

SetAspiredVersionsCallback

virtual void SetAspiredVersionsCallback(
  AspiredVersionsCallback callback
) override

Supplies an AspiredVersionsCallback to use. Can be called at most once.

UpdateConfig

Status UpdateConfig(
  const FileSystemStoragePathSourceConfig & config
)

Supplies a new config to use.

The set of servables to monitor can be changed at any time (see class comment for more information), but it is illegal to change the file-system polling period once SetAspiredVersionsCallback() has been called.

config

FileSystemStoragePathSourceConfig config() const 

~FileSystemStoragePathSource

 ~FileSystemStoragePathSource() override