mSchemaHashTable = CassandraTableName.getSchemaHashTableName(instanceURI);
mSchemaIdTable = CassandraTableName.getSchemaIdTableName(instanceURI);
mCounterTable = CassandraTableName.getSchemaCounterTableName(instanceURI);
if (!mAdmin.tableExists(mSchemaHashTable)) {
throw new KijiNotInstalledException("Schema hash table not installed.", instanceURI);
}
if (!mAdmin.tableExists(mSchemaIdTable)) {
throw new KijiNotInstalledException("Schema ID table not installed.", instanceURI);
}
if (!mAdmin.tableExists(mCounterTable)) {
throw new KijiNotInstalledException("Schema counter table not installed.", instanceURI);
}
mZKClient = ZooKeeperUtils.getZooKeeperClient(instanceURI.getZooKeeperEnsemble());
mZKLock = new ZooKeeperLock(mZKClient, ZooKeeperUtils.getSchemaTableLock(mInstanceURI));
final State oldState = mState.getAndSet(State.OPEN);