[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16437490#comment-16437490 ] ASF subversion and git services commented on SOLR-11913: Commit a4f60c286319d2e46fb76f5461e8aa1101f8b9e0 in lucene-solr's branch refs/heads/branch_7x from [~dsmiley] [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a4f60c2 ] SOLR-11913: SolrParams now implements Iterable> and has stream() (cherry picked from commit 9a149ad) > SolrParams ought to implement Iterable > > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Assignee: David Smiley >Priority: Minor > Labels: newdev > Fix For: 7.4 > > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913.patch, > SOLR-11913.patch, SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16437487#comment-16437487 ] ASF subversion and git services commented on SOLR-11913: Commit 9a149ad7e77837b7a99e84a4968fe43747ec30a0 in lucene-solr's branch refs/heads/master from [~dsmiley] [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9a149ad ] SOLR-11913: SolrParams now implements Iterable> and has stream() > SolrParams ought to implement Iterable > > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Assignee: David Smiley >Priority: Minor > Labels: newdev > Fix For: 7.4 > > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913.patch, > SOLR-11913.patch, SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436784#comment-16436784 ] Tapan Vaishnav commented on SOLR-11913: --- I see, how come it didn't show anything in the following report? https://issues.apache.org/jira/browse/SOLR-11913?focusedCommentId=16428288=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16428288 Also, apologies that you had to most of the work. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Assignee: David Smiley >Priority: Minor > Labels: newdev > Fix For: 7.4 > > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913.patch, > SOLR-11913.patch, SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436771#comment-16436771 ] David Smiley commented on SOLR-11913: - Here's another update. It turns out there were some problems with TextResponseWriter's order of instanceof checks. So I tweaked that order to put some of the more general stuff towards the end. I also added a nice toString to the Map.Entry we have. Hopefully tests pass this time... > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Assignee: David Smiley >Priority: Minor > Labels: newdev > Fix For: 7.4 > > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913.patch, > SOLR-11913.patch, SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436723#comment-16436723 ] Tapan Vaishnav commented on SOLR-11913: --- bq.Sure; I'll re-order that. There is no real code rule about that here; I just try to maintain some semblance of some sort of organization that feels reasonable and not haphazard. I see. bq.Thanks for helping out. I'll expect to commit soon after the tests pass. (y) > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Assignee: David Smiley >Priority: Minor > Labels: newdev > Fix For: 7.4 > > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913.patch, > SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436722#comment-16436722 ] David Smiley commented on SOLR-11913: - {quote}We are not using the _Override_ annotation for the stream function, so isn't it better to re-order it about the iterator function for better code style? {quote} Sure; I'll re-order that. There is no real code rule about that here; I just try to maintain some semblance of some sort of organization that feels reasonable and not haphazard. Thanks for helping out. I'll expect to commit soon after the tests pass. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Assignee: David Smiley >Priority: Minor > Labels: newdev > Fix For: 7.4 > > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913.patch, > SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436519#comment-16436519 ] Tapan Vaishnav commented on SOLR-11913: --- [~dsmiley] Thanks for the updated patch. {quote}Added more Javadocs, not just to the new methods here {quote} Thanks for the Javadocs, I'll keep in mind about the manner from next time onwards. {quote}added a convenience method: public Stream> stream() {quote} We are not using the _Override_ annotation for the stream function, so isn't it better to re-order it about the iterator function for better code style? Thank you for all your feedbacks, there were really helpful. > SolrParams ought to implement Iterable > > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Assignee: David Smiley >Priority: Minor > Labels: newdev > Fix For: 7.4 > > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913.patch, > SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436266#comment-16436266 ] David Smiley commented on SOLR-11913: - Here's an updated patch. I think it's ready. * added a convenience method: {{public Stream> stream()}} * Added more javadocs, not just to the new methods here * Re-ordered what you added and the existing writeMap to fit better with the loose organization of existing methods * MultiMapSolrParams now overrides iterator(). * changed assertEquals to assertArrayEquals where applicable in the test > SolrParams ought to implement Iterable > > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Assignee: David Smiley >Priority: Minor > Labels: newdev > Fix For: 7.4 > > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913.patch, > SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16428288#comment-16428288 ] Lucene/Solr QA commented on SOLR-11913: --- | (/) *{color:green}+1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} test4tests {color} | {color:green} 0m 0s{color} | {color:green} The patch appears to include 1 new or modified test files. {color} | || || || || {color:brown} master Compile Tests {color} || | {color:green}+1{color} | {color:green} compile {color} | {color:green} 1m 21s{color} | {color:green} master passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} compile {color} | {color:green} 1m 16s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 1m 16s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} Release audit (RAT) {color} | {color:green} 1m 4s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} Check forbidden APIs {color} | {color:green} 1m 0s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} Validate source patterns {color} | {color:green} 1m 0s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} unit {color} | {color:green} 0m 47s{color} | {color:green} dataimporthandler in the patch passed. {color} | | {color:green}+1{color} | {color:green} unit {color} | {color:green} 3m 39s{color} | {color:green} solrj in the patch passed. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 9m 40s{color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | JIRA Issue | SOLR-11913 | | JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12917498/SOLR-11913.patch | | Optional Tests | compile javac unit ratsources checkforbiddenapis validatesourcepatterns | | uname | Linux lucene1-us-west 3.13.0-88-generic #135-Ubuntu SMP Wed Jun 8 21:10:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | ant | | Personality | /home/jenkins/jenkins-slave/workspace/PreCommit-SOLR-Build/sourcedir/dev-tools/test-patch/lucene-solr-yetus-personality.sh | | git revision | master / 73d7410 | | ant | version: Apache Ant(TM) version 1.9.3 compiled on April 8 2014 | | Default Java | 1.8.0_152 | | Test Results | https://builds.apache.org/job/PreCommit-SOLR-Build/40/testReport/ | | modules | C: solr/contrib/dataimporthandler solr/solrj U: solr | | Console output | https://builds.apache.org/job/PreCommit-SOLR-Build/40/console | | Powered by | Apache Yetus 0.7.0 http://yetus.apache.org | This message was automatically generated. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Assignee: David Smiley >Priority: Minor > Labels: newdev > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913.patch, > SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16424994#comment-16424994 ] Tapan Vaishnav commented on SOLR-11913: --- [~dsmiley] Thanks for your reply. I have updated few getParameterNamesiterator() callers and fixed some bugs into the latest patch. Please have a look and let me know your thoughts. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Priority: Minor > Labels: newdev > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913.patch, > SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16415996#comment-16415996 ] David Smiley commented on SOLR-11913: - {quote}I tried doing so but it gave me some error stating _Rat problems were found!_ . I tried searching over the internet but couldn't find anything useful, did some playing around build.xml but all was in waste. {quote} That refers to quality or style checks that Lucene/Solr expressly insists upon. The log output _should_ tell you exactly what the problem is. {quote} when you said about callers of getParameterNamesiterator(), did you mean callers in SolrParams class only or all callers of that iterator function? {quote} All. Note your IDE should have a "find usages" or similarly named feature. bq. Though ModifiableSolrParams is just an example, I check for this class and it is using getParameterNamesiterator() for its add(SolrParams params) function which has never been called, so no point in changing that, I guess. Please do change it. When you say "has never been called"; maybe I don't understand what you mean but IntelliJ reports 30 usages across the codebase. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Priority: Minor > Labels: newdev > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411026#comment-16411026 ] Tapan Vaishnav commented on SOLR-11913: --- {quote}The default impl can produce a Map.Entry with a getValue that calls through to getParams. {quote} This I didn't think of. Thanks for pointing it out, have fixed now and will upload with the latest patch. I have fixed the typo in testcase and added the override annotation. (though haven't uploaded the patch yet.) {quote}BTW try ant precommit. Hopefully it'll show you that you need to use @Override {quote} I tried doing so but it gave me some error stating _Rat problems were found!_ . I tried searching over the internet but couldn't find anything useful, did some playing around build.xml but all was in waste. Anyways, what I want to ask is when you said about callers of getParameterNamesiterator(), did you mean callers in SolrParams class only or all callers of that iterator function? I mean there are some functions in SolrParam class which are using getParameterNamesiterator() and we can modify those functions for Java 5 foreach or Java 8 stream style. Or there are some classes which are extending the SolrParams like ModifiableSolrParams, MultiMapSolrParams etc which are using getParameterNamesiterator() and we can modify those for Java 5 foreach or Java 8 stream style. Though ModifiableSolrParams is just an example, I check for this class and it is using getParameterNamesiterator() for its add(SolrParams params) function which has never been called, so no point in changing that, I guess. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Priority: Minor > Labels: newdev > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16410710#comment-16410710 ] David Smiley commented on SOLR-11913: - You're getting there Tapan! Typo in test name: testMapEntyrIterators Now, quoting the description where I mentioned one detail not done... bq. The default impl can produce a Map.Entry with a getValue that calls through to getParams. Instead I see that you're calling getParams eagerly. The distinction is that callers that only care about certain named params will needlessly pay a cost to getParams for parameters that aren't even needed. BTW try {{ant precommit}}. Hopefully it'll show you that you need to use {{\@Override}} Can you please try updating some callers of getParameterNamesIterator to see which of those would be good candidates to renovate to use the Java 5 for-each style? Perhaps do everything but Solr "core" (i.e. just SolrJ + contribs) which can be tested in less time than running "ant test" on everything. Although you did add a unit test which is nice, there's nothing like real-world usage through other code that needs to use it. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Priority: Minor > Labels: newdev > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16410663#comment-16410663 ] Tapan Vaishnav commented on SOLR-11913: --- {quote}1. When uploading updated patches, please use an identical filename. JIRA tracks revisions provided that the file name hasn't changed. {quote} I see. {quote}Though you did provide a method getMapEntryIteretor which should be renamed to iterator. {quote} Done. Please have a look, apologies for making you review again n again. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Priority: Minor > Labels: newdev > Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16408001#comment-16408001 ] David Smiley commented on SOLR-11913: - 1. When uploading updated patches, please use an identical filename. JIRA tracks revisions provided that the file name hasn't changed. 2. I suspect your latest patch won't compile. I see SolrParams now implements Iterable (great), but in doing so you must provide an implementation of the {{iterator}} method, which you didn't. Though you did provide a method {{getMapEntryIteretor}} which should be renamed to {{iterator}}. 3. bq. But there are other classes too which extend SolrParams and need to be modified. _Only_ subclasses of SolrParams that can offer a more efficient implementation should override the default implementation you are adding to SolrParams. You'll hopefully realize this as you progress. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Priority: Minor > Labels: newdev > Attachments: SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16407783#comment-16407783 ] Tapan Vaishnav commented on SOLR-11913: --- [~dsmiley] Thanks for your review. I have fixed the pointed out changes and attached as SOLR-11913_v2.patch. Please, have a look whenever you get time. > The key part as referenced in the description – having SolrParams implement >Iterable wasn't done. I thought that we had to implement the function not as in the _implements_ keyword. > Why did you create SolrParams.getMapEntry? You could inline it to do an > anonymous inner class It wasn't creating any unnecessary new object and I thought that we might use it in future but has been fixed now. > Please override this for ModifiableSolrParams to return a more optimal > implementation. I have overridden the _iterator()_ from Iterable class for ModifiableSolrParams. But there are other classes too which extend SolrParams and need to be modified. Will do after the next review. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Priority: Minor > Labels: newdev > Attachments: SOLR-11913.patch, SOLR-11913_v2.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16405481#comment-16405481 ] David Smiley commented on SOLR-11913: - It's a start. The key part as referenced in the description -- having SolrParams implement Iterable wasn't done. Why did you create SolrParams.getMapEntry? You could inline it to do an anonymous inner class Please override this for ModifiableSolrParams to return a more optimal implementation. After I code review those changes, we can consider callers of getParameterNamesIterator to see which of those would be good candidates to renovate to use the Java 5 for-each style. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Priority: Minor > Labels: newdev > Attachments: SOLR-11913.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16403273#comment-16403273 ] Tapan Vaishnav commented on SOLR-11913: --- [~dsmiley] [~gus_heck] I have added the patch. Please have a look at it and let me know your feedback. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Priority: Minor > Labels: newdev > Attachments: SOLR-11913.patch > > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16375926#comment-16375926 ] Tapan Vaishnav commented on SOLR-11913: --- [~dsmiley] Thanks for your quick reply. I think this should work. Iterable can just produce the iterator which we can iterate over to. And for the value of each [key: value] pair of _Map.Entry_ , we can use the _getParams_ internally by passing the _Map.Entry_ object(which would be nothing but the _iterator.next_) into the _getValue_ function of _ModifiableSolrParams_ class. {noformat} public Iterator> Iterable(){ Set set = vals.entrySet(); return set.iterator(); } public String[] getValue(Map.Entry map){ if (map!=null) { return getParams(map.getKey()); } return null; } {noformat} > SolrParams ought to implement Iterable > > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Priority: Minor > Labels: newdev > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16373894#comment-16373894 ] David Smiley commented on SOLR-11913: - For the Iterable part, that might work but I don't think a LinkedHashMap should be created internally just to expose this. When I referred to {{getValue}} it was specifically for {{Map.Entry.getValue}} so it shouldn't consume an iterator's position – i.e. repeated calls should produce the same result. > SolrParams ought to implement Iterable> > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Priority: Minor > Labels: newdev > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-11913) SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
[ https://issues.apache.org/jira/browse/SOLR-11913?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16372535#comment-16372535 ] Tapan Vaishnav commented on SOLR-11913: --- >From whatever I understood(Apologies if I'm heavily wrong, just started using >Solr) scratch。。。 {noformat} public Iterator> Iterable(SolrParams params){ vals = new LinkedHashMap<>(); if( params != null ) { this.add( params ); } Iterator > entries = vals.entrySet().iterator(); return entries; } public String[] getValue(Iterator > it){ if (it.hasNext()) { Map.Entry pair = it.next(); return getParams(pair.getKey()); } return null; } {noformat} > SolrParams ought to implement Iterable > > -- > > Key: SOLR-11913 > URL: https://issues.apache.org/jira/browse/SOLR-11913 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) >Reporter: David Smiley >Priority: Minor > Labels: newdev > > SolrJ ought to implement {{Iterable >}} so that > it's easier to iterate on it, either using Java 5 for-each style, or Java 8 > streams. The implementation on ModifiableSolrParams can delegate through to > the underlying LinkedHashMap entry set. The default impl can produce a > Map.Entry with a getValue that calls through to getParams. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org