Package io.hypersistence.optimizer.core.event.persistence
package io.hypersistence.optimizer.core.event.persistence
-
ClassDescriptionResolves DDL fragments using the host's registered Hibernate 6/7 SQL types.Creates missing event tables without bootstrapping another SessionFactory.The
EventCategoryclassifies anEventbased on the phase during which it is emitted, so that configuration and mapping events (detected once, at bootstrap) can be told apart from runtime events (emitted continuously while the application runs).The dialect-specific fragments needed by the fixed event schema.Bootstraps event persistence using the factory and dialect already resolved by the scanner.TheEventPersistenceContextwires together the collaborators of the event persistence feature (EventStore,RuntimeEventAggregatorandPersistentEventHandler) and manages their lifecycle.TheEventPersistenceSettingsis an immutable holder for the resolved event persistence configuration, computed once when the feature is activated.Applies the configured event schema action, propagating hard failures to the coordinator.Coordinates the lightweight strategy and the optional metadata fallback.Immutable JDBC model, deliberately independent of JPA and Hibernate metadata.TheEventSignaturecomputes a stable key used to group runtime events for aggregation.TheEventStorepersists events into the database using plain JDBC and batchedINSERTstatements.TheHostConnectionProviderdelegates all JDBC connection handling to the host application'sConnectionProvider, so that the short-livedSessionFactoryused to generate the event tables borrows connections from the very same pool as the application.AWebAppConnectionProviderthat borrows and releases its JDBC connections through the host application's HibernateConnectionProvider.TheHypersistenceOptimizerBootstrapEventis the canonical entity model for theho_bootstrap_eventstable, which holds the configuration and mapping events detected during a single optimizer bootstrap.TheHypersistenceOptimizerBootstrapRunis the canonical entity model for theho_bootstrap_runtable, which holds one row per optimizer bootstrap (a snapshot of the application at startup).TheHypersistenceOptimizerRuntimeEventis the canonical entity model for theho_runtime_eventstable, which holds the aggregated runtime events (one row per run, event signature and time window, carrying an occurrence count and, where available, the total and maximum durations).TheMetadataEventSchemaCreatorcreates, on demand, the database tables used by the event persistence feature.TheMissingTableSchemaFilterProviderlimits thehbm2ddlschema management of the metadata fallback to the event tables that are missing.ThePersistentEventHandleris theEventHandlerregistered on theConfigwhen the event persistence feature is enabled.TheRuntimeEventAggregatorrolls up runtime events into time windows so that a slow operation triggered many times is summarized as a handful of rows (one per window) carrying an occurrence count and, when available, the total and maximum durations, rather than one row per occurrence.TheRuntimeRollupis a mutable accumulator that aggregates all the runtime events sharing the same signature within the same time window.TheSchemaActioncontrols how the event persistence feature manages the database tables it uses.TheSessionFactoryConnectionExecutorruns the event persistence JDBC work against aConnectionborrowed from the host application's HibernateSessionFactory.TheWebAppoptionally starts the Hypersistence Optimizer WebApp inside the host application, so the events can be visualized without deploying a separate process.