Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14508

TopicStreams do not allow use of collection aliases

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 7.4, 8.1
    • None
    • SolrJ

    Description

      I'm trying to use the solrJ TopicStream class to listen for data in a collection by referencing its alias. It complains about there not being any slices for that alias. On investigation it looked like the code in solrj was explicitly NOT looking at aliases in topic stream.

       

      I made some minor changes and rebuilt and it seems to work.

       

      in two places where getSlices is called, I set the useAlias flag to true

       
      protected void constructStreams() throws IOException {
          try {
            ZkStateReader zkStateReader = cloudSolrClient.getZkStateReader();
            Slice[] slices = CloudSolrStream.getSlices(this.collection, zkStateReader, true);
       
      and also here
       
      private void getCheckpoints() throws IOException {
          this.checkpoints = new HashMap<>();
          ZkStateReader zkStateReader = cloudSolrClient.getZkStateReader();

          Slice[] slices = CloudSolrStream.getSlices(this.collection, zkStateReader, true);
       
      I don't know how many versions this affects but I'm sure its a bunch. Also I hit the same errors using the REST api as I did using Solrj, so this would probably not affect that

      Attachments

        Activity

          People

            Unassigned Unassigned
            Jnight82 Jonathan Nightingale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: