Package org.platformlayer.service.solr.model

Examples of org.platformlayer.service.solr.model.SolrCluster


  @Test
  public void testCreateAndDeleteItem() throws Exception {
    String id = random.randomAlphanumericString(8);

    SolrCluster solr = new SolrCluster();
    solr.dnsName = id + ".test.platformlayer.org";

    solr = putItem(id, solr);

    solr = waitForHealthy(solr);

    InetSocketAddress socketAddress = getUniqueEndpoint(solr);

    Assert.assertFalse(isPortOpen(socketAddress));

    openFirewall(solr, SolrConstants.API_PORT);
    Assert.assertTrue(isPortOpen(socketAddress));

    // TODO: Make endpoint http://<ip>:<port>/<path>...

    String url = "http://" + socketAddress.getAddress().getHostAddress() + ":" + socketAddress.getPort() + "/solr";
    testSolr(url);

    String customFieldKey = "customfield1";

    SolrSchemaField field = new SolrSchemaField();
    field.name = customFieldKey;
    field.type = "text_general";
    field.getTags().add(Tag.buildParentTag(solr.getKey()));

    // TODO: Our scoping of keys is problematic now...
    // If two clusters both have the same key "customfield1", they can't have the same ID
    field = putItem(id + "-" + customFieldKey, field);
    waitForHealthy(field);
View Full Code Here


  public String getInstanceKey() {
    return "solr";
  }

  public List<SolrSchemaField> getFields() throws OpsException {
    SolrCluster cluster = getCluster();
    List<SolrSchemaField> fields = Lists.newArrayList();
    for (SolrSchemaField field : platformLayer.listItems(SolrSchemaField.class, TagFilter.byParent(cluster))) {
      fields.add(field);
    }
    return fields;
View Full Code Here

TOP

Related Classes of org.platformlayer.service.solr.model.SolrCluster

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.