Re: [Katta-developer] Deploynig index via addIndex
Brought to you by:
joa23
From: Farshad K. <tee...@ho...> - 2010-04-30 18:37:03
|
Hello, I figured it out. The problem was caused by starting another zkServer via: ZkServer zkServer = ZkKattaUtil.startZkServer(zkConfig); Farshad Kazemzadeh From: tee...@ho... To: kat...@li... Date: Thu, 29 Apr 2010 12:36:53 -0700 Subject: [Katta-developer] Deploynig index via addIndex Hello, I am trying to experiment with the addIndex functionality of katta (in net.sf.katta) and have add addIndex() method running from my own jar file. I get the following exceptions and seem to have been stuck in the while loop (see code below). Any ideas? Thank you in advance, Farshad Kazemzadeh ------------------------------------------------------------------------------------------------------------------------------------------------- WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x2 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x4 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x6 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x8 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0xa zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0xc zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0xe zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x10 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x12 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x14 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x16 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x18 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x1a zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x1c zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x1e zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x20 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x22 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x24 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x26 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x27 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) WARN pRequest, Got exception when processing sessionid:0x1284abba9cb0000 type:create cxid:0x28 zxid:0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:114) ..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................[root@n15 KattaDeployer]# [ **** Code ***** import net.sf.katta.client.DeployClient; import net.sf.katta.client.IDeployClient; import net.sf.katta.client.IIndexDeployFuture; import net.sf.katta.client.IndexState; import net.sf.katta.protocol.InteractionProtocol; import net.sf.katta.util.ZkConfiguration; import net.sf.katta.util.ZkKattaUtil; import org.I0Itec.zkclient.ZkServer; public class kattaDeployer { public kattaDeployer() { } /** * */ private void DeployIndex(String indexName, String indexToDeploy, String replication) { ZkConfiguration zkConfig = new ZkConfiguration(); //Using current katta install's katta.zk.properties which defines the zk nodes. ZkServer zkServer = ZkKattaUtil.startZkServer(zkConfig); int indexReplication = Integer.parseInt(replication); InteractionProtocol protocol = new InteractionProtocol(zkServer.getZkClient(), zkConfig); IDeployClient deployClient = new DeployClient(protocol); if (indexName.trim().equals("*")) { throw new IllegalArgumentException("Index with name " + indexName + " isn't allowed."); } if (deployClient.existsIndex(indexName)) { throw new IllegalArgumentException("Index with name " + indexName + " already exists."); } try { long startTime = System.currentTimeMillis(); IIndexDeployFuture deployFuture = deployClient.addIndex(indexName, indexToDeploy, indexReplication); while (true) { long duration = System.currentTimeMillis() - startTime; if (deployFuture.getState() == IndexState.DEPLOYED) { System.out.println("\nDeployed index '" + indexName + "' in " + duration + " ms"); break; } else if (deployFuture.getState() == IndexState.ERROR) { System.out.println("\nFailed to deploy index '" + indexName + "' in " + duration + " ms"); break; } System.out.print("."); deployFuture.joinDeployment(1000); } } catch (final InterruptedException e) { System.out.println("interrupted wait on index deployment"); } } /** * * @param args */ public static void main(String[] args) { if (args.length < 3) { System.out.println("Please enter valid arguments.."); System.exit(0); } String indexname = args[0]; String indexToDeploy = args[1]; String replication = args[2]; kattaDeployer id = new kattaDeployer(); id.DeployIndex(indexname, indexToDeploy, replication); } } Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Sign up now. _________________________________________________________________ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2 |