CatalogHolder
The one mutable thing in the type system: which TypeCatalog is the current one for a database.
A catalog is a value and is replaced whole rather than edited, so something has to hold which value is current, and that something cannot be the catalog. This is it, and it is deliberately the whole of it - it does not know that a converter or a codec exists, only how to put one catalog in the place of another, and, where the database is listed as several servers, which cluster those catalogs are read from.
lock guards more than the swap, which is why it is a lock rather than a compare-and-set: GlobalCatalogStore.ensureLoaded holds it across the round trip that reads the catalog out of the database, so twenty connections opening at once read it once between them. A lock that spans that has to live on something outlasting any single catalog, which is the second reason this class exists.
Properties
Everything the driver knows about this database, as one value. Read without a lock, from anywhere.
Held across a catalog load as well as across a swap - see the note on the class.
The system identifier of the cluster this catalog belongs to, fixed by the first server admitted. null until then - and for good where the database is a single server, which is never asked.
Functions
Admits server, which reported identifier, if that is the cluster this catalog belongs to - which the first server admitted decides.
Whether server has been admitted already, and need not be asked again.
Puts the catalog transform derives in the place of the current one.