ZooKeeperInfo.Command cmd = ZooKeeperInfo.Command.newBuilder().setType(ZooKeeperInfo.Command.Type.MIGRATE_EXCHANGE).addArgument(nodePath).build();
ZNode.createSequentialNode("/local/mist_client/" + host + "/cmd", false, cmd.toString().getBytes());
}
if(hasOld) {
BrokerSpy brokerSpy = new BrokerSpy(oldhost);
for(;;) {
String producer = brokerSpy.getExchangeAttribs(miExchange.isQueue(), miExchange.getName(), "NumProducers");
String consumer = brokerSpy.getExchangeAttribs(miExchange.isQueue(), miExchange.getName(), "NumConsumers");
if(producer.compareTo("0") == 0 && consumer.compareTo("1") == 0)
break;
else {
myConsole.logResponse("[%s] waiting for %s producer(s) and %d consumer(s) to migrate%n", miExchange.toString(), producer, (Integer.valueOf(consumer) - 1));
Utils.justSleep(1000);
}
}
for(;;) {
String pending = brokerSpy.getExchangeAttribs(miExchange.isQueue(), miExchange.getName(), "NumMsgs");
if(pending.compareTo("0") == 0)
break;
try {
pendingCnt = Integer.valueOf(pending);
}