Search in sources :

Example 1 with CommitMitigatingTieredMergePolicy

use of org.apache.jackrabbit.oak.plugins.index.lucene.writer.CommitMitigatingTieredMergePolicy in project jackrabbit-oak by apache.

the class IndexDefinition method createMergePolicy.

private MergePolicy createMergePolicy() {
    String mmp = System.getProperty("oak.lucene.cmmp");
    if (mmp != null) {
        return new CommitMitigatingTieredMergePolicy();
    }
    String mergePolicyName = getOptionalValue(definition, LuceneIndexConstants.MERGE_POLICY_NAME, null);
    MergePolicy mergePolicy = null;
    if (mergePolicyName != null) {
        if (mergePolicyName.equalsIgnoreCase("no")) {
            mergePolicy = NoMergePolicy.COMPOUND_FILES;
        } else if (mergePolicyName.equalsIgnoreCase("mitigated")) {
            mergePolicy = new CommitMitigatingTieredMergePolicy();
        } else if (mergePolicyName.equalsIgnoreCase("tiered") || mergePolicyName.equalsIgnoreCase("default")) {
            mergePolicy = new TieredMergePolicy();
        } else if (mergePolicyName.equalsIgnoreCase("logbyte")) {
            mergePolicy = new LogByteSizeMergePolicy();
        } else if (mergePolicyName.equalsIgnoreCase("logdoc")) {
            mergePolicy = new LogDocMergePolicy();
        }
    }
    if (mergePolicy == null) {
        mergePolicy = new TieredMergePolicy();
    }
    return mergePolicy;
}
Also used : TieredMergePolicy(org.apache.lucene.index.TieredMergePolicy) CommitMitigatingTieredMergePolicy(org.apache.jackrabbit.oak.plugins.index.lucene.writer.CommitMitigatingTieredMergePolicy) CommitMitigatingTieredMergePolicy(org.apache.jackrabbit.oak.plugins.index.lucene.writer.CommitMitigatingTieredMergePolicy) LogByteSizeMergePolicy(org.apache.lucene.index.LogByteSizeMergePolicy) NoMergePolicy(org.apache.lucene.index.NoMergePolicy) MergePolicy(org.apache.lucene.index.MergePolicy) LogByteSizeMergePolicy(org.apache.lucene.index.LogByteSizeMergePolicy) LogDocMergePolicy(org.apache.lucene.index.LogDocMergePolicy) TieredMergePolicy(org.apache.lucene.index.TieredMergePolicy) CommitMitigatingTieredMergePolicy(org.apache.jackrabbit.oak.plugins.index.lucene.writer.CommitMitigatingTieredMergePolicy) LogDocMergePolicy(org.apache.lucene.index.LogDocMergePolicy)

Aggregations

CommitMitigatingTieredMergePolicy (org.apache.jackrabbit.oak.plugins.index.lucene.writer.CommitMitigatingTieredMergePolicy)1 LogByteSizeMergePolicy (org.apache.lucene.index.LogByteSizeMergePolicy)1 LogDocMergePolicy (org.apache.lucene.index.LogDocMergePolicy)1 MergePolicy (org.apache.lucene.index.MergePolicy)1 NoMergePolicy (org.apache.lucene.index.NoMergePolicy)1 TieredMergePolicy (org.apache.lucene.index.TieredMergePolicy)1