Interface MetaStore
- All Known Implementing Classes:
GraphQLMetaStore
@NotThreadSafe
public interface MetaStore
MetaStore
is a GraphQL abstraction layer between Athena application and a custom file metadata database; it
persists metadata info into the database as well as reading it from that database.-
Method Summary
Modifier and TypeMethodDescription@NotNull graphql.ExecutionResult
executeNative
(@NotNull String query) Retrieves a file metadata using a native GraphQL query.@NotNull graphql.ExecutionResult
getMetaData
(@NotNull String fileId, @NotNull List<String> metadataFields) Retrieves a file metadata identified by a specified file ID.void
saveMetaData
(@NotNull String fileId, @NotNull MetaData metaData) Persists a file metadata into database.
-
Method Details
-
executeNative
Retrieves a file metadata using a native GraphQL query.- Parameters:
query
- The query for fetching file metadata- Returns:
- a metadata object
- Throws:
NullPointerException
- ifquery
isnull
-
getMetaData
@NotNull @NotNull graphql.ExecutionResult getMetaData(@NotNull @NotNull String fileId, @NotNull @NotNull List<String> metadataFields) Retrieves a file metadata identified by a specified file ID.- Parameters:
fileId
- The provided file IDmetadataFields
- The dynamic set up fields that are returned to the service client- Returns:
- a metadata object containing all requested metadata fields
- Throws:
NullPointerException
- iffileId
ormetadataFields
isnull
IllegalArgumentException
- ifmetadataFields
is an empty list
-
saveMetaData
Persists a file metadata into database.The implementation does NOT have to be thread-safe.
MetaStore
assumes that it is the callers' responsibilities to implement the thread safety themselves.- Parameters:
fileId
- The ID of the file that has already been uploaded to object storage. The value of the ID must be the return value ofFileStore.upload(File)
so that the corresponding metadata can be retrieved later by callinggetMetaData(String, List)
metaData
- The metadata object that is going to be saved into database- Throws:
NullPointerException
- iffileId
ormetaData
isnull
-