From 26673bcbded22ad83c695b668d68dbcb3b04e756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Pazos?= Date: Wed, 11 Oct 2023 17:22:20 -0300 Subject: [PATCH] Use github.com/golang/snappy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolás Pazos --- storage/remote/queue_manager.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index 71a833943..17ec34d5e 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -24,7 +24,8 @@ import ( "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/gogo/protobuf/proto" - reSnappy "github.com/klauspost/compress/snappy" + + "github.com/golang/snappy" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" "go.opentelemetry.io/otel" @@ -1733,8 +1734,8 @@ func buildWriteRequest(samples []prompb.TimeSeries, metadata []prompb.MetricMeta } else { buf = &[]byte{} } - compressed := reSnappy.Encode(*buf, pBuf.Bytes()) - if n := reSnappy.MaxEncodedLen(len(pBuf.Bytes())); buf != nil && n > len(*buf) { + compressed := snappy.Encode(*buf, pBuf.Bytes()) + if n := snappy.MaxEncodedLen(len(pBuf.Bytes())); buf != nil && n > len(*buf) { // grow the buffer for the next time *buf = make([]byte, n) } @@ -1780,8 +1781,8 @@ func buildReducedWriteRequest(samples []prompb.ReducedTimeSeries, labels map[uin buf = &[]byte{} } - compressed := reSnappy.Encode(*buf, pBuf.Bytes()) - if n := reSnappy.MaxEncodedLen(len(pBuf.Bytes())); buf != nil && n > len(*buf) { + compressed := snappy.Encode(*buf, pBuf.Bytes()) + if n := snappy.MaxEncodedLen(len(pBuf.Bytes())); buf != nil && n > len(*buf) { // grow the buffer for the next time *buf = make([]byte, n) }