Class DocumentNodeStoreBuilder<T extends DocumentNodeStoreBuilder<T>>
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBuilder<T>
-
- Direct Known Subclasses:
MongoDocumentNodeStoreBuilderBase
,RDBDocumentNodeStoreBuilder
public class DocumentNodeStoreBuilder<T extends DocumentNodeStoreBuilder<T>> extends java.lang.Object
A generic builder for aDocumentNodeStore
. By default the builder will create an in-memoryDocumentNodeStore
. In most cases this is only useful for tests.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.jackrabbit.guava.common.base.Supplier<org.apache.jackrabbit.oak.spi.blob.BlobStore>
blobStoreSupplier
static int
DEFAULT_CACHE_SEGMENT_COUNT
static int
DEFAULT_CACHE_STACK_MOVE_DISTANCE
static int
DEFAULT_CHILDREN_CACHE_PERCENTAGE
static int
DEFAULT_DIFF_CACHE_PERCENTAGE
static long
DEFAULT_MEMORY_CACHE_SIZE
static int
DEFAULT_NODE_CACHE_PERCENTAGE
static int
DEFAULT_PREV_DOC_CACHE_PERCENTAGE
static int
DEFAULT_UPDATE_LIMIT
protected org.apache.jackrabbit.guava.common.base.Supplier<DocumentStore>
documentStoreSupplier
-
Constructor Summary
Constructors Constructor Description DocumentNodeStoreBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DocumentNodeStore
build()
org.apache.jackrabbit.guava.common.cache.Cache<NamePathRev,DocumentNodeState.Children>
buildChildrenCache(DocumentNodeStore store)
org.apache.jackrabbit.guava.common.cache.Cache<org.apache.jackrabbit.oak.cache.CacheValue,NodeDocument>
buildDocumentCache(DocumentStore docStore)
org.apache.jackrabbit.guava.common.cache.Cache<RevisionsKey,LocalDiffCache.Diff>
buildLocalDiffCache()
org.apache.jackrabbit.guava.common.cache.Cache<org.apache.jackrabbit.oak.cache.CacheValue,StringValue>
buildMemoryDiffCache()
org.apache.jackrabbit.guava.common.cache.Cache<PathRev,DocumentNodeState>
buildNodeCache(DocumentNodeStore store)
NodeDocumentCache
buildNodeDocumentCache(DocumentStore docStore, NodeDocumentLocks locks)
org.apache.jackrabbit.guava.common.cache.Cache<StringValue,NodeDocument>
buildPrevDocumentsCache(DocumentStore docStore)
T
clock(org.apache.jackrabbit.oak.stats.Clock clock)
MissingLastRevSeeker
createMissingLastRevSeeker()
java.lang.Iterable<org.apache.jackrabbit.oak.plugins.blob.ReferencedBlob>
createReferencedBlobs(DocumentNodeStore ns)
VersionGCSupport
createVersionGCSupport()
T
disableBranches()
int
getAsyncDelay()
org.apache.jackrabbit.oak.spi.blob.BlobStore
getBlobStore()
@Nullable org.apache.jackrabbit.oak.cache.CacheStats
getBlobStoreCacheStats()
@Nullable org.apache.jackrabbit.oak.plugins.blob.BlobStoreStats
getBlobStoreStats()
boolean
getCacheEmptyCommitValue()
long
getChildrenCacheSize()
org.apache.jackrabbit.oak.stats.Clock
getClock()
int
getClusterId()
int
getCommitValueCacheSize()
org.apache.jackrabbit.oak.plugins.document.DiffCache
getDiffCache(int clusterId)
long
getDiffCacheSize()
@Nullable org.apache.jackrabbit.oak.spi.toggle.Feature
getDocStoreThrottlingFeature()
long
getDocumentCacheSize()
DocumentStore
getDocumentStore()
DocumentStoreStatsCollector
getDocumentStoreStatsCollector()
java.util.concurrent.Executor
getExecutor()
org.apache.jackrabbit.oak.spi.gc.GCMonitor
getGCMonitor()
long
getJournalGCMaxAge()
The maximum age for journal entries in milliseconds.JournalPropertyHandlerFactory
getJournalPropertyHandlerFactory()
boolean
getLeaseCheck()
Deprecated.This method does not distinguish betweenLeaseCheckMode.LENIENT
andLeaseCheckMode.STRICT
and returnstrue
for both modes.LeaseFailureHandler
getLeaseFailureHandler()
long
getLocalDiffCacheSize()
boolean
getLogging()
long
getMemoryDiffCacheSize()
org.apache.jackrabbit.guava.common.base.Predicate<Path>
getNodeCachePathPredicate()
org.apache.jackrabbit.guava.common.base.Predicate<java.lang.String>
getNodeCachePredicate()
Deprecated.UsegetNodeCachePathPredicate()
instead.long
getNodeCacheSize()
DocumentNodeStoreStatsCollector
getNodeStoreStatsCollector()
@NotNull java.util.Map<java.lang.String,PersistentCacheStats>
getPersistenceCacheStats()
PersistentCache
getPersistentCache()
@Nullable org.apache.jackrabbit.oak.spi.toggle.Feature
getPrefetchFeature()
long
getPrevDocumentCacheSize()
boolean
getReadOnlyMode()
long
getRevisionGCMaxAge()
The maximum age for changes in milliseconds.org.apache.jackrabbit.oak.stats.StatisticsProvider
getStatisticsProvider()
long
getSuspendTimeoutMillis()
@NotNull ThrottlingStatsCollector
getThrottlingStatsCollector()
boolean
getTiming()
int
getUpdateLimit()
org.apache.jackrabbit.guava.common.cache.Weigher<org.apache.jackrabbit.oak.cache.CacheValue,org.apache.jackrabbit.oak.cache.CacheValue>
getWeigher()
boolean
isBundlingDisabled()
boolean
isClusterInvisible()
boolean
isDisableBranches()
boolean
isPrefetchExternalChanges()
boolean
isThrottlingEnabled()
boolean
isUseSimpleRevision()
T
memoryCacheDistribution(int nodeCachePercentage, int prevDocCachePercentage, int childrenCachePercentage, int diffCachePercentage)
T
memoryCacheSize(long memoryCacheSize)
static DocumentNodeStoreBuilder<?>
newDocumentNodeStoreBuilder()
T
setAsyncDelay(int asyncDelay)
Set the maximum delay to write the last revision to the root node.T
setBlobStore(org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore)
Set the blob store to use.T
setBundlingDisabled(boolean enabled)
T
setCacheEmptyCommitValue(boolean enable)
Controls whether caching of empty commit values (negative cache) is enabled.T
setCacheSegmentCount(int cacheSegmentCount)
T
setCacheStackMoveDistance(int cacheSegmentCount)
T
setClusterId(int clusterId)
Set the cluster id to use.T
setClusterInvisible(boolean invisible)
Set the cluster as invisible to the discovery lite service.T
setCommitValueCacheSize(int cacheSize)
T
setDocStoreThrottlingFeature(@Nullable org.apache.jackrabbit.oak.spi.toggle.Feature docStoreThrottling)
T
setDocumentStore(DocumentStore documentStore)
Set the document store to use.T
setDocumentStoreStatsCollector(DocumentStoreStatsCollector documentStoreStatsCollector)
T
setExecutor(java.util.concurrent.Executor executor)
T
setGCMonitor(@NotNull org.apache.jackrabbit.oak.spi.gc.GCMonitor gcMonitor)
T
setJournalCache(java.lang.String journalCache)
Sets the journal cache option.T
setJournalGCMaxAge(long maxRevisionAgeMillis)
T
setJournalPropertyHandlerFactory(JournalPropertyHandlerFactory factory)
T
setLeaseCheck(boolean leaseCheck)
Deprecated.usesetLeaseCheckMode(LeaseCheckMode)
instead.T
setLeaseCheckMode(LeaseCheckMode mode)
T
setLeaseFailureHandler(LeaseFailureHandler leaseFailureHandler)
T
setLogging(boolean logging)
T
setLoggingPrefix(java.lang.String prefix)
Sets a custom prefix for the logger.T
setNodeCachePathPredicate(org.apache.jackrabbit.guava.common.base.Predicate<Path> p)
T
setNodeCachePredicate(org.apache.jackrabbit.guava.common.base.Predicate<java.lang.String> p)
Deprecated.UsesetNodeCachePathPredicate(Predicate)
instead.T
setNodeStoreStatsCollector(DocumentNodeStoreStatsCollector statsCollector)
T
setPersistentCache(java.lang.String persistentCache)
Sets the persistent cache option.T
setPrefetchExternalChanges(boolean b)
T
setPrefetchFeature(@Nullable org.apache.jackrabbit.oak.spi.toggle.Feature prefetch)
T
setReadOnlyMode()
T
setRevisionGCMaxAge(long maxRevisionGCAgeMillis)
T
setStatisticsProvider(org.apache.jackrabbit.oak.stats.StatisticsProvider statisticsProvider)
T
setSuspendTimeoutMillis(long suspendTimeoutMillis)
T
setThrottlingEnabled(boolean b)
T
setThrottlingStatsCollector(@NotNull ThrottlingStatsCollector throttlingStatsCollector)
T
setTiming(boolean timing)
Use the timing document store wrapper.T
setUpdateLimit(int limit)
T
setUseSimpleRevision(boolean useSimpleRevision)
protected T
thisBuilder()
T
withWeigher(org.apache.jackrabbit.guava.common.cache.Weigher<org.apache.jackrabbit.oak.cache.CacheValue,org.apache.jackrabbit.oak.cache.CacheValue> weigher)
-
-
-
Field Detail
-
DEFAULT_MEMORY_CACHE_SIZE
public static final long DEFAULT_MEMORY_CACHE_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_NODE_CACHE_PERCENTAGE
public static final int DEFAULT_NODE_CACHE_PERCENTAGE
- See Also:
- Constant Field Values
-
DEFAULT_PREV_DOC_CACHE_PERCENTAGE
public static final int DEFAULT_PREV_DOC_CACHE_PERCENTAGE
- See Also:
- Constant Field Values
-
DEFAULT_CHILDREN_CACHE_PERCENTAGE
public static final int DEFAULT_CHILDREN_CACHE_PERCENTAGE
- See Also:
- Constant Field Values
-
DEFAULT_DIFF_CACHE_PERCENTAGE
public static final int DEFAULT_DIFF_CACHE_PERCENTAGE
- See Also:
- Constant Field Values
-
DEFAULT_CACHE_SEGMENT_COUNT
public static final int DEFAULT_CACHE_SEGMENT_COUNT
- See Also:
- Constant Field Values
-
DEFAULT_CACHE_STACK_MOVE_DISTANCE
public static final int DEFAULT_CACHE_STACK_MOVE_DISTANCE
- See Also:
- Constant Field Values
-
DEFAULT_UPDATE_LIMIT
public static final int DEFAULT_UPDATE_LIMIT
- See Also:
- Constant Field Values
-
documentStoreSupplier
protected org.apache.jackrabbit.guava.common.base.Supplier<DocumentStore> documentStoreSupplier
-
blobStoreSupplier
protected org.apache.jackrabbit.guava.common.base.Supplier<org.apache.jackrabbit.oak.spi.blob.BlobStore> blobStoreSupplier
-
-
Method Detail
-
newDocumentNodeStoreBuilder
public static DocumentNodeStoreBuilder<?> newDocumentNodeStoreBuilder()
- Returns:
- a new
DocumentNodeStoreBuilder
.
-
build
public DocumentNodeStore build()
-
thisBuilder
protected final T thisBuilder()
-
setPersistentCache
public T setPersistentCache(java.lang.String persistentCache)
Sets the persistent cache option.- Returns:
- this
-
setJournalCache
public T setJournalCache(java.lang.String journalCache)
Sets the journal cache option.- Returns:
- this
-
setTiming
public T setTiming(boolean timing)
Use the timing document store wrapper.- Parameters:
timing
- whether to use the timing wrapper.- Returns:
- this
-
getTiming
public boolean getTiming()
-
setLogging
public T setLogging(boolean logging)
-
getLogging
public boolean getLogging()
-
setLoggingPrefix
public T setLoggingPrefix(java.lang.String prefix)
Sets a custom prefix for the logger.- Parameters:
prefix
- to be used in the logs output.- Returns:
- this
-
setLeaseCheck
@Deprecated public T setLeaseCheck(boolean leaseCheck)
Deprecated.usesetLeaseCheckMode(LeaseCheckMode)
instead.Iftrue
, sets lease check mode toLeaseCheckMode.LENIENT
, otherwise sets the mode toLeaseCheckMode.DISABLED
. This method is only kept for backward compatibility with the behaviour before OAK-7626. The new default lease check mode isLeaseCheckMode.STRICT
, but existing code may rely on the previous behaviour, when enabling the lease check corresponded with aLeaseCheckMode.LENIENT
behaviour.
-
getLeaseCheck
@Deprecated public boolean getLeaseCheck()
Deprecated.This method does not distinguish betweenLeaseCheckMode.LENIENT
andLeaseCheckMode.STRICT
and returnstrue
for both modes. UsegetLeaseCheckMode()
instead.
-
setLeaseCheckMode
public T setLeaseCheckMode(LeaseCheckMode mode)
-
setThrottlingEnabled
public T setThrottlingEnabled(boolean b)
-
isThrottlingEnabled
public boolean isThrottlingEnabled()
-
setReadOnlyMode
public T setReadOnlyMode()
-
getReadOnlyMode
public boolean getReadOnlyMode()
-
setPrefetchFeature
public T setPrefetchFeature(@Nullable @Nullable org.apache.jackrabbit.oak.spi.toggle.Feature prefetch)
-
getPrefetchFeature
@Nullable public @Nullable org.apache.jackrabbit.oak.spi.toggle.Feature getPrefetchFeature()
-
setDocStoreThrottlingFeature
public T setDocStoreThrottlingFeature(@Nullable @Nullable org.apache.jackrabbit.oak.spi.toggle.Feature docStoreThrottling)
-
getDocStoreThrottlingFeature
@Nullable public @Nullable org.apache.jackrabbit.oak.spi.toggle.Feature getDocStoreThrottlingFeature()
-
setLeaseFailureHandler
public T setLeaseFailureHandler(LeaseFailureHandler leaseFailureHandler)
-
getLeaseFailureHandler
public LeaseFailureHandler getLeaseFailureHandler()
-
setDocumentStore
public T setDocumentStore(DocumentStore documentStore)
Set the document store to use. By default an in-memory store is used.- Parameters:
documentStore
- the document store- Returns:
- this
-
getDocumentStore
public DocumentStore getDocumentStore()
-
getDiffCache
public org.apache.jackrabbit.oak.plugins.document.DiffCache getDiffCache(int clusterId)
-
setBlobStore
public T setBlobStore(org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore)
Set the blob store to use. By default an in-memory store is used.- Parameters:
blobStore
- the blob store- Returns:
- this
-
getBlobStore
public org.apache.jackrabbit.oak.spi.blob.BlobStore getBlobStore()
-
setClusterId
public T setClusterId(int clusterId)
Set the cluster id to use. By default, 0 is used, meaning the cluster id is automatically generated.- Parameters:
clusterId
- the cluster id- Returns:
- this
-
setClusterInvisible
public T setClusterInvisible(boolean invisible)
Set the cluster as invisible to the discovery lite service. By default it is visible.- Returns:
- this
- See Also:
DocumentDiscoveryLiteService
-
setCacheSegmentCount
public T setCacheSegmentCount(int cacheSegmentCount)
-
setCacheStackMoveDistance
public T setCacheStackMoveDistance(int cacheSegmentCount)
-
getClusterId
public int getClusterId()
-
isClusterInvisible
public boolean isClusterInvisible()
-
setAsyncDelay
public T setAsyncDelay(int asyncDelay)
Set the maximum delay to write the last revision to the root node. By default 1000 (meaning 1 second) is used.- Parameters:
asyncDelay
- in milliseconds- Returns:
- this
-
getAsyncDelay
public int getAsyncDelay()
-
getWeigher
public org.apache.jackrabbit.guava.common.cache.Weigher<org.apache.jackrabbit.oak.cache.CacheValue,org.apache.jackrabbit.oak.cache.CacheValue> getWeigher()
-
withWeigher
public T withWeigher(org.apache.jackrabbit.guava.common.cache.Weigher<org.apache.jackrabbit.oak.cache.CacheValue,org.apache.jackrabbit.oak.cache.CacheValue> weigher)
-
memoryCacheSize
public T memoryCacheSize(long memoryCacheSize)
-
memoryCacheDistribution
public T memoryCacheDistribution(int nodeCachePercentage, int prevDocCachePercentage, int childrenCachePercentage, int diffCachePercentage)
-
getNodeCacheSize
public long getNodeCacheSize()
-
getPrevDocumentCacheSize
public long getPrevDocumentCacheSize()
-
getChildrenCacheSize
public long getChildrenCacheSize()
-
getDocumentCacheSize
public long getDocumentCacheSize()
-
getDiffCacheSize
public long getDiffCacheSize()
-
getMemoryDiffCacheSize
public long getMemoryDiffCacheSize()
-
getLocalDiffCacheSize
public long getLocalDiffCacheSize()
-
setUseSimpleRevision
public T setUseSimpleRevision(boolean useSimpleRevision)
-
isUseSimpleRevision
public boolean isUseSimpleRevision()
-
getExecutor
public java.util.concurrent.Executor getExecutor()
-
setExecutor
public T setExecutor(java.util.concurrent.Executor executor)
-
clock
public T clock(org.apache.jackrabbit.oak.stats.Clock clock)
-
setStatisticsProvider
public T setStatisticsProvider(org.apache.jackrabbit.oak.stats.StatisticsProvider statisticsProvider)
-
getStatisticsProvider
public org.apache.jackrabbit.oak.stats.StatisticsProvider getStatisticsProvider()
-
getDocumentStoreStatsCollector
public DocumentStoreStatsCollector getDocumentStoreStatsCollector()
-
setDocumentStoreStatsCollector
public T setDocumentStoreStatsCollector(DocumentStoreStatsCollector documentStoreStatsCollector)
-
getThrottlingStatsCollector
@NotNull public @NotNull ThrottlingStatsCollector getThrottlingStatsCollector()
-
setThrottlingStatsCollector
public T setThrottlingStatsCollector(@NotNull @NotNull ThrottlingStatsCollector throttlingStatsCollector)
-
getNodeStoreStatsCollector
public DocumentNodeStoreStatsCollector getNodeStoreStatsCollector()
-
setNodeStoreStatsCollector
public T setNodeStoreStatsCollector(DocumentNodeStoreStatsCollector statsCollector)
-
getPersistenceCacheStats
@NotNull public @NotNull java.util.Map<java.lang.String,PersistentCacheStats> getPersistenceCacheStats()
-
getBlobStoreStats
@Nullable public @Nullable org.apache.jackrabbit.oak.plugins.blob.BlobStoreStats getBlobStoreStats()
-
getBlobStoreCacheStats
@Nullable public @Nullable org.apache.jackrabbit.oak.cache.CacheStats getBlobStoreCacheStats()
-
getClock
public org.apache.jackrabbit.oak.stats.Clock getClock()
-
disableBranches
public T disableBranches()
-
isDisableBranches
public boolean isDisableBranches()
-
setBundlingDisabled
public T setBundlingDisabled(boolean enabled)
-
isBundlingDisabled
public boolean isBundlingDisabled()
-
setPrefetchExternalChanges
public T setPrefetchExternalChanges(boolean b)
-
isPrefetchExternalChanges
public boolean isPrefetchExternalChanges()
-
setJournalPropertyHandlerFactory
public T setJournalPropertyHandlerFactory(JournalPropertyHandlerFactory factory)
-
getJournalPropertyHandlerFactory
public JournalPropertyHandlerFactory getJournalPropertyHandlerFactory()
-
setUpdateLimit
public T setUpdateLimit(int limit)
-
getUpdateLimit
public int getUpdateLimit()
-
setCommitValueCacheSize
public T setCommitValueCacheSize(int cacheSize)
-
getCommitValueCacheSize
public int getCommitValueCacheSize()
-
setCacheEmptyCommitValue
public T setCacheEmptyCommitValue(boolean enable)
Controls whether caching of empty commit values (negative cache) is enabled. This cache is disabled by default. The cache can only be enabled on aread-only
store. In read-write mode, the cache is always be disabled.- Parameters:
enable
-true
to enable the empty commit value cache.- Returns:
- this builder.
-
getCacheEmptyCommitValue
public boolean getCacheEmptyCommitValue()
- Returns:
true
when caching of empty commit values is enabled,false
otherwise.
-
setJournalGCMaxAge
public T setJournalGCMaxAge(long maxRevisionAgeMillis)
-
getJournalGCMaxAge
public long getJournalGCMaxAge()
The maximum age for journal entries in milliseconds. Older entries are candidates for GC.- Returns:
- maximum age for journal entries in milliseconds.
-
setRevisionGCMaxAge
public T setRevisionGCMaxAge(long maxRevisionGCAgeMillis)
-
getRevisionGCMaxAge
public long getRevisionGCMaxAge()
The maximum age for changes in milliseconds. Older changes are candidates for revision garbage collection.- Returns:
- maximum age in milliseconds.
-
setSuspendTimeoutMillis
public T setSuspendTimeoutMillis(long suspendTimeoutMillis)
-
getSuspendTimeoutMillis
public long getSuspendTimeoutMillis()
-
setGCMonitor
public T setGCMonitor(@NotNull @NotNull org.apache.jackrabbit.oak.spi.gc.GCMonitor gcMonitor)
-
getGCMonitor
public org.apache.jackrabbit.oak.spi.gc.GCMonitor getGCMonitor()
-
createVersionGCSupport
public VersionGCSupport createVersionGCSupport()
-
createReferencedBlobs
public java.lang.Iterable<org.apache.jackrabbit.oak.plugins.blob.ReferencedBlob> createReferencedBlobs(DocumentNodeStore ns)
-
createMissingLastRevSeeker
public MissingLastRevSeeker createMissingLastRevSeeker()
-
buildNodeCache
public org.apache.jackrabbit.guava.common.cache.Cache<PathRev,DocumentNodeState> buildNodeCache(DocumentNodeStore store)
-
buildChildrenCache
public org.apache.jackrabbit.guava.common.cache.Cache<NamePathRev,DocumentNodeState.Children> buildChildrenCache(DocumentNodeStore store)
-
buildMemoryDiffCache
public org.apache.jackrabbit.guava.common.cache.Cache<org.apache.jackrabbit.oak.cache.CacheValue,StringValue> buildMemoryDiffCache()
-
buildLocalDiffCache
public org.apache.jackrabbit.guava.common.cache.Cache<RevisionsKey,LocalDiffCache.Diff> buildLocalDiffCache()
-
buildDocumentCache
public org.apache.jackrabbit.guava.common.cache.Cache<org.apache.jackrabbit.oak.cache.CacheValue,NodeDocument> buildDocumentCache(DocumentStore docStore)
-
buildPrevDocumentsCache
public org.apache.jackrabbit.guava.common.cache.Cache<StringValue,NodeDocument> buildPrevDocumentsCache(DocumentStore docStore)
-
buildNodeDocumentCache
public NodeDocumentCache buildNodeDocumentCache(DocumentStore docStore, NodeDocumentLocks locks)
-
setNodeCachePredicate
@Deprecated public T setNodeCachePredicate(org.apache.jackrabbit.guava.common.base.Predicate<java.lang.String> p)
Deprecated.UsesetNodeCachePathPredicate(Predicate)
instead.
-
getNodeCachePredicate
@Deprecated public org.apache.jackrabbit.guava.common.base.Predicate<java.lang.String> getNodeCachePredicate()
Deprecated.UsegetNodeCachePathPredicate()
instead.
-
setNodeCachePathPredicate
public T setNodeCachePathPredicate(org.apache.jackrabbit.guava.common.base.Predicate<Path> p)
-
getNodeCachePathPredicate
public org.apache.jackrabbit.guava.common.base.Predicate<Path> getNodeCachePathPredicate()
-
getPersistentCache
public PersistentCache getPersistentCache()
-
-