Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/en/changes/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
| **Total** | **158** | - | - |

* BanyanDB: make `BanyanDBMetricsDAO` output `scan all blocks` info log only when the model is not `indexModel`.
* BanyanDB: fix the `BanyanDBMetricsDAO.multiGet` not work properly in `IndexMode`.
* BanyanDB: remove `@StoreIDAsTag`, and automatically create a virtual String tag `id` for the SeriesID in `IndexMode`.
* Remove method `appendMutant` from StorageID.

#### UI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class TopNCacheReadCommand extends TopN {

@Override
public StorageID id() {
return new StorageID().appendMutant(null, id);
return new StorageID().append(id);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class TopNCacheWriteCommand extends TopN {

@Override
public StorageID id() {
return new StorageID().appendMutant(null, id);
return new StorageID().append(id);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class TopNDatabaseStatement extends TopN {

@Override
public StorageID id() {
return new StorageID().appendMutant(null, id);
return new StorageID().append(id);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,13 @@ public class EndpointTraffic extends Metrics {
@Setter
@Getter
@Column(name = SERVICE_ID)
@BanyanDB.SeriesID(index = 0)
private String serviceId;
@Setter
@Getter
@Column(name = NAME)
@ElasticSearch.Column(legacyName = "name")
@ElasticSearch.MatchQuery
@BanyanDB.MatchQuery(analyzer = BanyanDB.MatchQuery.AnalyzerType.URL)
@BanyanDB.SeriesID(index = 1)
private String name = Const.EMPTY_STRING;
@Setter
@Getter
Expand All @@ -77,11 +75,7 @@ protected StorageID id0() {
// Downgrade the time bucket to day level only.
// supportDownSampling == false for this entity.
return new StorageID()
.appendMutant(
new String[] {
SERVICE_ID,
NAME
},
.append(
IDManager.EndpointID.buildId(
this.getServiceId(), this.getName())
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@ public class InstanceTraffic extends Metrics {
@Setter
@Getter
@Column(name = SERVICE_ID)
@BanyanDB.SeriesID(index = 0)
private String serviceId;

@Setter
@Getter
@Column(name = NAME, storageOnly = true)
@ElasticSearch.Column(legacyName = "name")
@BanyanDB.SeriesID(index = 1)
private String name;

@Setter
Expand Down Expand Up @@ -135,10 +133,7 @@ public RemoteData.Builder serialize() {
@Override
protected StorageID id0() {
return new StorageID()
.appendMutant(new String[] {
SERVICE_ID,
NAME
}, IDManager.ServiceInstanceID.buildId(serviceId, name));
.append(IDManager.ServiceInstanceID.buildId(serviceId, name));
}

public static class Builder implements StorageBuilder<InstanceTraffic> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,14 @@ public class NetworkAddressAlias extends Metrics {
@Setter
@Getter
@Column(name = ADDRESS)
@BanyanDB.SeriesID(index = 0)
private String address;
@Setter
@Getter
@Column(name = REPRESENT_SERVICE_ID)
@BanyanDB.SeriesID(index = 1)
private String representServiceId;
@Setter
@Getter
@Column(name = REPRESENT_SERVICE_INSTANCE_ID)
@BanyanDB.SeriesID(index = 2)
private String representServiceInstanceId;
@Setter
@Getter
Expand All @@ -89,8 +86,7 @@ public boolean combine(final Metrics metrics) {

@Override
protected StorageID id0() {
return new StorageID().appendMutant(
new String[] {ADDRESS}, IDManager.NetworkAddressAliasDefine.buildId(address));
return new StorageID().append(IDManager.NetworkAddressAliasDefine.buildId(address));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"instanceId",
"name",
})
@BanyanDB.StoreIDAsTag
@BanyanDB.IndexMode
public class ProcessTraffic extends Metrics {
public static final String INDEX_NAME = "process_traffic";
Expand All @@ -74,7 +73,6 @@ public class ProcessTraffic extends Metrics {
@Setter
@Getter
@Column(name = INSTANCE_ID, length = 600)
@BanyanDB.SeriesID(index = 0)
private String instanceId;

@Getter
Expand All @@ -84,7 +82,6 @@ public class ProcessTraffic extends Metrics {
@Setter
@Getter
@Column(name = NAME, length = 500)
@BanyanDB.SeriesID(index = 1)
private String name;

@Setter
Expand Down Expand Up @@ -196,10 +193,7 @@ protected StorageID id0() {
if (processId == null) {
processId = IDManager.ProcessID.buildId(instanceId, name);
}
return new StorageID().appendMutant(new String[] {
INSTANCE_ID,
NAME
}, processId);
return new StorageID().append(processId);
}

public static class Builder implements StorageBuilder<ProcessTraffic> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ public class ServiceLabelRecord extends Metrics {
public static final String SERVICE_ID = "service_id";
public static final String LABEL = "label";

@BanyanDB.SeriesID(index = 0)
@Column(name = SERVICE_ID)
private String serviceId;
@BanyanDB.SeriesID(index = 1)
@Column(name = LABEL, length = 50)
private String label;

Expand All @@ -83,9 +81,7 @@ public Metrics toDay() {

@Override
protected StorageID id0() {
return new StorageID()
.append(SERVICE_ID, serviceId)
.append(LABEL, label);
return new StorageID().append(serviceId).append(label);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,15 @@ public class TagAutocompleteData extends Metrics {
@Getter
@Column(name = TAG_KEY)
@ElasticSearch.EnableDocValues
@BanyanDB.SeriesID(index = 1)
private String tagKey;
@Setter
@Getter
@Column(name = TAG_VALUE, length = Tag.TAG_LENGTH)
@BanyanDB.SeriesID(index = 2)
private String tagValue;

@Setter
@Getter
@Column(name = TAG_TYPE)
@BanyanDB.SeriesID(index = 0)
private String tagType;

@Override
Expand All @@ -94,10 +91,10 @@ public Metrics toDay() {
@Override
protected StorageID id0() {
return new StorageID()
.appendMutant(new String[] {TIME_BUCKET}, toTimeBucketInDay())
.append(TAG_TYPE, tagType)
.append(TAG_KEY, tagKey)
.append(TAG_VALUE, tagValue);
.append(toTimeBucketInDay())
.append(tagType)
.append(tagKey)
.append(tagValue);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public class ServiceTraffic extends Metrics {
@Column(name = NAME)
@ElasticSearch.Column(legacyName = "name")
@ElasticSearch.MatchQuery
@BanyanDB.SeriesID(index = 1)
private String name = Const.EMPTY_STRING;

@Setter
Expand All @@ -90,7 +89,6 @@ public class ServiceTraffic extends Metrics {
@Setter
@Getter
@Column(name = LAYER)
@BanyanDB.SeriesID(index = 0)
private Layer layer = Layer.UNDEFINED;

/**
Expand All @@ -107,10 +105,7 @@ protected StorageID id0() {
} else {
id = encode(name) + Const.POINT + Layer.UNDEFINED.value();
}
return new StorageID().appendMutant(new String[] {
NAME,
LAYER
}, id);
return new StorageID().append(id);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
}, callSuper = false)
public abstract class Metrics extends StreamData implements StorageData {
public static final String ENTITY_ID = "entity_id";
public static final String ID = "id";

/**
* Time attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,38 +51,29 @@ public class InstanceHierarchyRelationTraffic extends Metrics {
@Setter
@Getter
@Column(name = INSTANCE_ID, length = 250)
@BanyanDB.SeriesID(index = 0)
private String instanceId;

@Setter
@Getter
@Column(name = SERVICE_LAYER)
@BanyanDB.SeriesID(index = 1)
private Layer serviceLayer = Layer.UNDEFINED;

@Setter
@Getter
@Column(name = RELATED_INSTANCE_ID, length = 250)
@BanyanDB.SeriesID(index = 2)
private String relatedInstanceId;

@Setter
@Getter
@Column(name = RELATED_SERVICE_LAYER)
@BanyanDB.SeriesID(index = 3)
private Layer relatedServiceLayer = Layer.UNDEFINED;

@Override
protected StorageID id0() {
String id = IDManager.ServiceInstanceID.buildInstanceHierarchyRelationId(
new IDManager.ServiceInstanceID.InstanceHierarchyRelationDefine(
instanceId, serviceLayer, relatedInstanceId, relatedServiceLayer));
return new StorageID().appendMutant(new String[] {
INSTANCE_ID,
RELATED_INSTANCE_ID,
SERVICE_LAYER,
RELATED_SERVICE_LAYER
}, id);
return new StorageID().append(id);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public class ServiceHierarchyRelationTraffic extends Metrics {
@Setter
@Getter
@Column(name = SERVICE_ID, length = 250)
@BanyanDB.SeriesID(index = 0)
private String serviceId;

/**
Expand All @@ -63,7 +62,6 @@ public class ServiceHierarchyRelationTraffic extends Metrics {
@Setter
@Getter
@Column(name = SERVICE_LAYER)
@BanyanDB.SeriesID(index = 1)
private Layer serviceLayer = Layer.UNDEFINED;

/**
Expand All @@ -72,7 +70,6 @@ public class ServiceHierarchyRelationTraffic extends Metrics {
@Setter
@Getter
@Column(name = RELATED_SERVICE_ID, length = 250)
@BanyanDB.SeriesID(index = 2)
private String relatedServiceId;

/**
Expand All @@ -81,7 +78,6 @@ public class ServiceHierarchyRelationTraffic extends Metrics {
@Setter
@Getter
@Column(name = RELATED_SERVICE_LAYER)
@BanyanDB.SeriesID(index = 3)
private Layer relatedServiceLayer = Layer.UNDEFINED;

@Override
Expand All @@ -90,12 +86,7 @@ protected StorageID id0() {
new IDManager.ServiceID.ServiceHierarchyRelationDefine(
serviceId, serviceLayer, relatedServiceId, relatedServiceLayer));

return new StorageID().appendMutant(new String[] {
SERVICE_ID,
SERVICE_LAYER,
RELATED_SERVICE_ID,
RELATED_SERVICE_LAYER
}, id);
return new StorageID().append(id);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,7 @@ public class JFRProfilingDataRecord extends Record {

@Override
public StorageID id() {
return new StorageID().appendMutant(
new String[]{
TASK_ID,
INSTANCE_ID,
EVENT_TYPE,
UPLOAD_TIME
},
return new StorageID().append(
Hashing.sha256().newHasher()
.putString(taskId, StandardCharsets.UTF_8)
.putString(instanceId, StandardCharsets.UTF_8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,7 @@ public class EBPFProfilingDataRecord extends Record {

@Override
public StorageID id() {
return new StorageID().appendMutant(
new String[] {
SCHEDULE_ID,
STACK_ID_LIST,
UPLOAD_TIME
},
return new StorageID().append(
Hashing.sha256().newHasher()
.putString(scheduleId, Charsets.UTF_8)
.putString(stackIdList, Charsets.UTF_8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public class EBPFProfilingScheduleRecord extends Metrics {
public static final String EBPF_PROFILING_SCHEDULE_ID = "ebpf_profiling_schedule_id";

@Column(name = TASK_ID)
@BanyanDB.SeriesID(index = 0)
private String taskId;
@Column(name = PROCESS_ID, length = 600)
private String processId;
Expand All @@ -73,7 +72,6 @@ public class EBPFProfilingScheduleRecord extends Metrics {
@Column(name = END_TIME)
private long endTime;
@Column(name = EBPF_PROFILING_SCHEDULE_ID)
@BanyanDB.SeriesID(index = 1)
private String scheduleId;

@Override
Expand Down Expand Up @@ -101,7 +99,7 @@ public Metrics toDay() {

@Override
protected StorageID id0() {
return new StorageID().append(TASK_ID, taskId).append(EBPF_PROFILING_SCHEDULE_ID, scheduleId);
return new StorageID().append(taskId).append(scheduleId);
}

@Override
Expand Down
Loading
Loading