Class LogByteSizeMergePolicyProvider

java.lang.Object
org.opensearch.index.LogByteSizeMergePolicyProvider
All Implemented Interfaces:
MergePolicyProvider

public class LogByteSizeMergePolicyProvider extends Object implements MergePolicyProvider

The LogByteSizeMergePolicy is an alternative merge policy primarily used here to optimize the merging of segments in scenarios with index with timestamps. While the TieredMergePolicy is the default choice, the LogByteSizeMergePolicy can be configured as the default merge policy for time-index data using the index.datastream_merge.policy setting.

Unlike the TieredMergePolicy, which prioritizes merging segments of equal sizes, the LogByteSizeMergePolicy specializes in merging adjacent segments efficiently. This characteristic makes it particularly well-suited for range queries on time-index data. Typically, adjacent segments in time-index data often contain documents with similar timestamps. When these segments are merged, the resulting segment covers a range of timestamps with reduced overlap compared to the adjacent segments. This reduced overlap remains even as segments grow older and larger, which can significantly benefit range queries on timestamps.

In contrast, the TieredMergePolicy does not honor this timestamp range optimization. It focuses on merging segments of equal sizes and does not consider adjacency. Consequently, as segments grow older and larger, the overlap of timestamp ranges among adjacent segments managed by TieredMergePolicy can increase. This can lead to inefficiencies in range queries on timestamps, as the number of segments to be scanned within a given timestamp range could become high.

Opensearch.internal:
  • Field Details

    • DEFAULT_MIN_MERGE

      public static final org.opensearch.core.common.unit.ByteSizeValue DEFAULT_MIN_MERGE
    • DEFAULT_MERGE_FACTOR

      public static final int DEFAULT_MERGE_FACTOR
      See Also:
    • DEFAULT_MAX_MERGED_SEGMENT

      public static final org.opensearch.core.common.unit.ByteSizeValue DEFAULT_MAX_MERGED_SEGMENT
    • DEFAULT_MAX_MERGE_SEGMENT_FORCE_MERGE

      public static final org.opensearch.core.common.unit.ByteSizeValue DEFAULT_MAX_MERGE_SEGMENT_FORCE_MERGE
    • INDEX_LBS_MERGE_POLICY_MERGE_FACTOR_SETTING

      public static final Setting<Integer> INDEX_LBS_MERGE_POLICY_MERGE_FACTOR_SETTING
    • INDEX_LBS_MERGE_POLICY_MIN_MERGE_SETTING

      public static final Setting<org.opensearch.core.common.unit.ByteSizeValue> INDEX_LBS_MERGE_POLICY_MIN_MERGE_SETTING
    • INDEX_LBS_MAX_MERGE_SEGMENT_SETTING

      public static final Setting<org.opensearch.core.common.unit.ByteSizeValue> INDEX_LBS_MAX_MERGE_SEGMENT_SETTING
    • INDEX_LBS_MAX_MERGE_SEGMENT_FOR_FORCED_MERGE_SETTING

      public static final Setting<org.opensearch.core.common.unit.ByteSizeValue> INDEX_LBS_MAX_MERGE_SEGMENT_FOR_FORCED_MERGE_SETTING
    • INDEX_LBS_MAX_MERGED_DOCS_SETTING

      public static final Setting<Integer> INDEX_LBS_MAX_MERGED_DOCS_SETTING
    • INDEX_LBS_NO_CFS_RATIO_SETTING

      public static final Setting<Double> INDEX_LBS_NO_CFS_RATIO_SETTING
  • Method Details