lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doron Cohen (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-3635) Allow setting arbitrary objects on PerfRunData
Date Mon, 19 Dec 2011 12:03:30 GMT

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

Doron Cohen commented on LUCENE-3635:
-------------------------------------

Patch looks good.

bq. I do not propose to move IR/IW/TR/TW etc. into that map. If however people think that
we should, I can do that as well.

I rather keep these ones explicit as they are now.

bq. I wonder if we should have this Map require Closeable so that we can close the objects
on PerfRunData.close()

Closing would be convenient, but I think requiring to pass Closeable is too restrictive? 
Instead, you could add something like this to close():

{code}
for (Object o : perfObjects.values()) {
  if (o instanceof Closeable) {
    IOUtils.close((Closeable) o);
  }
}
{code}

This is done only once at the end, so "instanceof" is not a perf issue here.
If we close like this, we also need to document it at setPerfObject().

I think, BTW, that PFD.close() is not called by the Benchmark, it has to be explicitly invoked
by the user.
                
> Allow setting arbitrary objects on PerfRunData
> ----------------------------------------------
>
>                 Key: LUCENE-3635
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3635
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: modules/benchmark
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>            Priority: Minor
>             Fix For: 3.6, 4.0
>
>         Attachments: LUCENE-3635.patch
>
>
> PerfRunData is used as the intermediary objects between PerfRunTasks. Just like we can
set IndexReader/Writer on it, it will be good if it allows setting other arbitrary objects
that are e.g. created by one task and used by another.
> A recent example is the enhancement to the benchmark package following the addition of
the facet module. We had to add TaxoReader/Writer.
> The proposal is to add a HashMap<String, Object> that custom PerfTasks can set()/get().
I do not propose to move IR/IW/TR/TW etc. into that map. If however people think that we should,
I can do that as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message