use of org.apache.jackrabbit.oak.plugins.observation.filter.ChangeSetFilter in project jackrabbit-oak by apache.
the class ChangeProcessor method evalPrefilter.
/**
* Evaluate the prefilter for a given commit.
* @param changeSet
*
* @return a FilterResult indicating either inclusion, exclusion or
* inclusion-due-to-skipping. The latter is used to reflect
* prefilter evaluation better in statistics (as it could also have
* been reported just as include)
*/
private FilterResult evalPrefilter(NodeState root, CommitInfo info, ChangeSet changeSet) {
if (info == null) {
return FilterResult.PREFILTERING_SKIPPED;
}
if (root == null) {
// we can't do any diffing etc, so just not exclude it
return FilterResult.PREFILTERING_SKIPPED;
}
final FilterProvider fp = filterProvider.get();
// FIXME don't rely on toString for session id
if (!fp.includeCommit(contentSession.toString(), info)) {
// 'classic' (and cheap pre-) filtering
return FilterResult.EXCLUDE;
}
if (changeSet == null) {
// go through prefiltering)
return FilterResult.PREFILTERING_SKIPPED;
}
final ChangeSetFilter prefilter = fp;
if (prefilter.excludes(changeSet)) {
return FilterResult.EXCLUDE;
} else {
return FilterResult.INCLUDE;
}
}
Aggregations