diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-12-23 12:48:20 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-12-23 12:48:20 -0800 |
| commit | 09ca936c78c1044412f47dc06caff1bf08273e60 (patch) | |
| tree | c8402cc969ca53b841bfdcb6ae23d3955a20e5ec /weed/command | |
| parent | dda5c6d3cb32550777f1baf5bd00794e10e56d84 (diff) | |
| download | seaweedfs-09ca936c78c1044412f47dc06caff1bf08273e60.tar.xz seaweedfs-09ca936c78c1044412f47dc06caff1bf08273e60.zip | |
shell: add ec.decode command
Diffstat (limited to 'weed/command')
| -rw-r--r-- | weed/command/backup.go | 10 | ||||
| -rw-r--r-- | weed/command/export.go | 8 | ||||
| -rw-r--r-- | weed/command/fix.go | 5 |
3 files changed, 13 insertions, 10 deletions
diff --git a/weed/command/backup.go b/weed/command/backup.go index cef2bbe3a..a6d660006 100644 --- a/weed/command/backup.go +++ b/weed/command/backup.go @@ -3,10 +3,12 @@ package command import ( "fmt" + "github.com/spf13/viper" + "github.com/chrislusf/seaweedfs/weed/security" "github.com/chrislusf/seaweedfs/weed/storage/needle" + "github.com/chrislusf/seaweedfs/weed/storage/super_block" "github.com/chrislusf/seaweedfs/weed/util" - "github.com/spf13/viper" "github.com/chrislusf/seaweedfs/weed/operation" "github.com/chrislusf/seaweedfs/weed/storage" @@ -98,15 +100,15 @@ func runBackup(cmd *Command, args []string) bool { return true } } - var replication *storage.ReplicaPlacement + var replication *super_block.ReplicaPlacement if *s.replication != "" { - replication, err = storage.NewReplicaPlacementFromString(*s.replication) + replication, err = super_block.NewReplicaPlacementFromString(*s.replication) if err != nil { fmt.Printf("Error generate volume %d replication %s : %v\n", vid, *s.replication, err) return true } } else { - replication, err = storage.NewReplicaPlacementFromString(stats.Replication) + replication, err = super_block.NewReplicaPlacementFromString(stats.Replication) if err != nil { fmt.Printf("Error get volume %d replication %s : %v\n", vid, stats.Replication, err) return true diff --git a/weed/command/export.go b/weed/command/export.go index d3a765e09..a27b88c64 100644 --- a/weed/command/export.go +++ b/weed/command/export.go @@ -4,6 +4,7 @@ import ( "archive/tar" "bytes" "fmt" + "io" "os" "path" "path/filepath" @@ -12,11 +13,10 @@ import ( "text/template" "time" - "io" - "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/storage" "github.com/chrislusf/seaweedfs/weed/storage/needle" + "github.com/chrislusf/seaweedfs/weed/storage/super_block" "github.com/chrislusf/seaweedfs/weed/storage/types" ) @@ -93,8 +93,8 @@ type VolumeFileScanner4Export struct { vid needle.VolumeId } -func (scanner *VolumeFileScanner4Export) VisitSuperBlock(superBlock storage.SuperBlock) error { - scanner.version = superBlock.Version() +func (scanner *VolumeFileScanner4Export) VisitSuperBlock(superBlock super_block.SuperBlock) error { + scanner.version = superBlock.Version return nil } diff --git a/weed/command/fix.go b/weed/command/fix.go index 2fbbca5e6..9acf1801f 100644 --- a/weed/command/fix.go +++ b/weed/command/fix.go @@ -8,6 +8,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/storage" "github.com/chrislusf/seaweedfs/weed/storage/needle" + "github.com/chrislusf/seaweedfs/weed/storage/super_block" "github.com/chrislusf/seaweedfs/weed/storage/types" ) @@ -34,8 +35,8 @@ type VolumeFileScanner4Fix struct { nm *storage.NeedleMap } -func (scanner *VolumeFileScanner4Fix) VisitSuperBlock(superBlock storage.SuperBlock) error { - scanner.version = superBlock.Version() +func (scanner *VolumeFileScanner4Fix) VisitSuperBlock(superBlock super_block.SuperBlock) error { + scanner.version = superBlock.Version return nil } |
