Interface FileStore
- All Known Implementing Classes:
SwiftFileStore
@NotThreadSafe
public interface FileStore
FileStore
is an abstraction layer between Athena application and object storage; it can persist an
in-memory representation
of a file into object storage as well as retrieving it from that storage.-
Method Summary
-
Method Details
-
upload
Persists a file into object storage database.Note that calling this method does NOT automatically update the managed metadata of this file in
MetaStore
. The metadata must be saved separately usingMetaStore.saveMetaData(String, MetaData)
.The implementation does NOT have to be thread-safe.
FileStore
assumes that it is the callers' responsibilities to implement the thread safety themselves.- Parameters:
file
- An object representing the file to be persisted- Returns:
- the file ID that can be used later to retrieve that file in Athena
- Throws:
NullPointerException
- iffile
isnull
-
download
Retrieves a file identified by a specified file ID from object storage.- Parameters:
fileId
- The provided file ID, which is the same as the return value ofupload(File)
- Returns:
- a previously
uploaded file stream
- Throws:
NullPointerException
- iffileId
isnull
-