Class ModelRepositoryContext

Class Documentation

class ModelRepositoryContext

A ModelRepositoryContext object is used to query an inference server for model repository information, including information about the models within the model repository.

Once created a ModelRepositoryContext object can be used repeatedly to get information from the server. A ModelRepositoryContext object can use either HTTP protocol or GRPC protocol depending on the Create function (ModelRepositoryHttpContext::Create or ModelRepositoryGrpcContext::Create). For example:

std::unique_ptr<ModelRepositoryContext> ctx;
ModelRepositoryHttpContext::Create(&ctx, "localhost:8000");
ModelRepositoryIndex index;
ctx->GetModelRepositoryIndex(&index);
...
ctx->GetModelRepositoryIndex(&index);
...

Note

ModelRepositoryContext::Create methods are thread-safe. GetModelRepositoryIndex() is not thread-safe. For a given ModelRepositoryContext, calls to GetModelRepositoryIndex() must be serialized.

Public Functions

virtual ~ModelRepositoryContext() = 0
virtual Error GetModelRepositoryIndex(ModelRepositoryIndex *index) = 0

Contact the inference server and get the index of the model repository.

Return

Error object indicating success or failure of the request.

Parameters
  • index: Returns the index of the model repository.