mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
go fmt
This commit is contained in:
parent
cc32436d63
commit
7359193e97
|
@ -13,13 +13,13 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DirectoryEtcRoot = "/etc"
|
DirectoryEtcRoot = "/etc"
|
||||||
DirectoryEtcSeaweedFS = "/etc/seaweedfs"
|
DirectoryEtcSeaweedFS = "/etc/seaweedfs"
|
||||||
DirectoryEtcRemote = "/etc/remote"
|
DirectoryEtcRemote = "/etc/remote"
|
||||||
FilerConfName = "filer.conf"
|
FilerConfName = "filer.conf"
|
||||||
IamConfigDirecotry = "/etc/iam"
|
IamConfigDirecotry = "/etc/iam"
|
||||||
IamIdentityFile = "identity.json"
|
IamIdentityFile = "identity.json"
|
||||||
IamPoliciesFile = "policies.json"
|
IamPoliciesFile = "policies.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
type FilerConf struct {
|
type FilerConf struct {
|
||||||
|
|
|
@ -63,7 +63,6 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector
|
||||||
return fuse.EIO
|
return fuse.EIO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
"github.com/chrislusf/seaweedfs/weed/pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/wdclient"
|
"github.com/chrislusf/seaweedfs/weed/wdclient"
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ func (s3a *S3ApiServer) completeMultipartUpload(input *s3.CompleteMultipartUploa
|
||||||
return nil, s3err.ErrNoSuchUpload
|
return nil, s3err.ErrNoSuchUpload
|
||||||
}
|
}
|
||||||
|
|
||||||
pentry, err := s3a.getEntry(s3a.genUploadsFolder(*input.Bucket),*input.UploadId)
|
pentry, err := s3a.getEntry(s3a.genUploadsFolder(*input.Bucket), *input.UploadId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("completeMultipartUpload %s %s error: %v", *input.Bucket, *input.UploadId, err)
|
glog.Errorf("completeMultipartUpload %s %s error: %v", *input.Bucket, *input.UploadId, err)
|
||||||
return nil, s3err.ErrNoSuchUpload
|
return nil, s3err.ErrNoSuchUpload
|
||||||
|
@ -112,11 +112,11 @@ func (s3a *S3ApiServer) completeMultipartUpload(input *s3.CompleteMultipartUploa
|
||||||
dirName = dirName[:len(dirName)-1]
|
dirName = dirName[:len(dirName)-1]
|
||||||
}
|
}
|
||||||
|
|
||||||
err = s3a.mkFile(dirName, entryName, finalParts,func(entry *filer_pb.Entry) {
|
err = s3a.mkFile(dirName, entryName, finalParts, func(entry *filer_pb.Entry) {
|
||||||
if entry.Extended == nil {
|
if entry.Extended == nil {
|
||||||
entry.Extended = make(map[string][]byte)
|
entry.Extended = make(map[string][]byte)
|
||||||
}
|
}
|
||||||
for k,v := range pentry.Extended{
|
for k, v := range pentry.Extended {
|
||||||
if k != "key" {
|
if k != "key" {
|
||||||
entry.Extended[k] = v
|
entry.Extended[k] = v
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ func (s3a *S3ApiServer) mkdir(parentDirectoryPath string, dirName string, fn fun
|
||||||
|
|
||||||
func (s3a *S3ApiServer) mkFile(parentDirectoryPath string, fileName string, chunks []*filer_pb.FileChunk, fn func(entry *filer_pb.Entry)) error {
|
func (s3a *S3ApiServer) mkFile(parentDirectoryPath string, fileName string, chunks []*filer_pb.FileChunk, fn func(entry *filer_pb.Entry)) error {
|
||||||
|
|
||||||
return filer_pb.MkFile(s3a, parentDirectoryPath, fileName, chunks,fn)
|
return filer_pb.MkFile(s3a, parentDirectoryPath, fileName, chunks, fn)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@ func (c *commandVolumeFixReplication) fixOverReplicatedVolumes(commandEnv *Comma
|
||||||
func (c *commandVolumeFixReplication) fixUnderReplicatedVolumes(commandEnv *CommandEnv, writer io.Writer, takeAction bool, underReplicatedVolumeIds []uint32, volumeReplicas map[uint32][]*VolumeReplica, allLocations []location, retryCount int) (err error) {
|
func (c *commandVolumeFixReplication) fixUnderReplicatedVolumes(commandEnv *CommandEnv, writer io.Writer, takeAction bool, underReplicatedVolumeIds []uint32, volumeReplicas map[uint32][]*VolumeReplica, allLocations []location, retryCount int) (err error) {
|
||||||
|
|
||||||
for _, vid := range underReplicatedVolumeIds {
|
for _, vid := range underReplicatedVolumeIds {
|
||||||
for i:=0;i<retryCount+1;i++{
|
for i := 0; i < retryCount+1; i++ {
|
||||||
if err = c.fixOneUnderReplicatedVolume(commandEnv, writer, takeAction, volumeReplicas, vid, allLocations); err == nil {
|
if err = c.fixOneUnderReplicatedVolume(commandEnv, writer, takeAction, volumeReplicas, vid, allLocations); err == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ func (c *commandVolumeServerEvacuate) Do(args []string, commandEnv *CommandEnv,
|
||||||
return fmt.Errorf("need to specify volume server by -node=<host>:<port>")
|
return fmt.Errorf("need to specify volume server by -node=<host>:<port>")
|
||||||
}
|
}
|
||||||
|
|
||||||
for i:=0;i<*retryCount+1;i++{
|
for i := 0; i < *retryCount+1; i++ {
|
||||||
if err = volumeServerEvacuate(commandEnv, *volumeServer, *skipNonMoveable, *applyChange, writer); err == nil {
|
if err = volumeServerEvacuate(commandEnv, *volumeServer, *skipNonMoveable, *applyChange, writer); err == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,8 +170,8 @@ func (m *LogBuffer) copyToFlush() *dataToFlush {
|
||||||
m.lastFlushTime = m.stopTime
|
m.lastFlushTime = m.stopTime
|
||||||
}
|
}
|
||||||
m.buf = m.prevBuffers.SealBuffer(m.startTime, m.stopTime, m.buf, m.pos)
|
m.buf = m.prevBuffers.SealBuffer(m.startTime, m.stopTime, m.buf, m.pos)
|
||||||
m.startTime = time.Unix(0,0)
|
m.startTime = time.Unix(0, 0)
|
||||||
m.stopTime = time.Unix(0,0)
|
m.stopTime = time.Unix(0, 0)
|
||||||
m.pos = 0
|
m.pos = 0
|
||||||
m.idx = m.idx[:0]
|
m.idx = m.idx[:0]
|
||||||
return d
|
return d
|
||||||
|
|
Loading…
Reference in a new issue