lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Smiley (JIRA)" <>
Subject [jira] [Commented] (LUCENE-5608) SpatialPrefixTree API refactor
Date Mon, 19 May 2014 04:42:38 GMT


David Smiley commented on LUCENE-5608:

One thing about the API I don't love is that to write an efficient Cell impl, you have to
lazy-decode from bytes. This is because the code using the Cell creates Cells sometimes only
to check leaf status and/or the level, or maybe to check if it's within (underneath, a suffix
of) another cell. Alternatively, there could be some simple methods on SPT like readCellIsBoolean()
and readCellLevel(), and have Cell.isPrefixOf() take a BytesRef instead of another Cell. 
Ok, a couple simple new methods, but then there is the conundrum of the parameters to abstract
methods in AbstractVisitingPrefixTreeFilter like visitLeaf() that take a Cell, which would
maybe would be modified to take, what, a BytesRef; and maybe the length and leaf boolean?
 That doesn't seem right.  So lazy-decode it is.

> SpatialPrefixTree API refactor
> ------------------------------
>                 Key: LUCENE-5608
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/spatial
>            Reporter: David Smiley
>            Assignee: David Smiley
>             Fix For: 5.0
>         Attachments: LUCENE-5608__SpatialPrefixTree_API_refactor.patch
> This is a refactor of the SpatialPrefixTree spatial API, in preparation for more SPT
implementations on the near horizon.  These are fairly internal APIs;
didn't have to change, nor the Solr adapters, and I doubt ES would have to either.
> API changes:
> * SpatialPrefixTree & Cell had a fairly significant make-over. The existing implementations
for Geohash & Quad have been made to subclass LegacyPrefixTree & LegacyCell shim's,
and otherwise had very few changes (performance _should_ be the same).  Cell is now an interface.
> * New CellIterator which is an Iterator<Cell>. Includes 3 implementations.
> * PrefixTreeStrategy.simplifyIndexedCells was renamed to pruneLeafyBranches and moved
to RPT and made toggle'able with a setter. It's going to be removed in the future but for
the time being it remains a useful optimization.
> * RPT's pointsOnly & multiOverlappingIndexedShapes options now have setters.
> Future:
> * The AbstractVisitingPrefixTreeFilter (used by RPT's Intersects, Within, Disjoint) really
should be refactored to use the new CellIterator API as it will reduce the amount of code
and should make the code easier to follow since it would be based on a well-knon design-pattern
(an iterator).
> I wish I had done this as a series of commits on a GitHub branch; ah well.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message