Class CompositeNodeStore
- java.lang.Object
-
- org.apache.jackrabbit.oak.composite.CompositeNodeStore
-
- All Implemented Interfaces:
org.apache.jackrabbit.oak.spi.commit.Observable
,org.apache.jackrabbit.oak.spi.state.NodeStore
public class CompositeNodeStore extends Object implements org.apache.jackrabbit.oak.spi.state.NodeStore, org.apache.jackrabbit.oak.spi.commit.Observable
ANodeStore
implementation that combines otherNodeStore
instances mounted under paths defined byMount
.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:
- 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.
- 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CompositeNodeStore.Builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Closeable
addObserver(org.apache.jackrabbit.oak.spi.commit.Observer observer)
String
checkpoint(long lifetime)
String
checkpoint(long lifetime, Map<String,String> properties)
Map<String,String>
checkpointInfo(String checkpoint)
Iterable<String>
checkpoints()
org.apache.jackrabbit.oak.api.Blob
createBlob(InputStream inputStream)
org.apache.jackrabbit.oak.api.Blob
getBlob(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)
org.apache.jackrabbit.oak.spi.state.NodeState
rebase(org.apache.jackrabbit.oak.spi.state.NodeBuilder builder)
boolean
release(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(String checkpoint)
-
-
-
Method Detail
-
getRoot
public org.apache.jackrabbit.oak.spi.state.NodeState getRoot()
- Specified by:
getRoot
in interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.apache.jackrabbit.oak.spi.state.NodeStore
-
createBlob
public org.apache.jackrabbit.oak.api.Blob createBlob(InputStream inputStream) throws IOException
- Specified by:
createBlob
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeStore
- Throws:
IOException
-
getBlob
public org.apache.jackrabbit.oak.api.Blob getBlob(String reference)
- Specified by:
getBlob
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeStore
-
checkpoints
public Iterable<String> checkpoints()
- Specified by:
checkpoints
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeStore
-
checkpoint
public String checkpoint(long lifetime, Map<String,String> properties)
- Specified by:
checkpoint
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeStore
-
checkpoint
public String checkpoint(long lifetime)
- Specified by:
checkpoint
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeStore
-
checkpointInfo
public Map<String,String> checkpointInfo(String checkpoint)
- Specified by:
checkpointInfo
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeStore
-
retrieve
public org.apache.jackrabbit.oak.spi.state.NodeState retrieve(String checkpoint)
- Specified by:
retrieve
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeStore
-
release
public boolean release(String checkpoint)
- Specified by:
release
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeStore
-
addObserver
public Closeable addObserver(org.apache.jackrabbit.oak.spi.commit.Observer observer)
- Specified by:
addObserver
in interfaceorg.apache.jackrabbit.oak.spi.commit.Observable
-
-