SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
add tool to printout dat file content
Chris Lufb1ed0e30d98
diff --git a/unmaintained/see_dat/see_dat.go b/unmaintained/see_dat/see_dat.gonew file mode 100644index 0000000000..ce31c1d20b--- /dev/null+++ b/unmaintained/see_dat/see_dat.go@@ -0,0 +1,34 @@+package main++import (+ "flag"+ "github.com/chrislusf/seaweedfs/weed/glog"+ "github.com/chrislusf/seaweedfs/weed/storage"+)++var (+ volumePath = flag.String("dir", "/tmp", "data directory to store files")+ volumeCollection = flag.String("collection", "", "the volume collection name")+ volumeId = flag.Int("volumeId", -1, "a volume id. The volume should already exist in the dir. The volume index file should not exist.")+)++func main() {+ flag.Parse()++ var version storage.Version+ vid := storage.VolumeId(*volumeId)+ err := storage.ScanVolumeFile(*volumePath, *volumeCollection, vid,+ storage.NeedleMapInMemory,+ func(superBlock storage.SuperBlock) error {+ version = superBlock.Version()+ return nil+ }, false, func(n *storage.Needle, offset int64) error {+ glog.V(0).Infof("%d,%s%x offset %d size %d cookie %x",+ *volumeId, n.Id, n.Cookie, offset, n.Size, n.Cookie)+ return nil+ })+ if err != nil {+ glog.Fatalf("Reading Volume File [ERROR] %s\n", err)+ }++}