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
Modifier and TypeClassDescriptionclass
class
class
Nested classes/interfaces inherited from class org.apache.storm.blobstore.ClientBlobStore
ClientBlobStore.WithBlobstore
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected AtomicOutputStream
createBlobToExtend
(String key, SettableBlobMeta meta) Client facing API to create a blob.void
Creates state inside a zookeeper.void
deleteBlob
(String key) Client facing API to delete a blob.protected void
finalize()
Client facing API to read a blob.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
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.listKeys()
List keys.void
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()
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.Methods inherited from class org.apache.storm.blobstore.ClientBlobStore
createBlob, setBlobMeta, withConfiguredClient
-
Constructor Details
-
NimbusBlobStore
public NimbusBlobStore()
-
-
Method Details
-
prepare
Description copied from class:ClientBlobStore
Sets up the client API by parsing the configs.- Specified by:
prepare
in 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:ClientBlobStore
Client facing API to create a blob.- Specified by:
createBlobToExtend
in classClientBlobStore
- Parameters:
key
- blob key namemeta
- contains ACL information- Returns:
- AtomicOutputStream returns an output stream into which data can be written
- Throws:
AuthorizationException
KeyAlreadyExistsException
-
updateBlob
public AtomicOutputStream updateBlob(String key) throws AuthorizationException, KeyNotFoundException Description copied from class:ClientBlobStore
Client facing API to update a blob.- Specified by:
updateBlob
in classClientBlobStore
- Parameters:
key
- blob key name- Returns:
- AtomicOutputStream returns an output stream into which data can be written
- Throws:
AuthorizationException
KeyNotFoundException
-
getBlobMeta
Description copied from class:ClientBlobStore
Client facing API to read the metadata information.- Specified by:
getBlobMeta
in classClientBlobStore
- Parameters:
key
- blob key name- Returns:
- AtomicOutputStream returns an output stream into which data can be written
- Throws:
AuthorizationException
KeyNotFoundException
-
isRemoteBlobExists
Description copied from class:ClientBlobStore
Decide if the blob is deleted from cluster.- Specified by:
isRemoteBlobExists
in classClientBlobStore
- Parameters:
blobKey
- blob key- Throws:
AuthorizationException
-
setBlobMetaToExtend
protected void setBlobMetaToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException Description copied from class:ClientBlobStore
Client facing API to set the metadata for a blob.- Specified by:
setBlobMetaToExtend
in classClientBlobStore
- Parameters:
key
- blob key namemeta
- contains ACL information- Throws:
AuthorizationException
KeyNotFoundException
-
deleteBlob
Description copied from class:ClientBlobStore
Client facing API to delete a blob.- Specified by:
deleteBlob
in classClientBlobStore
- Parameters:
key
- blob key name- Throws:
AuthorizationException
KeyNotFoundException
-
createStateInZookeeper
Description copied from class:ClientBlobStore
Creates 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:
createStateInZookeeper
in classClientBlobStore
-
getBlob
Description copied from class:ClientBlobStore
Client facing API to read a blob.- Specified by:
getBlob
in classClientBlobStore
- Parameters:
key
- blob key name- Returns:
- an InputStream to read the metadata for a blob
- Throws:
AuthorizationException
KeyNotFoundException
-
listKeys
Description copied from class:ClientBlobStore
List keys.- Specified by:
listKeys
in classClientBlobStore
- Returns:
- Iterator for a list of keys currently present in the blob store.
-
getBlobReplication
Description copied from class:ClientBlobStore
Client facing API to read the replication of a blob.- Specified by:
getBlobReplication
in classClientBlobStore
- Parameters:
key
- blob key name- Returns:
- int indicates the replication factor of a blob
- Throws:
AuthorizationException
KeyNotFoundException
-
updateBlobReplication
public int updateBlobReplication(String key, int replication) throws AuthorizationException, KeyNotFoundException Description copied from class:ClientBlobStore
Client facing API to update the replication of a blob.- Specified by:
updateBlobReplication
in 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:
AuthorizationException
KeyNotFoundException
-
setClient
Description copied from class:ClientBlobStore
Client facing API to set a nimbus client.- Specified by:
setClient
in 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:
shutdown
in interfaceShutdownable
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in classClientBlobStore
-
getRemoteBlobstoreUpdateTime
Description copied from class:ClientBlobStore
Client facing API to get the last update time of existing blobs in a blobstore. This is only required for use on supervisors.- Specified by:
getRemoteBlobstoreUpdateTime
in classClientBlobStore
- Returns:
- the timestamp of when the blobstore was last updated. -1L if the blobstore does not support this.
- Throws:
IOException
-