apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.67k stars 1.03k forks source link

Refactor Directory/Multi/SegmentReader creation/reopening/cloning/closing [LUCENE-2355] #3431

Open asfimport opened 14 years ago

asfimport commented 14 years ago

*Reader lifecycle evolved over time to become some heavily tangled mess. It's hard to understand what's going on there, it's even harder to add some fields/logic while ensuring that all possible code paths preserve these fields/interact with the logic properly. While some of said mess is justified by the task at hand, a big part is just badly done copypaste and can be removed.

I am currently refactoring this and intended to open an issue with a working patch, but the task winded up somewhat bigger than I expected, so I'm opening it earlier to track stuff encountered/changed/fixed. The list is by no means exhaustive.

I did some structural modifications:


Migrated from LUCENE-2355 by Earwin Burrfoot, updated Dec 06 2010 Linked issues:

asfimport commented 14 years ago

Earwin Burrfoot (migrated from JIRA)

Some more stuff I forgot:

asfimport commented 14 years ago

Earwin Burrfoot (migrated from JIRA)

I think I'm going to introduce interface RefCounted, abstract class WhateverRefCounted, which guards against increment on closed instance and has nice mass-decRef methods in IOUtils.

asfimport commented 14 years ago

Earwin Burrfoot (migrated from JIRA)

asfimport commented 14 years ago

Earwin Burrfoot (migrated from JIRA)

asfimport commented 14 years ago

Earwin Burrfoot (migrated from JIRA)

asfimport commented 14 years ago

Earwin Burrfoot (migrated from JIRA)

asfimport commented 14 years ago

Earwin Burrfoot (migrated from JIRA)