lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Klaas (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SOLR-536) Automatic binding of results to Beans (for solrj)
Date Thu, 05 Jun 2008 18:43:45 GMT

    [ https://issues.apache.org/jira/browse/SOLR-536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602744#action_12602744
] 

Mike Klaas commented on SOLR-536:
---------------------------------

> This is expensive
> private final Map<Class, List<DocField>> infocache = 
>    Collections.synchronizedMap( new HashMap<Class, List<DocField>>() );

> Let us make it
> private final Map<Class, List<DocField>> infocache = 
>    new ConcurrentHashMap<Class, List<DocField>>() ;

Expensive?  I'd expect the synchronizedMap to be faster and more memory compact.  The ConcurrentHashMap
is definitely more concurrent, though.



> Automatic binding of results to Beans (for solrj)
> -------------------------------------------------
>
>                 Key: SOLR-536
>                 URL: https://issues.apache.org/jira/browse/SOLR-536
>             Project: Solr
>          Issue Type: New Feature
>          Components: clients - java
>    Affects Versions: 1.3
>            Reporter: Noble Paul
>            Assignee: Ryan McKinley
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: SOLR-536.patch, SOLR-536.patch, SOLR-536.patch
>
>
> as we are using java5 .we can use annotations to bind SolrDocument to java beans directly.
> This can make the usage of solrj a  bit simpler
> The QueryResponse class in solrj can have an extra method as follows
> public <T> List<T> getResultBeans(Class<T> klass)
> and the bean can have annotations as
> class MyBean{
> @Field("id") //name is optional
> String id;
> @Field("category")
> List<String> categories
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message