public void validate(ClientState state) throws RequestValidationException { ThriftValidation.validateKeyspaceNotSystem(keyspace); }
public void validate(ClientState state) throws RequestValidationException { ThriftValidation.validateKeyspaceNotSystem(keyspace); }
public void validate(ClientState state) throws RequestValidationException { ThriftValidation.validateKeyspaceNotSystem(keyspace); }
public String system_drop_keyspace(String keyspace) throws InvalidRequestException, SchemaDisagreementException, TException { logger.trace("drop_keyspace"); try { ThriftValidation.validateKeyspaceNotSystem(keyspace); state().hasKeyspaceAccess(keyspace, Permission.DROP); MigrationManager.announceKeyspaceDrop(keyspace); return Schema.instance.getVersion().toString(); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } }
public String system_drop_keyspace(String keyspace) throws InvalidRequestException, SchemaDisagreementException, TException { logger.debug("drop_keyspace"); try { ThriftValidation.validateKeyspaceNotSystem(keyspace); state().hasKeyspaceAccess(keyspace, Permission.DROP); MigrationManager.announceKeyspaceDrop(keyspace); return Schema.instance.getVersion().toString(); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } }
public String system_drop_keyspace(String keyspace) throws InvalidRequestException, SchemaDisagreementException, TException { logger.trace("drop_keyspace"); try { ThriftValidation.validateKeyspaceNotSystem(keyspace); state().hasKeyspaceAccess(keyspace, Permission.DROP); MigrationManager.announceKeyspaceDrop(keyspace); return Schema.instance.getVersion().toString(); } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } }
/** * The <code>CqlParser</code> only goes as far as extracting the keyword arguments * from these statements, so this method is responsible for processing and * validating. * * @throws InvalidRequestException if arguments are missing or unacceptable */ public void validate(ClientState state) throws RequestValidationException { ThriftValidation.validateKeyspaceNotSystem(name); // keyspace name if (!PATTERN_WORD_CHARS.matcher(name).matches()) throw new InvalidRequestException(String.format("\"%s\" is not a valid keyspace name", name)); if (name.length() > SchemaConstants.NAME_LENGTH) throw new InvalidRequestException(String.format("Keyspace names shouldn't be more than %s characters long (got \"%s\")", SchemaConstants.NAME_LENGTH, name)); attrs.validate(); if (attrs.getReplicationStrategyClass() == null) throw new ConfigurationException("Missing mandatory replication strategy class"); // The strategy is validated through KSMetaData.validate() in announceNewKeyspace below. // However, for backward compatibility with thrift, this doesn't validate unexpected options yet, // so doing proper validation here. KeyspaceParams params = attrs.asNewKeyspaceParams(); params.validate(name); if (params.replication.klass.equals(LocalStrategy.class)) throw new ConfigurationException("Unable to use given strategy class: LocalStrategy is reserved for internal use."); }
/** * The <code>CqlParser</code> only goes as far as extracting the keyword arguments * from these statements, so this method is responsible for processing and * validating. * * @throws InvalidRequestException if arguments are missing or unacceptable */ public void validate(ClientState state) throws RequestValidationException { ThriftValidation.validateKeyspaceNotSystem(name); // keyspace name if (!PATTERN_WORD_CHARS.matcher(name).matches()) throw new InvalidRequestException(String.format("\"%s\" is not a valid keyspace name", name)); if (name.length() > SchemaConstants.NAME_LENGTH) throw new InvalidRequestException(String.format("Keyspace names shouldn't be more than %s characters long (got \"%s\")", SchemaConstants.NAME_LENGTH, name)); attrs.validate(); if (attrs.getReplicationStrategyClass() == null) throw new ConfigurationException("Missing mandatory replication strategy class"); // The strategy is validated through KSMetaData.validate() in announceNewKeyspace below. // However, for backward compatibility with thrift, this doesn't validate unexpected options yet, // so doing proper validation here. KeyspaceParams params = attrs.asNewKeyspaceParams(); params.validate(name); if (params.replication.klass.equals(LocalStrategy.class)) throw new ConfigurationException("Unable to use given strategy class: LocalStrategy is reserved for internal use."); }
public void prepareKeyspace(ClientState state) throws InvalidRequestException { if (!functionName.hasKeyspace() && state.getRawKeyspace() != null) functionName = new FunctionName(state.getKeyspace(), functionName.name); if (!functionName.hasKeyspace()) throw new InvalidRequestException("Functions must be fully qualified with a keyspace name if a keyspace is not set for the session"); ThriftValidation.validateKeyspaceNotSystem(functionName.keyspace); }
@Override public void prepareKeyspace(ClientState state) throws InvalidRequestException { if (!functionName.hasKeyspace() && state.getRawKeyspace() != null) functionName = new FunctionName(state.getKeyspace(), functionName.name); if (!functionName.hasKeyspace()) throw new InvalidRequestException("Functions must be fully qualified with a keyspace name if a keyspace is not set for the session"); ThriftValidation.validateKeyspaceNotSystem(functionName.keyspace); }
public void prepareKeyspace(ClientState state) throws InvalidRequestException { if (!functionName.hasKeyspace() && state.getRawKeyspace() != null) functionName = new FunctionName(state.getRawKeyspace(), functionName.name); if (!functionName.hasKeyspace()) throw new InvalidRequestException("Functions must be fully qualified with a keyspace name if a keyspace is not set for the session"); ThriftValidation.validateKeyspaceNotSystem(functionName.keyspace); }
public void prepareKeyspace(ClientState state) throws InvalidRequestException { if (!functionName.hasKeyspace() && state.getRawKeyspace() != null) functionName = new FunctionName(state.getKeyspace(), functionName.name); if (!functionName.hasKeyspace()) throw new InvalidRequestException("Functions must be fully qualified with a keyspace name if a keyspace is not set for the session"); ThriftValidation.validateKeyspaceNotSystem(functionName.keyspace); }
public void prepareKeyspace(ClientState state) throws InvalidRequestException { if (!functionName.hasKeyspace() && state.getRawKeyspace() != null) functionName = new FunctionName(state.getRawKeyspace(), functionName.name); if (!functionName.hasKeyspace()) throw new InvalidRequestException("Functions must be fully qualified with a keyspace name if a keyspace is not set for the session"); ThriftValidation.validateKeyspaceNotSystem(functionName.keyspace); }
@Override public void prepareKeyspace(ClientState state) throws InvalidRequestException { if (!functionName.hasKeyspace() && state.getRawKeyspace() != null) functionName = new FunctionName(state.getKeyspace(), functionName.name); if (!functionName.hasKeyspace()) throw new InvalidRequestException("Functions must be fully qualified with a keyspace name if a keyspace is not set for the session"); ThriftValidation.validateKeyspaceNotSystem(functionName.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); } }
/** 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); } }
/** 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); } }
/** * The <code>CqlParser</code> only goes as far as extracting the keyword arguments * from these statements, so this method is responsible for processing and * validating. * * @throws InvalidRequestException if arguments are missing or unacceptable */ public void validate(ClientState state) throws RequestValidationException { ThriftValidation.validateKeyspaceNotSystem(name); // keyspace name if (!name.matches("\\w+")) throw new InvalidRequestException(String.format("\"%s\" is not a valid keyspace name", name)); if (name.length() > Schema.NAME_LENGTH) throw new InvalidRequestException(String.format("Keyspace names shouldn't be more than %s characters long (got \"%s\")", Schema.NAME_LENGTH, name)); attrs.validate(); if (attrs.getReplicationStrategyClass() == null) throw new ConfigurationException("Missing mandatory replication strategy class"); // The strategy is validated through KSMetaData.validate() in announceNewKeyspace below. // However, for backward compatibility with thrift, this doesn't validate unexpected options yet, // so doing proper validation here. AbstractReplicationStrategy.validateReplicationStrategy(name, AbstractReplicationStrategy.getClass(attrs.getReplicationStrategyClass()), StorageService.instance.getTokenMetadata(), DatabaseDescriptor.getEndpointSnitch(), attrs.getReplicationOptions()); }
public void prepareKeyspace(ClientState state) throws InvalidRequestException { if (!functionName.hasKeyspace() && state.getRawKeyspace() != null) functionName = new FunctionName(state.getKeyspace(), functionName.name); if (!functionName.hasKeyspace()) throw new InvalidRequestException("Functions must be fully qualified with a keyspace name if a keyspace is not set for the session"); ThriftValidation.validateKeyspaceNotSystem(functionName.keyspace); stateFunc = new FunctionName(functionName.keyspace, stateFunc.name); if (finalFunc != null) finalFunc = new FunctionName(functionName.keyspace, finalFunc.name); }
public void prepareKeyspace(ClientState state) throws InvalidRequestException { if (!functionName.hasKeyspace() && state.getRawKeyspace() != null) functionName = new FunctionName(state.getKeyspace(), functionName.name); if (!functionName.hasKeyspace()) throw new InvalidRequestException("Functions must be fully qualified with a keyspace name if a keyspace is not set for the session"); ThriftValidation.validateKeyspaceNotSystem(functionName.keyspace); stateFunc = new FunctionName(functionName.keyspace, stateFunc.name); if (finalFunc != null) finalFunc = new FunctionName(functionName.keyspace, finalFunc.name); }