Amrit Sarkar created SOLR-12658:
-----------------------------------

             Summary: Extend support for more than 4 "partitionKeys" in 
ParallelStream after SOLR-11598
                 Key: SOLR-12658
                 URL: https://issues.apache.org/jira/browse/SOLR-12658
             Project: Solr
          Issue Type: Improvement
      Security Level: Public (Default Security Level. Issues are Public)
          Components: streaming expressions
            Reporter: Amrit Sarkar


SOLR-11598 extended the capabilities for Export handler to have more than 4 
fields for sorting.

As streaming expressions leverages Export handler, ParallelStream allowed 
maximum 4 fields in "{color:blue}partitionKeys{color}" and silently ignored 
rest of the fields if more than 4 are specified.

 HashQParserPlugin:CompositeHash: 347
{code}
  private static class CompositeHash implements HashKey {

    private HashKey key1;
    private HashKey key2;
    private HashKey key3;
    private HashKey key4;

    public CompositeHash(HashKey[] hashKeys) {
      key1 = hashKeys[0];
      key2 = hashKeys[1];
      key3 = (hashKeys.length > 2) ? hashKeys[2] : new ZeroHash();
      key4 = (hashKeys.length > 3) ? hashKeys[3] : new ZeroHash();
    }

    public void setNextReader(LeafReaderContext context) throws IOException {
      key1.setNextReader(context);
      key2.setNextReader(context);
      key3.setNextReader(context);
      key4.setNextReader(context);
    }

    public long hashCode(int doc) throws IOException {
      return 
key1.hashCode(doc)+key2.hashCode(doc)+key3.hashCode(doc)+key4.hashCode(doc);
    }
  }
{code}

To make sure we have documents distributed across workers when executing 
streaming expression parallely, all the fields specified in 'partitionKeys' 
should be considered in calculating which worker particular document should go 
for further processing.





--
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

Reply via email to