@Override /** {@inheritDoc} */ public LayoutConsumer.Registration registerLayoutConsumer(LayoutConsumer consumer) throws IOException { Preconditions.checkState(mState.get() == State.STARTED, "TableLayoutMonitor has not been started."); mConsumers.add(consumer); consumer.update(getLayout()); return new LayoutConsumerRegistration(mConsumers, consumer); }
@Override /** {@inheritDoc} */ public void updateLayoutConsumers(FijiTableLayout layout) throws IOException { Preconditions.checkState(mState.get() == State.STARTED, "TableLayoutMonitor has not been started."); layout.setSchemaTable(mSchemaTable); for (LayoutConsumer consumer : getLayoutConsumers()) { consumer.update(layout); } }
mInitializationLatch = null; } else { mUserRegistration = new TableUserRegistration(zkClient, tableURI, generateTableUserID()); mInitializationLatch = new CountDownLatch(1); mTableLayoutTracker = new TableLayoutTracker(
@Override /** {@inheritDoc} */ public TableLayoutMonitor apply(String tableName) { final FijiURI tableURI = FijiURI.newBuilder(mInstanceURI).withTableName(tableName).build(); try { return new DefaultTableLayoutMonitor(tableURI, mSchemaTable, mMetaTable, mZKClient).start(); } catch (IOException e) { throw new FijiIOException(e); } } }