@Evolving public interface FilesetCatalog
Modifier and Type | Method and Description |
---|---|
Fileset |
alterFileset(NameIdentifier ident,
FilesetChange... changes)
Apply the
change to a fileset in the catalog. |
default Fileset |
createFileset(NameIdentifier ident,
java.lang.String comment,
Fileset.Type type,
java.lang.String storageLocation,
java.util.Map<java.lang.String,java.lang.String> properties)
Create a fileset metadata with a default location in the catalog.
|
default Fileset |
createMultipleLocationFileset(NameIdentifier ident,
java.lang.String comment,
Fileset.Type type,
java.util.Map<java.lang.String,java.lang.String> storageLocations,
java.util.Map<java.lang.String,java.lang.String> properties)
Create a fileset metadata with multiple storage locations in the catalog.
|
boolean |
dropFileset(NameIdentifier ident)
Drop a fileset from the catalog.
|
default boolean |
filesetExists(NameIdentifier ident)
Check if a fileset exists using an
NameIdentifier from the catalog. |
default java.lang.String |
getFileLocation(NameIdentifier ident,
java.lang.String subPath)
Get the actual location of a file or directory based on the default storage location of Fileset
and the sub path.
|
default java.lang.String |
getFileLocation(NameIdentifier ident,
java.lang.String subPath,
java.lang.String locationName)
Get the actual location of a file or directory based on the storage location of Fileset and the
sub path by the location name.
|
NameIdentifier[] |
listFilesets(Namespace namespace)
List the filesets in a schema namespace from the catalog.
|
Fileset |
loadFileset(NameIdentifier ident)
Load fileset metadata by
NameIdentifier from the catalog. |
NameIdentifier[] listFilesets(Namespace namespace) throws NoSuchSchemaException
namespace
- A schema namespace.NoSuchSchemaException
- If the schema does not exist.Fileset loadFileset(NameIdentifier ident) throws NoSuchFilesetException
NameIdentifier
from the catalog.ident
- A fileset identifier.NoSuchFilesetException
- If the fileset does not exist.default boolean filesetExists(NameIdentifier ident)
NameIdentifier
from the catalog.ident
- A fileset identifier.default Fileset createFileset(NameIdentifier ident, java.lang.String comment, Fileset.Type type, java.lang.String storageLocation, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchSchemaException, FilesetAlreadyExistsException
If the type of the fileset object is "MANAGED", the underlying storageLocation can be null, and Gravitino will manage the storage location based on the location of the schema.
If the type of the fileset object is "EXTERNAL", the underlying storageLocation must be set.
ident
- A fileset identifier.comment
- The comment of the fileset.type
- The type of the fileset.storageLocation
- The storage location of the fileset.properties
- The properties of the fileset.NoSuchSchemaException
- If the schema does not exist.FilesetAlreadyExistsException
- If the fileset already exists.default Fileset createMultipleLocationFileset(NameIdentifier ident, java.lang.String comment, Fileset.Type type, java.util.Map<java.lang.String,java.lang.String> storageLocations, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchSchemaException, FilesetAlreadyExistsException
ident
- A fileset identifier.comment
- The comment of the fileset.type
- The type of the fileset.storageLocations
- The location names and storage locations of the fileset.properties
- The properties of the fileset.NoSuchSchemaException
- If the schema does not exist.FilesetAlreadyExistsException
- If the fileset already exists.Fileset alterFileset(NameIdentifier ident, FilesetChange... changes) throws NoSuchFilesetException, java.lang.IllegalArgumentException
change
to a fileset in the catalog.
Implementation may reject the change. If any change is rejected, no changes should be applied to the fileset.
The FilesetChange.RenameFileset
change will only update the fileset name, the underlying storage
location for managed fileset will not be renamed.
ident
- A fileset identifier.changes
- The changes to apply to the fileset.NoSuchFilesetException
- If the fileset does not exist.java.lang.IllegalArgumentException
- If the change is rejected by the implementation.boolean dropFileset(NameIdentifier ident)
The underlying files will be deleted if this fileset type is managed, otherwise, only the metadata will be dropped.
ident
- A fileset identifier.default java.lang.String getFileLocation(NameIdentifier ident, java.lang.String subPath) throws NoSuchFilesetException
ident
- A fileset identifier.subPath
- The sub path to the file or directory.NoSuchFilesetException
- If the fileset does not exist.default java.lang.String getFileLocation(NameIdentifier ident, java.lang.String subPath, java.lang.String locationName) throws NoSuchFilesetException, NoSuchLocationNameException
ident
- A fileset identifier.subPath
- The sub path to the file or directory.locationName
- The location name. If null, the default location will be used.NoSuchFilesetException
- If the fileset does not exist.NoSuchLocationNameException
- If the location name does not exist.