Skip to content

Commit 844aa50

Browse files
authored
Add more comments for IndexMode (#12930)
1 parent 776a757 commit 844aa50

File tree

1 file changed

+29
-1
lines changed
  • oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation

1 file changed

+29
-1
lines changed

oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/annotation/BanyanDB.java

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
import java.lang.annotation.RetentionPolicy;
2525
import java.lang.annotation.Target;
2626

27+
import org.apache.skywalking.oap.server.core.analysis.metrics.Metrics;
2728
import org.apache.skywalking.oap.server.core.analysis.record.Record;
29+
import org.apache.skywalking.oap.server.core.storage.StorageID;
2830

2931
/**
3032
* BanyanDB annotation is a holder including all annotations for BanyanDB storage
@@ -125,7 +127,8 @@ enum IndexType {
125127
/**
126128
* MeasureField defines a column as a measure's field.
127129
* The measure field has a significant difference from no-indexing tag.
128-
* The measure fields are stored in another file, but no-indexing tag is stored in the same file with the indexing tags.
130+
* The measure fields are stored in another file, but no-indexing tag is stored in the same file with the indexing
131+
* tags.
129132
* <p>
130133
* Annotated: the column is a measure field.
131134
* Unannotated: the column is a measure tag.
@@ -211,6 +214,7 @@ enum AnalyzerType {
211214

212215
/**
213216
* EnableSort is used to indicate the IndexRule supports sorting.
217+
*
214218
* @since 10.2.0
215219
*/
216220
@Target({ElementType.FIELD})
@@ -220,6 +224,30 @@ enum AnalyzerType {
220224

221225
/**
222226
* IndexMode is used to indicate the index mode of the metric.
227+
* IndexMode metric is a half-time series metric, which means the metric is time relative, and still affected by
228+
* metric TTL, but its ID doesn't include time bucket. The entity has a unique name to represent the entity.
229+
* <p>
230+
* The entity should be a kind of metadata entity, e.g. ServiceTraffic.
231+
* The return({@link StorageID} of {@link Metrics#id()} should not include any time relative column.
232+
* <pre>
233+
* <code>
234+
* return new StorageID().appendMutant(new String[] {
235+
* NAME,
236+
* LAYER
237+
* }, id);
238+
* </code>
239+
* </pre>
240+
* <p>
241+
* A metric with complete(not IndexMode) time series data includes the TIME_BUCKET column in the ID.
242+
* <pre>
243+
* <code>
244+
* return new StorageID()
245+
* .append(TIME_BUCKET, getTimeBucket())
246+
* .append(ENTITY_ID, getEntityId());
247+
* </code>
248+
* </pre>
249+
*
250+
* <p>
223251
* All columns in the metric will be stored in the index exclusively.
224252
* When an entity column is not used in query condition, only {@link Column#storageOnly()} is allowed.
225253
* No {@link MeasureField} is allowed for those columns in IndexMode entity.

0 commit comments

Comments
 (0)