Package org.gridgain.internal.ml.storage
Interface ModelSource
- All Known Implementing Classes:
ModelStorageProviderImpl.FileModelSource
public interface ModelSource
Represents a source from which a model can be loaded.
This abstracts the different locations where models might be stored
(local filesystem, HTTP, S3, etc.) behind a common interface.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumEnum representing the possible statuses of a model source. -
Method Summary
Modifier and TypeMethodDescriptionGets the model ID associated with this source.Gets the current status of this model source.getUri()Gets the URI for this model source.Gets the version associated with this source.booleanisLocal()Checks if this model source is already available locally.Resolves this model source to a local path asynchronously.voidSets the status of this model source.
-
Method Details
-
getUri
String getUri()Gets the URI for this model source.- Returns:
- The URI as a string
-
getModelId
String getModelId()Gets the model ID associated with this source.- Returns:
- The model ID
-
getVersion
String getVersion()Gets the version associated with this source.- Returns:
- The version
-
resolveToLocalPath
CompletableFuture<Path> resolveToLocalPath()Resolves this model source to a local path asynchronously. If the source is already local, returns the path. If the source is remote, downloads the model to a local path and returns that path.- Returns:
- A CompletableFuture containing the path to the model on the local filesystem
-
isLocal
boolean isLocal()Checks if this model source is already available locally.- Returns:
- true if the model is available locally, false otherwise
-
getStatus
ModelSource.ModelSourceStatus getStatus()Gets the current status of this model source.- Returns:
- The model source status
-
setStatus
Sets the status of this model source.- Parameters:
status- The new status
-