Class CloudBlobStore

java.lang.Object
org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
org.apache.jackrabbit.oak.plugins.blob.CachingBlobStore
org.apache.jackrabbit.oak.plugins.blob.cloud.CloudBlobStore
All Implemented Interfaces:
AutoCloseable, org.apache.jackrabbit.oak.commons.cache.Cache.Backend<org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId,org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.Data>, org.apache.jackrabbit.oak.spi.blob.BlobStore, org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore

public class CloudBlobStore extends CachingBlobStore
Implementation of the BlobStore to store blobs in a cloud blob store.

Extends AbstractBlobStore and breaks the the binary to chunks for easier management.

  • Constructor Details

    • CloudBlobStore

      public CloudBlobStore()
  • Method Details

    • getCloudContainer

      protected String getCloudContainer()
    • setCloudContainer

      public void setCloudContainer(String cloudContainer)
    • getAccessKey

      public String getAccessKey()
    • setAccessKey

      public void setAccessKey(String accessKey)
    • getSecretKey

      public String getSecretKey()
    • setSecretKey

      public void setSecretKey(String secretKey)
    • getCloudProvider

      public String getCloudProvider()
    • setCloudProvider

      public void setCloudProvider(String cloudProvider)
    • init

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

      protected void storeBlock(byte[] digest, int level, byte[] data) throws IOException
      Uploads the block to the cloud service.
      Specified by:
      storeBlock in class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
      Throws:
      IOException
    • readBlockFromBackend

      protected byte[] readBlockFromBackend(org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId blockId) throws Exception
      Reads the data from the actual cloud service.
      Specified by:
      readBlockFromBackend in class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
      Throws:
      Exception
    • deleteBucket

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

      public void startMark() throws IOException
      Specified by:
      startMark in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore
      Specified by:
      startMark in class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
      Throws:
      IOException
    • mark

      protected void mark(org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId id) throws Exception
      Specified by:
      mark in class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
      Throws:
      Exception
    • sweep

      public int sweep() throws IOException
      Specified by:
      sweep in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore
      Specified by:
      sweep in class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
      Throws:
      IOException
    • isMarkEnabled

      protected boolean isMarkEnabled()
      Specified by:
      isMarkEnabled in class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
    • getAllChunkIds

      public Iterator<String> getAllChunkIds(long maxLastModifiedTime) throws Exception
      Throws:
      Exception
    • countDeleteChunks

      public long countDeleteChunks(List<String> chunkIds, long maxLastModifiedTime) throws Exception
      Throws:
      Exception