Class CloudBlobStore

    • Constructor Detail

      • CloudBlobStore

        public CloudBlobStore()
    • Method Detail

      • getCloudContainer

        protected java.lang.String getCloudContainer()
      • setCloudContainer

        public void setCloudContainer​(java.lang.String cloudContainer)
      • getAccessKey

        public java.lang.String getAccessKey()
      • setAccessKey

        public void setAccessKey​(java.lang.String accessKey)
      • getSecretKey

        public java.lang.String getSecretKey()
      • setSecretKey

        public void setSecretKey​(java.lang.String secretKey)
      • getCloudProvider

        public java.lang.String getCloudProvider()
      • setCloudProvider

        public void setCloudProvider​(java.lang.String cloudProvider)
      • init

        public void init()
                  throws java.lang.Exception
        Instantiates a connection to the cloud blob store.
        Throws:
        java.lang.Exception - if an error occurs
      • storeBlock

        protected void storeBlock​(byte[] digest,
                                  int level,
                                  byte[] data)
                           throws java.io.IOException
        Uploads the block to the cloud service.
        Specified by:
        storeBlock in class AbstractBlobStore
        Parameters:
        digest - the content hash (32 bytes)
        level - the indirection level (0 is for user data, 1 is a list of digests that point to user data, 2 is a list of digests that point to digests, and so on). This parameter is for informational use only, and it is not required to store it unless that's easy to achieve
        data - the data to be stored (the number of bytes is at most the block size)
        Throws:
        java.io.IOException
      • readBlockFromBackend

        protected byte[] readBlockFromBackend​(AbstractBlobStore.BlockId blockId)
                                       throws java.lang.Exception
        Reads the data from the actual cloud service.
        Specified by:
        readBlockFromBackend in class AbstractBlobStore
        Parameters:
        blockId - the block id
        Returns:
        the block data, or null
        Throws:
        java.lang.Exception
      • deleteBucket

        public void deleteBucket()
        Delete the cloud container and all its contents.
      • getAllChunkIds

        public java.util.Iterator<java.lang.String> getAllChunkIds​(long maxLastModifiedTime)
                                                            throws java.lang.Exception
        Description copied from interface: GarbageCollectableBlobStore
        Gets all the identifiers.
        Parameters:
        maxLastModifiedTime - the max last modified time to consider for retrieval, with the special value '0' meaning no filtering by time
        Returns:
        the identifiers
        Throws:
        java.lang.Exception - the exception
      • countDeleteChunks

        public long countDeleteChunks​(java.util.List<java.lang.String> chunkIds,
                                      long maxLastModifiedTime)
                               throws java.lang.Exception
        Description copied from interface: GarbageCollectableBlobStore
        Deletes the blobs with the given ids.
        Parameters:
        chunkIds - the chunk ids
        maxLastModifiedTime - the max last modified time to consider for retrieval, with the special value '0' meaning no filtering by time
        Returns:
        long the count of successful deletions
        Throws:
        java.lang.Exception - the exception