public class NimbusBlobStore extends ClientBlobStore implements AutoCloseable
NimbusBlobStore is a USER facing client API to perform basic operations such as create, update, delete and read for local and hdfs blob store.
For local blob store it is also the client facing API for supervisor in order to download blobs from nimbus.
| Modifier and Type | Class and Description |
|---|---|
class |
NimbusBlobStore.NimbusDownloadInputStream |
class |
NimbusBlobStore.NimbusKeyIterator |
class |
NimbusBlobStore.NimbusUploadAtomicOutputStream |
ClientBlobStore.WithBlobstore| Constructor and Description |
|---|
NimbusBlobStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected AtomicOutputStream |
createBlobToExtend(String key,
SettableBlobMeta meta)
Client facing API to create a blob.
|
void |
createStateInZookeeper(String key)
Creates state inside a zookeeper.
|
void |
deleteBlob(String key)
Client facing API to delete a blob.
|
protected void |
finalize() |
InputStreamWithMeta |
getBlob(String key)
Client facing API to read a blob.
|
ReadableBlobMeta |
getBlobMeta(String key)
Client facing API to read the metadata information.
|
int |
getBlobReplication(String key)
Client facing API to read the replication of a blob.
|
long |
getRemoteBlobstoreUpdateTime()
Client facing API to get the last update time of existing blobs in a blobstore.
|
boolean |
isRemoteBlobExists(String blobKey)
Decide if the blob is deleted from cluster.
|
Iterator<String> |
listKeys()
List keys.
|
void |
prepare(Map<String,Object> conf)
Sets up the client API by parsing the configs.
|
protected void |
setBlobMetaToExtend(String key,
SettableBlobMeta meta)
Client facing API to set the metadata for a blob.
|
boolean |
setClient(Map<String,Object> conf,
NimbusClient client)
Client facing API to set a nimbus client.
|
void |
shutdown() |
AtomicOutputStream |
updateBlob(String key)
Client facing API to update a blob.
|
int |
updateBlobReplication(String key,
int replication)
Client facing API to update the replication of a blob.
|
createBlob, setBlobMeta, withConfiguredClientpublic void prepare(Map<String,Object> conf)
ClientBlobStoreSets up the client API by parsing the configs.
prepare in class ClientBlobStoreconf - The storm conf containing the config detailsprotected AtomicOutputStream createBlobToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyAlreadyExistsException
ClientBlobStoreClient facing API to create a blob.
createBlobToExtend in class ClientBlobStorekey - blob key namemeta - contains ACL informationAuthorizationExceptionKeyAlreadyExistsExceptionpublic AtomicOutputStream updateBlob(String key) throws AuthorizationException, KeyNotFoundException
ClientBlobStoreClient facing API to update a blob.
updateBlob in class ClientBlobStorekey - blob key nameAuthorizationExceptionKeyNotFoundExceptionpublic ReadableBlobMeta getBlobMeta(String key) throws AuthorizationException, KeyNotFoundException
ClientBlobStoreClient facing API to read the metadata information.
getBlobMeta in class ClientBlobStorekey - blob key nameAuthorizationExceptionKeyNotFoundExceptionpublic boolean isRemoteBlobExists(String blobKey) throws AuthorizationException
ClientBlobStoreDecide if the blob is deleted from cluster.
isRemoteBlobExists in class ClientBlobStoreblobKey - blob keyAuthorizationExceptionprotected void setBlobMetaToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException
ClientBlobStoreClient facing API to set the metadata for a blob.
setBlobMetaToExtend in class ClientBlobStorekey - blob key namemeta - contains ACL informationAuthorizationExceptionKeyNotFoundExceptionpublic void deleteBlob(String key) throws AuthorizationException, KeyNotFoundException
ClientBlobStoreClient facing API to delete a blob.
deleteBlob in class ClientBlobStorekey - blob key nameAuthorizationExceptionKeyNotFoundExceptionpublic void createStateInZookeeper(String key)
ClientBlobStoreCreates state inside a zookeeper. Required for blobstore to write to zookeeper when Nimbus HA is turned on in order to maintain state consistency.
createStateInZookeeper in class ClientBlobStorepublic InputStreamWithMeta getBlob(String key) throws AuthorizationException, KeyNotFoundException
ClientBlobStoreClient facing API to read a blob.
getBlob in class ClientBlobStorekey - blob key nameAuthorizationExceptionKeyNotFoundExceptionpublic Iterator<String> listKeys()
ClientBlobStoreList keys.
listKeys in class ClientBlobStorepublic int getBlobReplication(String key) throws AuthorizationException, KeyNotFoundException
ClientBlobStoreClient facing API to read the replication of a blob.
getBlobReplication in class ClientBlobStorekey - blob key nameAuthorizationExceptionKeyNotFoundExceptionpublic int updateBlobReplication(String key, int replication) throws AuthorizationException, KeyNotFoundException
ClientBlobStoreClient facing API to update the replication of a blob.
updateBlobReplication in class ClientBlobStorekey - blob key namereplication - int indicates the replication factor a blob has to be setAuthorizationExceptionKeyNotFoundExceptionpublic boolean setClient(Map<String,Object> conf, NimbusClient client)
ClientBlobStoreClient facing API to set a nimbus client.
setClient in class ClientBlobStoreconf - storm confclient - NimbusClientpublic void shutdown()
shutdown in interface Shutdownablepublic void close()
close in interface AutoCloseableclose in class ClientBlobStorepublic long getRemoteBlobstoreUpdateTime()
throws IOException
ClientBlobStoreClient facing API to get the last update time of existing blobs in a blobstore. This is only required for use on supervisors.
getRemoteBlobstoreUpdateTime in class ClientBlobStoreIOExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.