use of org.apache.solr.cloud.MiniSolrCloudCluster in project YCSB by brianfrankcooper.
the class SolrClientBaseTest method onlyOnce.
@BeforeClass
public static void onlyOnce() throws Exception {
Path miniSolrCloudClusterTempDirectory = Files.createTempDirectory("miniSolrCloudCluster");
miniSolrCloudClusterTempDirectory.toFile().deleteOnExit();
miniSolrCloudCluster = new MiniSolrCloudCluster(1, miniSolrCloudClusterTempDirectory, JettyConfig.builder().build());
// Upload Solr configuration
URL configDir = SolrClientBaseTest.class.getClassLoader().getResource("solr_config");
assertNotNull(configDir);
miniSolrCloudCluster.uploadConfigDir(new File(configDir.toURI()), MOCK_TABLE);
}
use of org.apache.solr.cloud.MiniSolrCloudCluster in project titan by thinkaurelius.
the class SolrRunner method start.
public static void start() throws Exception {
String userDir = System.getProperty("user.dir");
String solrHome = userDir.contains("titan-solr") ? Joiner.on(File.separator).join(userDir, "target", "test-classes", "solr") : Joiner.on(File.separator).join(userDir, "titan-solr", "target", "test-classes", "solr");
File templateDirectory = new File(solrHome + File.separator + TEMPLATE_DIRECTORY);
assert templateDirectory.exists();
File temp = new File(TMP_DIRECTORY + File.separator + "solr-" + System.nanoTime());
assert !temp.exists();
temp.mkdirs();
temp.deleteOnExit();
File solrXml = new File(solrHome, "solr.xml");
miniSolrCloudCluster = new MiniSolrCloudCluster(NUM_SERVERS, null, temp, solrXml, null, null);
for (String core : COLLECTIONS) {
File coreDirectory = new File(temp.getAbsolutePath() + File.separator + core);
assert coreDirectory.mkdirs();
FileUtils.copyDirectory(templateDirectory, coreDirectory);
miniSolrCloudCluster.uploadConfigDir(coreDirectory.getAbsoluteFile(), core);
}
}
use of org.apache.solr.cloud.MiniSolrCloudCluster in project lucene-solr by apache.
the class SearchHandlerTest method testZkConnected.
@Test
public void testZkConnected() throws Exception {
MiniSolrCloudCluster miniCluster = new MiniSolrCloudCluster(5, createTempDir(), buildJettyConfig("/solr"));
final CloudSolrClient cloudSolrClient = miniCluster.getSolrClient();
try {
assertNotNull(miniCluster.getZkServer());
List<JettySolrRunner> jettys = miniCluster.getJettySolrRunners();
assertEquals(5, jettys.size());
for (JettySolrRunner jetty : jettys) {
assertTrue(jetty.isRunning());
}
// create collection
String collectionName = "testSolrCloudCollection";
String configName = "solrCloudCollectionConfig";
miniCluster.uploadConfigSet(SolrTestCaseJ4.TEST_PATH().resolve("collection1/conf"), configName);
CollectionAdminRequest.createCollection(collectionName, configName, 2, 2).process(miniCluster.getSolrClient());
QueryRequest req = new QueryRequest();
QueryResponse rsp = req.process(cloudSolrClient, collectionName);
assertTrue(rsp.getResponseHeader().getBooleanArg("zkConnected"));
} finally {
miniCluster.shutdown();
}
}
use of org.apache.solr.cloud.MiniSolrCloudCluster in project lucene-solr by apache.
the class TestDistribIDF method setUp.
@Override
public void setUp() throws Exception {
if (random().nextBoolean()) {
System.setProperty("solr.statsCache", ExactStatsCache.class.getName());
} else {
System.setProperty("solr.statsCache", LRUStatsCache.class.getName());
}
super.setUp();
solrCluster = new MiniSolrCloudCluster(3, createTempDir(), buildJettyConfig("/solr"));
// set some system properties for use by tests
System.setProperty("solr.test.sys.prop1", "propone");
System.setProperty("solr.test.sys.prop2", "proptwo");
solrCluster.uploadConfigSet(TEST_PATH().resolve("collection1/conf"), "conf1");
solrCluster.uploadConfigSet(configset("configset-2"), "conf2");
}
use of org.apache.solr.cloud.MiniSolrCloudCluster in project ddf by codice.
the class BackupCommandTest method createMiniSolrCloudCluster.
private static void createMiniSolrCloudCluster() throws Exception {
miniSolrCloud = new MiniSolrCloudCluster(1, getBaseDirPath(), JettyConfig.builder().setContext("/solr").build());
miniSolrCloud.getSolrClient().connect();
}
Aggregations