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 Type
    Method
    Description
    @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

      @NotNull @NotNull graphql.ExecutionResult executeNative(@NotNull @NotNull String query)
      Retrieves a file metadata using a native GraphQL query.
      Parameters:
      query - The query for fetching file metadata
      Returns:
      a metadata object
      Throws:
      NullPointerException - if query is null
    • 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 ID
      metadataFields - The dynamic set up fields that are returned to the service client
      Returns:
      a metadata object containing all requested metadata fields
      Throws:
      NullPointerException - if fileId or metadataFields is null
      IllegalArgumentException - if metadataFields is an empty list
    • saveMetaData

      void saveMetaData(@NotNull @NotNull String fileId, @NotNull @NotNull MetaData metaData)
      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 of FileStore.upload(File) so that the corresponding metadata can be retrieved later by calling getMetaData(String, List)
      metaData - The metadata object that is going to be saved into database
      Throws:
      NullPointerException - if fileId or metaData is null