Class IndexUpdate
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.index.IndexUpdate
-
- All Implemented Interfaces:
NodeTraversalCallback.PathSource
,Editor
public class IndexUpdate extends java.lang.Object implements Editor, NodeTraversalCallback.PathSource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndexUpdate.MissingIndexProviderStrategy
-
Field Summary
Fields Modifier and Type Field Description static long
INDEX_JCR_TYPE_INVALID_LOG_LIMITER
-
Constructor Summary
Constructors Constructor Description IndexUpdate(IndexEditorProvider provider, java.lang.String async, NodeState root, NodeBuilder builder, IndexUpdateCallback updateCallback)
IndexUpdate(IndexEditorProvider provider, java.lang.String async, NodeState root, NodeBuilder builder, IndexUpdateCallback updateCallback, NodeTraversalCallback traversalCallback, CommitInfo commitInfo, CorruptIndexHandler corruptIndexHandler)
IndexUpdate(IndexEditorProvider provider, java.lang.String async, NodeState root, NodeBuilder builder, IndexUpdateCallback updateCallback, CommitInfo commitInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Editor
childNodeAdded(java.lang.String name, NodeState after)
Processes an added child node.@NotNull Editor
childNodeChanged(java.lang.String name, NodeState before, NodeState after)
Processes a changed child node.@Nullable Editor
childNodeDeleted(java.lang.String name, NodeState before)
Processes a deleted child node.void
commitProgress(IndexCommitCallback.IndexProgress indexProgress)
void
enter(NodeState before, NodeState after)
Called before the given before and after states are compared.java.lang.String
getIndexingStats()
java.lang.String
getPath()
Returns the path of this node, building it lazily when first requested.java.util.List<java.lang.String>
getReindexStats()
java.util.Set<java.lang.String>
getUpdatedIndexPaths()
boolean
isReindexingPerformed()
void
leave(NodeState before, NodeState after)
Called after the given before and after states are compared.void
propertyAdded(PropertyState after)
Processes an added property.void
propertyChanged(PropertyState before, PropertyState after)
Processes a changed property.void
propertyDeleted(PropertyState before)
Processes a removed property.void
setIgnoreReindexFlags(boolean ignoreReindexFlag)
void
setNodeCountEstimator(org.apache.jackrabbit.oak.plugins.index.progress.NodeCountEstimator nodeCountEstimator)
void
setTraversalRateEstimator(org.apache.jackrabbit.oak.plugins.index.progress.TraversalRateEstimator estimator)
IndexUpdate
withMissingProviderStrategy(IndexUpdate.MissingIndexProviderStrategy missingProvider)
-
-
-
Constructor Detail
-
IndexUpdate
public IndexUpdate(IndexEditorProvider provider, java.lang.String async, NodeState root, NodeBuilder builder, IndexUpdateCallback updateCallback)
-
IndexUpdate
public IndexUpdate(IndexEditorProvider provider, java.lang.String async, NodeState root, NodeBuilder builder, IndexUpdateCallback updateCallback, CommitInfo commitInfo)
-
IndexUpdate
public IndexUpdate(IndexEditorProvider provider, java.lang.String async, NodeState root, NodeBuilder builder, IndexUpdateCallback updateCallback, NodeTraversalCallback traversalCallback, CommitInfo commitInfo, CorruptIndexHandler corruptIndexHandler)
-
-
Method Detail
-
enter
public void enter(NodeState before, NodeState after) throws CommitFailedException
Description copied from interface:Editor
Called before the given before and after states are compared. The implementation can use this method to initialize any internal state needed for processing the results of the comparison. For example an implementation could look up the effective node type of the after state to know what constraints to apply to on the content changes.- Specified by:
enter
in interfaceEditor
- Parameters:
before
- before state, non-existent if this node was addedafter
- after state, non-existent if this node was removed- Throws:
CommitFailedException
- if this commit should be rejected
-
isReindexingPerformed
public boolean isReindexingPerformed()
-
getReindexStats
public java.util.List<java.lang.String> getReindexStats()
-
getUpdatedIndexPaths
public java.util.Set<java.lang.String> getUpdatedIndexPaths()
-
setTraversalRateEstimator
public void setTraversalRateEstimator(org.apache.jackrabbit.oak.plugins.index.progress.TraversalRateEstimator estimator)
-
setNodeCountEstimator
public void setNodeCountEstimator(org.apache.jackrabbit.oak.plugins.index.progress.NodeCountEstimator nodeCountEstimator)
-
getIndexingStats
public java.lang.String getIndexingStats()
-
setIgnoreReindexFlags
public void setIgnoreReindexFlags(boolean ignoreReindexFlag)
-
getPath
public java.lang.String getPath()
Returns the path of this node, building it lazily when first requested.- Specified by:
getPath
in interfaceNodeTraversalCallback.PathSource
-
leave
public void leave(NodeState before, NodeState after) throws CommitFailedException
Description copied from interface:Editor
Called after the given before and after states are compared. The implementation can use this method to post-process information collected during the content diff. For example an implementation that during the diff just recorded the fact that this node was modified in some way could then use this method to trigger an index update based on that modification flag.- Specified by:
leave
in interfaceEditor
- Parameters:
before
- before state, non-existent if this node was addedafter
- after state, non-existent if this node was removed- Throws:
CommitFailedException
- if this commit should be rejected
-
propertyAdded
public void propertyAdded(PropertyState after) throws CommitFailedException
Description copied from interface:Editor
Processes an added property.- Specified by:
propertyAdded
in interfaceEditor
- Parameters:
after
- the added property- Throws:
CommitFailedException
- if processing failed
-
propertyChanged
public void propertyChanged(PropertyState before, PropertyState after) throws CommitFailedException
Description copied from interface:Editor
Processes a changed property.- Specified by:
propertyChanged
in interfaceEditor
- Parameters:
before
- the original propertyafter
- the changed property- Throws:
CommitFailedException
- if processing failed
-
propertyDeleted
public void propertyDeleted(PropertyState before) throws CommitFailedException
Description copied from interface:Editor
Processes a removed property.- Specified by:
propertyDeleted
in interfaceEditor
- Parameters:
before
- the removed property- Throws:
CommitFailedException
- if processing failed
-
childNodeAdded
@NotNull public @NotNull Editor childNodeAdded(java.lang.String name, NodeState after) throws CommitFailedException
Description copied from interface:Editor
Processes an added child node.- Specified by:
childNodeAdded
in interfaceEditor
- Parameters:
name
- name of the added nodeafter
- the added child node- Returns:
- an editor for processing the subtree below the added node,
or
null
if the subtree does not need processing - Throws:
CommitFailedException
- if processing failed
-
childNodeChanged
@NotNull public @NotNull Editor childNodeChanged(java.lang.String name, NodeState before, NodeState after) throws CommitFailedException
Description copied from interface:Editor
Processes a changed child node. This method gets called for all child nodes that may contain changes between the before and after states.- Specified by:
childNodeChanged
in interfaceEditor
- Parameters:
name
- name of the changed nodebefore
- child node before the changeafter
- child node after the change- Returns:
- an editor for processing the subtree below the added node,
or
null
if the subtree does not need processing - Throws:
CommitFailedException
- if processing failed
-
childNodeDeleted
@Nullable public @Nullable Editor childNodeDeleted(java.lang.String name, NodeState before) throws CommitFailedException
Description copied from interface:Editor
Processes a deleted child node.- Specified by:
childNodeDeleted
in interfaceEditor
- Parameters:
name
- name of the deleted nodebefore
- the deleted child node- Returns:
- an editor for processing the subtree below the removed node,
or
null
if the subtree does not need processing - Throws:
CommitFailedException
- if processing failed
-
commitProgress
public void commitProgress(IndexCommitCallback.IndexProgress indexProgress)
-
withMissingProviderStrategy
public IndexUpdate withMissingProviderStrategy(IndexUpdate.MissingIndexProviderStrategy missingProvider)
-
-