mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-31 15:06:26 +00:00
wip
This commit is contained in:
parent
84631d8c04
commit
0d0804a202
2 changed files with 25 additions and 27 deletions
|
@ -2,9 +2,6 @@ package logstorage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
|
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type filter interface {
|
type filter interface {
|
||||||
|
@ -62,27 +59,3 @@ func (fs *streamFilter) apply(bs *blockSearch, bm *bitmap) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func toFloat64StringExt(bs *blockSearch, bb *bytesutil.ByteBuffer, v string) string {
|
|
||||||
if len(v) != 8 {
|
|
||||||
logger.Panicf("FATAL: %s: unexpected length for binary representation of floating-point number: got %d; want 8", bs.partPath(), len(v))
|
|
||||||
}
|
|
||||||
bb.B = toFloat64String(bb.B[:0], v)
|
|
||||||
return bytesutil.ToUnsafeString(bb.B)
|
|
||||||
}
|
|
||||||
|
|
||||||
func toIPv4StringExt(bs *blockSearch, bb *bytesutil.ByteBuffer, v string) string {
|
|
||||||
if len(v) != 4 {
|
|
||||||
logger.Panicf("FATAL: %s: unexpected length for binary representation of IPv4: got %d; want 4", bs.partPath(), len(v))
|
|
||||||
}
|
|
||||||
bb.B = toIPv4String(bb.B[:0], v)
|
|
||||||
return bytesutil.ToUnsafeString(bb.B)
|
|
||||||
}
|
|
||||||
|
|
||||||
func toTimestampISO8601StringExt(bs *blockSearch, bb *bytesutil.ByteBuffer, v string) string {
|
|
||||||
if len(v) != 8 {
|
|
||||||
logger.Panicf("FATAL: %s: unexpected length for binary representation of ISO8601 timestamp: got %d; want 8", bs.partPath(), len(v))
|
|
||||||
}
|
|
||||||
bb.B = toTimestampISO8601String(bb.B[:0], v)
|
|
||||||
return bytesutil.ToUnsafeString(bb.B)
|
|
||||||
}
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
|
||||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -292,3 +293,27 @@ func quoteFieldNameIfNeeded(s string) string {
|
||||||
func isMsgFieldName(fieldName string) bool {
|
func isMsgFieldName(fieldName string) bool {
|
||||||
return fieldName == "" || fieldName == "_msg"
|
return fieldName == "" || fieldName == "_msg"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func toFloat64StringExt(bs *blockSearch, bb *bytesutil.ByteBuffer, v string) string {
|
||||||
|
if len(v) != 8 {
|
||||||
|
logger.Panicf("FATAL: %s: unexpected length for binary representation of floating-point number: got %d; want 8", bs.partPath(), len(v))
|
||||||
|
}
|
||||||
|
bb.B = toFloat64String(bb.B[:0], v)
|
||||||
|
return bytesutil.ToUnsafeString(bb.B)
|
||||||
|
}
|
||||||
|
|
||||||
|
func toIPv4StringExt(bs *blockSearch, bb *bytesutil.ByteBuffer, v string) string {
|
||||||
|
if len(v) != 4 {
|
||||||
|
logger.Panicf("FATAL: %s: unexpected length for binary representation of IPv4: got %d; want 4", bs.partPath(), len(v))
|
||||||
|
}
|
||||||
|
bb.B = toIPv4String(bb.B[:0], v)
|
||||||
|
return bytesutil.ToUnsafeString(bb.B)
|
||||||
|
}
|
||||||
|
|
||||||
|
func toTimestampISO8601StringExt(bs *blockSearch, bb *bytesutil.ByteBuffer, v string) string {
|
||||||
|
if len(v) != 8 {
|
||||||
|
logger.Panicf("FATAL: %s: unexpected length for binary representation of ISO8601 timestamp: got %d; want 8", bs.partPath(), len(v))
|
||||||
|
}
|
||||||
|
bb.B = toTimestampISO8601String(bb.B[:0], v)
|
||||||
|
return bytesutil.ToUnsafeString(bb.B)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue