[jira] [Commented] (SOLR-12880) Show the FacetProcessor class name instead of the FacetRequest in the JSON Facets debug-trace output

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SOLR-12880) Show the FacetProcessor class name instead of the FacetRequest in the JSON Facets debug-trace output

JIRA jira@apache.org

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

Tim Underwood commented on SOLR-12880:
--------------------------------------

{quote}Sorry for being touchy. I just observed that your statement was so broadly applicable that it would seem to suggest all anonymous classes are bad, and thus by consequence all lambdas as well – ouch! That's quite an opinion you have :) I acknowledge your points but the benefit to both is brevity and keeping logic close to where it's used instead of spread out. So as always in coding, "it depends".
{quote}
Yes, it depends and it's all about the tradeoffs.  I spent most of the my time coding in Scala and make very heavy use of lambdas throughout my codebases and they are very useful.  However they absolutely make stack traces harder to read and bytecode harder to track down.  The tradeoff being I have much cleaner code that is easier to understand and maintain.  So in those cases the tradeoffs are worth it to me.

So no, my comments were not meant to be overly broad and applicable to everything involving anonymous classes or lambdas :).
{quote}I think *either* drop getName() and make FacetHeatmapProcessor an inner class, *or* adopt getName() and subclass it when the simpleName isn't useful. I think both are fine but I lean towards FacetHeatmapProcessor being an inner class as it's then one less API method (no getName).
{quote}
Sounds good.  I've updated the PR to remove the getName() method and just rely on FacetHeapmapProcessor being non-anonymous.

 

> Show the FacetProcessor class name instead of the FacetRequest in the JSON Facets debug-trace output
> ----------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-12880
>                 URL: https://issues.apache.org/jira/browse/SOLR-12880
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public)
>          Components: Facet Module
>    Affects Versions: 7.5
>            Reporter: Tim Underwood
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> In the "facet-trace" debug output for the JSON facets the "processor" field current shows the class name of the FacetRequest implementation (e.g. FacetField, FacetQuery, FacetRange, etc.).  It seems like this would be more useful if it showed the FacetProcessor class being used instead (e.g. FacetFieldProcessorByArrayDV, FacetFieldProcessorByHashDV, FacetQueryProcessor, FacetRangeProcessor, etc.)
> Example of how it works today:
> {noformat}
> "debug": {
>   "facet-trace": {
>     "processor": FacetQuery "elapse": 50 "query": null "domainSize": 3296 "sub-facet": [{
>       processor = FacetField,
>       elapse = 18,
>       field = partTypeId,
>       limit = -1,
>       domainSize = 3296,
>       numBuckets = 392
>     }, {
>       processor = FacetField,
>       elapse = 25,
>       field = browseNodeId,
>       limit = -1,
>       domainSize = 3296,
>       numBuckets = 535
>     }]
>   }
> }
> {noformat}
> This is what showing the FacetProcessor class name would show:
> {noformat}
> "debug": {
>   "facet-trace": {
>     "processor": FacetQueryProcessor "elapse": 77 "query": null "domainSize": 3442 "sub-facet": [{
>       processor = FacetFieldProcessorByHashDV,
>       elapse = 3,
>       field = partTypeId,
>       limit = -1,
>       domainSize = 3442,
>       numBuckets = 407
>     }, {
>       processor = FacetFieldProcessorByHashDV,
>       elapse = 4,
>       field = browseNodeId,
>       limit = -1,
>       domainSize = 3442,
>       numBuckets = 553
>     }]
>   }
> }
> {noformat}
> Alternatively an additional debug field could be added with this information.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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