use std::sync::Arc;
use crate::control::catalog_entry::entry::CatalogEntry;
use crate::control::state::SharedState;
pub(crate) fn invalidate_gateway_cache_for_entry(entry: &CatalogEntry, shared: &Arc<SharedState>) {
let Some(ref inv) = shared.gateway_invalidator else {
return;
};
match entry {
CatalogEntry::PutCollection(stored) => {
inv.invalidate(&stored.name, stored.descriptor_version.max(1));
}
CatalogEntry::DeactivateCollection { name, .. } => {
inv.invalidate(name, 0);
}
CatalogEntry::PurgeCollection { name, .. } => {
inv.invalidate(name, 0);
}
CatalogEntry::PutSequence(_) => {
}
CatalogEntry::DeleteSequence { .. } => {
}
CatalogEntry::PutSequenceState(_) => {
}
CatalogEntry::PutTrigger(_) => {
}
CatalogEntry::DeleteTrigger { .. } => {
}
CatalogEntry::PutFunction(_) => {
}
CatalogEntry::DeleteFunction { .. } => {
}
CatalogEntry::PutProcedure(_) => {
}
CatalogEntry::DeleteProcedure { .. } => {
}
CatalogEntry::PutSchedule(_) => {
}
CatalogEntry::DeleteSchedule { .. } => {
}
CatalogEntry::PutChangeStream(_) => {
}
CatalogEntry::DeleteChangeStream { .. } => {
}
CatalogEntry::PutUser(_) => {
}
CatalogEntry::DeactivateUser { .. } => {
}
CatalogEntry::PutRole(_) => {
}
CatalogEntry::DeleteRole { .. } => {
}
CatalogEntry::PutApiKey(_) => {
}
CatalogEntry::RevokeApiKey { .. } => {
}
CatalogEntry::PutMaterializedView(_) => {
}
CatalogEntry::DeleteMaterializedView { .. } => {
}
CatalogEntry::PutContinuousAggregate(_) => {
}
CatalogEntry::DeleteContinuousAggregate { .. } => {
}
CatalogEntry::PutTenant(_) => {
}
CatalogEntry::DeleteTenant { .. } => {
}
CatalogEntry::PutRlsPolicy(_) => {
}
CatalogEntry::DeleteRlsPolicy { .. } => {
}
CatalogEntry::PutPermission(_) => {
}
CatalogEntry::DeletePermission { .. } => {
}
CatalogEntry::PutOwner(_) => {
}
CatalogEntry::DeleteOwner { .. } => {
}
CatalogEntry::PutSynonymGroup(_) => {
}
CatalogEntry::DeleteSynonymGroup { .. } => {
}
CatalogEntry::PutCustomType(_) => {
}
CatalogEntry::DeleteCustomType { .. } => {
}
CatalogEntry::PutDatabase(_) => {
}
CatalogEntry::DeleteDatabase { .. } => {
}
CatalogEntry::PutDatabaseGrant { .. } => {
}
CatalogEntry::DeleteDatabaseGrant { .. } => {
}
CatalogEntry::PutOidcProvider(_) => {
}
CatalogEntry::DeleteOidcProvider { .. } => {
}
CatalogEntry::CloneDatabase { .. } => {
}
CatalogEntry::MoveTenantCutover { collections, .. } => {
for coll in collections.iter() {
inv.invalidate(&coll.name, coll.descriptor_version.max(1));
}
}
}
}