tensorflow::serving::PathPrefixLoaderFactory

#include <caching_manager.h>

A simple LoaderFactory that looks for a servable at a path formed by concatenating a fixed path prefix with the servable's name.

Summary

It assumes that a given servable only has one version, namely version 0.

Inheritance

Inherits from: tensorflow::serving::CachingManager::LoaderFactory

Constructors and Destructors

PathPrefixLoaderFactory(const string & path_prefix, std::unique_ptr< StoragePathSourceAdapter > adapter)
~PathPrefixLoaderFactory()

Public functions

CreateLoader(const ServableId & servable_id) override
virtual ServableData< std::unique_ptr< Loader > >
Creates servable data consisting of the loader corresponding to the servable-id.
GetServableVersion(const string & servable_name, ServableRequest::AutoVersionPolicy policy) const override
virtual int64_t
Returns a version corresponding to the servable name, for the given policy.

Public functions

CreateLoader

virtual ServableData< std::unique_ptr< Loader > > CreateLoader(
  const ServableId & servable_id
) override

Creates servable data consisting of the loader corresponding to the servable-id.

Any errors can be reported by embedding them in the returned ServableData item.

GetServableVersion

virtual int64_t GetServableVersion(
  const string & servable_name,
  ServableRequest::AutoVersionPolicy policy
) const override

Returns a version corresponding to the servable name, for the given policy.

PathPrefixLoaderFactory

 PathPrefixLoaderFactory(
  const string & path_prefix,
  std::unique_ptr< StoragePathSourceAdapter > adapter
)

~PathPrefixLoaderFactory

 ~PathPrefixLoaderFactory() override=default