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 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 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())); }