From dd03d25e3bb710ed5b26f9bbebf314145dfceff8 Mon Sep 17 00:00:00 2001 From: Denys Zhdanov Date: Tue, 4 Jul 2023 13:11:31 +0200 Subject: [PATCH 1/2] Update whisper dependency --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index cbf9e292c..15a755f48 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/dgryski/go-trigram v0.0.0-20160407183937-79ec494e1ad0 github.com/dgryski/httputil v0.0.0-20160116060654-189c2918cd08 github.com/go-graphite/carbonzipper v0.0.0-20180329125635-fedce067a794 - github.com/go-graphite/go-whisper v0.0.0-20230316154527-2337c74b5007 + github.com/go-graphite/go-whisper v0.0.0-20230526115116-e3110f57c01c github.com/go-graphite/protocol v1.0.1-0.20220718132526-4b842ba389ee github.com/gogo/protobuf v1.3.2 github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect diff --git a/go.sum b/go.sum index 338b0516f..496882a92 100644 --- a/go.sum +++ b/go.sum @@ -100,6 +100,8 @@ github.com/go-graphite/go-whisper v0.0.0-20230221134257-6774e38a461b h1:vyKMs7TO github.com/go-graphite/go-whisper v0.0.0-20230221134257-6774e38a461b/go.mod h1:1edRhfqJoiHSjN72nYptHK0YR4yYt8aPC4NRHWhT0XE= github.com/go-graphite/go-whisper v0.0.0-20230316154527-2337c74b5007 h1:jfpukwFZGuZhWTKbGL+qNJB32CDBcERIQ+03hnPsdIs= github.com/go-graphite/go-whisper v0.0.0-20230316154527-2337c74b5007/go.mod h1:1edRhfqJoiHSjN72nYptHK0YR4yYt8aPC4NRHWhT0XE= +github.com/go-graphite/go-whisper v0.0.0-20230526115116-e3110f57c01c h1:Edc/U64p3BAlAm/V8WLjEwK4WxC2eq1FOyLw3yO99zg= +github.com/go-graphite/go-whisper v0.0.0-20230526115116-e3110f57c01c/go.mod h1:1edRhfqJoiHSjN72nYptHK0YR4yYt8aPC4NRHWhT0XE= github.com/go-graphite/protocol v1.0.1-0.20220718132526-4b842ba389ee h1:Sb63UbLUOXtKFIfNfZIkWrs73vWD0ZKzrBdTjvlVOBQ= github.com/go-graphite/protocol v1.0.1-0.20220718132526-4b842ba389ee/go.mod h1:puWkW2DFZi46CaLY1rxYhkDiBDFlpaTDaMjcE/Cd9gw= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= From 6da8386fb124cceececeed90f7989a69cebe062e Mon Sep 17 00:00:00 2001 From: Denys Zhdanov Date: Tue, 4 Jul 2023 13:12:02 +0200 Subject: [PATCH 2/2] Sync vendor dir --- go.sum | 6 ------ .../go-graphite/go-whisper/whisper.go | 19 ++++++++++++++----- vendor/modules.txt | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/go.sum b/go.sum index 496882a92..5c4f4558b 100644 --- a/go.sum +++ b/go.sum @@ -94,12 +94,6 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-graphite/carbonzipper v0.0.0-20180329125635-fedce067a794 h1:9N+1I8z47huAZdcBWVIqfZZPzIzMyXqGd3uR21QN5mA= github.com/go-graphite/carbonzipper v0.0.0-20180329125635-fedce067a794/go.mod h1:sfZ+AkP8/bBcWSGVqhseV6t6e/+C0i/PkTpA32W5rXs= -github.com/go-graphite/go-whisper v0.0.0-20230221132853-95257dc0091a h1:d5ri9aVVwjXmbn9PCQsLlrtfoxDsiUMEoin7dLGtKY0= -github.com/go-graphite/go-whisper v0.0.0-20230221132853-95257dc0091a/go.mod h1:1edRhfqJoiHSjN72nYptHK0YR4yYt8aPC4NRHWhT0XE= -github.com/go-graphite/go-whisper v0.0.0-20230221134257-6774e38a461b h1:vyKMs7TOeAoxwklVChPObeimZHmOR1IiqTvQox4z8xA= -github.com/go-graphite/go-whisper v0.0.0-20230221134257-6774e38a461b/go.mod h1:1edRhfqJoiHSjN72nYptHK0YR4yYt8aPC4NRHWhT0XE= -github.com/go-graphite/go-whisper v0.0.0-20230316154527-2337c74b5007 h1:jfpukwFZGuZhWTKbGL+qNJB32CDBcERIQ+03hnPsdIs= -github.com/go-graphite/go-whisper v0.0.0-20230316154527-2337c74b5007/go.mod h1:1edRhfqJoiHSjN72nYptHK0YR4yYt8aPC4NRHWhT0XE= github.com/go-graphite/go-whisper v0.0.0-20230526115116-e3110f57c01c h1:Edc/U64p3BAlAm/V8WLjEwK4WxC2eq1FOyLw3yO99zg= github.com/go-graphite/go-whisper v0.0.0-20230526115116-e3110f57c01c/go.mod h1:1edRhfqJoiHSjN72nYptHK0YR4yYt8aPC4NRHWhT0XE= github.com/go-graphite/protocol v1.0.1-0.20220718132526-4b842ba389ee h1:Sb63UbLUOXtKFIfNfZIkWrs73vWD0ZKzrBdTjvlVOBQ= diff --git a/vendor/github.com/go-graphite/go-whisper/whisper.go b/vendor/github.com/go-graphite/go-whisper/whisper.go index 44e230a02..2f4a5274d 100644 --- a/vendor/github.com/go-graphite/go-whisper/whisper.go +++ b/vendor/github.com/go-graphite/go-whisper/whisper.go @@ -111,10 +111,11 @@ type Options struct { Compressed bool // It's a hint, used if the retention is big enough, more in // Retention.calculateSuitablePointsPerBlock - PointsPerBlock int - PointSize float32 - InMemory bool - OpenFileFlag *int + PointsPerBlock int + PointSize float32 + InMemory bool + InMemoryContent []byte + OpenFileFlag *int MixAggregationSpecs []MixAggregationSpec MixAvgCompressedPointSizes map[int][]float32 @@ -596,7 +597,15 @@ func Open(path string) (whisper *Whisper, err error) { func OpenWithOptions(path string, options *Options) (whisper *Whisper, err error) { var file file if options.InMemory { - file = newMemFile(path) + if mc := options.InMemoryContent; mc != nil { + file = &memFile{ + name: path, + data: mc, + offset: 0, + } + } else { + file = newMemFile(path) + } } else { flag := os.O_RDWR if options.OpenFileFlag != nil { diff --git a/vendor/modules.txt b/vendor/modules.txt index 127cc0a42..f25c09761 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -59,7 +59,7 @@ github.com/eapache/queue # github.com/go-graphite/carbonzipper v0.0.0-20180329125635-fedce067a794 ## explicit github.com/go-graphite/carbonzipper/zipper/httpHeaders -# github.com/go-graphite/go-whisper v0.0.0-20230316154527-2337c74b5007 +# github.com/go-graphite/go-whisper v0.0.0-20230526115116-e3110f57c01c ## explicit; go 1.18 github.com/go-graphite/go-whisper # github.com/go-graphite/protocol v1.0.1-0.20220718132526-4b842ba389ee