mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-22 08:07:25 +08:00
@@ -67,7 +67,6 @@ func main() {
|
||||
}(d)
|
||||
}
|
||||
|
||||
|
||||
counter := int64(0)
|
||||
lastResetTime := time.Now()
|
||||
|
||||
|
@@ -2,14 +2,13 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||
"github.com/chrislusf/seaweedfs/weed/storage"
|
||||
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -2,12 +2,11 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"time"
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||
"github.com/chrislusf/seaweedfs/weed/storage"
|
||||
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
||||
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -45,5 +44,4 @@ func main() {
|
||||
if err != nil {
|
||||
glog.Fatalf("Reading Volume File [ERROR] %s\n", err)
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -91,6 +91,11 @@ func (s3a *S3ApiServer) completeMultipartUpload(ctx context.Context, input *s3.C
|
||||
}
|
||||
dirName = fmt.Sprintf("%s/%s/%s", s3a.option.BucketsPath, *input.Bucket, dirName)
|
||||
|
||||
// remove suffix '/'
|
||||
if strings.HasSuffix(dirName, "/") {
|
||||
dirName = dirName[:len(dirName)-1]
|
||||
}
|
||||
|
||||
err = s3a.mkFile(ctx, dirName, entryName, finalParts)
|
||||
|
||||
if err != nil {
|
||||
|
@@ -125,9 +125,11 @@ func (s3a *S3ApiServer) listFilerEntries(ctx context.Context, bucket, originalPr
|
||||
}
|
||||
lastEntryName = entry.Name
|
||||
if entry.IsDirectory {
|
||||
if entry.Name != ".uploads" {
|
||||
commonPrefixes = append(commonPrefixes, PrefixEntry{
|
||||
Prefix: fmt.Sprintf("%s%s/", dir, entry.Name),
|
||||
})
|
||||
}
|
||||
} else {
|
||||
contents = append(contents, ListEntry{
|
||||
Key: fmt.Sprintf("%s%s", dir, entry.Name),
|
||||
|
@@ -675,7 +675,7 @@ type PostResponse struct {
|
||||
}
|
||||
|
||||
type PrefixEntry struct {
|
||||
Prefix string `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Prefix"`
|
||||
Prefix string `xml:"Prefix"`
|
||||
}
|
||||
|
||||
type PutObject struct {
|
||||
|
@@ -48,7 +48,7 @@ func (ms *MasterServer) dirLookupHandler(w http.ResponseWriter, r *http.Request)
|
||||
collection := r.FormValue("collection") //optional, but can be faster if too many collections
|
||||
location := ms.findVolumeLocation(collection, vid)
|
||||
httpStatus := http.StatusOK
|
||||
if location.Error != "" {
|
||||
if location.Error != "" || location.Locations == nil {
|
||||
httpStatus = http.StatusNotFound
|
||||
} else {
|
||||
forRead := r.FormValue("read")
|
||||
@@ -60,7 +60,7 @@ func (ms *MasterServer) dirLookupHandler(w http.ResponseWriter, r *http.Request)
|
||||
|
||||
// findVolumeLocation finds the volume location from master topo if it is leader,
|
||||
// or from master client if not leader
|
||||
func (ms *MasterServer) findVolumeLocation(collection string, vid string) operation.LookupResult {
|
||||
func (ms *MasterServer) findVolumeLocation(collection, vid string) operation.LookupResult {
|
||||
var locations []operation.Location
|
||||
var err error
|
||||
if ms.Topo.IsLeader() {
|
||||
|
@@ -98,7 +98,7 @@ func writeDataNodeInfo(writer io.Writer, t *master_pb.DataNodeInfo) statistics {
|
||||
}
|
||||
func writeVolumeInformationMessage(writer io.Writer, t *master_pb.VolumeInformationMessage) statistics {
|
||||
fmt.Fprintf(writer, " volume %+v \n", t)
|
||||
return newStatiscis(t)
|
||||
return newStatistics(t)
|
||||
}
|
||||
|
||||
type statistics struct {
|
||||
@@ -108,7 +108,7 @@ type statistics struct {
|
||||
DeletedBytes uint64
|
||||
}
|
||||
|
||||
func newStatiscis(t *master_pb.VolumeInformationMessage) statistics {
|
||||
func newStatistics(t *master_pb.VolumeInformationMessage) statistics {
|
||||
return statistics{
|
||||
Size: t.Size,
|
||||
FileCount: t.FileCount,
|
||||
|
Reference in New Issue
Block a user