mirror of
https://github.com/hanzoai/s3.git
synced 2026-11-02 13:11:24 +00:00
Full internal rename — build-verified, every module green (root + s3-rdma-sidecar
+ telemetry/server + all test modules):
- Dirs: weed/→s3/ (main tree); cmd/weed-{db,sql}→cmd/s3-{db,sql};
seaweed-volume→s3-volume; seaweedfs-rdma-sidecar→s3-rdma-sidecar;
s3/mount/weedfs_*.go→s3fs_*.go (~113 path renames).
- Imports: github.com/hanzoai/s3/weed/ → /s3/ across 1700+ files.
- gRPC proto services Seaweed/SeaweedFiler/SeaweedMessaging/... → Hanzo*
(8 services) via full protoc regeneration (correct descriptors, no sed-corruption).
- Brand SeaweedFS/Seaweed/seaweed → Hanzo/hanzo; internal X-Seaweedfs-* headers
→ X-Hanzo-*; .seaweedfs config dir → .s3.
- CLI is `s3`: go install github.com/hanzoai/s3/s3@latest | make install | Docker.
install.sh rewritten as a Hanzo S3 installer.
- External forks github.com/seaweedfs/{raft,go-fuse,goexif,cockroachdb-parser}
kept verbatim — immutable third-party module paths; NOTICE retained.
Residual (cosmetic, non-build): kafka loadtest test-proto package com.seaweedfs.loadtest.
49 lines
1.3 KiB
Go
49 lines
1.3 KiB
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
"path"
|
|
"strconv"
|
|
|
|
"github.com/hanzoai/s3/s3/util"
|
|
|
|
"github.com/hanzoai/s3/s3/glog"
|
|
"github.com/hanzoai/s3/s3/storage/idx"
|
|
"github.com/hanzoai/s3/s3/storage/types"
|
|
util_http "github.com/hanzoai/s3/s3/util/http"
|
|
)
|
|
|
|
var (
|
|
fixVolumePath = flag.String("dir", "/tmp", "data directory to store files")
|
|
fixVolumeCollection = flag.String("collection", "", "the volume collection name")
|
|
fixVolumeId = flag.Int("volumeId", -1, "a volume id. The volume should already exist in the dir. The volume index file should not exist.")
|
|
)
|
|
|
|
/*
|
|
This is to see content in .idx files.
|
|
|
|
see_idx -v=4 -volumeId=9 -dir=/Users/chrislu/Downloads
|
|
*/
|
|
func main() {
|
|
flag.Parse()
|
|
util_http.InitGlobalHttpClient()
|
|
|
|
fileName := strconv.Itoa(*fixVolumeId)
|
|
if *fixVolumeCollection != "" {
|
|
fileName = *fixVolumeCollection + "_" + fileName
|
|
}
|
|
indexFile, err := os.OpenFile(path.Join(*fixVolumePath, fileName+".idx"), os.O_RDONLY, 0644)
|
|
if err != nil {
|
|
glog.Fatalf("Create Volume Index [ERROR] %s\n", err)
|
|
}
|
|
defer indexFile.Close()
|
|
|
|
idx.WalkIndexFile(indexFile, 0, func(key types.NeedleId, offset types.Offset, size types.Size) error {
|
|
fmt.Printf("key:%v offset:%v size:%v(%v)\n", key, offset, size, util.BytesToHumanReadable(uint64(size)))
|
|
return nil
|
|
})
|
|
|
|
}
|