aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-07-08 02:28:04 -0700
committerChris Lu <chris.lu@gmail.com>2018-07-08 02:28:04 -0700
commitd4d7ced922866e76e8c004d1c1045bcda2b25d5e (patch)
tree199d7a8895ce1225ae5647cfaeb15cec6f73cf4f /weed/command
parent922032b9bb2c885d5f65d1f835878a8b2d39a2a6 (diff)
downloadseaweedfs-d4d7ced922866e76e8c004d1c1045bcda2b25d5e.tar.xz
seaweedfs-d4d7ced922866e76e8c004d1c1045bcda2b25d5e.zip
refactoring: add type for needle id, offset
later the type size can possibly be adjusted
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/export.go3
-rw-r--r--weed/command/filer.go16
-rw-r--r--weed/command/fix.go5
3 files changed, 14 insertions, 10 deletions
diff --git a/weed/command/export.go b/weed/command/export.go
index 0f7496472..72fcae9fb 100644
--- a/weed/command/export.go
+++ b/weed/command/export.go
@@ -14,6 +14,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/storage"
+ "github.com/chrislusf/seaweedfs/weed/storage/types"
)
const (
@@ -157,7 +158,7 @@ func runExport(cmd *Command, args []string) bool {
type nameParams struct {
Name string
- Id uint64
+ Id types.NeedleId
Mime string
Key string
Ext string
diff --git a/weed/command/filer.go b/weed/command/filer.go
index f6478c105..cddad4c0d 100644
--- a/weed/command/filer.go
+++ b/weed/command/filer.go
@@ -88,15 +88,17 @@ func (fo *FilerOptions) start() {
masters := *f.masters
+ println("*f.dirListingLimit", *f.dirListingLimit)
+
fs, nfs_err := weed_server.NewFilerServer(defaultMux, publicVolumeMux, &weed_server.FilerOption{
Masters: strings.Split(masters, ","),
- Collection: *fo.collection,
- DefaultReplication: *fo.defaultReplicaPlacement,
- RedirectOnRead: *fo.redirectOnRead,
- DisableDirListing: *fo.disableDirListing,
- MaxMB: *fo.maxMB,
- SecretKey: *fo.secretKey,
- DirListingLimit: *fo.dirListingLimit,
+ Collection: *f.collection,
+ DefaultReplication: *f.defaultReplicaPlacement,
+ RedirectOnRead: *f.redirectOnRead,
+ DisableDirListing: *f.disableDirListing,
+ MaxMB: *f.maxMB,
+ SecretKey: *f.secretKey,
+ DirListingLimit: *f.dirListingLimit,
})
if nfs_err != nil {
glog.Fatalf("Filer startup error: %v", nfs_err)
diff --git a/weed/command/fix.go b/weed/command/fix.go
index f3103c6c2..32b09fd72 100644
--- a/weed/command/fix.go
+++ b/weed/command/fix.go
@@ -7,6 +7,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/storage"
+ "github.com/chrislusf/seaweedfs/weed/storage/types"
)
func init() {
@@ -54,11 +55,11 @@ func runFix(cmd *Command, args []string) bool {
}, false, func(n *storage.Needle, offset int64) error {
glog.V(2).Infof("key %d offset %d size %d disk_size %d gzip %v", n.Id, offset, n.Size, n.DiskSize(), n.IsGzipped())
if n.Size > 0 {
- pe := nm.Put(n.Id, uint32(offset/storage.NeedlePaddingSize), n.Size)
+ pe := nm.Put(n.Id, types.Offset(offset/types.NeedlePaddingSize), n.Size)
glog.V(2).Infof("saved %d with error %v", n.Size, pe)
} else {
glog.V(2).Infof("skipping deleted file ...")
- return nm.Delete(n.Id, uint32(offset/storage.NeedlePaddingSize))
+ return nm.Delete(n.Id, types.Offset(offset/types.NeedlePaddingSize))
}
return nil
})