lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-6232) Replace ValueSource context Map with a more concrete data type
Date Fri, 13 Feb 2015 19:36:12 GMT

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

Yonik Seeley commented on LUCENE-6232:
--------------------------------------

Here's the one I came up with in Heliosearch:
https://github.com/Heliosearch/heliosearch/blob/b7fa35c519d9facc3860dd78d28797542422080b/solr/core/src/java/org/apache/solr/search/QueryContext.java

It's called QueryContext since it seemed it could be more generic than just for value sources.

If we switch from IdentityHashMap (which is currently used) to HashMap, it might be good to
make sure any heavy-weight equals implementations check for other==this.

Regarding the current patch on this issue, 
https://github.com/Heliosearch/heliosearch/blob/b7fa35c519d9facc3860dd78d28797542422080b/solr/core/src/java/org/apache/solr/search/QueryContext.java
+  public Map<String,FunctionValues> getValuesCache() {

That seems rather specific to a particular kind of value source and probably doesn't belong
at this level?

> Replace ValueSource context Map with a more concrete data type
> --------------------------------------------------------------
>
>                 Key: LUCENE-6232
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6232
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Mike Drob
>         Attachments: LUCENE-6232.patch, LUCENE-6232.patch
>
>
> Inspired by LUCENE-3973
> The context object used by ValueSource and friends is a raw Map that provides no type
safety guarantees. In our current state, there are lots of warnings about unchecked casts,
raw types, and generally unsafe code from the compiler's perspective.
> There are several common patterns and types of Objects that we store in the context.
It would be beneficial to instead use a class with typed methods for get/set of Scorer, Weights,
etc.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message