/** * Creates a buffered fiji table writer that stores modifications to be sent on command * or when the buffer overflows. * * @param table A fiji table. * @throws FijiTableNotFoundException in case of an invalid table parameter * @throws IOException in case of IO errors. */ public HBaseFijiBufferedWriter(HBaseFijiTable table) throws IOException { mTable = table; try { mHTable = mTable.openHTableConnection(); } catch (TableNotFoundException e) { throw new FijiTableNotFoundException(table.getURI()); } mLayoutConsumerRegistration = mTable.registerLayoutConsumer(new InnerLayoutUpdater()); Preconditions.checkState(mWriterLayoutCapsule != null, "HBaseFijiBufferedWriter for table: %s failed to initialize.", mTable.getURI()); SchemaPlatformBridge.get().setAutoFlush(mHTable, false); // Retain the table only after everything else succeeded: mTable.retain(); synchronized (mInternalLock) { Preconditions.checkState(mState == State.UNINITIALIZED, "Cannot open HBaseFijiBufferedWriter instance in state %s.", mState); mState = State.OPEN; } ResourceTracker.get().registerResource(this); }