Fix to Avro features

This commit is contained in:
Aditya Ujeniya
2025-05-25 19:44:21 +02:00
parent 968940da1f
commit aa0a3673f2
6 changed files with 111 additions and 22 deletions

View File

@@ -198,8 +198,6 @@ func decodeLine(dec *lineprotocol.Decoder,
var lvl *memorystore.Level = nil
prevCluster, prevHost := "", ""
var AvroBuf avro.AvroStruct
var ok bool
for dec.Next() {
rawmeasurement, err := dec.Measurement()
@@ -333,14 +331,13 @@ func decodeLine(dec *lineprotocol.Decoder,
}
if config.Keys.Checkpoints.FileFormat != "json" {
AvroBuf.MetricName = string(metricBuf)
AvroBuf.Cluster = cluster
AvroBuf.Node = host
AvroBuf.Selector = selector
AvroBuf.Value = metric.Value
AvroBuf.Timestamp = t.Unix()
avro.LineProtocolMessages <- AvroBuf
avro.LineProtocolMessages <- &avro.AvroStruct{
MetricName: string(metricBuf),
Cluster: cluster,
Node: host,
Selector: append([]string{}, selector...),
Value: metric.Value,
Timestamp: t.Unix()}
}
if err := ms.WriteToLevel(lvl, selector, t.Unix(), []memorystore.Metric{metric}); err != nil {