本文整理汇总了Java中org.apache.solr.util.ExternalPaths类的典型用法代码示例。如果您正苦于以下问题:Java ExternalPaths类的具体用法?Java ExternalPaths怎么用?Java ExternalPaths使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExternalPaths类属于org.apache.solr.util包,在下文中一共展示了ExternalPaths类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
super.setUp();
dataDir1 = createTempDir();
dataDir2 = createTempDir();
home = ExternalPaths.EXAMPLE_MULTICORE_HOME;
System.setProperty("solr.solr.home", home);
System.setProperty( "solr.core0.data.dir", dataDir1.getCanonicalPath() );
System.setProperty( "solr.core1.data.dir", dataDir2.getCanonicalPath() );
zkDir = dataDir1.getAbsolutePath() + File.separator
+ "zookeeper/server1/data";
zkServer = new ZkTestServer(zkDir);
zkServer.run();
SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), AbstractZkTestCase.TIMEOUT);
zkClient.makePath("/solr", false, true);
zkClient.close();
System.setProperty("zkHost", zkServer.getZkAddress());
}
示例2: testBootstrap
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@Test
public void testBootstrap() throws Exception {
// test bootstrap_conf
String[] args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
"bootstrap", "-solrhome", this.solrHome};
ZkCLI.main(args);
assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/collection1", true));
args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
"bootstrap", "-solrhome", ExternalPaths.EXAMPLE_MULTICORE_HOME};
ZkCLI.main(args);
assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/core0", true));
assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/core1", true));
}
示例3: setUp
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
super.setUp();
createTempDir();
dataDir2 = new File(TEMP_DIR, getSimpleClassName() + "-core1-"
+ System.currentTimeMillis());
dataDir2.mkdirs();
home = ExternalPaths.EXAMPLE_MULTICORE_HOME;
System.setProperty("solr.solr.home", home);
System.setProperty( "solr.core0.data.dir", dataDir.getCanonicalPath() );
System.setProperty( "solr.core1.data.dir", dataDir2.getCanonicalPath() );
zkDir = dataDir.getAbsolutePath() + File.separator
+ "zookeeper/server1/data";
zkServer = new ZkTestServer(zkDir);
zkServer.run();
SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), AbstractZkTestCase.TIMEOUT);
zkClient.makePath("/solr", false, true);
zkClient.close();
System.setProperty("zkHost", zkServer.getZkAddress());
}
示例4: testBootstrap
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@Test
public void testBootstrap() throws Exception {
// test bootstrap_conf
String[] args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
"bootstrap", "-solrhome", ExternalPaths.EXAMPLE_HOME};
ZkCLI.main(args);
assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/collection1", true));
args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
"bootstrap", "-solrhome", ExternalPaths.EXAMPLE_MULTICORE_HOME};
ZkCLI.main(args);
assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/core0", true));
assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/core1", true));
}
示例5: setUp
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@Override
public void setUp() throws Exception
{
super.setUp();
System.setProperty("solr.solr.home", ExternalPaths.EXAMPLE_HOME);
System.setProperty("tests.shardhandler.randomSeed", Long.toString(random().nextLong()));
File dataDir = createTempDir();
dataDir.mkdirs();
System.setProperty("solr.data.dir", dataDir.getCanonicalPath());
String path = ExternalPaths.WEBAPP_HOME;
server = new Server(port);
// insecure: only use for tests!!!!
server.setSessionIdManager(new HashSessionIdManager(new Random(random().nextLong())));
new WebAppContext(server, path, context );
SocketConnector connector = new SocketConnector();
connector.setMaxIdleTime(1000 * 60 * 60);
connector.setSoLingerTime(-1);
connector.setPort(0);
server.setConnectors(new Connector[]{connector});
server.setStopAtShutdown( true );
server.start();
port = connector.getLocalPort();
}
示例6: beforeTest
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@BeforeClass
public static void beforeTest() throws Exception {
createJetty(ExternalPaths.EXAMPLE_HOME, null, null);
jetty.getDispatchFilter().getServletHandler()
.addServletWithMapping(RedirectServlet.class, "/redirect/*");
jetty.getDispatchFilter().getServletHandler()
.addServletWithMapping(SlowServlet.class, "/slow/*");
jetty.getDispatchFilter().getServletHandler()
.addServletWithMapping(DebugServlet.class, "/debug/*");
}
示例7: setUp
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
super.setUp();
zkDir = createTempDir("zkData").getAbsolutePath();
zkServer = new ZkTestServer(zkDir);
zkServer.run();
home = ExternalPaths.EXAMPLE_HOME;
}
示例8: setUp
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
super.setUp();
log.info("####SETUP_START " + getTestName());
boolean useNewSolrXml = random().nextBoolean();
File tmpDir = createTempDir();
if (useNewSolrXml) {
solrHome = ExternalPaths.EXAMPLE_HOME;
} else {
File tmpSolrHome = new File(tmpDir, "tmp-solr-home");
FileUtils.copyDirectory(new File(ExternalPaths.EXAMPLE_HOME), tmpSolrHome);
FileUtils.copyFile(getFile("old-solr-example/solr.xml"), new File(tmpSolrHome, "solr.xml"));
solrHome = tmpSolrHome.getAbsolutePath();
}
zkDir = tmpDir.getAbsolutePath() + File.separator
+ "zookeeper/server1/data";
log.info("ZooKeeper dataDir:" + zkDir);
zkServer = new ZkTestServer(zkDir);
zkServer.run();
System.setProperty("zkHost", zkServer.getZkAddress());
SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), AbstractZkTestCase.TIMEOUT);
zkClient.makePath("/solr", false, true);
zkClient.close();
this.zkClient = new SolrZkClient(zkServer.getZkAddress(),
AbstractZkTestCase.TIMEOUT);
log.info("####SETUP_END " + getTestName());
}
示例9: setUp
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@Override
public void setUp() throws Exception
{
super.setUp();
System.setProperty("solr.solr.home", ExternalPaths.EXAMPLE_HOME);
File dataDir = new File(LuceneTestCase.TEMP_DIR,
getClass().getName() + "-" + System.currentTimeMillis());
dataDir.mkdirs();
System.setProperty("solr.data.dir", dataDir.getCanonicalPath());
String path = ExternalPaths.WEBAPP_HOME;
server = new Server(port);
// insecure: only use for tests!!!!
server.setSessionIdManager(new HashSessionIdManager(new Random(random().nextLong())));
new WebAppContext(server, path, context );
SocketConnector connector = new SocketConnector();
connector.setMaxIdleTime(1000 * 60 * 60);
connector.setSoLingerTime(-1);
connector.setPort(0);
server.setConnectors(new Connector[]{connector});
server.setStopAtShutdown( true );
server.start();
port = connector.getLocalPort();
}
示例10: setUp
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
super.setUp();
createTempDir();
zkDir = dataDir.getAbsolutePath() + File.separator
+ "zookeeper/server1/data";
zkServer = new ZkTestServer(zkDir);
zkServer.run();
home = ExternalPaths.EXAMPLE_HOME;
}
示例11: testBootstrapWithChroot
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@Test
public void testBootstrapWithChroot() throws Exception {
String chroot = "/foo/bar";
assertFalse(zkClient.exists(chroot, true));
String[] args = new String[] {"-zkhost", zkServer.getZkAddress() + chroot,
"-cmd", "bootstrap", "-solrhome", ExternalPaths.EXAMPLE_HOME};
ZkCLI.main(args);
assertTrue(zkClient.exists(chroot + ZkController.CONFIGS_ZKNODE
+ "/collection1", true));
}
示例12: beforeTest
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@BeforeClass
public static void beforeTest() throws Exception {
createJetty(ExternalPaths.EXAMPLE_HOME, null, null);
}
示例13: beforeTest
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@BeforeClass
public static void beforeTest() throws Exception {
initCore(ExternalPaths.EXAMPLE_CONFIG, ExternalPaths.EXAMPLE_SCHEMA,
ExternalPaths.EXAMPLE_HOME);
}
示例14: beforeTest
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@BeforeClass
public static void beforeTest() throws Exception {
initCore(ExternalPaths.EXAMPLE_CONFIG, ExternalPaths.EXAMPLE_SCHEMA, ExternalPaths.EXAMPLE_HOME);
}
示例15: beforeTest
import org.apache.solr.util.ExternalPaths; //导入依赖的package包/类
@BeforeClass
public static void beforeTest() throws Exception {
createJetty(ExternalPaths.EXAMPLE_SCHEMALESS_HOME, null, null);
}