public static CFMetaData validateColumnFamily(String keyspaceName, String cfName) throws org.apache.cassandra.exceptions.InvalidRequestException { validateKeyspace(keyspaceName); if (cfName.isEmpty()) throw new org.apache.cassandra.exceptions.InvalidRequestException("non-empty columnfamily is required"); CFMetaData metadata = Schema.instance.getCFMetaData(keyspaceName, cfName); if (metadata == null) throw new org.apache.cassandra.exceptions.InvalidRequestException("unconfigured columnfamily " + cfName); return metadata; }
/** update an existing keyspace, but do not allow column family modifications. * @throws SchemaDisagreementException */ public String system_update_keyspace(KsDef ks_def) throws InvalidRequestException, SchemaDisagreementException, TException { logger.debug("update_keyspace"); try { ThriftValidation.validateKeyspaceNotSystem(ks_def.name); state().hasKeyspaceAccess(ks_def.name, Permission.ALTER); ThriftValidation.validateKeyspace(ks_def.name); if (ks_def.getCf_defs() != null && ks_def.getCf_defs().size() > 0) throw new InvalidRequestException("Keyspace update must not contain any column family definitions."); MigrationManager.announceKeyspaceUpdate(KSMetaData.fromThrift(ks_def)); return Schema.instance.getVersion().toString(); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } }
ThriftValidation.validateKeyspace(keyspace);
/** update an existing keyspace, but do not allow column family modifications. * @throws SchemaDisagreementException */ public String system_update_keyspace(KsDef ks_def) throws InvalidRequestException, SchemaDisagreementException, TException { logger.trace("update_keyspace"); try { ThriftValidation.validateKeyspaceNotSystem(ks_def.name); state().hasKeyspaceAccess(ks_def.name, Permission.ALTER); ThriftValidation.validateKeyspace(ks_def.name); if (ks_def.getCf_defs() != null && ks_def.getCf_defs().size() > 0) throw new InvalidRequestException("Keyspace update must not contain any table definitions."); MigrationManager.announceKeyspaceUpdate(ThriftConversion.fromThrift(ks_def)); return Schema.instance.getVersion().toString(); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } }
public static CFMetaData validateColumnFamilyWithCompactMode(String keyspaceName, String cfName, boolean noCompactMode) throws org.apache.cassandra.exceptions.InvalidRequestException { validateKeyspace(keyspaceName); if (cfName.isEmpty()) throw new org.apache.cassandra.exceptions.InvalidRequestException("non-empty table is required"); CFMetaData metadata = Schema.instance.getCFMetaData(keyspaceName, cfName); if (metadata == null) throw new org.apache.cassandra.exceptions.InvalidRequestException("unconfigured table " + cfName); if (metadata.isCompactTable() && noCompactMode) return metadata.asNonCompact(); else return metadata; }
/** update an existing keyspace, but do not allow column family modifications. * @throws SchemaDisagreementException */ public String system_update_keyspace(KsDef ks_def) throws InvalidRequestException, SchemaDisagreementException, TException { logger.trace("update_keyspace"); try { ThriftValidation.validateKeyspaceNotSystem(ks_def.name); state().hasKeyspaceAccess(ks_def.name, Permission.ALTER); ThriftValidation.validateKeyspace(ks_def.name); if (ks_def.getCf_defs() != null && ks_def.getCf_defs().size() > 0) throw new InvalidRequestException("Keyspace update must not contain any table definitions."); MigrationManager.announceKeyspaceUpdate(ThriftConversion.fromThrift(ks_def)); return Schema.instance.getVersion().toString(); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } }
public static CFMetaData validateColumnFamilyWithCompactMode(String keyspaceName, String cfName, boolean noCompactMode) throws org.apache.cassandra.exceptions.InvalidRequestException { validateKeyspace(keyspaceName); if (cfName.isEmpty()) throw new org.apache.cassandra.exceptions.InvalidRequestException("non-empty table is required"); CFMetaData metadata = Schema.instance.getCFMetaData(keyspaceName, cfName); if (metadata == null) throw new org.apache.cassandra.exceptions.InvalidRequestException("unconfigured table " + cfName); if (metadata.isCompactTable() && noCompactMode) return metadata.asNonCompact(); else return metadata; }