apache / apache/lucene

A Rotating Split Policy For Managing Bounded Indices [LUCENE-2429]

Open
#3,503 0 comments 0 reactions 0 assignees View on GitHub
affects-version:3.0.1 legacy-jira-priority:Major module:core/index type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

(Please note that the feature described in #3499 is required reading for this issue.)

A rotating split policy maintains a bounded set of sub-indices underneath the split index's directory. The motivation for such a policy is to be able to control the size of the index in a user-defined manner. It comes in handy in scenarios where (a) documents are added at a higher-than-normal rate, and (b) documents older than a certain cut-off date needn't be searchable. As a matter of fact, this policy is applicable to most real-time streams, given that they tend to satisfy both of the above properties.

In short, when the number of sub-indices hits the maximum allowed number (`@see` {`@link` ROTATING_POLICY_MAXIMUM_SUB_INDICES}), then this policy effectively forces the last sub-index out of the split index. A sub-index is deemed to be the last one if it is considered to be lesser (according to #getDirectoryComparator) than every other sub-index.

The exact point in time at which rotation occurs is determined by the split rule(s) in effect for this policy. For example, one may apply a scheduled split rule (see LUCENE-2427) if one wishes the split to occur at fixed intervals. For finer control over the periodicity of the interval, a cron split rule (see LUCENE-2428) may be employed.

To illustrate the behavior of the rotation policy policy, consider a split rule that triggers a split on the hour every hour. Furthermore, let's assume that the maximum number of sub-indices allowed is 7. In this case, the rotation policy will have no more than 8 hours worth of data (1 hour in the super-index and each of the 7 sub-indices).

---
Migrated from [LUCENE-2429](https://issues.apache.org/jira/browse/LUCENE-2429) by Karthick Sankarachary
Attachments: [LUCENE-2429.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-2429/LUCENE-2429.patch)
Linked issues:
- #3499

Contributor guide

Open the contributing guide

Research direction

Read linked issue #3499 and the attached LUCENE-2429.patch first, then trace the split index's directory comparator and ROTATING_POLICY_MAXIMUM_SUB_INDICES. Compare the behavior with the scheduled and cron split rules referenced as LUCENE-2427 and LUCENE-2428; done means enforcing the bounded rotating set of sub-indices described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.