Package org.apache.solr.client.solrj.impl

Examples of org.apache.solr.client.solrj.impl.CloudSolrServer


        String zkHost = job.get("solr.zkhost");
        if (zkHost != null && zkHost.equals("") == false) {
            String collection = job.get("solr.zk.collection", "collection1");
            LOG.info("Indexing to collection: " + collection + " w/ ZK host: "
                    + zkHost);
            solr = new CloudSolrServer(zkHost);
            ((CloudSolrServer) solr).setDefaultCollection(collection);
        } else {
            String solrURL = job.get("solr.server.url");
            int queueSize = job.getInt("solr.client.queue.size", 100);
            int threadCount = job.getInt("solr.client.threads", 1);
View Full Code Here


  }

  @Test
  public void testClonesCloudSolrServerCorrectly() throws MalformedURLException {
    LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(BASE_URL, ALTERNATE_BASE_URL);
    CloudSolrServer cloudServer = new CloudSolrServer(ZOO_KEEPER_URL, lbSolrServer);

    CloudSolrServer clone = SolrServerUtils.clone(cloudServer);
    Assert.assertEquals(ZOO_KEEPER_URL, ReflectionTestUtils.getField(clone, FIELD_ZOO_KEEPER));

    LBHttpSolrServer lbClone = clone.getLbServer();
    Assert.assertEquals(ReflectionTestUtils.getField(lbSolrServer, FIELD_ALIVE_SERVERS),
        ReflectionTestUtils.getField(lbClone, FIELD_ALIVE_SERVERS));

    assertLBHttpSolrServerProperties(lbSolrServer, lbClone);
  }
View Full Code Here

  @Test
  @SuppressWarnings("unchecked")
  public void testClonesCloudSolrServerForCoreCorrectlyWhenCoreNameIsNotEmpty() throws MalformedURLException {
    LBHttpSolrServer lbSolrServer = new LBHttpSolrServer(BASE_URL, ALTERNATE_BASE_URL);
    CloudSolrServer cloudServer = new CloudSolrServer(ZOO_KEEPER_URL, lbSolrServer);

    CloudSolrServer clone = SolrServerUtils.clone(cloudServer, CORE_NAME);
    Assert.assertEquals(ZOO_KEEPER_URL, ReflectionTestUtils.getField(clone, FIELD_ZOO_KEEPER));

    LBHttpSolrServer lbClone = clone.getLbServer();
    Map<String, ?> aliveServers = (Map<String, ?>) ReflectionTestUtils.getField(lbClone, FIELD_ALIVE_SERVERS);
    Assert.assertThat(aliveServers.keySet(), hasItems(CORE_URL, ALTERNATE_CORE_URL));

    assertLBHttpSolrServerProperties(lbSolrServer, lbClone);
    Assert.assertThat(clone.getDefaultCollection(), equalTo(CORE_NAME));
  }
View Full Code Here

    Assert.assertThat(clone.getDefaultCollection(), equalTo(CORE_NAME));
  }

  @Test
  public void testClonesCloudSolrServerForCoreCorrectlyWhenNoLBHttpServerPresent() throws MalformedURLException {
    CloudSolrServer cloudServer = new CloudSolrServer(ZOO_KEEPER_URL);

    CloudSolrServer clone = SolrServerUtils.clone(cloudServer, CORE_NAME);
    Assert.assertEquals(ZOO_KEEPER_URL, ReflectionTestUtils.getField(clone, FIELD_ZOO_KEEPER));

    LBHttpSolrServer lbClone = clone.getLbServer();

    assertLBHttpSolrServerProperties(cloudServer.getLbServer(), lbClone);
    Assert.assertThat(clone.getDefaultCollection(), equalTo(CORE_NAME));
  }
View Full Code Here

  @Parameters
  public static Collection<Object[]> data() throws MalformedURLException {
    Object[][] data = new Object[][] { { new HttpSolrServer("http://127.0.0.1:8983") },
        { new LBHttpSolrServer("http://127.0.0.1:8983", "http://127.0.0.1:6666") },
        { new CloudSolrServer("http://127.0.0.1:8080") } };
    return Arrays.asList(data);
  }
View Full Code Here

TOP

Related Classes of org.apache.solr.client.solrj.impl.CloudSolrServer

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.