本文整理汇总了Java中org.apache.solr.util.ExternalPaths.EXAMPLE_HOME属性的典型用法代码示例。如果您正苦于以下问题:Java ExternalPaths.EXAMPLE_HOME属性的具体用法?Java ExternalPaths.EXAMPLE_HOME怎么用?Java ExternalPaths.EXAMPLE_HOME使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.solr.util.ExternalPaths
的用法示例。
在下文中一共展示了ExternalPaths.EXAMPLE_HOME属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testBootstrap
@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));
}
示例2: setUp
@Override
@Before
public void setUp() throws Exception {
super.setUp();
zkDir = createTempDir("zkData").getAbsolutePath();
zkServer = new ZkTestServer(zkDir);
zkServer.run();
home = ExternalPaths.EXAMPLE_HOME;
}
示例3: setUp
@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());
}
示例4: setUp
@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;
}
示例5: testBootstrapWithChroot
@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));
}
示例6: testUpConfigLinkConfigClearZk
@Test
public void testUpConfigLinkConfigClearZk() throws Exception {
File tmpDir = createTempDir();
// test upconfig
String confsetname = "confsetone";
String[] args = new String[] {
"-zkhost",
zkServer.getZkAddress(),
"-cmd",
"upconfig",
"-confdir",
ExternalPaths.EXAMPLE_HOME + File.separator + "collection1"
+ File.separator + "conf", "-confname", confsetname};
ZkCLI.main(args);
assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/" + confsetname, true));
// print help
// ZkCLI.main(new String[0]);
// test linkconfig
args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
"linkconfig", "-collection", "collection1", "-confname", confsetname};
ZkCLI.main(args);
ZkNodeProps collectionProps = ZkNodeProps.load(zkClient.getData(ZkStateReader.COLLECTIONS_ZKNODE + "/collection1", null, null, true));
assertTrue(collectionProps.containsKey("configName"));
assertEquals(confsetname, collectionProps.getStr("configName"));
// test down config
File confDir = new File(tmpDir,
"solrtest-confdropspot-" + this.getClass().getName() + "-" + System.currentTimeMillis());
assertFalse(confDir.exists());
args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
"downconfig", "-confdir", confDir.getAbsolutePath(), "-confname", confsetname};
ZkCLI.main(args);
File[] files = confDir.listFiles();
List<String> zkFiles = zkClient.getChildren(ZkController.CONFIGS_ZKNODE + "/" + confsetname, null, true);
assertEquals(files.length, zkFiles.size());
File sourceConfDir = new File(ExternalPaths.EXAMPLE_HOME + File.separator + "collection1"
+ File.separator + "conf");
// filter out all directories starting with . (e.g. .svn)
Collection<File> sourceFiles = FileUtils.listFiles(sourceConfDir, TrueFileFilter.INSTANCE, new RegexFileFilter("[^\\.].*"));
for (File sourceFile :sourceFiles){
int indexOfRelativePath = sourceFile.getAbsolutePath().lastIndexOf("collection1" + File.separator + "conf");
String relativePathofFile = sourceFile.getAbsolutePath().substring(indexOfRelativePath + 17, sourceFile.getAbsolutePath().length());
File downloadedFile = new File(confDir,relativePathofFile);
assertTrue(downloadedFile.getAbsolutePath() + " does not exist source:" + sourceFile.getAbsolutePath(), downloadedFile.exists());
assertTrue("Content didn't change",FileUtils.contentEquals(sourceFile,downloadedFile));
}
// test reset zk
args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
"clear", "/"};
ZkCLI.main(args);
assertEquals(0, zkClient.getChildren("/", null, true).size());
}
示例7: testUpConfigLinkConfigClearZk
@Test
public void testUpConfigLinkConfigClearZk() throws Exception {
// test upconfig
String confsetname = "confsetone";
String[] args = new String[] {
"-zkhost",
zkServer.getZkAddress(),
"-cmd",
"upconfig",
"-confdir",
ExternalPaths.EXAMPLE_HOME + File.separator + "collection1"
+ File.separator + "conf", "-confname", confsetname};
ZkCLI.main(args);
assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/" + confsetname, true));
// print help
// ZkCLI.main(new String[0]);
// test linkconfig
args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
"linkconfig", "-collection", "collection1", "-confname", confsetname};
ZkCLI.main(args);
ZkNodeProps collectionProps = ZkNodeProps.load(zkClient.getData(ZkStateReader.COLLECTIONS_ZKNODE + "/collection1", null, null, true));
assertTrue(collectionProps.containsKey("configName"));
assertEquals(confsetname, collectionProps.getStr("configName"));
// test down config
File confDir = new File(TEMP_DIR,
"solrtest-confdropspot-" + this.getClass().getName() + "-" + System.currentTimeMillis());
assertFalse(confDir.exists());
args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
"downconfig", "-confdir", confDir.getAbsolutePath(), "-confname", confsetname};
ZkCLI.main(args);
File[] files = confDir.listFiles();
List<String> zkFiles = zkClient.getChildren(ZkController.CONFIGS_ZKNODE + "/" + confsetname, null, true);
assertEquals(files.length, zkFiles.size());
// test reset zk
args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
"clear", "/"};
ZkCLI.main(args);
assertEquals(0, zkClient.getChildren("/", null, true).size());
}
示例8: getSolrHome
public String getSolrHome() { return ExternalPaths.EXAMPLE_HOME; }