public Event.SchemaChange announceMigration(QueryState queryState, boolean isLocalOnly) throws RequestValidationException { Function old = findFunction(); if (old == null) { if (ifExists) return null; else throw new InvalidRequestException(getMissingFunctionError()); } KeyspaceMetadata ksm = Schema.instance.getKSMetaData(old.name().keyspace); Collection<UDAggregate> referrers = ksm.functions.aggregatesUsingFunction(old); if (!referrers.isEmpty()) throw new InvalidRequestException(String.format("Function '%s' still referenced by %s", old, referrers)); MigrationManager.announceFunctionDrop((UDFunction) old, isLocalOnly); return new Event.SchemaChange(Event.SchemaChange.Change.DROPPED, Event.SchemaChange.Target.FUNCTION, old.name().keyspace, old.name().name, AbstractType.asCQLTypeStringList(old.argTypes())); }
public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException { Function function = findFunction(); if (function == null) { if (!ifExists) throw new InvalidRequestException(String.format("Unconfigured function %s.%s(%s)", functionName.keyspace, functionName.name, Joiner.on(",").join(argRawTypes))); } else { state.ensureHasPermission(Permission.DROP, FunctionResource.function(function.name().keyspace, function.name().name, function.argTypes())); } }
expr = new DropFunctionStatement(fn, argsTypes, argsPresent, ifExists);
public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException { Function function = findFunction(); if (function == null) { if (!ifExists) throw new InvalidRequestException(String.format("Unconfigured function %s.%s(%s)", functionName.keyspace, functionName.name, Joiner.on(",").join(argRawTypes))); } else { state.ensureHasPermission(Permission.DROP, FunctionResource.function(function.name().keyspace, function.name().name, function.argTypes())); } }
expr = new DropFunctionStatement(fn, argsTypes, argsPresent, ifExists);
public Event.SchemaChange announceMigration(QueryState queryState, boolean isLocalOnly) throws RequestValidationException { Function old = findFunction(); if (old == null) { if (ifExists) return null; else throw new InvalidRequestException(getMissingFunctionError()); } KeyspaceMetadata ksm = Schema.instance.getKSMetaData(old.name().keyspace); Collection<UDAggregate> referrers = ksm.functions.aggregatesUsingFunction(old); if (!referrers.isEmpty()) throw new InvalidRequestException(String.format("Function '%s' still referenced by %s", old, referrers)); MigrationManager.announceFunctionDrop((UDFunction) old, isLocalOnly); return new Event.SchemaChange(Event.SchemaChange.Change.DROPPED, Event.SchemaChange.Target.FUNCTION, old.name().keyspace, old.name().name, AbstractType.asCQLTypeStringList(old.argTypes())); }
public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException { Function function = findFunction(); if (function == null) { if (!ifExists) throw new InvalidRequestException(String.format("Unconfigured function %s.%s(%s)", functionName.keyspace, functionName.name, Joiner.on(",").join(argRawTypes))); } else { state.ensureHasPermission(Permission.DROP, FunctionResource.function(function.name().keyspace, function.name().name, function.argTypes())); } }
expr = new DropFunctionStatement(fn, argsTypes, argsPresent, ifExists);
public Event.SchemaChange announceMigration(QueryState queryState, boolean isLocalOnly) throws RequestValidationException { Function old = findFunction(); if (old == null) { if (ifExists) return null; else throw new InvalidRequestException(getMissingFunctionError()); } KeyspaceMetadata ksm = Schema.instance.getKSMetaData(old.name().keyspace); Collection<UDAggregate> referrers = ksm.functions.aggregatesUsingFunction(old); if (!referrers.isEmpty()) throw new InvalidRequestException(String.format("Function '%s' still referenced by %s", old, referrers)); MigrationManager.announceFunctionDrop((UDFunction) old, isLocalOnly); return new Event.SchemaChange(Event.SchemaChange.Change.DROPPED, Event.SchemaChange.Target.FUNCTION, old.name().keyspace, old.name().name, AbstractType.asCQLTypeStringList(old.argTypes())); }