Class MongoBlobStore

    • Field Detail

      • COLLECTION_BLOBS

        public static final java.lang.String COLLECTION_BLOBS
        See Also:
        Constant Field Values
    • Constructor Detail

      • MongoBlobStore

        public MongoBlobStore​(com.mongodb.client.MongoDatabase db)
        Constructs a new MongoBlobStore
        Parameters:
        db - the database
      • MongoBlobStore

        public MongoBlobStore​(com.mongodb.client.MongoDatabase db,
                              long cacheSize)
        Constructs a new MongoBlobStore
        Parameters:
        db - the database
        cacheSize - the cache size
      • MongoBlobStore

        public MongoBlobStore​(@NotNull
                              @NotNull com.mongodb.client.MongoDatabase db,
                              long cacheSize,
                              @Nullable
                              @Nullable DocumentNodeStoreBuilder<?> builder)
        Constructs a new MongoBlobStore
        Parameters:
        db - the database
        cacheSize - the cache size
        builder - DocumentNodeStoreBuilder, supplying further options
    • Method Detail

      • 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 blockId)
                                       throws java.lang.Exception
        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:
        blockId - the block id
        Returns:
        the block data, or null
        Throws:
        java.lang.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
      • 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