Package org.apache.storm.blobstore
Class NimbusBlobStore
java.lang.Object
org.apache.storm.blobstore.ClientBlobStore
org.apache.storm.blobstore.NimbusBlobStore
- All Implemented Interfaces:
AutoCloseable,Shutdownable
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclassNested classes/interfaces inherited from class org.apache.storm.blobstore.ClientBlobStore
ClientBlobStore.WithBlobstore -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected AtomicOutputStreamcreateBlobToExtend(String key, SettableBlobMeta meta) Client facing API to create a blob.voidCreates state inside a zookeeper.voiddeleteBlob(String key) Client facing API to delete a blob.protected voidfinalize()Client facing API to read a blob.getBlobMeta(String key) Client facing API to read the metadata information.intgetBlobReplication(String key) Client facing API to read the replication of a blob.longClient facing API to get the last update time of existing blobs in a blobstore.booleanisRemoteBlobExists(String blobKey) Decide if the blob is deleted from cluster.listKeys()List keys.voidSets up the client API by parsing the configs.protected voidsetBlobMetaToExtend(String key, SettableBlobMeta meta) Client facing API to set the metadata for a blob.booleansetClient(Map<String, Object> conf, NimbusClient client) Client facing API to set a nimbus client.voidshutdown()updateBlob(String key) Client facing API to update a blob.intupdateBlobReplication(String key, int replication) Client facing API to update the replication of a blob.Methods inherited from class org.apache.storm.blobstore.ClientBlobStore
createBlob, setBlobMeta, withConfiguredClient
-
Constructor Details
-
NimbusBlobStore
public NimbusBlobStore()
-
-
Method Details
-
prepare
Description copied from class:ClientBlobStoreSets up the client API by parsing the configs.- Specified by:
preparein classClientBlobStore- Parameters:
conf- The storm conf containing the config details
-
createBlobToExtend
protected AtomicOutputStream createBlobToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyAlreadyExistsException Description copied from class:ClientBlobStoreClient facing API to create a blob.- Specified by:
createBlobToExtendin classClientBlobStore- Parameters:
key- blob key namemeta- contains ACL information- Returns:
- AtomicOutputStream returns an output stream into which data can be written
- Throws:
AuthorizationExceptionKeyAlreadyExistsException
-
updateBlob
public AtomicOutputStream updateBlob(String key) throws AuthorizationException, KeyNotFoundException Description copied from class:ClientBlobStoreClient facing API to update a blob.- Specified by:
updateBlobin classClientBlobStore- Parameters:
key- blob key name- Returns:
- AtomicOutputStream returns an output stream into which data can be written
- Throws:
AuthorizationExceptionKeyNotFoundException
-
getBlobMeta
Description copied from class:ClientBlobStoreClient facing API to read the metadata information.- Specified by:
getBlobMetain classClientBlobStore- Parameters:
key- blob key name- Returns:
- AtomicOutputStream returns an output stream into which data can be written
- Throws:
AuthorizationExceptionKeyNotFoundException
-
isRemoteBlobExists
Description copied from class:ClientBlobStoreDecide if the blob is deleted from cluster.- Specified by:
isRemoteBlobExistsin classClientBlobStore- Parameters:
blobKey- blob key- Throws:
AuthorizationException
-
setBlobMetaToExtend
protected void setBlobMetaToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException Description copied from class:ClientBlobStoreClient facing API to set the metadata for a blob.- Specified by:
setBlobMetaToExtendin classClientBlobStore- Parameters:
key- blob key namemeta- contains ACL information- Throws:
AuthorizationExceptionKeyNotFoundException
-
deleteBlob
Description copied from class:ClientBlobStoreClient facing API to delete a blob.- Specified by:
deleteBlobin classClientBlobStore- Parameters:
key- blob key name- Throws:
AuthorizationExceptionKeyNotFoundException
-
createStateInZookeeper
Description copied from class:ClientBlobStoreCreates state inside a zookeeper. Required for blobstore to write to zookeeper when Nimbus HA is turned on in order to maintain state consistency.- Specified by:
createStateInZookeeperin classClientBlobStore
-
getBlob
Description copied from class:ClientBlobStoreClient facing API to read a blob.- Specified by:
getBlobin classClientBlobStore- Parameters:
key- blob key name- Returns:
- an InputStream to read the metadata for a blob
- Throws:
AuthorizationExceptionKeyNotFoundException
-
listKeys
Description copied from class:ClientBlobStoreList keys.- Specified by:
listKeysin classClientBlobStore- Returns:
- Iterator for a list of keys currently present in the blob store.
-
getBlobReplication
Description copied from class:ClientBlobStoreClient facing API to read the replication of a blob.- Specified by:
getBlobReplicationin classClientBlobStore- Parameters:
key- blob key name- Returns:
- int indicates the replication factor of a blob
- Throws:
AuthorizationExceptionKeyNotFoundException
-
updateBlobReplication
public int updateBlobReplication(String key, int replication) throws AuthorizationException, KeyNotFoundException Description copied from class:ClientBlobStoreClient facing API to update the replication of a blob.- Specified by:
updateBlobReplicationin classClientBlobStore- Parameters:
key- blob key namereplication- int indicates the replication factor a blob has to be set- Returns:
- int indicates the replication factor of a blob
- Throws:
AuthorizationExceptionKeyNotFoundException
-
setClient
Description copied from class:ClientBlobStoreClient facing API to set a nimbus client.- Specified by:
setClientin classClientBlobStore- Parameters:
conf- storm confclient- NimbusClient- Returns:
- indicates where the client connection has been setup.
-
finalize
protected void finalize() -
shutdown
public void shutdown()- Specified by:
shutdownin interfaceShutdownable
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classClientBlobStore
-
getRemoteBlobstoreUpdateTime
Description copied from class:ClientBlobStoreClient facing API to get the last update time of existing blobs in a blobstore. This is only required for use on supervisors.- Specified by:
getRemoteBlobstoreUpdateTimein classClientBlobStore- Returns:
- the timestamp of when the blobstore was last updated. -1L if the blobstore does not support this.
- Throws:
IOException
-