Github user hmcl commented on a diff in the pull request: https://github.com/apache/storm/pull/665#discussion_r36998880 --- Diff: external/storm-solr/src/main/java/org/apache/storm/solr/schema/builder/RestJsonSchemaBuilder.java --- @@ -0,0 +1,53 @@ +package org.apache.storm.solr.schema.builder; + +import com.google.gson.Gson; +import org.apache.storm.solr.schema.Schema; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.net.URL; +import java.util.Scanner; + +/** + * Class that buils the {@link Schema} object from the JSON representation of the schema as returned by the + * URL of the form http://localhost:8983/solr/gettingstarted/schema/ . This particular URL returns the schema + * in JSON format for the gettingstarted example running locally. + * <p></p> + * Created by hlouro on 7/28/15. + */ +public class RestJsonSchemaBuilder implements SchemaBuilder { + private static final Logger logger = LoggerFactory.getLogger(RestJsonSchemaBuilder.class); + private Schema schema; + + + /** Urls with the form http://localhost:8983/solr/gettingstarted/schema/ returns the schema in JSON format */ + public RestJsonSchemaBuilder(String solrHost, String solrPort, String collection) throws IOException { + this(new URL("http://" + solrHost + ":" + solrPort + "/solr/" + collection + "/schema/")); --- End diff -- The class has two other constructors that can receive the complete url either has a String or has a URL object. I believe this covers the arbitrary URL you mention. My idea with the constructor that receives the host, port, and collection is to be the default, if you will. I I am not sure /solr/ and /schema/ can be renamed on Solr. I can research that. In case they are, the option is to provide a 5 args constructor that receives these two in addition to the existing 3.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---