diff options
| author | James Hartig <me@jameshartig.com> | 2022-11-20 23:19:41 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-20 20:19:41 -0800 |
| commit | 4c85da7844d50b424bd8b7ace6250f2f381846b9 (patch) | |
| tree | 79ccba777c91b71b947112865b48f9f897d5b938 /unmaintained/stream_read_volume/stream_read_volume.go | |
| parent | 70a4c98b00d811c01289f26d3602992a0d3f45e1 (diff) | |
| download | seaweedfs-4c85da7844d50b424bd8b7ace6250f2f381846b9.tar.xz seaweedfs-4c85da7844d50b424bd8b7ace6250f2f381846b9.zip | |
Include meta in ReadAllNeedles (#3991)
This is useful for doing backups on the data so we can accurately store the
last modified time, the compression state, and verify the crc.
Previously we were doing VolumeNeedleStatus and then an HTTP request which
needlessly read from the dat file twice.
Diffstat (limited to 'unmaintained/stream_read_volume/stream_read_volume.go')
| -rw-r--r-- | unmaintained/stream_read_volume/stream_read_volume.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/unmaintained/stream_read_volume/stream_read_volume.go b/unmaintained/stream_read_volume/stream_read_volume.go index b002c5061..cdbfa2c44 100644 --- a/unmaintained/stream_read_volume/stream_read_volume.go +++ b/unmaintained/stream_read_volume/stream_read_volume.go @@ -5,13 +5,14 @@ import ( "errors" "flag" "fmt" + "io" + "github.com/seaweedfs/seaweedfs/weed/operation" "github.com/seaweedfs/seaweedfs/weed/pb" "github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb" "github.com/seaweedfs/seaweedfs/weed/security" "github.com/seaweedfs/seaweedfs/weed/util" "google.golang.org/grpc" - "io" ) var ( @@ -29,7 +30,7 @@ func main() { vid := uint32(*volumeId) eachNeedleFunc := func(resp *volume_server_pb.ReadAllNeedlesResponse) error { - fmt.Printf("%d,%x%08x %d\n", resp.VolumeId, resp.NeedleId, resp.Cookie, len(resp.NeedleBlob)) + fmt.Printf("%d,%x%08x %d %v %d %x\n", resp.VolumeId, resp.NeedleId, resp.Cookie, len(resp.NeedleBlob), resp.NeedleBlobCompressed, resp.LastModified, resp.Crc) return nil } |
