/** * Returns the table name. * @return the table name. */ public String getName() { return mDesc.getName(); }
/** {@inheritDoc} */ @Deprecated @Override public FijiTableLayout modifyTableLayout(String tableName, TableLayoutDesc update) throws IOException { if (!tableName.equals(update.getName())) { throw new InvalidLayoutException(String.format( "Name of table in descriptor '%s' does not match table name '%s'.", update.getName(), tableName)); } return modifyTableLayout(update); }
/** {@inheritDoc} */ @Deprecated @Override public FijiTableLayout modifyTableLayout(String tableName, TableLayoutDesc update) throws IOException { if (!tableName.equals(update.getName())) { throw new InvalidLayoutException(String.format( "Name of table in descriptor '%s' does not match table name '%s'.", update.getName(), tableName)); } return modifyTableLayout(update); }
/** {@inheritDoc} */ @Deprecated @Override public FijiTableLayout modifyTableLayout( String tableName, TableLayoutDesc update, boolean dryRun, PrintStream printStream) throws IOException { if (!tableName.equals(update.getName())) { throw new InvalidLayoutException(String.format( "Name of table in descriptor '%s' does not match table name '%s'.", update.getName(), tableName)); } return modifyTableLayout(update, dryRun, printStream); }
/** {@inheritDoc} */ @Deprecated @Override public FijiTableLayout modifyTableLayout( String tableName, TableLayoutDesc update, boolean dryRun, PrintStream printStream) throws IOException { if (!tableName.equals(update.getName())) { throw new InvalidLayoutException(String.format( "Name of table in descriptor '%s' does not match table name '%s'.", update.getName(), tableName)); } return modifyTableLayout(update, dryRun, printStream); }
/** * Implements the --do=set operation. * * @param fiji Fiji instance. * @throws Exception on error. */ private void setLayout(Fiji fiji) throws Exception { final TableLayoutDesc layoutDesc = loadJsonTableLayoutDesc(mLayout); Preconditions.checkArgument(mTableURI.getTable().equals(layoutDesc.getName()), "Descriptor table name '%s' does not match URI %s.", layoutDesc.getName(), mTableURI); fiji.modifyTableLayout(layoutDesc, mDryRun, getPrintStream()); }
/** * 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); }
throw new IllegalArgumentException(String.format( "Fiji Cassandra does not support counter map type families. Family: %s, table: %s.", layout.getName(), family.getName())); "Fiji Cassandra does not support counter columns." + " Table: %s, family: %s, column: %s.", layout.getName(), family.getName(), column.getName()));
final FSDataInputStream inputStream = fs.open(path); final TableLayoutDesc tableLayout = FijiTableLayout.readTableLayoutDescFromJSON(inputStream); final String tableName = tableLayout.getName(); Preconditions.checkArgument( (mTableURI.getTable() == null) || tableName.equals(mTableURI.getTable()),
final String tableName = update.getName();
final FijiURI tableURI = FijiURI.newBuilder(mURI).withTableName(tableLayout.getName()).build(); CassandraTableLayoutUpdater.validateCassandraTableLayout(tableLayout); if (getMetaTable().tableExists(tableLayout.getName())) { throw new FijiAlreadyExistsException( String.format("Fiji table '%s' already exists.", tableURI), tableURI); getMetaTable().updateTableLayout(tableLayout.getName(), tableLayout);
/** {@inheritDoc} */ @Override public void createTable(TableLayoutDesc tableLayout, byte[][] splitKeys) throws IOException { final State state = mState.get(); Preconditions.checkState(state == State.OPEN, "Cannot create table in Fiji instance %s in state %s.", this, state); final FijiURI tableURI = FijiURI.newBuilder(mURI).withTableName(tableLayout.getName()).build(); LOG.debug("Creating Fiji table '{}'.", tableURI); ensureValidationCompatibility(tableLayout); // If security is enabled, apply the permissions to the new table. if (isSecurityEnabled()) { getSecurityManager().lock(); try { createTableUnchecked(tableLayout, splitKeys); getSecurityManager().applyPermissionsToNewTable(tableURI); } finally { getSecurityManager().unlock(); } } else { createTableUnchecked(tableLayout, splitKeys); } }
/** {@inheritDoc} */ @Override public void createTable(final TableLayoutDesc tableLayout) throws IOException { final State state = mState.get(); Preconditions.checkState(state == State.OPEN, "Cannot create table in Fiji instance %s in state %s.", this, state); final FijiURI tableURI = FijiURI.newBuilder(mURI).withTableName(tableLayout.getName()).build(); LOG.debug("Creating Fiji table '{}'.", tableURI); ensureValidationCompatibility(tableLayout); // If security is enabled, apply the permissions to the new table. if (isSecurityEnabled()) { getSecurityManager().lock(); try { createTableUnchecked(tableLayout); getSecurityManager().applyPermissionsToNewTable(tableURI); } finally { getSecurityManager().unlock(); } } else { createTableUnchecked(tableLayout); } }
TableLayoutDesc tableLayout, byte[][] splitKeys) throws IOException { final FijiURI tableURI = FijiURI.newBuilder(mURI).withTableName(tableLayout.getName()).build(); if (getMetaTable().tableExists(tableLayout.getName())) { throw new FijiAlreadyExistsException( String.format("Fiji table '%s' already exists.", tableURI), tableURI); getMetaTable().updateTableLayout(tableLayout.getName(), tableLayout);
final String tableName = update.getName();