Repository navigation
Group storage annotations per storage and per BanyanDB engine - #14274
Merged
Merged
Conversation
Member
Author
Storage annotations after this PR, by catalogEvery storage annotation, grouped as #14270 groups them: core (storage-neutral), then each storage. Status says whether it stays or where it moved from. Uses counts the declarations in production code on this branch. OAL-generated metrics also get Core (storage-neutral)
Elasticsearch:
|
| Annotation | Status | Uses | Read into |
|---|---|---|---|
@ElasticSearch.IndexOnly |
new, from @Column(indexOnly = true) |
5 | ElasticSearchExtension.isIndexOnly |
@ElasticSearch.MatchQuery(analyzer) |
stays | 4 | ElasticSearchExtension.analyzer |
@ElasticSearch.Keyword |
stays | 2 | ElasticSearchExtension.isKeyword |
@ElasticSearch.Routing |
stays | 3 | ElasticSearchExtension.isRouting, rolled up into ElasticSearchModelExtension.routing |
@ElasticSearch.EnableDocValues |
stays | 112 | ElasticSearchExtension.isDocValuesEnabled |
@ElasticSearch.Column(legacyName) |
stays | 19 | ElasticSearchExtension.legacyColumnName |
JDBC: @SQLDatabase.* (unchanged)
| Annotation | Status | Uses | Read into |
|---|---|---|---|
@SQLDatabase.CompositeIndex(withColumns) (repeatable; @SQLDatabase.CompositeIndices is its container) |
stays | 3: one on ProfileThreadSnapshotRecord.taskId, two on segmentId, which Java stores as one CompositeIndices |
SQLDatabaseExtension.indices; StorageModels reads the single annotation and the container's values |
@SQLDatabase.AdditionalEntity(additionalTables, reserveOriginalColumns) |
stays | 9 | SQLDatabaseModelExtension.additionalTables, excludeColumns |
@SQLDatabase.ExtraColumn4AdditionalEntity (repeatable; @SQLDatabase.MultipleExtraColumn4AdditionalEntity is its container) |
stays | 5, one per class, so no container | SQLDatabaseModelExtension.additionalTables; read the same way |
BanyanDB measure: @BanyanDB.Measure.*
| Annotation | Status | Uses | Read into |
|---|---|---|---|
@BanyanDB.Measure.SeriesID(index) |
from @BanyanDB.SeriesID |
27, plus every OAL metric | BanyanDBExtension.seriesIDIdx |
@BanyanDB.Measure.ShardingKey(index) |
from @BanyanDB.ShardingKey |
every OAL metric (generated) | BanyanDBExtension.shardingKeyIdx |
@BanyanDB.Measure.Field |
from @BanyanDB.MeasureField |
73 | BanyanDBExtension.isMeasureField |
@BanyanDB.Measure.EnableSort |
from @BanyanDB.EnableSort |
0 in production; BanyanDBIT uses it |
BanyanDBExtension.enableSort |
@BanyanDB.Measure.MatchQuery(analyzer) |
from @BanyanDB.MatchQuery |
0 in production; BanyanDBIT uses it |
BanyanDBExtension.analyzer |
BanyanDB index-mode measure: @BanyanDB.IndexMode.*
| Annotation | Status | Uses | Read into |
|---|---|---|---|
@BanyanDB.IndexMode (class marker) |
stays | 16 | BanyanDBModelExtension.indexMode |
@BanyanDB.IndexMode.EnableSort |
from @BanyanDB.EnableSort |
1 | BanyanDBExtension.enableSort |
@BanyanDB.IndexMode.MatchQuery(analyzer) |
from @BanyanDB.MatchQuery |
1 | BanyanDBExtension.analyzer |
BanyanDB stream: @BanyanDB.Stream.*
| Annotation | Status | Uses | Read into |
|---|---|---|---|
@BanyanDB.Stream.Group(StreamGroup) |
from @BanyanDB.Group(streamGroup = X) |
26 | BanyanDBModelExtension.streamGroup |
@BanyanDB.Stream.TimestampColumn(column) |
from @BanyanDB.TimestampColumn |
26 | BanyanDBModelExtension.timestampColumn |
@BanyanDB.Stream.AllowBootReshape |
from @Stream(allowBootReshape = true) |
3 | BanyanDBModelExtension.allowBootReshape |
@BanyanDB.Stream.SeriesID(index) |
from @BanyanDB.SeriesID |
28 | BanyanDBExtension.seriesIDIdx |
@BanyanDB.Stream.IndexRule(indexType) |
from @BanyanDB.IndexRule |
4 | BanyanDBExtension.indexType |
@BanyanDB.Stream.EnableSort |
from @BanyanDB.EnableSort |
6 | BanyanDBExtension.enableSort |
@BanyanDB.Stream.MatchQuery(analyzer) |
from @BanyanDB.MatchQuery |
1 | BanyanDBExtension.analyzer |
@BanyanDB.Stream.NoIndexing |
from @BanyanDB.NoIndexing |
2 | BanyanDBExtension.shouldIndex = false |
BanyanDB trace: @BanyanDB.Trace.*
| Annotation | Status | Uses | Read into |
|---|---|---|---|
@BanyanDB.Trace.Group(TraceGroup) |
from @BanyanDB.Group(traceGroup = X) |
3 | BanyanDBModelExtension.traceGroup |
@BanyanDB.Trace.StoreAsAttachmentOf(Target.class) |
from implements BanyanDBTrace.MergeTable (seven getMerge* / get*ColumnValue methods) and the model's own @BanyanDB.Group(traceGroup = X) |
2 (SWSpanAttachedEventRecord into SegmentRecord, SpanAttachedEventRecord into ZipkinSpanRecord) |
BanyanDBModelExtension.attachmentTarget; the rows go into the target's trace, whose query returns them; the trace group comes from the target |
@BanyanDB.Trace.TimestampColumn(column) |
from @BanyanDB.TimestampColumn |
5 | BanyanDBModelExtension.timestampColumn |
@BanyanDB.Trace.TraceIdColumn(column) |
stays | 5 | BanyanDBModelExtension.traceIdColumn |
@BanyanDB.Trace.SpanIdColumn(column) |
stays | 5 | BanyanDBModelExtension.spanIdColumn |
@BanyanDB.Trace.IndexRule(name, columns, orderByColumn) (repeatable; @BanyanDB.Trace.IndexRule.List is its container) |
stays | 5: one on ZipkinSpanRecord, two each on SegmentRecord and OTLPSpanRecord, stored as IndexRule.List |
BanyanDBModelExtension.traceIndexRules; the installer always builds each as a tree index (TYPE_TREE), the order-by column last |
@BanyanDB.Trace.InSpanPayloadOnly |
from @BanyanDB.NoIndexing |
1 | BanyanDBExtension.shouldIndex = false: no trace tag; the value is only in the span payload |
@BanyanDB.EnableSort on a trace field |
removed: BanyanDB never read it for traces | was 2 (SegmentRecord.latency, OTLPSpanRecord.duration) |
— |
Enums
| Old | New |
|---|---|
BanyanDB.MatchQuery.AnalyzerType.X |
BanyanDB.AnalyzerType.X, shared by the three BanyanDB MatchQuery |
BanyanDB.IndexRule.IndexType.X |
BanyanDB.Stream.IndexRule.IndexType.X |
Removed
Column#indexOnly(),Stream#allowBootReshape(),Model#isAllowBootReshape(),ModelColumn#isIndexOnly()and theBanyanDBTrace.MergeTableinterface.- The flat
@BanyanDB.SeriesID,ShardingKey,MeasureField,EnableSort,MatchQuery,IndexRule,NoIndexing,TimestampColumnandGroup.
The old BanyanDB forms this PR removes add up to the new ones: SeriesID 55 = 27 measure + 28 stream; TimestampColumn 31 = 26 + 5; Group 31 = 26 stream + 3 trace + 2 attached models; EnableSort 9 = 1 + 6 + 2 removed; MatchQuery 2 = 1 + 1; NoIndexing 3 = 2 + 1.
wu-sheng
force-pushed
the
storage-annotation-breakdown
branch
from
November 27, 2026 00:17
b6d1e11 to
9f35ad1
Compare
An attribute only one storage reads now lives under that storage's annotation, and its value in that storage's
extension of the model:
- `@Column(indexOnly)` becomes `@ElasticSearch.IndexOnly` (`ElasticSearchExtension`).
- `@Stream(allowBootReshape)` becomes `@BanyanDB.Stream.AllowBootReshape` (`BanyanDBModelExtension`). It is for
streams only: the BanyanDB installer's boot-reshape path for measures, which no production measure used, is
removed.
BanyanDB annotations are grouped by the engine that reads them: `@BanyanDB.Measure.*`, `@BanyanDB.IndexMode.*`,
`@BanyanDB.Stream.*` and `@BanyanDB.Trace.*`. `MeasureField` becomes `Measure.Field`, and a trace's `NoIndexing`
becomes `Trace.InSpanPayloadOnly`; the two `EnableSort` on trace models, which BanyanDB never read, are removed.
`@BanyanDB.Trace.StoreAsAttachmentOf(Target.class)` replaces the `BanyanDBTrace.MergeTable` interface: the rows go
into the target's trace and its query returns them; the target model gives the trace, its group and its columns.
The annotation changes leave every schema as it was: with every bundled OAL, MAL, LAL and TAL rule, Zipkin and
OTLP active, plus verification-only rules for every OAL and MAL function, the schemas dumped from BanyanDB, MySQL,
PostgreSQL, and Elasticsearch with and without logic sharding are identical to master's (Elasticsearch without
logic sharding ran without the `maxDouble()` / `minDouble()` rules, as master can't boot with them there). So are
the model definitions each build's `StorageModels` produces for the hand-written models and the function classes,
but for the two removed `EnableSort`.
Also fix OAL `maxDouble()` / `minDouble()`: their double column was named `value`, which Elasticsearch without
logic sharding refused at boot ("Class type conflict in index: metrics-all"). It is now `double_value`, as
`doubleAvg()`'s.
wu-sheng
force-pushed
the
storage-annotation-breakdown
branch
from
November 27, 2026 00:51
9f35ad1 to
6b63121
Compare
wankai123
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #14270: storage annotations grouped per storage and per BanyanDB engine. The issue lists where every annotation now lives; in short:
@Column(indexOnly)→@ElasticSearch.IndexOnly;@Stream(allowBootReshape)→@BanyanDB.Stream.AllowBootReshape, for streams only (the installer's boot-reshape path for measures, which no production measure used, is removed, with itsBanyanDBITcase).@BanyanDB.Measure.*,@BanyanDB.IndexMode.*,@BanyanDB.Stream.*,@BanyanDB.Trace.*.MeasureField→Measure.Field; a trace'sNoIndexing→Trace.InSpanPayloadOnly; the twoEnableSorton trace models, which BanyanDB never read, are removed.@BanyanDB.Trace.StoreAsAttachmentOf(Target.class)replaces theBanyanDBTrace.MergeTableinterface for the two span-attached-event models: their rows go into the target's trace, and its query returns them. The target model gives the trace, its group and its columns, and BanyanDB's write path for those events reads them from the model.@BanyanDB.Measure.SeriesID/@BanyanDB.Measure.ShardingKey.Besides the annotations, the change touches the model definition, the installers and schema builders, BanyanDB's write path for the attached events, and the annotation names OAL code generation emits. No config, query or analysis change.
Also fixes OAL
maxDouble()/minDouble(): their double column was namedvalue, which Elasticsearch without logic sharding refused at boot (Class type conflict in index: metrics-all). It is nowdouble_value, asdoubleAvg()'s. No bundled rule uses either function.Tests and how the change was verified
The change must leave every schema as it was, so most of the verification compares master and this branch.
BanyanDBPropertyIT's setup failed to connect to its container before any test ran; re-run alone on the same code, its three tests pass.BanyanDBITwas first changed on master to assert the full measure, stream, index rule and binding shapes (it passes there), then kept unchanged through the refactor; the only other test changes are the constructor and annotation migration, and the removedtestMeasureAdditiveBootReshape.index,doc_values, analyzer,_sourceexcludes) and the index settings; every BanyanDB group, measure (entity, sharding key, tags, fields), stream, trace, property, TopN, index rule (type, analyzer, tags) and binding; and the OAP's metric catalog. Master's and this branch's dumps were compared object by object, attribute by attribute.maxDouble()/minDouble()rules, so that comparison ran without them; there, 49 of the 57 models share themetrics-all,records-allandmanagementindices.maxDouble()/minDouble()fix: only those two functions' tables, templates, indices and measures change, by the column name; Elasticsearch without logic sharding boots with both rules on.StorageModelswas run over every hand-written model class and every OAL / MAL function class (172 definitions, 1,217 columns), and its output compared: every field ofModel,ModelColumnand each storage's extension, and every class's annotations. The definitions are identical to master's but for the two removed traceEnableSortand thedouble_valuerename; the annotations differ by exactly the moves above. OAL-generated classes are built at boot, so they are not in this export; their storage is in the dumps of 3.maxDouble()/minDouble()verification metrics (JDBC:double_valuecolumn and index added; Elasticsearch with logic sharding:double_valuemapping appended; BanyanDB: shape mismatch at boot, so the metric stays off until reshaped). The dumps after each boot, with the values the server assigns itself kept, differ only there. (Elasticsearch without logic sharding re-puts an identicalrecords-alltemplate for two record models on every boot; master rebooted on its own storage does the same.)Closes [Feature] Break down storage annotations by storage and BanyanDB engine #14270.
Update the
CHANGESlog.GraalVM distro impact:
OALClassGeneratorV2now emitsBanyanDB.Measure.SeriesIDandBanyanDB.Measure.ShardingKey. The distro's precompiler runs this generator, so the generated classes take the new names without a distro change; the generator's source is pinned in the distro's staleness checksums, so its next sync flags it for a re-check.