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
79762385bd
commit
862c2cb8e6
|
@ -46,7 +46,7 @@ func (store *LevelDB2Store) initialize(dir string, dbCount int) (err error) {
|
|||
CompactionTableSizeMultiplier: 4,
|
||||
}
|
||||
|
||||
for d := 0 ; d < dbCount; d++ {
|
||||
for d := 0; d < dbCount; d++ {
|
||||
dbFolder := fmt.Sprintf("%s/%02d", dir, d)
|
||||
os.MkdirAll(dbFolder, 0755)
|
||||
db, dbErr := leveldb.OpenFile(dbFolder, opts)
|
||||
|
@ -204,5 +204,5 @@ func hashToBytes(dir string, dbCount int) ([]byte, int) {
|
|||
|
||||
x := b[len(b)-1]
|
||||
|
||||
return b, int(x)%dbCount
|
||||
return b, int(x) % dbCount
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ func TestCreateAndFind(t *testing.T) {
|
|||
dir, _ := ioutil.TempDir("", "seaweedfs_filer_test")
|
||||
defer os.RemoveAll(dir)
|
||||
store := &LevelDB2Store{}
|
||||
store.initialize(dir,2)
|
||||
store.initialize(dir, 2)
|
||||
filer.SetStore(store)
|
||||
filer.DisableDirectoryCache()
|
||||
|
||||
|
@ -68,7 +68,7 @@ func TestEmptyRoot(t *testing.T) {
|
|||
dir, _ := ioutil.TempDir("", "seaweedfs_filer_test2")
|
||||
defer os.RemoveAll(dir)
|
||||
store := &LevelDB2Store{}
|
||||
store.initialize(dir,2)
|
||||
store.initialize(dir, 2)
|
||||
filer.SetStore(store)
|
||||
filer.DisableDirectoryCache()
|
||||
|
||||
|
|
|
@ -49,12 +49,10 @@ func (c *commandFsMv) Do(args []string, commandEnv *CommandEnv, writer io.Writer
|
|||
|
||||
ctx := context.Background()
|
||||
|
||||
|
||||
sourceDir, sourceName := filer2.FullPath(sourcePath).DirAndName()
|
||||
|
||||
destinationDir, destinationName := filer2.FullPath(destinationPath).DirAndName()
|
||||
|
||||
|
||||
return commandEnv.withFilerClient(ctx, filerServer, filerPort, func(client filer_pb.SeaweedFilerClient) error {
|
||||
|
||||
// collect destination entry info
|
||||
|
@ -77,7 +75,6 @@ func (c *commandFsMv) Do(args []string, commandEnv *CommandEnv, writer io.Writer
|
|||
targetName = destinationName
|
||||
}
|
||||
|
||||
|
||||
request := &filer_pb.AtomicRenameEntryRequest{
|
||||
OldDirectory: sourceDir,
|
||||
OldName: sourceName,
|
||||
|
|
|
@ -34,7 +34,6 @@ type Topology struct {
|
|||
Configuration *Configuration
|
||||
|
||||
RaftServer raft.Server
|
||||
|
||||
}
|
||||
|
||||
func NewTopology(id string, seq sequence.Sequencer, volumeSizeLimit uint64, pulse int) *Topology {
|
||||
|
|
Loading…
Reference in a new issue