Class FileBlobStore

    • Constructor Detail

      • FileBlobStore

        public FileBlobStore​(java.lang.String dir)
    • Method Detail

      • writeBlob

        public java.lang.String writeBlob​(java.lang.String tempFilePath)
                                   throws java.io.IOException
        Description copied from interface: GarbageCollectableBlobStore
        Write a blob from a temporary file. The temporary file is removed afterwards. A file based blob stores might simply rename the file, so that no additional writes are necessary.
        Specified by:
        writeBlob in interface GarbageCollectableBlobStore
        Overrides:
        writeBlob in class AbstractBlobStore
        Parameters:
        tempFilePath - the temporary file name
        Returns:
        the blob id
        Throws:
        java.io.IOException
      • storeBlock

        protected void storeBlock​(byte[] digest,
                                  int level,
                                  byte[] data)
                           throws java.io.IOException
        Description copied from class: AbstractBlobStore
        Store a block of data.
        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 id)
                                       throws java.io.IOException
        Description copied from class: AbstractBlobStore
        Load the block from the storage backend. Returns null if the block was not found.
        Specified by:
        readBlockFromBackend in class AbstractBlobStore
        Parameters:
        id - the block id
        Returns:
        the block data, or null
        Throws:
        java.io.IOException
      • 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
      • 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