/** * Writes the new layout to ZooKeeper. * * <p> This pushes a layout update to all table users. </p> * * @param update Layout update to push to ZooKeeper. * * @throws java.io.IOException on I/O error. * @throws org.apache.zookeeper.KeeperException on ZooKeeper error. */ private void writeZooKeeper(TableLayoutDesc update) throws IOException, KeeperException { LOG.info("Updating layout for table {} from layout ID {} to layout ID {} in ZooKeeper.", mTableURI, update.getReferenceLayout(), update.getLayoutId()); ZooKeeperUtils.setTableLayout(mZKClient, mTableURI, update.getLayoutId()); }
/** * Writes the new layout to ZooKeeper. * * <p> This pushes a layout update to all table users. </p> * * @param update Layout update to push to ZooKeeper. * * @throws IOException on I/O error. * @throws KeeperException on ZooKeeper error. */ private void writeZooKeeper(TableLayoutDesc update) throws IOException, KeeperException { LOG.info("Updating layout for table {} from layout ID {} to layout ID {} in ZooKeeper.", mTableURI, update.getReferenceLayout(), update.getLayoutId()); ZooKeeperUtils.setTableLayout(mZKClient, mTableURI, update.getLayoutId()); }
/** * Writes the new table layout to the meta-table. * * @param update Layout update to write to the meta-table. * @throws IOException on I/O error. */ private void writeMetaTable(TableLayoutDesc update) throws IOException { LOG.info("Updating layout for table {} from layout ID {} to layout ID {} in meta-table.", mTableURI, update.getReferenceLayout(), update.getLayoutId()); final String table = update.getName(); mNewLayout = mFiji.getMetaTable().updateTableLayout(table, update); }
/** * Writes the new table layout to the meta-table. * * @param update Layout update to write to the meta-table. * @throws java.io.IOException on I/O error. */ private void writeMetaTable(TableLayoutDesc update) throws IOException { LOG.info("Updating layout for table {} from layout ID {} to layout ID {} in meta-table.", mTableURI, update.getReferenceLayout(), update.getLayoutId()); final String table = update.getName(); mNewLayout = mFiji.getMetaTable().updateTableLayout(table, update); }
final String refLayoutIdStr = update.getReferenceLayout();
final String refLayoutIdStr = update.getReferenceLayout();
if (!Objects.equal(currentLayout.getDesc().getLayoutId(), update.getReferenceLayout())) { throw new InvalidLayoutException(String.format( "Reference layout ID %s does not match current layout ID %s.", update.getReferenceLayout(), currentLayout.getDesc().getLayoutId()));
if (!Objects.equal(currentLayout.getDesc().getLayoutId(), update.getReferenceLayout())) { throw new InvalidLayoutException(String.format( "Reference layout ID %s does not match current layout ID %s.", update.getReferenceLayout(), currentLayout.getDesc().getLayoutId()));