tensorflow::serving::AspiredVersionsManagerBuilder

#include <aspired_versions_manager_builder.h>

Builds an AspiredVersionsManager with options and sources connected to it.

Summary

It takes over the ownership of the sources and the returned manager handles the destruction of itself and its dependencies. Both single sources and source/source-adapter chains are accepted, i.e. you can use sources that directly supply loaders (Source<std::unique_ptr<Loader>>) or composites that consist of Source<S> + some chain of SourceAdapter<S, ...>, ..., SourceAdapter<..., std::unique_ptr<Loader>>. The builder connects the chain for you.

Usage:

...
AspiredVersionsManagerBuilder::Options options = ManagerOptions();
std::unique_ptr<AspiredVersionsManagerBuilder> builder;
TF_CHECK_OK(AspiredVersionsManagerBuilder::Create(
    std::move(options), &builder));
builder->AddSource(std::move(some_source));
builder->AddSourceChain(
    std::move(source), std::move(source_adapter1),
    std::move(source_adapter2));
std::unique_ptr<Manager> manager = builder->Build();
...

NOTE: A builder can only be used to build a single AspiredVersionsManager.

This class is not thread-safe.

Constructors and Destructors

~AspiredVersionsManagerBuilder()

Public types

Options using

Public static functions

Create(Options options, std::unique_ptr< AspiredVersionsManagerBuilder > *builder)
Status

Public functions

AddSource(std::unique_ptr< S > source)
void
Connects the source to the AspiredVersionsManager being built and takes over its ownership.
AddSourceChain(std::unique_ptr< S > source, std::unique_ptr< SA > first_source_adapter, std::unique_ptr< Args >... remaining_source_adapters)
void
Connects a chain comprising a source and a chain of source adapters, s.t.
Build()
std::unique_ptr< Manager >
Builds the AspiredVersionsManager and returns it as the Manager interface.

Public types

Public static functions

Create

Status Create(
  Options options,
  std::unique_ptr< AspiredVersionsManagerBuilder > *builder
)

Public functions

AddSource

void AddSource(
  std::unique_ptr< S > source
)

Connects the source to the AspiredVersionsManager being built and takes over its ownership.

REQUIRES: Template type S be convertible to Source<std::unique_ptr<Loader>>.

AddSourceChain

void AddSourceChain(
  std::unique_ptr< S > source,
  std::unique_ptr< SA > first_source_adapter,
  std::unique_ptr< Args >... remaining_source_adapters
)

Connects a chain comprising a source and a chain of source adapters, s.t.

the final adapter in the chain emits Loaders for the manager. The final adapter is connected to the manager. We take ownership of the whole chain.

REQUIRES: At least one source adapter.

Usage: builder->AddSourceChain( std::move(source), std::move(source_adapter1), std::move(source_adapter2));

Build

std::unique_ptr< Manager > Build()

Builds the AspiredVersionsManager and returns it as the Manager interface.

~AspiredVersionsManagerBuilder

 ~AspiredVersionsManagerBuilder()=default