@Evolving public interface ModelCatalog
Modifier and Type | Method and Description |
---|---|
boolean |
deleteModel(NameIdentifier ident)
Delete the model from the catalog.
|
boolean |
deleteModelVersion(NameIdentifier ident,
int version)
Delete the model version by the
NameIdentifier and version number. |
boolean |
deleteModelVersion(NameIdentifier ident,
java.lang.String alias)
Delete the model version by the
NameIdentifier and version alias. |
Model |
getModel(NameIdentifier ident)
Get a model metadata by
NameIdentifier from the catalog. |
ModelVersion |
getModelVersion(NameIdentifier ident,
int version)
Get a model version by the
NameIdentifier and version number from the catalog. |
ModelVersion |
getModelVersion(NameIdentifier ident,
java.lang.String alias)
Get a model version by the
NameIdentifier and version alias from the catalog. |
void |
linkModelVersion(NameIdentifier ident,
java.lang.String uri,
java.lang.String[] aliases,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties)
Link a new model version to the registered model object.
|
NameIdentifier[] |
listModels(Namespace namespace)
List the models in a schema namespace from the catalog.
|
int[] |
listModelVersions(NameIdentifier ident)
List all the versions of the register model by
NameIdentifier in the catalog. |
default boolean |
modelExists(NameIdentifier ident)
Check if a model exists using an
NameIdentifier from the catalog. |
default boolean |
modelVersionExists(NameIdentifier ident,
int version)
Check if the model version exists by the
NameIdentifier and version number. |
default boolean |
modelVersionExists(NameIdentifier ident,
java.lang.String alias)
Check if the model version exists by the
NameIdentifier and version alias. |
Model |
registerModel(NameIdentifier ident,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties)
Register a model in the catalog if the model is not existed, otherwise the
ModelAlreadyExistsException will be thrown. |
default Model |
registerModel(NameIdentifier ident,
java.lang.String uri,
java.lang.String[] aliases,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties)
Register a model in the catalog if the model is not existed, otherwise the
ModelAlreadyExistsException will be thrown. |
NameIdentifier[] listModels(Namespace namespace) throws NoSuchSchemaException
namespace
- A schema namespace.NoSuchSchemaException
- If the schema does not exist.Model getModel(NameIdentifier ident) throws NoSuchModelException
NameIdentifier
from the catalog.ident
- A model identifier.NoSuchModelException
- If the model does not exist.default boolean modelExists(NameIdentifier ident)
NameIdentifier
from the catalog.ident
- A model identifier.Model registerModel(NameIdentifier ident, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchSchemaException, ModelAlreadyExistsException
ModelAlreadyExistsException
will be thrown. The Model
object will be created when the
model is registered, users can call linkModelVersion(NameIdentifier,
String, String[], String, Map)
to link the model version to the registered Model
.ident
- The name identifier of the model.comment
- The comment of the model. The comment is optional and can be null.properties
- The properties of the model. The properties are optional and can be null or
empty.NoSuchSchemaException
- If the schema does not exist.ModelAlreadyExistsException
- If the model already registered.default Model registerModel(NameIdentifier ident, java.lang.String uri, java.lang.String[] aliases, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchSchemaException, ModelAlreadyExistsException, ModelVersionAliasesAlreadyExistException
ModelAlreadyExistsException
will be thrown. The Model
object will be created when the
model is registered, in the meantime, the model version (version 0) will also be created and
linked to the registered model.ident
- The name identifier of the model.uri
- The model artifact URI.aliases
- The aliases of the model version. The aliases should be unique in this model,
otherwise the ModelVersionAliasesAlreadyExistException
will be thrown. The aliases
are optional and can be empty. Also, be aware that the alias cannot be a number or a number
string.comment
- The comment of the model. The comment is optional and can be null.properties
- The properties of the model. The properties are optional and can be null or
empty.NoSuchSchemaException
- If the schema does not exist when register a model.ModelAlreadyExistsException
- If the model already registered.ModelVersionAliasesAlreadyExistException
- If the aliases already exist in the model.boolean deleteModel(NameIdentifier ident)
ident
- The name identifier of the model.int[] listModelVersions(NameIdentifier ident) throws NoSuchModelException
NameIdentifier
in the catalog.ident
- The name identifier of the model.NoSuchModelException
- If the model does not exist.ModelVersion getModelVersion(NameIdentifier ident, int version) throws NoSuchModelVersionException
NameIdentifier
and version number from the catalog.ident
- The name identifier of the model.version
- The version number of the model.NoSuchModelVersionException
- If the model version does not exist.ModelVersion getModelVersion(NameIdentifier ident, java.lang.String alias) throws NoSuchModelVersionException
NameIdentifier
and version alias from the catalog.ident
- The name identifier of the model.alias
- The version alias of the model.NoSuchModelVersionException
- If the model version does not exist.default boolean modelVersionExists(NameIdentifier ident, int version)
NameIdentifier
and version number. If the
model version exists, return true, otherwise return false.ident
- The name identifier of the model.version
- The version number of the model.default boolean modelVersionExists(NameIdentifier ident, java.lang.String alias)
NameIdentifier
and version alias. If the model
version exists, return true, otherwise return false.ident
- The name identifier of the model.alias
- The version alias of the model.void linkModelVersion(NameIdentifier ident, java.lang.String uri, java.lang.String[] aliases, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchModelException, ModelVersionAliasesAlreadyExistException
ident
- The name identifier of the model.uri
- The URI of the model version artifact.aliases
- The aliases of the model version. The aliases should be unique in this model,
otherwise the ModelVersionAliasesAlreadyExistException
will be thrown. The aliases
are optional and can be empty. Also, be aware that the alias cannot be a number or a number
string.comment
- The comment of the model version. The comment is optional and can be null.properties
- The properties of the model version. The properties are optional and can be
null or empty.NoSuchModelException
- If the model does not exist.ModelVersionAliasesAlreadyExistException
- If the aliases already exist in the model.boolean deleteModelVersion(NameIdentifier ident, int version)
NameIdentifier
and version number. If the model version
does not exist, return false. If the model version is deleted, return true.ident
- The name identifier of the model.version
- The version number of the model.boolean deleteModelVersion(NameIdentifier ident, java.lang.String alias)
NameIdentifier
and version alias. If the model version
does not exist, return false. If the model version is deleted, return true.ident
- The name identifier of the model.alias
- The version alias of the model.