/** * Open a connection to the HBase schema table for a Fiji instance. * * @param fijiURI the FijiURI * @param conf The Hadoop configuration. * @param tableFactory HTableInterface factory. * @throws IOException on I/O error. */ public HBaseSchemaTable( FijiURI fijiURI, Configuration conf, HTableInterfaceFactory tableFactory ) throws IOException { mURI = fijiURI; mSchemaHashTable = newSchemaHashTable(mURI, conf, tableFactory); mSchemaIdTable = newSchemaIdTable(mURI, conf, tableFactory); mZKClient = ZooKeeperUtils.getZooKeeperClient(mURI); mZKLock = new ZooKeeperLock(mZKClient, ZooKeeperUtils.getSchemaTableLock(mURI)); final State oldState = mState.getAndSet(State.OPEN); Preconditions.checkState(oldState == State.UNINITIALIZED, "Cannot open SchemaTable instance in state %s.", oldState); ResourceTracker.get().registerResource(this); }