Package org.apache.storm.blobstore
Class ClientBlobStore
java.lang.Object
org.apache.storm.blobstore.ClientBlobStore
- All Implemented Interfaces:
- AutoCloseable,- Shutdownable
- Direct Known Subclasses:
- HdfsClientBlobStore,- LocalModeClientBlobStore,- NimbusBlobStore
The ClientBlobStore has two concrete implementations 1. NimbusBlobStore 2. HdfsClientBlobStore.
 
Create, update, read and delete are some of the basic operations defined by this interface. Each operation is validated for permissions against an user. We currently have NIMBUS_ADMINS and SUPERVISOR_ADMINS configuration. NIMBUS_ADMINS are given READ, WRITE and ADMIN access whereas the SUPERVISOR_ADMINS are given READ access in order to read and download the blobs form the nimbus.
The ACLs for the blob store are validated against whether the subject is a NIMBUS_ADMIN, SUPERVISOR_ADMIN or USER who has read, write or admin privileges in order to perform respective operations on the blob.
For more detailed implementation
- See Also:
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract voidclose()final AtomicOutputStreamcreateBlob(String key, SettableBlobMeta meta) Client facing API to create a blob.protected abstract AtomicOutputStreamcreateBlobToExtend(String key, SettableBlobMeta meta) Client facing API to create a blob.abstract voidCreates state inside a zookeeper.abstract voiddeleteBlob(String key) Client facing API to delete a blob.abstract InputStreamWithMetaClient facing API to read a blob.abstract ReadableBlobMetagetBlobMeta(String key) Client facing API to read the metadata information.abstract intgetBlobReplication(String key) Client facing API to read the replication of a blob.abstract longClient facing API to get the last update time of existing blobs in a blobstore.abstract booleanisRemoteBlobExists(String blobKey) Decide if the blob is deleted from cluster.listKeys()List keys.abstract voidSets up the client API by parsing the configs.final voidsetBlobMeta(String key, SettableBlobMeta meta) Client facing API to set the metadata for a blob.protected abstract voidsetBlobMetaToExtend(String key, SettableBlobMeta meta) Client facing API to set the metadata for a blob.abstract booleansetClient(Map<String, Object> conf, NimbusClient client) Client facing API to set a nimbus client.abstract AtomicOutputStreamupdateBlob(String key) Client facing API to update a blob.abstract intupdateBlobReplication(String key, int replication) Client facing API to update the replication of a blob.static voidwithConfiguredClient(ClientBlobStore.WithBlobstore withBlobstore) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.storm.daemon.Shutdownableshutdown
- 
Constructor Details- 
ClientBlobStorepublic ClientBlobStore()
 
- 
- 
Method Details- 
withConfiguredClientpublic static void withConfiguredClient(ClientBlobStore.WithBlobstore withBlobstore) throws Exception - Throws:
- Exception
 
- 
prepareSets up the client API by parsing the configs.- Parameters:
- conf- The storm conf containing the config details
 
- 
createBlobToExtendprotected abstract AtomicOutputStream createBlobToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyAlreadyExistsException Client facing API to create a blob.- Parameters:
- key- blob key name
- meta- contains ACL information
- Returns:
- AtomicOutputStream returns an output stream into which data can be written
- Throws:
- AuthorizationException
- KeyAlreadyExistsException
 
- 
updateBlobpublic abstract AtomicOutputStream updateBlob(String key) throws AuthorizationException, KeyNotFoundException Client facing API to update a blob.- Parameters:
- key- blob key name
- Returns:
- AtomicOutputStream returns an output stream into which data can be written
- Throws:
- AuthorizationException
- KeyNotFoundException
 
- 
getBlobMetapublic abstract ReadableBlobMeta getBlobMeta(String key) throws AuthorizationException, KeyNotFoundException Client facing API to read the metadata information.- Parameters:
- key- blob key name
- Returns:
- AtomicOutputStream returns an output stream into which data can be written
- Throws:
- AuthorizationException
- KeyNotFoundException
 
- 
isRemoteBlobExistsDecide if the blob is deleted from cluster.- Parameters:
- blobKey- blob key
- Throws:
- AuthorizationException
 
- 
setBlobMetaToExtendprotected abstract void setBlobMetaToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException Client facing API to set the metadata for a blob.- Parameters:
- key- blob key name
- meta- contains ACL information
- Throws:
- AuthorizationException
- KeyNotFoundException
 
- 
deleteBlobClient facing API to delete a blob.- Parameters:
- key- blob key name
- Throws:
- AuthorizationException
- KeyNotFoundException
 
- 
getBlobpublic abstract InputStreamWithMeta getBlob(String key) throws AuthorizationException, KeyNotFoundException Client facing API to read a blob.- Parameters:
- key- blob key name
- Returns:
- an InputStream to read the metadata for a blob
- Throws:
- AuthorizationException
- KeyNotFoundException
 
- 
listKeysList keys.- Returns:
- Iterator for a list of keys currently present in the blob store.
 
- 
getBlobReplicationpublic abstract int getBlobReplication(String key) throws AuthorizationException, KeyNotFoundException Client facing API to read the replication of a blob.- Parameters:
- key- blob key name
- Returns:
- int indicates the replication factor of a blob
- Throws:
- AuthorizationException
- KeyNotFoundException
 
- 
updateBlobReplicationpublic abstract int updateBlobReplication(String key, int replication) throws AuthorizationException, KeyNotFoundException Client facing API to update the replication of a blob.- Parameters:
- key- blob key name
- replication- int indicates the replication factor a blob has to be set
- Returns:
- int indicates the replication factor of a blob
- Throws:
- AuthorizationException
- KeyNotFoundException
 
- 
setClientClient facing API to set a nimbus client.- Parameters:
- conf- storm conf
- client- NimbusClient
- Returns:
- indicates where the client connection has been setup.
 
- 
createStateInZookeeperCreates state inside a zookeeper. Required for blobstore to write to zookeeper when Nimbus HA is turned on in order to maintain state consistency.
- 
closepublic abstract void close()- Specified by:
- closein interface- AutoCloseable
 
- 
createBlobpublic final AtomicOutputStream createBlob(String key, SettableBlobMeta meta) throws AuthorizationException, KeyAlreadyExistsException Client facing API to create a blob.- Parameters:
- key- blob key name
- meta- contains ACL information
- Returns:
- AtomicOutputStream returns an output stream into which data can be written
- Throws:
- AuthorizationException
- KeyAlreadyExistsException
 
- 
setBlobMetapublic final void setBlobMeta(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException Client facing API to set the metadata for a blob.- Parameters:
- key- blob key name
- meta- contains ACL information
- Throws:
- AuthorizationException
- KeyNotFoundException
 
- 
getRemoteBlobstoreUpdateTimeClient facing API to get the last update time of existing blobs in a blobstore. This is only required for use on supervisors.- Returns:
- the timestamp of when the blobstore was last updated. -1L if the blobstore does not support this.
- Throws:
- IOException
 
 
-