apache / apache/lucene

Should we make Bits implement Accountable

Open
#15,814 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Bits are returned from a few public APIs, notably LeafReader.getLiveDocs(), and can be significant consumers of heap. Most implementations are actually some form of BitSet, which implements Accountable, and means that clients can call ramBytesUsed() on them to get an idea of how much space they are using. Should we push this interface down to the base class? From a quick glance it seems that it would be pretty simple to implement, but maybe there is a historical reason that it wasn't done.

Contributor guide

Open the contributing guide

Research direction

Start by tracing LeafReader.getLiveDocs() and the Bits base interface, then inspect BitSet implementations and Accountable's ramBytesUsed() contract. Check whether all Bits implementations can provide meaningful heap accounting and review existing tests around live documents; done means the API decision is resolved and any required implementation and tests consistently expose memory usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.