/** * Get the writer layout capsule ensuring that the layout has not been updated while a transaction * is in progress. * * @return the WriterLayoutCapsule for this writer. * @throws LayoutUpdatedException in case the table layout has been updated while a transaction is * in progress */ private WriterLayoutCapsule getWriterLayoutCapsule() throws LayoutUpdatedException { synchronized (mLock) { if (mLayoutOutOfDate) { // If the layout was updated, roll back the transaction and throw an Exception to indicate // the need to retry. rollback(); // TODO: SCHEMA-468 improve error message for LayoutUpdatedException. throw new LayoutUpdatedException( "Table layout was updated during a transaction, please retry."); } else { return mWriterLayoutCapsule; } } }