Segment Store Modularization
This page describes the process of storing the Segment Store and its related implementation classes in its own bundle, separated from oak-core. The initial target of the analysis are the packages matching the filter org.apache.jackrabbit.oak.plugins.segment.*.
Backwards dependencies
These are the components that depend on the classes contained in org.apache.jackrabbit.oak.plugins.segment.*. This shows how much code in oak-core is coupled with the internal API or with the implementation classes of the Segment Store.
From oak-core
- org.apache.jackrabbit.oak.plugins.backup.FileStoreBackup;
- org.apache.jackrabbit.oak.plugins.backup.FileStoreRestore;
- org.apache.jackrabbit.oak.plugins.value.ValueImpl;
- org.apache.jackrabbit.oak.util.AbstractCheckpointMBean.
I listed here only dependencies from oak-core, ignoring the ones coming from oak-http and oak-tarmk-standby. In fact, assuming that the exported packages of the Segment Store provide the needed classes, these bundles will continue to work the same. I also ignored oak-run and oak-upgrade, because they are not relevant in a conversation assuming OSGi as the runtime environment of the Segment Store.
Forward dependencies
These are the components that the classes in org.apache.jackrabbit.oak.plugins.segment.* depend on. This shows how much code in oak-core is used by these packages.
Dependencies on API classes:
- org.apache.jackrabbit.oak.api.Blob;
- org.apache.jackrabbit.oak.api.CommitFailedException;
- org.apache.jackrabbit.oak.api.Descriptors;
- org.apache.jackrabbit.oak.api.PropertyState;
- org.apache.jackrabbit.oak.api.Type.
Dependencies on JMX APIs:
- org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean;
- org.apache.jackrabbit.oak.api.jmx.CheckpointMBean.
Dependencies on cache utility classes:
- org.apache.jackrabbit.oak.cache.CacheLIRS;
- org.apache.jackrabbit.oak.cache.CacheStats.
Dependencies on OSGi utility classes, and OSGi-based implementations of the whiteboard:
- org.apache.jackrabbit.oak.osgi.ObserverTracker;
- org.apache.jackrabbit.oak.osgi.OsgiUtil;
- org.apache.jackrabbit.oak.osgi.OsgiWhiteboard.
Dependencies on the blob internal API and implementation or utility classes:
- org.apache.jackrabbit.oak.plugins.blob.BlobGarbageCollector;
- org.apache.jackrabbit.oak.plugins.blob.BlobGC;
- org.apache.jackrabbit.oak.plugins.blob.BlobGCMBean;
- org.apache.jackrabbit.oak.plugins.blob.BlobReferenceRetriever;
- org.apache.jackrabbit.oak.plugins.blob.BlobStoreBlob;
- org.apache.jackrabbit.oak.plugins.blob.MarkSweepGarbageCollector;
- org.apache.jackrabbit.oak.plugins.blob.ReferenceCollector;
- org.apache.jackrabbit.oak.plugins.blob.SharedDataStore.
Dependencies on data store utility classes:
- org.apache.jackrabbit.oak.plugins.blob.datastore.SharedDataStoreUtils
Dependencies on utility classes for storing cluster identifiers in the repository:
- org.apache.jackrabbit.oak.plugins.identifier.ClusterRepositoryInfo.
Dependencies on the in-memory implementation of the NodeState API:
- org.apache.jackrabbit.oak.plugins.memory.AbstractBlob;
- org.apache.jackrabbit.oak.plugins.memory.AbstractPropertyState;
- org.apache.jackrabbit.oak.plugins.memory.BinaryPropertyState;
- org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState;
- org.apache.jackrabbit.oak.plugins.memory.MemoryChildNodeEntry;
- org.apache.jackrabbit.oak.plugins.memory.MemoryNodeBuilder;
- org.apache.jackrabbit.oak.plugins.memory.ModifiedNodeState;
- org.apache.jackrabbit.oak.plugins.memory.MultiBinaryPropertyState;
- org.apache.jackrabbit.oak.plugins.memory.PropertyStates.
Dependencies on the conversion utility class:
- org.apache.jackrabbit.oak.plugins.value.Conversions.
Dependencies on the internal API to define a commit and on implementation and utility classes:
- org.apache.jackrabbit.oak.spi.commit.ChangeDispatcher;
- org.apache.jackrabbit.oak.spi.commit.CommitHook;
- org.apache.jackrabbit.oak.spi.commit.CommitInfo;
- org.apache.jackrabbit.oak.spi.commit.Observable;
- org.apache.jackrabbit.oak.spi.commit.Observer.
Dependencies on garbage collection internal API and utility classes:
- org.apache.jackrabbit.oak.spi.gc.GCMonitor;
- org.apache.jackrabbit.oak.spi.gc.GCMonitorTracker.
Dependencies on the node store internal API and on implementation and utility classes:
- org.apache.jackrabbit.oak.spi.state.AbstractChildNodeEntry;
- org.apache.jackrabbit.oak.spi.state.AbstractNodeState;
- org.apache.jackrabbit.oak.spi.state.ApplyDiff;
- org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
- org.apache.jackrabbit.oak.spi.state.ConflictAnnotatingRebaseDiff;
- org.apache.jackrabbit.oak.spi.state.DefaultNodeStateDiff;
- org.apache.jackrabbit.oak.spi.state.NodeBuilder;
- org.apache.jackrabbit.oak.spi.state.NodeState;
- org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
- org.apache.jackrabbit.oak.spi.state.NodeStateUtils;
- org.apache.jackrabbit.oak.spi.state.NodeStore;
- org.apache.jackrabbit.oak.spi.state.ProxyNodeStore;
- org.apache.jackrabbit.oak.spi.state.RevisionGC;
- org.apache.jackrabbit.oak.spi.state.RevisionGCMBean.
Dependencies on the whiteboard API and on implementation and utility classes:
- org.apache.jackrabbit.oak.spi.whiteboard.AbstractServiceTracker;
- org.apache.jackrabbit.oak.spi.whiteboard.CompositeRegistration;
- org.apache.jackrabbit.oak.spi.whiteboard.Registration;
- org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardExecutor;
- org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils.
Dependency on time tracking utility class:
- org.apache.jackrabbit.oak.stats.Clock.
Dependency on utility class for a generic CheckpointMBean implementation:
- org.apache.jackrabbit.oak.util.AbstractCheckpointMBean
List of packages to export
According to the previous list of dependencies, the following packages should be exported for the new Segment Store bundle to access the functionalities it requires.
- org.apache.jackrabbit.oak.cache;
- org.apache.jackrabbit.oak.plugins.blob;
- org.apache.jackrabbit.oak.plugins.blob.datastore
Before exporting those packages, it would be better to review them and try to limit their exported surface.