public class FileSystemBlobStore extends Object implements BlobStoreService
FileSystem
.
This is used in addition to the local blob storage for high availability.
Constructor and Description |
---|
FileSystemBlobStore(FileSystem fileSystem,
String storagePath) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
closeAndCleanupAllData()
Closes and cleans up the store.
|
boolean |
delete(JobID jobId,
org.apache.flink.runtime.blob.BlobKey blobKey)
Tries to delete a blob from storage.
|
boolean |
deleteAll(JobID jobId)
Tries to delete all blobs for the given job from storage.
|
boolean |
get(JobID jobId,
org.apache.flink.runtime.blob.BlobKey blobKey,
File localFile)
Copies a blob to a local file.
|
boolean |
put(File localFile,
JobID jobId,
org.apache.flink.runtime.blob.BlobKey blobKey)
Copies the local file to the blob store.
|
public FileSystemBlobStore(FileSystem fileSystem, String storagePath) throws IOException
IOException
public boolean put(File localFile, JobID jobId, org.apache.flink.runtime.blob.BlobKey blobKey) throws IOException
BlobStore
put
in interface BlobStore
localFile
- The file to copyjobId
- ID of the job this blob belongs to (or null if job-unrelated)blobKey
- The ID for the file in the blob storeIOException
- If the copy failspublic boolean get(JobID jobId, org.apache.flink.runtime.blob.BlobKey blobKey, File localFile) throws IOException
BlobView
get
in interface BlobView
jobId
- ID of the job this blob belongs to (or null if job-unrelated)blobKey
- The blob IDlocalFile
- The local file to copy toIOException
- If the copy failspublic boolean delete(JobID jobId, org.apache.flink.runtime.blob.BlobKey blobKey)
BlobStore
NOTE: This also tries to delete any created directories if empty.
public boolean deleteAll(JobID jobId)
BlobStore
NOTE: This also tries to delete any created directories if empty.
public void closeAndCleanupAllData()
BlobStoreService
closeAndCleanupAllData
in interface BlobStoreService
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.