if (uri.getInstance() == null) {
throw new KijiInvalidNameException(String.format(
"Kiji URI '%s' does not specify a Kiji instance name", uri));
}
final HBaseAdminFactory adminFactory = hbaseFactory.getHBaseAdminFactory(uri);
final HTableInterfaceFactory tableFactory = hbaseFactory.getHTableInterfaceFactory(uri);
// TODO: Factor this in HBaseKiji
conf.set(HConstants.ZOOKEEPER_QUORUM, Joiner.on(",").join(uri.getZookeeperQuorumOrdered()));
conf.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, uri.getZookeeperClientPort());
final HBaseAdmin hbaseAdmin = adminFactory.create(conf);
try {
if (hbaseAdmin.tableExists(
KijiManagedHBaseTableName.getSystemTableName(uri.getInstance()).toString())) {
throw new KijiAlreadyExistsException(String.format(
"Kiji instance '%s' already exists.", uri), uri);