private static Logger LOG = Logger.getLogger(DeployUndeploySearchInLoop.class);
public static void main(String[] args) throws Exception {
LuceneClient luceneClient = new LuceneClient();
ZkConfiguration zkConfig = new ZkConfiguration();
DeployClient deployClient = new DeployClient(ZkKattaUtil.startZkClient(zkConfig, 60000), zkConfig);
QueryParser parser = new QueryParser(Version.LUCENE_30, "field", new KeywordAnalyzer());
Query query = parser.parse("foo: b*");
int runThroughs = 2;
while (true) {
try {
String indexName = "index" + runThroughs;
LOG.info("deploying index '" + indexName + "'");
deployClient.addIndex(indexName, "/Users/jz/Documents/workspace/ms/katta/src/test/testIndexA", 1)
.joinDeployment();
} catch (Exception e) {
logException("deploy", e);
}
try {
String indexName = "index" + (runThroughs - 1);
LOG.info("undeploying index '" + indexName + "'");
deployClient.removeIndex(indexName);
} catch (Exception e) {
logException("undeploy", e);
}
try {