Class CompositeNodeStore

  • All Implemented Interfaces:
    org.apache.jackrabbit.oak.spi.commit.Observable, org.apache.jackrabbit.oak.spi.state.NodeStore, org.apache.jackrabbit.oak.spi.state.PrefetchNodeStore

    public class CompositeNodeStore
    extends java.lang.Object
    implements org.apache.jackrabbit.oak.spi.state.NodeStore, org.apache.jackrabbit.oak.spi.state.PrefetchNodeStore, org.apache.jackrabbit.oak.spi.commit.Observable
    A NodeStore implementation that combines other NodeStore instances mounted under paths defined by Mount.

    The main objective of this implementation is to proxy operations working on at most single read-write store with any number of read-only stores. While the composition would technically work at the NodeStore level there are several less-than-obvious issues which prevent it:

    1. Thread safety of the write operation can be quite costly, and will come on top of the thread safety measures already put in place by the composite node stores.
    2. Many JCR subsystems require global state, e.g. the versioning store. This global state can become corrupt if multiple mounts operate on it or if mounts are added and removed.

    As such, the only supported configuration is at most a single write-enabled store.

    Because of the limitation described above, right now the only correct way to use CompositeNodeStore is to create a normal repository, split it into parts using oak-upgrade --{include,exclude}-paths and then configure this node store implementation to composite split parts together.

    • Field Summary

      • Fields inherited from interface org.apache.jackrabbit.oak.spi.state.PrefetchNodeStore

        NOOP
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.Closeable addObserver​(org.apache.jackrabbit.oak.spi.commit.Observer observer)  
      java.lang.String checkpoint​(long lifetime)  
      java.lang.String checkpoint​(long lifetime, java.util.Map<java.lang.String,​java.lang.String> properties)  
      java.util.Map<java.lang.String,​java.lang.String> checkpointInfo​(java.lang.String checkpoint)  
      java.lang.Iterable<java.lang.String> checkpoints()  
      org.apache.jackrabbit.oak.api.Blob createBlob​(java.io.InputStream inputStream)  
      org.apache.jackrabbit.oak.api.Blob getBlob​(java.lang.String reference)  
      org.apache.jackrabbit.oak.spi.state.NodeState getRoot()  
      org.apache.jackrabbit.oak.spi.state.NodeState merge​(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder, org.apache.jackrabbit.oak.spi.commit.CommitHook commitHook, org.apache.jackrabbit.oak.spi.commit.CommitInfo info)  
      void prefetch​(java.util.Collection<java.lang.String> paths, org.apache.jackrabbit.oak.spi.state.NodeState rootState)  
      org.apache.jackrabbit.oak.spi.state.NodeState rebase​(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder)  
      boolean release​(java.lang.String checkpoint)  
      org.apache.jackrabbit.oak.spi.state.NodeState reset​(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder)  
      org.apache.jackrabbit.oak.spi.state.NodeState retrieve​(java.lang.String checkpoint)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getRoot

        public org.apache.jackrabbit.oak.spi.state.NodeState getRoot()
        Specified by:
        getRoot in interface org.apache.jackrabbit.oak.spi.state.NodeStore
      • merge

        public org.apache.jackrabbit.oak.spi.state.NodeState merge​(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder,
                                                                   org.apache.jackrabbit.oak.spi.commit.CommitHook commitHook,
                                                                   org.apache.jackrabbit.oak.spi.commit.CommitInfo info)
                                                            throws org.apache.jackrabbit.oak.api.CommitFailedException
        Specified by:
        merge in interface org.apache.jackrabbit.oak.spi.state.NodeStore
        Throws:
        org.apache.jackrabbit.oak.api.CommitFailedException
      • rebase

        public org.apache.jackrabbit.oak.spi.state.NodeState rebase​(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder)
        Specified by:
        rebase in interface org.apache.jackrabbit.oak.spi.state.NodeStore
      • reset

        public org.apache.jackrabbit.oak.spi.state.NodeState reset​(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder)
        Specified by:
        reset in interface org.apache.jackrabbit.oak.spi.state.NodeStore
      • createBlob

        public org.apache.jackrabbit.oak.api.Blob createBlob​(java.io.InputStream inputStream)
                                                      throws java.io.IOException
        Specified by:
        createBlob in interface org.apache.jackrabbit.oak.spi.state.NodeStore
        Throws:
        java.io.IOException
      • getBlob

        public org.apache.jackrabbit.oak.api.Blob getBlob​(java.lang.String reference)
        Specified by:
        getBlob in interface org.apache.jackrabbit.oak.spi.state.NodeStore
      • checkpoints

        public java.lang.Iterable<java.lang.String> checkpoints()
        Specified by:
        checkpoints in interface org.apache.jackrabbit.oak.spi.state.NodeStore
      • checkpoint

        public java.lang.String checkpoint​(long lifetime,
                                           java.util.Map<java.lang.String,​java.lang.String> properties)
        Specified by:
        checkpoint in interface org.apache.jackrabbit.oak.spi.state.NodeStore
      • checkpoint

        public java.lang.String checkpoint​(long lifetime)
        Specified by:
        checkpoint in interface org.apache.jackrabbit.oak.spi.state.NodeStore
      • checkpointInfo

        public java.util.Map<java.lang.String,​java.lang.String> checkpointInfo​(java.lang.String checkpoint)
        Specified by:
        checkpointInfo in interface org.apache.jackrabbit.oak.spi.state.NodeStore
      • retrieve

        public org.apache.jackrabbit.oak.spi.state.NodeState retrieve​(java.lang.String checkpoint)
        Specified by:
        retrieve in interface org.apache.jackrabbit.oak.spi.state.NodeStore
      • release

        public boolean release​(java.lang.String checkpoint)
        Specified by:
        release in interface org.apache.jackrabbit.oak.spi.state.NodeStore
      • addObserver

        public java.io.Closeable addObserver​(org.apache.jackrabbit.oak.spi.commit.Observer observer)
        Specified by:
        addObserver in interface org.apache.jackrabbit.oak.spi.commit.Observable
      • prefetch

        public void prefetch​(java.util.Collection<java.lang.String> paths,
                             org.apache.jackrabbit.oak.spi.state.NodeState rootState)
        Specified by:
        prefetch in interface org.apache.jackrabbit.oak.spi.state.PrefetchNodeStore