@Test public void testZnodeMigration() throws Exception { String rootRSZnode = ZKUtil.joinZNode(zkw.baseZNode, "root-region-server"); assertTrue(ZKUtil.checkExists(zkw, rootRSZnode) > -1); ToolRunner.run(TEST_UTIL.getConfiguration(), new UpgradeTo96(), new String[] { "-execute" }); assertEquals(-1, ZKUtil.checkExists(zkw, rootRSZnode)); byte[] data = ZKUtil.getData(zkw, tableAZnode); assertTrue(ProtobufUtil.isPBMagicPrefix(data)); checkTableState(data, ZooKeeperProtos.Table.State.ENABLED); data = ZKUtil.getData(zkw, peer1Znode); assertTrue(ProtobufUtil.isPBMagicPrefix(data)); checkReplicationPeerData(data, peer1); }
@Override public int run(String[] args) throws Exception { if (!parseOption(args)) { printUsage(); return -1; } if (checkForHFileV1) { int res = doHFileV1Check(); if (res == 0) LOG.info("No HFileV1 found."); else { LOG.warn("There are some HFileV1, or corrupt files (files with incorrect major version)."); } return res; } else if (upgrade) { if (isAnyHBaseProcessAlive()) { LOG.error("Some HBase processes are still alive, or znodes not expired yet. " + "Please stop them before upgrade or try after some time."); throw new IOException("Some HBase processes are still alive, or znodes not expired yet"); } return executeUpgrade(); } return -1; }
UpgradeTo96 extends Configured implements Tool { @Override public int run(String[] args) throws Exception { if (!parseOption(args)) { printUsage(); return -1; } if (checkForHFileV1) { int res = doHFileV1Check(); if (res == 0) LOG.info("No HFileV1 found."); else { LOG.warn("There are some HFileV1, or corrupt files (files with incorrect major version)."); } return res; } else if (upgrade) { if (isAnyHBaseProcessAlive()) { LOG.error("Some HBase processes are still alive, or znodes not expired yet. " + "Please stop them before upgrade or try after some time."); throw new IOException("Some HBase processes are still alive, or znodes not expired yet"); } return executeUpgrade(); } return -1; } }
UpgradeTo96 extends Configured implements Tool { @Override public int run(String[] args) throws Exception { if (!parseOption(args)) { printUsage(); return -1; } if (checkForHFileV1) { int res = doHFileV1Check(); if (res == 0) LOG.info("No HFileV1 found."); else { LOG.warn("There are some HFileV1, or corrupt files (files with incorrect major version)."); } return res; } else if (upgrade) { if (isAnyHBaseProcessAlive()) { LOG.error("Some HBase processes are still alive, or znodes not expired yet. " + "Please stop them before upgrade or try after some time."); throw new IOException("Some HBase processes are still alive, or znodes not expired yet"); } return executeUpgrade(); } return -1; } UpgradeTo96(); }
UpgradeTo96 extends Configured implements Tool { @Override public int run(String[] args) throws Exception { if (!parseOption(args)) { printUsage(); return -1; } if (checkForHFileV1) { int res = doHFileV1Check(); if (res == 0) LOG.info("No HFileV1 found."); else { LOG.warn("There are some HFileV1, or corrupt files (files with incorrect major version)."); } return res; } else if (upgrade) { if (isAnyHBaseProcessAlive()) { LOG.error("Some HBase processes are still alive, or znodes not expired yet. " + "Please stop them before upgrade or try after some time."); throw new IOException("Some HBase processes are still alive, or znodes not expired yet"); } return executeUpgrade(); } return -1; } UpgradeTo96(); @Override int run(String[] args); static void main(String[] args); }
UpgradeTo96 extends Configured implements Tool { @Override public int run(String[] args) throws Exception { if (!parseOption(args)) { printUsage(); return -1; } if (checkForHFileV1) { int res = doHFileV1Check(); if (res == 0) LOG.info("No HFileV1 found."); else { LOG.warn("There are some HFileV1, or corrupt files (files with incorrect major version)."); } return res; } else if (upgrade) { if (isAnyHBaseProcessAlive()) { LOG.error("Some HBase processes are still alive, or znodes not expired yet. " + "Please stop them before upgrade or try after some time."); throw new IOException("Some HBase processes are still alive, or znodes not expired yet"); } return executeUpgrade(); } return -1; } UpgradeTo96(); @Override int run(String[] args); static void main(String[] args);  }