org.apache.storm.blobstore

## Class NimbusBlobStore

- java.lang.Object
- - org.apache.storm.blobstore.ClientBlobStore
  - - org.apache.storm.blobstore.NimbusBlobStore

- All Implemented Interfaces:
    AutoCloseable, Shutdownable

      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.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `NimbusBlobStore.NimbusDownloadInputStream`
    `class` | `NimbusBlobStore.NimbusKeyIterator`
    `class` | `NimbusBlobStore.NimbusUploadAtomicOutputStream`

    - ### Nested classes/interfaces inherited from class org.apache.storm.blobstore.ClientBlobStore

      `ClientBlobStore.WithBlobstore`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NimbusBlobStore()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.
    `long` | `getRemoteBlobstoreUpdateTime()` 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.
    `Iterator<String>` | `listKeys()` List keys.
    `void` | `prepare(Map<String,Object> 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<String,Object> 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.

    - ### Methods inherited from class org.apache.storm.blobstore.ClientBlobStore

      `createBlob, setBlobMeta, withConfiguredClient`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NimbusBlobStore

          public NimbusBlobStore()

  - ### Method Detail

    - #### prepare

          public void prepare(Map<String,Object> conf)

      Description copied from class: `ClientBlobStore`

      Sets up the client API by parsing the configs.

      Specified by:
        `prepare` in class `ClientBlobStore`
      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 class `ClientBlobStore`
      Parameters:
        `key` - blob key name
        `meta` - 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 class `ClientBlobStore`
      Parameters:
        `key` - blob key name
      Returns:
        AtomicOutputStream returns an output stream into which data can be written
      Throws:
        `AuthorizationException`
        `KeyNotFoundException`

    - #### getBlobMeta

          public ReadableBlobMeta getBlobMeta(String key)
                                       throws AuthorizationException,
                                              KeyNotFoundException

      Description copied from class: `ClientBlobStore`

      Client facing API to read the metadata information.

      Specified by:
        `getBlobMeta` in class `ClientBlobStore`
      Parameters:
        `key` - blob key name
      Returns:
        AtomicOutputStream returns an output stream into which data can be written
      Throws:
        `AuthorizationException`
        `KeyNotFoundException`

    - #### isRemoteBlobExists

          public boolean isRemoteBlobExists(String blobKey)
                                     throws AuthorizationException

      Description copied from class: `ClientBlobStore`

      Decide if the blob is deleted from cluster.

      Specified by:
        `isRemoteBlobExists` in class `ClientBlobStore`
      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 class `ClientBlobStore`
      Parameters:
        `key` - blob key name
        `meta` - contains ACL information
      Throws:
        `AuthorizationException`
        `KeyNotFoundException`

    - #### deleteBlob

          public void deleteBlob(String key)
                          throws AuthorizationException,
                                 KeyNotFoundException

      Description copied from class: `ClientBlobStore`

      Client facing API to delete a blob.

      Specified by:
        `deleteBlob` in class `ClientBlobStore`
      Parameters:
        `key` - blob key name
      Throws:
        `AuthorizationException`
        `KeyNotFoundException`

    - #### createStateInZookeeper

          public void createStateInZookeeper(String key)

      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 class `ClientBlobStore`

    - #### getBlob

          public InputStreamWithMeta getBlob(String key)
                                      throws AuthorizationException,
                                             KeyNotFoundException

      Description copied from class: `ClientBlobStore`

      Client facing API to read a blob.

      Specified by:
        `getBlob` in class `ClientBlobStore`
      Parameters:
        `key` - blob key name
      Returns:
        an InputStream to read the metadata for a blob
      Throws:
        `AuthorizationException`
        `KeyNotFoundException`

    - #### listKeys

          public Iterator<String> listKeys()

      Description copied from class: `ClientBlobStore`

      List keys.

      Specified by:
        `listKeys` in class `ClientBlobStore`
      Returns:
        Iterator for a list of keys currently present in the blob store.

    - #### getBlobReplication

          public int getBlobReplication(String key)
                                 throws AuthorizationException,
                                        KeyNotFoundException

      Description copied from class: `ClientBlobStore`

      Client facing API to read the replication of a blob.

      Specified by:
        `getBlobReplication` in class `ClientBlobStore`
      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 class `ClientBlobStore`
      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`

    - #### setClient

          public boolean setClient(Map<String,Object> conf,
                                   NimbusClient client)

      Description copied from class: `ClientBlobStore`

      Client facing API to set a nimbus client.

      Specified by:
        `setClient` in class `ClientBlobStore`
      Parameters:
        `conf` - storm conf
        `client` - NimbusClient
      Returns:
        indicates where the client connection has been setup.

    - #### finalize

          protected void finalize()

      Overrides:
        `finalize` in class `Object`

    - #### shutdown

          public void shutdown()

      Specified by:
        `shutdown` in interface `Shutdownable`

    - #### close

          public void close()

      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in class `ClientBlobStore`

    - #### getRemoteBlobstoreUpdateTime

          public long getRemoteBlobstoreUpdateTime()
                                            throws IOException

      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 class `ClientBlobStore`
      Returns:
        the timestamp of when the blobstore was last updated. -1L if the blobstore does not support this.
      Throws:
        `IOException`

Copyright © 2021 The Apache Software Foundation. All rights reserved.