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.
|
void |
delete(BlobKey blobKey)
Tries to delete a blob from storage.
|
void |
delete(JobID jobId,
String key)
Tries to delete a blob from storage.
|
void |
deleteAll(JobID jobId)
Tries to delete all blobs for the given job from storage.
|
void |
get(BlobKey blobKey,
File localFile)
Copies a blob to a local file.
|
void |
get(JobID jobId,
String key,
File localFile)
Copies a blob to a local file.
|
void |
put(File localFile,
BlobKey blobKey)
Copies the local file to the blob store.
|
void |
put(File localFile,
JobID jobId,
String key)
Copies a local file to the blob store.
|
public FileSystemBlobStore(FileSystem fileSystem, String storagePath) throws IOException
IOExceptionpublic void put(File localFile, BlobKey blobKey) throws IOException
BlobStoreput in interface BlobStorelocalFile - The file to copyblobKey - The ID for the file in the blob storeIOException - If the copy failspublic void put(File localFile, JobID jobId, String key) throws IOException
BlobStoreThe job ID and key make up a composite key for the file.
put in interface BlobStorelocalFile - The file to copyjobId - The JobID part of ID for the file in the blob storekey - The String part of ID for the file in the blob storeIOException - If the copy failspublic void get(BlobKey blobKey, File localFile) throws IOException
BlobViewget in interface BlobViewblobKey - The blob IDlocalFile - The local file to copy toIOException - If the copy failspublic void get(JobID jobId, String key, File localFile) throws IOException
BlobViewget in interface BlobViewjobId - The JobID part of ID for the blobkey - The String part of ID for the bloblocalFile - The local file to copy toIOException - If the copy failspublic void delete(BlobKey blobKey)
BlobStoreNOTE: This also tries to delete any created directories if empty.
public void delete(JobID jobId, String key)
BlobStoreNOTE: This also tries to delete any created directories if empty.
public void deleteAll(JobID jobId)
BlobStoreNOTE: This also tries to delete any created directories if empty.
public void closeAndCleanupAllData()
BlobStoreServicecloseAndCleanupAllData in interface BlobStoreServicepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.