[ 
https://issues.apache.org/jira/browse/LUCENE-5426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13887465#comment-13887465
 ] 

Shai Erera commented on LUCENE-5426:
------------------------------------

I've got few questions:

* Why is this code now in the accumulator:

{code}
+    if (dv.getValueCount() > Integer.MAX_VALUE) {
+      throw new IllegalArgumentException("can only handle valueCount < 
Integer.MAX_VALUE; got " + dv.getValueCount());
+    }
{code}

I see that it's still in DefaultSSDVReaderState, i.e. you cannot construct it 
if DV-count is more than Integer.MAX_VALUE. It also looks odd in the 
accumulator - it only uses it if the given FacetArrays are {{null}}?

* Can you please make sure all the added getters are not called from inside 
loops, such as state.getIndexReader/separatorRegex?

* Perhaps you should pull getSize() up to SSDVReaderState as well and use it 
instead of getDV().valueCount()? Just in case you can compute the size without 
obtaining the DV (i.e. lazy). Currently you're forced to pull a DV from the 
reader. If you do that, then please fix the Accumulator to use it too.

Otherwise this looks good. The gist of this patch is that you made 
SSDVReaderState abstract (i.e. could have been an interface) and 
DefaultSSDVReaderState is the current concrete implementation, right?

> Make SortedSetDocValuesReaderState customizable
> -----------------------------------------------
>
>                 Key: LUCENE-5426
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5426
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/facet
>    Affects Versions: 4.6
>            Reporter: John Wang
>         Attachments: sortedsetreaderstate.patch, sortedsetreaderstate.patch
>
>
> We have a reader that have a different data structure (in memory) where the 
> cost of computing ordinals per reader open is too expensive in the realtime 
> setting.
> We are maintaining in memory data structure that supports all functionality 
> and would like to leverage SortedSetDocValuesAccumulator.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to