public abstract class ClientBlobStore extends Object implements Shutdownable, AutoCloseable
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
NimbusBlobStore| Modifier and Type | Class and Description |
|---|---|
static interface |
ClientBlobStore.WithBlobstore |
| Constructor and Description |
|---|
ClientBlobStore() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close() |
AtomicOutputStream |
createBlob(String key,
SettableBlobMeta meta)
Client facing API to create a blob.
|
protected abstract AtomicOutputStream |
createBlobToExtend(String key,
SettableBlobMeta meta)
Client facing API to create a blob.
|
abstract void |
createStateInZookeeper(String key)
Creates state inside a zookeeper.
|
abstract void |
deleteBlob(String key)
Client facing API to delete a blob.
|
abstract InputStreamWithMeta |
getBlob(String key)
Client facing API to read a blob.
|
abstract ReadableBlobMeta |
getBlobMeta(String key)
Client facing API to read the metadata information.
|
abstract int |
getBlobReplication(String key)
Client facing API to read the replication of a blob.
|
abstract long |
getRemoteBlobstoreUpdateTime()
Client facing API to get the last update time of existing blobs in a blobstore.
|
abstract boolean |
isRemoteBlobExists(String blobKey)
Decide if the blob is deleted from cluster.
|
abstract Iterator<String> |
listKeys()
List keys.
|
abstract void |
prepare(Map<String,Object> conf)
Sets up the client API by parsing the configs.
|
void |
setBlobMeta(String key,
SettableBlobMeta meta)
Client facing API to set the metadata for a blob.
|
protected abstract void |
setBlobMetaToExtend(String key,
SettableBlobMeta meta)
Client facing API to set the metadata for a blob.
|
abstract boolean |
setClient(Map<String,Object> conf,
NimbusClient client)
Client facing API to set a nimbus client.
|
abstract AtomicOutputStream |
updateBlob(String key)
Client facing API to update a blob.
|
abstract int |
updateBlobReplication(String key,
int replication)
Client facing API to update the replication of a blob.
|
static void |
withConfiguredClient(ClientBlobStore.WithBlobstore withBlobstore) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitshutdownpublic static void withConfiguredClient(ClientBlobStore.WithBlobstore withBlobstore) throws Exception
Exceptionpublic abstract void prepare(Map<String,Object> conf)
Sets up the client API by parsing the configs.
conf - The storm conf containing the config detailsprotected abstract AtomicOutputStream createBlobToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyAlreadyExistsException
Client facing API to create a blob.
key - blob key namemeta - contains ACL informationAuthorizationExceptionKeyAlreadyExistsExceptionpublic abstract AtomicOutputStream updateBlob(String key) throws AuthorizationException, KeyNotFoundException
Client facing API to update a blob.
key - blob key nameAuthorizationExceptionKeyNotFoundExceptionpublic abstract ReadableBlobMeta getBlobMeta(String key) throws AuthorizationException, KeyNotFoundException
Client facing API to read the metadata information.
key - blob key nameAuthorizationExceptionKeyNotFoundExceptionpublic abstract boolean isRemoteBlobExists(String blobKey) throws AuthorizationException
Decide if the blob is deleted from cluster.
blobKey - blob keyAuthorizationExceptionprotected abstract void setBlobMetaToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException
Client facing API to set the metadata for a blob.
key - blob key namemeta - contains ACL informationAuthorizationExceptionKeyNotFoundExceptionpublic abstract void deleteBlob(String key) throws AuthorizationException, KeyNotFoundException
Client facing API to delete a blob.
key - blob key nameAuthorizationExceptionKeyNotFoundExceptionpublic abstract InputStreamWithMeta getBlob(String key) throws AuthorizationException, KeyNotFoundException
Client facing API to read a blob.
key - blob key nameAuthorizationExceptionKeyNotFoundExceptionpublic abstract Iterator<String> listKeys()
List keys.
public abstract int getBlobReplication(String key) throws AuthorizationException, KeyNotFoundException
Client facing API to read the replication of a blob.
key - blob key nameAuthorizationExceptionKeyNotFoundExceptionpublic abstract int updateBlobReplication(String key, int replication) throws AuthorizationException, KeyNotFoundException
Client facing API to update the replication of a blob.
key - blob key namereplication - int indicates the replication factor a blob has to be setAuthorizationExceptionKeyNotFoundExceptionpublic abstract boolean setClient(Map<String,Object> conf, NimbusClient client)
Client facing API to set a nimbus client.
conf - storm confclient - NimbusClientpublic abstract void createStateInZookeeper(String key)
Creates state inside a zookeeper. Required for blobstore to write to zookeeper when Nimbus HA is turned on in order to maintain state consistency.
public abstract void close()
close in interface AutoCloseablepublic final AtomicOutputStream createBlob(String key, SettableBlobMeta meta) throws AuthorizationException, KeyAlreadyExistsException
Client facing API to create a blob.
key - blob key namemeta - contains ACL informationAuthorizationExceptionKeyAlreadyExistsExceptionpublic final void setBlobMeta(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException
Client facing API to set the metadata for a blob.
key - blob key namemeta - contains ACL informationAuthorizationExceptionKeyNotFoundExceptionpublic abstract long getRemoteBlobstoreUpdateTime()
throws IOException
Client facing API to get the last update time of existing blobs in a blobstore. This is only required for use on supervisors.
IOExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.