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 |
conf
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.
|
Iterator<String> |
listKeys() |
void |
prepare(Map 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 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
public void prepare(Map conf)
ClientBlobStore
Sets up the client API by parsing the configs.
prepare
in class ClientBlobStore
conf
- The storm conf containing the config details.protected AtomicOutputStream createBlobToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyAlreadyExistsException
ClientBlobStore
Client facing API to create a blob.
createBlobToExtend
in class ClientBlobStore
key
- blob key name.meta
- contains ACL information.AuthorizationException
KeyAlreadyExistsException
public AtomicOutputStream updateBlob(String key) throws AuthorizationException, KeyNotFoundException
ClientBlobStore
Client facing API to update a blob.
updateBlob
in class ClientBlobStore
key
- blob key name.AuthorizationException
KeyNotFoundException
public ReadableBlobMeta getBlobMeta(String key) throws AuthorizationException, KeyNotFoundException
ClientBlobStore
Client facing API to read the metadata information.
getBlobMeta
in class ClientBlobStore
key
- blob key name.AuthorizationException
KeyNotFoundException
protected void setBlobMetaToExtend(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException
ClientBlobStore
Client facing API to set the metadata for a blob.
setBlobMetaToExtend
in class ClientBlobStore
key
- blob key name.meta
- contains ACL information.AuthorizationException
KeyNotFoundException
public void deleteBlob(String key) throws AuthorizationException, KeyNotFoundException
ClientBlobStore
Client facing API to delete a blob.
deleteBlob
in class ClientBlobStore
key
- blob key name.AuthorizationException
KeyNotFoundException
public void createStateInZookeeper(String key)
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
createStateInZookeeper
in class ClientBlobStore
public InputStreamWithMeta getBlob(String key) throws AuthorizationException, KeyNotFoundException
ClientBlobStore
Client facing API to read a blob.
getBlob
in class ClientBlobStore
key
- blob key name.AuthorizationException
KeyNotFoundException
public Iterator<String> listKeys()
listKeys
in class ClientBlobStore
public int getBlobReplication(String key) throws AuthorizationException, KeyNotFoundException
ClientBlobStore
Client facing API to read the replication of a blob.
getBlobReplication
in class ClientBlobStore
key
- blob key name.AuthorizationException
KeyNotFoundException
public int updateBlobReplication(String key, int replication) throws AuthorizationException, KeyNotFoundException
ClientBlobStore
Client facing API to update the replication of a blob.
updateBlobReplication
in class ClientBlobStore
key
- blob key name.replication
- int indicates the replication factor a blob has to be set.AuthorizationException
KeyNotFoundException
public boolean setClient(Map conf, NimbusClient client)
ClientBlobStore
Client facing API to set a nimbus client.
setClient
in class ClientBlobStore
conf
- storm confclient
- NimbusClientpublic void shutdown()
shutdown
in interface Shutdownable
public void close()
close
in interface AutoCloseable
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.