[jira] Created: (SOLR-427) Allow IndexSchema to load from an InputStream, not just a file system file

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (SOLR-427) Allow IndexSchema to load from an InputStream, not just a file system file

JIRA jira@apache.org
Allow IndexSchema to load from an InputStream, not just a file system file
--------------------------------------------------------------------------

                 Key: SOLR-427
                 URL: https://issues.apache.org/jira/browse/SOLR-427
             Project: Solr
          Issue Type: Improvement
          Components: search
    Affects Versions: 1.3
            Reporter: Erik Hatcher
            Assignee: Erik Hatcher
            Priority: Minor
             Fix For: 1.3


IndexSchema is currently tied to reading a file system schema.xml file.   In order to more dynamically load a schema from in-memory configuration this needs to be adjusted.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-427) Allow IndexSchema to load from an InputStream, not just a file system file

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/SOLR-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Erik Hatcher updated SOLR-427:
------------------------------

    Attachment: patch.txt

Attached is a patch that allows IndexSchema to load from an InputStream.  This deprecates the getInputStream() method  as that didn't seem a viable method to keep - suggestions welcome on that.   It also deprecates the original constructor, though that might be unnecessary.

> Allow IndexSchema to load from an InputStream, not just a file system file
> --------------------------------------------------------------------------
>
>                 Key: SOLR-427
>                 URL: https://issues.apache.org/jira/browse/SOLR-427
>             Project: Solr
>          Issue Type: Improvement
>          Components: search
>    Affects Versions: 1.3
>            Reporter: Erik Hatcher
>            Assignee: Erik Hatcher
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: patch.txt
>
>
> IndexSchema is currently tied to reading a file system schema.xml file.   In order to more dynamically load a schema from in-memory configuration this needs to be adjusted.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-427) Allow IndexSchema to load from an InputStream, not just a file system file

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Erik Hatcher commented on SOLR-427:
-----------------------------------

Ultimately what I want to do is affect an in-memory schema and then load a new SolrCore with it, without having to futz with XML.  This gets some of the way there in the simplest way possible.

> Allow IndexSchema to load from an InputStream, not just a file system file
> --------------------------------------------------------------------------
>
>                 Key: SOLR-427
>                 URL: https://issues.apache.org/jira/browse/SOLR-427
>             Project: Solr
>          Issue Type: Improvement
>          Components: search
>    Affects Versions: 1.3
>            Reporter: Erik Hatcher
>            Assignee: Erik Hatcher
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: patch.txt
>
>
> IndexSchema is currently tied to reading a file system schema.xml file.   In order to more dynamically load a schema from in-memory configuration this needs to be adjusted.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (SOLR-427) Allow IndexSchema to load from an InputStream, not just a file system file

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/SOLR-427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Erik Hatcher resolved SOLR-427.
-------------------------------

    Resolution: Fixed

committed.   I left the deprecations of the file constructor and the getInputStream() method.   The file constructor can easily be refactored out.  As for getInputStream() - the only way this could be viable with an IndexSchema constructed by an InputStream would be if the schema bytes were tucked away when loaded so they could be regurgitated back - which perhaps makes sense?!   Something to consider when we eventually get around to cleaning up all the deprecations we have lying around.

> Allow IndexSchema to load from an InputStream, not just a file system file
> --------------------------------------------------------------------------
>
>                 Key: SOLR-427
>                 URL: https://issues.apache.org/jira/browse/SOLR-427
>             Project: Solr
>          Issue Type: Improvement
>          Components: search
>    Affects Versions: 1.3
>            Reporter: Erik Hatcher
>            Assignee: Erik Hatcher
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: patch.txt
>
>
> IndexSchema is currently tied to reading a file system schema.xml file.   In order to more dynamically load a schema from in-memory configuration this needs to be adjusted.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-427) Allow IndexSchema to load from an InputStream, not just a file system file

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Ryan McKinley commented on SOLR-427:
------------------------------------

Hymmm.  I'm just now looking at this in the context of multi-core support....

Deprecating IndexSchema(SolrConfig solrConfig, String schemaFile) isn't good because it gives up RELOAD -- the schema no longer knows where it came from.  Also, the changes you make set the filename to "schema.xml" regardless of what is actually used.

But maybe it is ok.  everything we have is hardcoded to instanceDir+"/conf/schema.xml" anyway.




> Allow IndexSchema to load from an InputStream, not just a file system file
> --------------------------------------------------------------------------
>
>                 Key: SOLR-427
>                 URL: https://issues.apache.org/jira/browse/SOLR-427
>             Project: Solr
>          Issue Type: Improvement
>          Components: search
>    Affects Versions: 1.3
>            Reporter: Erik Hatcher
>            Assignee: Erik Hatcher
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: patch.txt
>
>
> IndexSchema is currently tied to reading a file system schema.xml file.   In order to more dynamically load a schema from in-memory configuration this needs to be adjusted.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-427) Allow IndexSchema to load from an InputStream, not just a file system file

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Erik Hatcher commented on SOLR-427:
-----------------------------------

I was following the precedent set by SolrConfig (i.e. public SolrConfig(String instanceDir, String file, InputStream is)) a bit with this patch.   Why is "file" in that constructor?

It is highly desirable and useful to have these things configurable outside the scope of a file system file, or even XML for that matter (but that can be hacked with an InputStream that hides the XML nature of it at this point).  

I concur that it would be great for these configuration pieces to be able to reload themselves - perhaps what we do is simply tuck the bytes read from the InputStream away internally so they can be reloaded or dumped back out.

I'm fine with undeprecating that constructor, though, at least until we come up with something better.

> Allow IndexSchema to load from an InputStream, not just a file system file
> --------------------------------------------------------------------------
>
>                 Key: SOLR-427
>                 URL: https://issues.apache.org/jira/browse/SOLR-427
>             Project: Solr
>          Issue Type: Improvement
>          Components: search
>    Affects Versions: 1.3
>            Reporter: Erik Hatcher
>            Assignee: Erik Hatcher
>            Priority: Minor
>             Fix For: 1.3
>
>         Attachments: patch.txt
>
>
> IndexSchema is currently tied to reading a file system schema.xml file.   In order to more dynamically load a schema from in-memory configuration this needs to be adjusted.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.