org.apache.jackrabbit.mk.blobs
Class DbBlobStore

java.lang.Object
  extended by org.apache.jackrabbit.mk.blobs.AbstractBlobStore
      extended by org.apache.jackrabbit.mk.blobs.DbBlobStore
All Implemented Interfaces:
BlobStore, Cache.Backend<AbstractBlobStore.BlockId,AbstractBlobStore.Data>

public class DbBlobStore
extends AbstractBlobStore

A database blob store.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.jackrabbit.mk.blobs.AbstractBlobStore
AbstractBlobStore.BlockId, AbstractBlobStore.Data
 
Field Summary
 
Fields inherited from class org.apache.jackrabbit.mk.blobs.AbstractBlobStore
BLOCK_SIZE_LIMIT, HASH_ALGORITHM, inUse, TYPE_DATA, TYPE_HASH, TYPE_HASH_COMPRESSED
 
Constructor Summary
DbBlobStore()
           
 
Method Summary
protected  boolean isMarkEnabled()
           
protected  void mark(AbstractBlobStore.BlockId blockId)
           
protected  byte[] readBlockFromBackend(AbstractBlobStore.BlockId blockId)
          Load the block from the storage backend.
 void setConnectionPool(org.h2.jdbcx.JdbcConnectionPool cp)
           
 void startMark()
           
protected  void storeBlock(byte[] digest, int level, byte[] data)
           
 int sweep()
           
 
Methods inherited from class org.apache.jackrabbit.mk.blobs.AbstractBlobStore
clearCache, clearInUse, getBlobLength, getBlockSize, getBlockSizeMin, load, mark, markInUse, readBlob, setBlockSize, setBlockSizeMin, usesBlobId, writeBlob, writeBlob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbBlobStore

public DbBlobStore()
Method Detail

setConnectionPool

public void setConnectionPool(org.h2.jdbcx.JdbcConnectionPool cp)
                       throws SQLException
Throws:
SQLException

storeBlock

protected void storeBlock(byte[] digest,
                          int level,
                          byte[] data)
                   throws SQLException
Specified by:
storeBlock in class AbstractBlobStore
Throws:
SQLException

readBlockFromBackend

protected byte[] readBlockFromBackend(AbstractBlobStore.BlockId blockId)
                               throws 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:
Exception

startMark

public void startMark()
               throws Exception
Specified by:
startMark in class AbstractBlobStore
Throws:
Exception

isMarkEnabled

protected boolean isMarkEnabled()
Specified by:
isMarkEnabled in class AbstractBlobStore

mark

protected void mark(AbstractBlobStore.BlockId blockId)
             throws Exception
Specified by:
mark in class AbstractBlobStore
Throws:
Exception

sweep

public int sweep()
          throws Exception
Specified by:
sweep in class AbstractBlobStore
Throws:
Exception


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.